@karmaniverous/jeeves-watcher 0.8.1 → 0.8.3
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 +17 -6
- package/dist/index.js +17 -6
- 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 }));
|
|
@@ -4389,6 +4398,13 @@ class DocumentProcessor {
|
|
|
4389
4398
|
await this.withFileErrorHandling(filePath, 'Failed to process file', async () => {
|
|
4390
4399
|
const ext = extname(filePath);
|
|
4391
4400
|
const { metadata, extracted, renderedContent, matchedRules, metadataWithRules, } = await this.buildMetadataWithRules(filePath);
|
|
4401
|
+
// Update values index before any skip conditions — values must
|
|
4402
|
+
// reflect current rule matches even when content is unchanged.
|
|
4403
|
+
if (this.valuesManager) {
|
|
4404
|
+
for (const ruleName of matchedRules) {
|
|
4405
|
+
this.valuesManager.update(ruleName, metadata);
|
|
4406
|
+
}
|
|
4407
|
+
}
|
|
4392
4408
|
const textToEmbed = renderedContent ?? extracted.text;
|
|
4393
4409
|
if (!textToEmbed.trim()) {
|
|
4394
4410
|
this.logger.debug({ filePath }, 'Skipping empty file');
|
|
@@ -4416,11 +4432,6 @@ class DocumentProcessor {
|
|
|
4416
4432
|
logger: this.logger,
|
|
4417
4433
|
}, textToEmbed, filePath, metadataWithRules, existingPayload, fileDates);
|
|
4418
4434
|
this.issuesManager?.clear(filePath);
|
|
4419
|
-
if (this.valuesManager) {
|
|
4420
|
-
for (const ruleName of matchedRules) {
|
|
4421
|
-
this.valuesManager.update(ruleName, metadata);
|
|
4422
|
-
}
|
|
4423
|
-
}
|
|
4424
4435
|
}, undefined);
|
|
4425
4436
|
}
|
|
4426
4437
|
/**
|
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 }));
|
|
@@ -4367,6 +4376,13 @@ class DocumentProcessor {
|
|
|
4367
4376
|
await this.withFileErrorHandling(filePath, 'Failed to process file', async () => {
|
|
4368
4377
|
const ext = extname(filePath);
|
|
4369
4378
|
const { metadata, extracted, renderedContent, matchedRules, metadataWithRules, } = await this.buildMetadataWithRules(filePath);
|
|
4379
|
+
// Update values index before any skip conditions — values must
|
|
4380
|
+
// reflect current rule matches even when content is unchanged.
|
|
4381
|
+
if (this.valuesManager) {
|
|
4382
|
+
for (const ruleName of matchedRules) {
|
|
4383
|
+
this.valuesManager.update(ruleName, metadata);
|
|
4384
|
+
}
|
|
4385
|
+
}
|
|
4370
4386
|
const textToEmbed = renderedContent ?? extracted.text;
|
|
4371
4387
|
if (!textToEmbed.trim()) {
|
|
4372
4388
|
this.logger.debug({ filePath }, 'Skipping empty file');
|
|
@@ -4394,11 +4410,6 @@ class DocumentProcessor {
|
|
|
4394
4410
|
logger: this.logger,
|
|
4395
4411
|
}, textToEmbed, filePath, metadataWithRules, existingPayload, fileDates);
|
|
4396
4412
|
this.issuesManager?.clear(filePath);
|
|
4397
|
-
if (this.valuesManager) {
|
|
4398
|
-
for (const ruleName of matchedRules) {
|
|
4399
|
-
this.valuesManager.update(ruleName, metadata);
|
|
4400
|
-
}
|
|
4401
|
-
}
|
|
4402
4413
|
}, undefined);
|
|
4403
4414
|
}
|
|
4404
4415
|
/**
|
package/package.json
CHANGED