@karmaniverous/jeeves-watcher 0.9.9 → 0.10.1
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/config.schema.json +91 -116
- package/dist/cli/jeeves-watcher/index.js +3702 -2999
- package/dist/index.d.ts +235 -172
- package/dist/index.js +4128 -3408
- package/package.json +2 -4
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ type WatchConfig = z.infer<typeof watchConfigSchema>;
|
|
|
31
31
|
declare const configWatchConfigSchema: z.ZodObject<{
|
|
32
32
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
33
33
|
debounceMs: z.ZodOptional<z.ZodNumber>;
|
|
34
|
-
reindex: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"issues">, z.ZodLiteral<"full">]>>;
|
|
34
|
+
reindex: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"issues">, z.ZodLiteral<"full">, z.ZodLiteral<"rules">]>>;
|
|
35
35
|
}, z.core.$strip>;
|
|
36
36
|
/** Configuration file watch settings controlling auto-reload behavior on config changes. */
|
|
37
37
|
type ConfigWatchConfig = z.infer<typeof configWatchConfigSchema>;
|
|
@@ -117,7 +117,7 @@ declare const jeevesWatcherConfigSchema: z.ZodObject<{
|
|
|
117
117
|
configWatch: z.ZodOptional<z.ZodObject<{
|
|
118
118
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
119
119
|
debounceMs: z.ZodOptional<z.ZodNumber>;
|
|
120
|
-
reindex: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"issues">, z.ZodLiteral<"full">]>>;
|
|
120
|
+
reindex: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"issues">, z.ZodLiteral<"full">, z.ZodLiteral<"rules">]>>;
|
|
121
121
|
}, z.core.$strip>>;
|
|
122
122
|
embedding: z.ZodObject<{
|
|
123
123
|
provider: z.ZodDefault<z.ZodString>;
|
|
@@ -140,7 +140,6 @@ declare const jeevesWatcherConfigSchema: z.ZodObject<{
|
|
|
140
140
|
port: z.ZodOptional<z.ZodNumber>;
|
|
141
141
|
cacheTtlMs: z.ZodOptional<z.ZodNumber>;
|
|
142
142
|
}, z.core.$strip>>;
|
|
143
|
-
extractors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
144
143
|
stateDir: z.ZodOptional<z.ZodString>;
|
|
145
144
|
inferenceRules: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
146
145
|
name: z.ZodString;
|
|
@@ -188,7 +187,6 @@ declare const jeevesWatcherConfigSchema: z.ZodObject<{
|
|
|
188
187
|
callbackUrl: z.ZodOptional<z.ZodURL>;
|
|
189
188
|
concurrency: z.ZodDefault<z.ZodNumber>;
|
|
190
189
|
}, z.core.$strip>>;
|
|
191
|
-
slots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
192
190
|
search: z.ZodOptional<z.ZodObject<{
|
|
193
191
|
scoreThresholds: z.ZodOptional<z.ZodObject<{
|
|
194
192
|
strong: z.ZodNumber;
|
|
@@ -218,6 +216,7 @@ type JeevesWatcherConfigInput = z.infer<typeof jeevesWatcherConfigSchema>;
|
|
|
218
216
|
* After `loadConfig`, all string rule entries have been resolved to `InferenceRule` objects.
|
|
219
217
|
*/
|
|
220
218
|
type JeevesWatcherConfig = Omit<JeevesWatcherConfigInput, 'inferenceRules'> & {
|
|
219
|
+
/** Resolved inference rules (string file paths have been loaded as InferenceRule objects). */
|
|
221
220
|
inferenceRules?: InferenceRule[];
|
|
222
221
|
};
|
|
223
222
|
|
|
@@ -290,6 +289,38 @@ type ProviderFactory = (config: EmbeddingConfig, logger?: pino.Logger) => Embedd
|
|
|
290
289
|
*/
|
|
291
290
|
declare function createEmbeddingProvider(config: EmbeddingConfig, logger?: pino.Logger, additionalProviders?: Map<string, ProviderFactory>): EmbeddingProvider;
|
|
292
291
|
|
|
292
|
+
/**
|
|
293
|
+
* Processor-level gitignore filter. Checks file paths against the nearest
|
|
294
|
+
* `.gitignore` chain in git repositories.
|
|
295
|
+
*/
|
|
296
|
+
declare class GitignoreFilter {
|
|
297
|
+
private repos;
|
|
298
|
+
/**
|
|
299
|
+
* Create a GitignoreFilter by scanning watched paths for `.gitignore` files.
|
|
300
|
+
*
|
|
301
|
+
* @param watchPaths - Absolute paths being watched (directories or globs resolved to roots).
|
|
302
|
+
*/
|
|
303
|
+
constructor(watchPaths: string[]);
|
|
304
|
+
/**
|
|
305
|
+
* Scan paths for git repos and their `.gitignore` files.
|
|
306
|
+
*/
|
|
307
|
+
private scan;
|
|
308
|
+
/**
|
|
309
|
+
* Check whether a file path is ignored by any applicable `.gitignore`.
|
|
310
|
+
*
|
|
311
|
+
* @param filePath - Absolute file path to check.
|
|
312
|
+
* @returns `true` if the file should be ignored.
|
|
313
|
+
*/
|
|
314
|
+
isIgnored(filePath: string): boolean;
|
|
315
|
+
/**
|
|
316
|
+
* Invalidate and re-parse a specific `.gitignore` file.
|
|
317
|
+
* Call when a `.gitignore` file is added, changed, or removed.
|
|
318
|
+
*
|
|
319
|
+
* @param gitignorePath - Absolute path to the `.gitignore` file that changed.
|
|
320
|
+
*/
|
|
321
|
+
invalidate(gitignorePath: string): void;
|
|
322
|
+
}
|
|
323
|
+
|
|
293
324
|
/**
|
|
294
325
|
* @module helpers/introspect
|
|
295
326
|
* JSDoc introspection for helper modules. Extracts function exports and their descriptions.
|
|
@@ -436,6 +467,7 @@ declare function loadCustomHelpers(hbs: typeof Handlebars, helpers: Record<strin
|
|
|
436
467
|
* The template engine: holds compiled templates and renders them against context.
|
|
437
468
|
*/
|
|
438
469
|
declare class TemplateEngine {
|
|
470
|
+
/** The Handlebars instance used for template compilation and rendering. */
|
|
439
471
|
readonly hbs: typeof Handlebars;
|
|
440
472
|
private readonly compiled;
|
|
441
473
|
constructor(hbs: typeof Handlebars);
|
|
@@ -617,6 +649,54 @@ interface ApplyRulesOptions {
|
|
|
617
649
|
*/
|
|
618
650
|
declare function applyRules(compiledRules: CompiledRule[], attributes: FileAttributes, options?: ApplyRulesOptions): Promise<ApplyRulesResult>;
|
|
619
651
|
|
|
652
|
+
/**
|
|
653
|
+
* @module rules/virtualRules
|
|
654
|
+
* In-memory virtual rule store for externally registered inference rules.
|
|
655
|
+
*
|
|
656
|
+
* Virtual rules are registered at runtime by external consumers (e.g., OpenClaw plugins)
|
|
657
|
+
* and merge into the inference pipeline alongside config-file rules.
|
|
658
|
+
* They survive config reloads but NOT service restarts.
|
|
659
|
+
*/
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* In-memory store for virtual inference rules.
|
|
663
|
+
*
|
|
664
|
+
* Virtual rules are appended AFTER config-file rules in evaluation order.
|
|
665
|
+
* Since inference uses last-match-wins for overlapping fields,
|
|
666
|
+
* virtual rules take precedence over config rules when both match the same file.
|
|
667
|
+
*/
|
|
668
|
+
declare class VirtualRuleStore {
|
|
669
|
+
private readonly entries;
|
|
670
|
+
/**
|
|
671
|
+
* Register virtual rules from an external source.
|
|
672
|
+
* Idempotent: re-registering with the same source replaces previous rules.
|
|
673
|
+
*
|
|
674
|
+
* @param source - Unique identifier for the rule source.
|
|
675
|
+
* @param rules - Inference rule definitions to register.
|
|
676
|
+
*/
|
|
677
|
+
register(source: string, rules: InferenceRule[]): void;
|
|
678
|
+
/**
|
|
679
|
+
* Remove virtual rules by source.
|
|
680
|
+
*
|
|
681
|
+
* @param source - The source identifier to unregister.
|
|
682
|
+
* @returns true if rules were found and removed.
|
|
683
|
+
*/
|
|
684
|
+
unregister(source: string): boolean;
|
|
685
|
+
/**
|
|
686
|
+
* Get all compiled virtual rules in registration order.
|
|
687
|
+
*/
|
|
688
|
+
getCompiled(): CompiledRule[];
|
|
689
|
+
/**
|
|
690
|
+
* Get all raw virtual rule definitions grouped by source.
|
|
691
|
+
* Used by the merged virtual document.
|
|
692
|
+
*/
|
|
693
|
+
getAll(): Record<string, InferenceRule[]>;
|
|
694
|
+
/** Check if any virtual rules are registered. */
|
|
695
|
+
get isEmpty(): boolean;
|
|
696
|
+
/** Total number of virtual rules across all sources. */
|
|
697
|
+
get size(): number;
|
|
698
|
+
}
|
|
699
|
+
|
|
620
700
|
/**
|
|
621
701
|
* @module values/ValuesManager
|
|
622
702
|
* Manages per-rule distinct metadata value tracking. Persists to disk with in-memory caching and sorted deduplication.
|
|
@@ -1182,182 +1262,45 @@ declare class EventQueue {
|
|
|
1182
1262
|
}
|
|
1183
1263
|
|
|
1184
1264
|
/**
|
|
1185
|
-
* @module
|
|
1186
|
-
*
|
|
1187
|
-
*
|
|
1188
|
-
* Virtual rules are registered at runtime by external consumers (e.g., OpenClaw plugins)
|
|
1189
|
-
* and merge into the inference pipeline alongside config-file rules.
|
|
1190
|
-
* They survive config reloads but NOT service restarts.
|
|
1191
|
-
*/
|
|
1192
|
-
|
|
1193
|
-
/**
|
|
1194
|
-
* In-memory store for virtual inference rules.
|
|
1195
|
-
*
|
|
1196
|
-
* Virtual rules are appended AFTER config-file rules in evaluation order.
|
|
1197
|
-
* Since inference uses last-match-wins for overlapping fields,
|
|
1198
|
-
* virtual rules take precedence over config rules when both match the same file.
|
|
1199
|
-
*/
|
|
1200
|
-
declare class VirtualRuleStore {
|
|
1201
|
-
private readonly entries;
|
|
1202
|
-
/**
|
|
1203
|
-
* Register virtual rules from an external source.
|
|
1204
|
-
* Idempotent: re-registering with the same source replaces previous rules.
|
|
1205
|
-
*
|
|
1206
|
-
* @param source - Unique identifier for the rule source.
|
|
1207
|
-
* @param rules - Inference rule definitions to register.
|
|
1208
|
-
*/
|
|
1209
|
-
register(source: string, rules: InferenceRule[]): void;
|
|
1210
|
-
/**
|
|
1211
|
-
* Remove virtual rules by source.
|
|
1212
|
-
*
|
|
1213
|
-
* @param source - The source identifier to unregister.
|
|
1214
|
-
* @returns true if rules were found and removed.
|
|
1215
|
-
*/
|
|
1216
|
-
unregister(source: string): boolean;
|
|
1217
|
-
/**
|
|
1218
|
-
* Get all compiled virtual rules in registration order.
|
|
1219
|
-
*/
|
|
1220
|
-
getCompiled(): CompiledRule[];
|
|
1221
|
-
/**
|
|
1222
|
-
* Get all raw virtual rule definitions grouped by source.
|
|
1223
|
-
* Used by the merged virtual document.
|
|
1224
|
-
*/
|
|
1225
|
-
getAll(): Record<string, InferenceRule[]>;
|
|
1226
|
-
/** Check if any virtual rules are registered. */
|
|
1227
|
-
get isEmpty(): boolean;
|
|
1228
|
-
/** Total number of virtual rules across all sources. */
|
|
1229
|
-
get size(): number;
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
/**
|
|
1233
|
-
* @module api/ReindexTracker
|
|
1234
|
-
* Tracks reindex operation state for status reporting. Single instance shared across handlers.
|
|
1265
|
+
* @module api/InitialScanTracker
|
|
1266
|
+
* Tracks initial filesystem scan state for status reporting.
|
|
1235
1267
|
*/
|
|
1236
|
-
/**
|
|
1237
|
-
interface
|
|
1238
|
-
/** Whether
|
|
1268
|
+
/** Initial scan status snapshot for API consumers. */
|
|
1269
|
+
interface InitialScanStatus {
|
|
1270
|
+
/** Whether the initial scan is currently in progress. */
|
|
1239
1271
|
active: boolean;
|
|
1240
|
-
/**
|
|
1241
|
-
|
|
1242
|
-
/**
|
|
1272
|
+
/** Number of files matched by watch globs. */
|
|
1273
|
+
filesMatched?: number;
|
|
1274
|
+
/** Number of files enqueued for processing so far. */
|
|
1275
|
+
filesEnqueued?: number;
|
|
1276
|
+
/** ISO 8601 timestamp when the scan started. */
|
|
1243
1277
|
startedAt?: string;
|
|
1244
|
-
/**
|
|
1245
|
-
|
|
1246
|
-
/** Total
|
|
1247
|
-
|
|
1278
|
+
/** ISO 8601 timestamp when the scan completed. */
|
|
1279
|
+
completedAt?: string;
|
|
1280
|
+
/** Total scan duration in milliseconds. */
|
|
1281
|
+
durationMs?: number;
|
|
1248
1282
|
}
|
|
1249
1283
|
/**
|
|
1250
|
-
* Tracks the state of
|
|
1284
|
+
* Tracks the state of the initial filesystem scan after service start.
|
|
1251
1285
|
*/
|
|
1252
|
-
declare class
|
|
1286
|
+
declare class InitialScanTracker {
|
|
1253
1287
|
private _active;
|
|
1254
|
-
private
|
|
1288
|
+
private _filesMatched;
|
|
1289
|
+
private _filesEnqueued;
|
|
1255
1290
|
private _startedAt?;
|
|
1256
|
-
private
|
|
1257
|
-
private
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1291
|
+
private _completedAt?;
|
|
1292
|
+
private _durationMs?;
|
|
1293
|
+
private _started;
|
|
1294
|
+
/** Mark the initial scan as started. */
|
|
1295
|
+
start(): void;
|
|
1296
|
+
/** Set the total number of matched files. */
|
|
1297
|
+
setMatched(count: number): void;
|
|
1262
1298
|
/** Increment the processed file count. */
|
|
1263
|
-
|
|
1264
|
-
/** Mark the
|
|
1299
|
+
incrementEnqueued(): void;
|
|
1300
|
+
/** Mark the scan as complete. */
|
|
1265
1301
|
complete(): void;
|
|
1266
|
-
/** Get current
|
|
1267
|
-
getStatus():
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
/**
|
|
1271
|
-
* @module api
|
|
1272
|
-
* Fastify API server factory. Registers all route handlers and returns an unstarted server instance.
|
|
1273
|
-
*/
|
|
1274
|
-
|
|
1275
|
-
/**
|
|
1276
|
-
* Options for {@link createApiServer}.
|
|
1277
|
-
*/
|
|
1278
|
-
interface ApiServerOptions {
|
|
1279
|
-
/** The document processor. */
|
|
1280
|
-
processor: DocumentProcessorInterface;
|
|
1281
|
-
/** The vector store client. */
|
|
1282
|
-
vectorStore: VectorStoreClient;
|
|
1283
|
-
/** The embedding provider. */
|
|
1284
|
-
embeddingProvider: EmbeddingProvider;
|
|
1285
|
-
/** The event queue. */
|
|
1286
|
-
queue: EventQueue;
|
|
1287
|
-
/** The application configuration. */
|
|
1288
|
-
config: JeevesWatcherConfig;
|
|
1289
|
-
/** The logger instance. */
|
|
1290
|
-
logger: pino.Logger;
|
|
1291
|
-
/** The issues manager. */
|
|
1292
|
-
issuesManager: IssuesManager;
|
|
1293
|
-
/** The values manager. */
|
|
1294
|
-
valuesManager: ValuesManager;
|
|
1295
|
-
/** The reindex tracker (optional, created if not provided). */
|
|
1296
|
-
reindexTracker?: ReindexTracker;
|
|
1297
|
-
/** Path to the config file on disk. */
|
|
1298
|
-
configPath: string;
|
|
1299
|
-
/** Helper introspection for merged document. */
|
|
1300
|
-
helperIntrospection?: AllHelpersIntrospection;
|
|
1301
|
-
/** Virtual rule store for externally registered inference rules. */
|
|
1302
|
-
virtualRuleStore?: VirtualRuleStore;
|
|
1303
|
-
}
|
|
1304
|
-
/**
|
|
1305
|
-
* Create the Fastify API server with all routes registered.
|
|
1306
|
-
*
|
|
1307
|
-
* The returned instance is not yet listening — call `server.listen()` to start.
|
|
1308
|
-
*
|
|
1309
|
-
* @param options - The server options.
|
|
1310
|
-
* @returns A configured Fastify instance.
|
|
1311
|
-
*/
|
|
1312
|
-
declare function createApiServer(options: ApiServerOptions): FastifyInstance;
|
|
1313
|
-
|
|
1314
|
-
/**
|
|
1315
|
-
* @module logger
|
|
1316
|
-
* Creates pino logger instances. I/O: optionally writes logs to file via pino/file transport. Defaults to stdout at info level.
|
|
1317
|
-
*/
|
|
1318
|
-
|
|
1319
|
-
/**
|
|
1320
|
-
* Create a pino logger instance.
|
|
1321
|
-
*
|
|
1322
|
-
* @param config - Optional logging configuration.
|
|
1323
|
-
* @returns A configured pino logger.
|
|
1324
|
-
*/
|
|
1325
|
-
declare function createLogger(config?: LoggingConfig): pino.Logger;
|
|
1326
|
-
|
|
1327
|
-
/**
|
|
1328
|
-
* @module gitignore
|
|
1329
|
-
* Processor-level gitignore filtering. Scans watched paths for `.gitignore` files in git repos, caches parsed patterns, and exposes `isIgnored()` for path checking.
|
|
1330
|
-
*/
|
|
1331
|
-
/**
|
|
1332
|
-
* Processor-level gitignore filter. Checks file paths against the nearest
|
|
1333
|
-
* `.gitignore` chain in git repositories.
|
|
1334
|
-
*/
|
|
1335
|
-
declare class GitignoreFilter {
|
|
1336
|
-
private repos;
|
|
1337
|
-
/**
|
|
1338
|
-
* Create a GitignoreFilter by scanning watched paths for `.gitignore` files.
|
|
1339
|
-
*
|
|
1340
|
-
* @param watchPaths - Absolute paths being watched (directories or globs resolved to roots).
|
|
1341
|
-
*/
|
|
1342
|
-
constructor(watchPaths: string[]);
|
|
1343
|
-
/**
|
|
1344
|
-
* Scan paths for git repos and their `.gitignore` files.
|
|
1345
|
-
*/
|
|
1346
|
-
private scan;
|
|
1347
|
-
/**
|
|
1348
|
-
* Check whether a file path is ignored by any applicable `.gitignore`.
|
|
1349
|
-
*
|
|
1350
|
-
* @param filePath - Absolute file path to check.
|
|
1351
|
-
* @returns `true` if the file should be ignored.
|
|
1352
|
-
*/
|
|
1353
|
-
isIgnored(filePath: string): boolean;
|
|
1354
|
-
/**
|
|
1355
|
-
* Invalidate and re-parse a specific `.gitignore` file.
|
|
1356
|
-
* Call when a `.gitignore` file is added, changed, or removed.
|
|
1357
|
-
*
|
|
1358
|
-
* @param gitignorePath - Absolute path to the `.gitignore` file that changed.
|
|
1359
|
-
*/
|
|
1360
|
-
invalidate(gitignorePath: string): void;
|
|
1302
|
+
/** Get current scan status. */
|
|
1303
|
+
getStatus(): InitialScanStatus;
|
|
1361
1304
|
}
|
|
1362
1305
|
|
|
1363
1306
|
/**
|
|
@@ -1431,6 +1374,8 @@ interface FileSystemWatcherOptions {
|
|
|
1431
1374
|
onFatalError?: (error: unknown) => void;
|
|
1432
1375
|
/** Optional gitignore filter for processor-level filtering. */
|
|
1433
1376
|
gitignoreFilter?: GitignoreFilter;
|
|
1377
|
+
/** Optional tracker for initial scan visibility in /status. */
|
|
1378
|
+
initialScanTracker?: InitialScanTracker;
|
|
1434
1379
|
}
|
|
1435
1380
|
/**
|
|
1436
1381
|
* Filesystem watcher that maps chokidar events to the processing queue.
|
|
@@ -1442,6 +1387,7 @@ declare class FileSystemWatcher {
|
|
|
1442
1387
|
private readonly logger;
|
|
1443
1388
|
private readonly health;
|
|
1444
1389
|
private readonly gitignoreFilter?;
|
|
1390
|
+
private readonly initialScanTracker?;
|
|
1445
1391
|
private globMatches;
|
|
1446
1392
|
private watcher;
|
|
1447
1393
|
/**
|
|
@@ -1458,6 +1404,17 @@ declare class FileSystemWatcher {
|
|
|
1458
1404
|
* Start watching the filesystem and processing events.
|
|
1459
1405
|
*/
|
|
1460
1406
|
start(): void;
|
|
1407
|
+
/**
|
|
1408
|
+
* Get the list of all currently watched file paths (absolute).
|
|
1409
|
+
*
|
|
1410
|
+
* Uses chokidar's in-memory `getWatched()` state — no filesystem I/O.
|
|
1411
|
+
* Returns an empty array if the watcher hasn't been started.
|
|
1412
|
+
*/
|
|
1413
|
+
getWatchedFiles(): string[];
|
|
1414
|
+
/**
|
|
1415
|
+
* Whether the initial filesystem scan is complete.
|
|
1416
|
+
*/
|
|
1417
|
+
get isReady(): boolean;
|
|
1461
1418
|
/**
|
|
1462
1419
|
* Stop the filesystem watcher.
|
|
1463
1420
|
*/
|
|
@@ -1482,6 +1439,109 @@ declare class FileSystemWatcher {
|
|
|
1482
1439
|
private wrapProcessing;
|
|
1483
1440
|
}
|
|
1484
1441
|
|
|
1442
|
+
/**
|
|
1443
|
+
* @module api/ReindexTracker
|
|
1444
|
+
* Tracks reindex operation state for status reporting. Single instance shared across handlers.
|
|
1445
|
+
*/
|
|
1446
|
+
/** Reindex status snapshot for API consumers. */
|
|
1447
|
+
interface ReindexStatus {
|
|
1448
|
+
/** Whether a reindex operation is currently in progress. */
|
|
1449
|
+
active: boolean;
|
|
1450
|
+
/** The active reindex scope (when {@link active} is true). */
|
|
1451
|
+
scope?: string;
|
|
1452
|
+
/** ISO 8601 timestamp when the current reindex started (when {@link active} is true). */
|
|
1453
|
+
startedAt?: string;
|
|
1454
|
+
/** Number of files processed so far (when {@link active} is true). */
|
|
1455
|
+
filesProcessed?: number;
|
|
1456
|
+
/** Total number of files to process (when {@link active} is true). */
|
|
1457
|
+
totalFiles?: number;
|
|
1458
|
+
}
|
|
1459
|
+
/**
|
|
1460
|
+
* Tracks the state of reindex operations.
|
|
1461
|
+
*/
|
|
1462
|
+
declare class ReindexTracker {
|
|
1463
|
+
private _active;
|
|
1464
|
+
private _scope?;
|
|
1465
|
+
private _startedAt?;
|
|
1466
|
+
private _filesProcessed;
|
|
1467
|
+
private _totalFiles;
|
|
1468
|
+
/** Mark a reindex as started. */
|
|
1469
|
+
start(scope: string): void;
|
|
1470
|
+
/** Set the total number of files to process. */
|
|
1471
|
+
setTotal(total: number): void;
|
|
1472
|
+
/** Increment the processed file count. */
|
|
1473
|
+
incrementProcessed(): void;
|
|
1474
|
+
/** Mark the current reindex as complete. */
|
|
1475
|
+
complete(): void;
|
|
1476
|
+
/** Get current reindex status. */
|
|
1477
|
+
getStatus(): ReindexStatus;
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
/**
|
|
1481
|
+
* @module api
|
|
1482
|
+
* Fastify API server factory. Registers all route handlers and returns an unstarted server instance.
|
|
1483
|
+
*/
|
|
1484
|
+
|
|
1485
|
+
/**
|
|
1486
|
+
* Options for {@link createApiServer}.
|
|
1487
|
+
*/
|
|
1488
|
+
interface ApiServerOptions {
|
|
1489
|
+
/** The document processor. */
|
|
1490
|
+
processor: DocumentProcessorInterface;
|
|
1491
|
+
/** The vector store client. */
|
|
1492
|
+
vectorStore: VectorStoreClient;
|
|
1493
|
+
/** The embedding provider. */
|
|
1494
|
+
embeddingProvider: EmbeddingProvider;
|
|
1495
|
+
/** The event queue. */
|
|
1496
|
+
queue: EventQueue;
|
|
1497
|
+
/** The application configuration. */
|
|
1498
|
+
config: JeevesWatcherConfig;
|
|
1499
|
+
/** The logger instance. */
|
|
1500
|
+
logger: pino.Logger;
|
|
1501
|
+
/** The issues manager. */
|
|
1502
|
+
issuesManager: IssuesManager;
|
|
1503
|
+
/** The values manager. */
|
|
1504
|
+
valuesManager: ValuesManager;
|
|
1505
|
+
/** The reindex tracker (optional, created if not provided). */
|
|
1506
|
+
reindexTracker?: ReindexTracker;
|
|
1507
|
+
/** Path to the config file on disk. */
|
|
1508
|
+
configPath: string;
|
|
1509
|
+
/** Helper introspection for merged document. */
|
|
1510
|
+
helperIntrospection?: AllHelpersIntrospection;
|
|
1511
|
+
/** Virtual rule store for externally registered inference rules. */
|
|
1512
|
+
virtualRuleStore?: VirtualRuleStore;
|
|
1513
|
+
/** Gitignore filter for reindex path validation. */
|
|
1514
|
+
gitignoreFilter?: GitignoreFilter;
|
|
1515
|
+
/** Service version string for /status endpoint. */
|
|
1516
|
+
version?: string;
|
|
1517
|
+
/** Initial scan tracker for /status visibility. */
|
|
1518
|
+
initialScanTracker?: InitialScanTracker;
|
|
1519
|
+
/** Filesystem watcher instance for /walk endpoint (in-memory file list). */
|
|
1520
|
+
fileSystemWatcher?: FileSystemWatcher;
|
|
1521
|
+
}
|
|
1522
|
+
/**
|
|
1523
|
+
* Create the Fastify API server with all routes registered.
|
|
1524
|
+
*
|
|
1525
|
+
* The returned instance is not yet listening — call `server.listen()` to start.
|
|
1526
|
+
*
|
|
1527
|
+
* @param options - The server options.
|
|
1528
|
+
* @returns A configured Fastify instance.
|
|
1529
|
+
*/
|
|
1530
|
+
declare function createApiServer(options: ApiServerOptions): FastifyInstance;
|
|
1531
|
+
|
|
1532
|
+
/**
|
|
1533
|
+
* @module logger
|
|
1534
|
+
* Creates pino logger instances. I/O: optionally writes logs to file via pino/file transport. Defaults to stdout at info level.
|
|
1535
|
+
*/
|
|
1536
|
+
|
|
1537
|
+
/**
|
|
1538
|
+
* Create a pino logger instance.
|
|
1539
|
+
*
|
|
1540
|
+
* @param config - Optional logging configuration.
|
|
1541
|
+
* @returns A configured pino logger.
|
|
1542
|
+
*/
|
|
1543
|
+
declare function createLogger(config?: LoggingConfig): pino.Logger;
|
|
1544
|
+
|
|
1485
1545
|
/**
|
|
1486
1546
|
* @module app/factories
|
|
1487
1547
|
* Component factory interfaces and defaults for {@link JeevesWatcher}. Override in tests to inject mocks.
|
|
@@ -1556,6 +1616,9 @@ declare class JeevesWatcher {
|
|
|
1556
1616
|
private virtualRuleStore;
|
|
1557
1617
|
private vectorStore;
|
|
1558
1618
|
private embeddingProvider;
|
|
1619
|
+
private gitignoreFilter;
|
|
1620
|
+
private readonly initialScanTracker;
|
|
1621
|
+
private readonly version;
|
|
1559
1622
|
/** Create a new JeevesWatcher instance. */
|
|
1560
1623
|
constructor(config: JeevesWatcherConfig, configPath?: string, factories?: Partial<JeevesWatcherFactories>, runtimeOptions?: JeevesWatcherRuntimeOptions);
|
|
1561
1624
|
/**
|
|
@@ -1658,5 +1721,5 @@ declare function deleteMetadata(filePath: string, metadataDir: string): Promise<
|
|
|
1658
1721
|
*/
|
|
1659
1722
|
declare function pointId(filePath: string, chunkIndex?: number): string;
|
|
1660
1723
|
|
|
1661
|
-
export { DocumentProcessor, EventQueue, FileSystemWatcher, GitignoreFilter, IssuesManager, JeevesWatcher, ReindexTracker, SystemHealth, TemplateEngine, ValuesManager, VectorStoreClient, apiConfigSchema, applyRules, buildAttributes, buildTemplateEngine, compileRules, configWatchConfigSchema, contentHash, createApiServer, createEmbeddingProvider, createHandlebarsInstance, createLogger, deleteMetadata, embeddingConfigSchema, extractText, inferenceRuleSchema, issueRecordSchema, jeevesWatcherConfigSchema, loadConfig, loadCustomHelpers, loggingConfigSchema, metadataPath, pointId, readMetadata, registerBuiltinHelpers, resolveTemplateSource, startFromConfig, vectorStoreConfigSchema, watchConfigSchema, writeMetadata };
|
|
1662
|
-
export type { AllHelpersIntrospection, ApiConfig, ApiServerOptions, ApplyRulesResult, CollectionInfo, CompiledRule, CompiledTemplate, ConfigWatchConfig, DocumentProcessorDeps, DocumentProcessorInterface, EmbeddingConfig, EmbeddingProvider, EventQueueOptions, ExtractedText, Extractor, FileAttributes, FileSystemWatcherOptions, HelperModuleIntrospection, InferenceRule, IssueRecord, IssuesFile, JeevesWatcherConfig, JeevesWatcherFactories, JeevesWatcherRuntimeOptions, LoggingConfig, PayloadFieldSchema, ProcessFn, ProcessorConfig, ProviderFactory, ReindexStatus, RuleLogger, ScrolledPoint, SearchResult, SystemHealthOptions, ValuesIndex, VectorPoint, VectorStore, VectorStoreConfig, WatchConfig, WatchEvent };
|
|
1724
|
+
export { DocumentProcessor, EventQueue, FileSystemWatcher, GitignoreFilter, InitialScanTracker, IssuesManager, JeevesWatcher, ReindexTracker, SystemHealth, TemplateEngine, ValuesManager, VectorStoreClient, VirtualRuleStore, apiConfigSchema, applyRules, buildAttributes, buildTemplateEngine, compileRules, configWatchConfigSchema, contentHash, createApiServer, createEmbeddingProvider, createHandlebarsInstance, createLogger, deleteMetadata, embeddingConfigSchema, extractText, inferenceRuleSchema, issueRecordSchema, jeevesWatcherConfigSchema, loadConfig, loadCustomHelpers, loggingConfigSchema, metadataPath, pointId, readMetadata, registerBuiltinHelpers, resolveTemplateSource, startFromConfig, vectorStoreConfigSchema, watchConfigSchema, writeMetadata };
|
|
1725
|
+
export type { AllHelpersIntrospection, ApiConfig, ApiServerOptions, ApplyRulesOptions, ApplyRulesResult, CollectionInfo, CompiledRule, CompiledTemplate, ConfigWatchConfig, DocumentProcessorDeps, DocumentProcessorInterface, EmbeddingConfig, EmbeddingProvider, EventQueueOptions, ExtractedText, Extractor, FileAttributes, FileSystemWatcherOptions, HelperModuleIntrospection, InferenceRule, InitialScanStatus, IssueRecord, IssuesFile, JeevesWatcherConfig, JeevesWatcherConfigInput, JeevesWatcherFactories, JeevesWatcherRuntimeOptions, LoggingConfig, PayloadFieldSchema, ProcessFn, ProcessorConfig, ProviderFactory, ReindexStatus, RenderResult, RuleLogger, ScrollPageResult, ScrolledPoint, SearchResult, SystemHealthOptions, ValuesIndex, VectorPoint, VectorStore, VectorStoreConfig, WatchConfig, WatchEvent };
|