@karmaniverous/jeeves-watcher 0.8.0 → 0.8.2
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/cli/jeeves-watcher/index.js +16 -2
- package/dist/index.js +16 -2
- package/package.json +1 -1
|
@@ -2546,6 +2546,8 @@ function createConfigReindexHandler(deps) {
|
|
|
2546
2546
|
processor: deps.processor,
|
|
2547
2547
|
logger: deps.logger,
|
|
2548
2548
|
reindexTracker: deps.reindexTracker,
|
|
2549
|
+
valuesManager: deps.valuesManager,
|
|
2550
|
+
issuesManager: deps.issuesManager,
|
|
2549
2551
|
}, scope);
|
|
2550
2552
|
return await reply.status(200).send({ status: 'started', scope });
|
|
2551
2553
|
}, deps.logger, 'Config reindex request');
|
|
@@ -3529,7 +3531,14 @@ function createApiServer(options) {
|
|
|
3529
3531
|
vectorStore,
|
|
3530
3532
|
logger,
|
|
3531
3533
|
}));
|
|
3532
|
-
app.post('/config-reindex', createConfigReindexHandler({
|
|
3534
|
+
app.post('/config-reindex', createConfigReindexHandler({
|
|
3535
|
+
config,
|
|
3536
|
+
processor,
|
|
3537
|
+
logger,
|
|
3538
|
+
reindexTracker,
|
|
3539
|
+
valuesManager,
|
|
3540
|
+
issuesManager,
|
|
3541
|
+
}));
|
|
3533
3542
|
app.get('/issues', withCache(cacheTtlMs, createIssuesHandler({ issuesManager })));
|
|
3534
3543
|
app.get('/config/schema', withCache(cacheTtlMs, createConfigSchemaHandler()));
|
|
3535
3544
|
app.post('/config/match', createConfigMatchHandler({ config, logger }));
|
|
@@ -4478,11 +4487,16 @@ class DocumentProcessor {
|
|
|
4478
4487
|
this.logger.debug({ filePath }, 'File not indexed, skipping');
|
|
4479
4488
|
return null;
|
|
4480
4489
|
}
|
|
4481
|
-
const { metadataWithRules } = await this.buildMetadataWithRules(filePath);
|
|
4490
|
+
const { metadataWithRules, matchedRules, metadata } = await this.buildMetadataWithRules(filePath);
|
|
4482
4491
|
const totalChunks = getChunkCount(existingPayload);
|
|
4483
4492
|
const ids = chunkIds(filePath, totalChunks);
|
|
4484
4493
|
await this.vectorStore.setPayload(ids, metadataWithRules);
|
|
4485
4494
|
this.issuesManager?.clear(filePath);
|
|
4495
|
+
if (this.valuesManager) {
|
|
4496
|
+
for (const ruleName of matchedRules) {
|
|
4497
|
+
this.valuesManager.update(ruleName, metadata);
|
|
4498
|
+
}
|
|
4499
|
+
}
|
|
4486
4500
|
this.logger.info({ filePath, chunks: totalChunks }, 'Rules re-applied');
|
|
4487
4501
|
return metadataWithRules;
|
|
4488
4502
|
}, null);
|
package/dist/index.js
CHANGED
|
@@ -2237,6 +2237,8 @@ function createConfigReindexHandler(deps) {
|
|
|
2237
2237
|
processor: deps.processor,
|
|
2238
2238
|
logger: deps.logger,
|
|
2239
2239
|
reindexTracker: deps.reindexTracker,
|
|
2240
|
+
valuesManager: deps.valuesManager,
|
|
2241
|
+
issuesManager: deps.issuesManager,
|
|
2240
2242
|
}, scope);
|
|
2241
2243
|
return await reply.status(200).send({ status: 'started', scope });
|
|
2242
2244
|
}, deps.logger, 'Config reindex request');
|
|
@@ -3220,7 +3222,14 @@ function createApiServer(options) {
|
|
|
3220
3222
|
vectorStore,
|
|
3221
3223
|
logger,
|
|
3222
3224
|
}));
|
|
3223
|
-
app.post('/config-reindex', createConfigReindexHandler({
|
|
3225
|
+
app.post('/config-reindex', createConfigReindexHandler({
|
|
3226
|
+
config,
|
|
3227
|
+
processor,
|
|
3228
|
+
logger,
|
|
3229
|
+
reindexTracker,
|
|
3230
|
+
valuesManager,
|
|
3231
|
+
issuesManager,
|
|
3232
|
+
}));
|
|
3224
3233
|
app.get('/issues', withCache(cacheTtlMs, createIssuesHandler({ issuesManager })));
|
|
3225
3234
|
app.get('/config/schema', withCache(cacheTtlMs, createConfigSchemaHandler()));
|
|
3226
3235
|
app.post('/config/match', createConfigMatchHandler({ config, logger }));
|
|
@@ -4456,11 +4465,16 @@ class DocumentProcessor {
|
|
|
4456
4465
|
this.logger.debug({ filePath }, 'File not indexed, skipping');
|
|
4457
4466
|
return null;
|
|
4458
4467
|
}
|
|
4459
|
-
const { metadataWithRules } = await this.buildMetadataWithRules(filePath);
|
|
4468
|
+
const { metadataWithRules, matchedRules, metadata } = await this.buildMetadataWithRules(filePath);
|
|
4460
4469
|
const totalChunks = getChunkCount(existingPayload);
|
|
4461
4470
|
const ids = chunkIds(filePath, totalChunks);
|
|
4462
4471
|
await this.vectorStore.setPayload(ids, metadataWithRules);
|
|
4463
4472
|
this.issuesManager?.clear(filePath);
|
|
4473
|
+
if (this.valuesManager) {
|
|
4474
|
+
for (const ruleName of matchedRules) {
|
|
4475
|
+
this.valuesManager.update(ruleName, metadata);
|
|
4476
|
+
}
|
|
4477
|
+
}
|
|
4464
4478
|
this.logger.info({ filePath, chunks: totalChunks }, 'Rules re-applied');
|
|
4465
4479
|
return metadataWithRules;
|
|
4466
4480
|
}, null);
|
package/package.json
CHANGED