@karmaniverous/jeeves-watcher 0.17.0 → 0.17.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/config.schema.json
CHANGED
|
@@ -34,7 +34,6 @@ import * as cheerio from 'cheerio';
|
|
|
34
34
|
import mammoth from 'mammoth';
|
|
35
35
|
import { MarkdownTextSplitter, RecursiveCharacterTextSplitter } from '@langchain/textsplitters';
|
|
36
36
|
import { QdrantClient } from '@qdrant/js-client-rest';
|
|
37
|
-
import 'node:module';
|
|
38
37
|
import 'cosmiconfig';
|
|
39
38
|
import 'ignore';
|
|
40
39
|
|
|
@@ -2286,7 +2285,7 @@ function createConfigMatchHandler(options) {
|
|
|
2286
2285
|
if (config !== cachedConfig) {
|
|
2287
2286
|
compiledRules = compileRules(config.inferenceRules ?? []);
|
|
2288
2287
|
watchMatcher = picomatch(config.watch.paths, { dot: true });
|
|
2289
|
-
ignoreMatcher = config.watch.ignored
|
|
2288
|
+
ignoreMatcher = config.watch.ignored.length
|
|
2290
2289
|
? picomatch(config.watch.ignored, { dot: true })
|
|
2291
2290
|
: undefined;
|
|
2292
2291
|
cachedConfig = config;
|
|
@@ -5816,7 +5815,7 @@ class FileSystemWatcher {
|
|
|
5816
5815
|
// Chokidar v5's inline anymatch does exact string equality for string
|
|
5817
5816
|
// matchers, breaking glob-based ignored patterns. Convert to picomatch
|
|
5818
5817
|
// functions that chokidar passes through as-is.
|
|
5819
|
-
const ignored = this.config.ignored
|
|
5818
|
+
const ignored = this.config.ignored.length
|
|
5820
5819
|
? resolveIgnored(this.config.ignored)
|
|
5821
5820
|
: undefined;
|
|
5822
5821
|
// Track initial scan statistics per root for diagnostics.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { DEFAULT_PORTS, postJson, fetchJson, createServiceCli } from '@karmaniverous/jeeves';
|
|
3
|
-
import { createRequire } from 'node:module';
|
|
2
|
+
import { DEFAULT_PORTS, postJson, fetchJson, getPackageVersion, createServiceCli } from '@karmaniverous/jeeves';
|
|
4
3
|
import { dirname, resolve, join, relative } from 'node:path';
|
|
5
4
|
import { fileURLToPath } from 'node:url';
|
|
6
5
|
import { packageDirectorySync } from 'package-directory';
|
|
@@ -121,7 +120,7 @@ const watchConfigSchema = z.object({
|
|
|
121
120
|
/** Glob patterns to ignore. */
|
|
122
121
|
ignored: z
|
|
123
122
|
.array(z.string())
|
|
124
|
-
.
|
|
123
|
+
.default(['**/node_modules/**'])
|
|
125
124
|
.describe('Glob patterns to exclude from watching (e.g., "**/node_modules/**").'),
|
|
126
125
|
/** Polling interval in milliseconds. */
|
|
127
126
|
pollIntervalMs: z
|
|
@@ -819,7 +818,7 @@ async function startFromConfig(configPath, descriptor) {
|
|
|
819
818
|
const config = await loadConfig(resolvedPath);
|
|
820
819
|
// Dynamic import breaks the circular dependency between this module
|
|
821
820
|
// and app/index.ts (which defines JeevesWatcher and re-exports startFromConfig).
|
|
822
|
-
const { JeevesWatcher } = await import('./index-
|
|
821
|
+
const { JeevesWatcher } = await import('./index-BRJ47BY6.js');
|
|
823
822
|
const app = new JeevesWatcher(config, resolvedPath, descriptor);
|
|
824
823
|
installShutdownHandlers(() => app.stop());
|
|
825
824
|
await app.start();
|
|
@@ -1621,7 +1620,7 @@ async function executeReindex(deps, scope, path, dryRun = false) {
|
|
|
1621
1620
|
}
|
|
1622
1621
|
else if (scope === 'rules' && pathArray && pathArray.length > 0) {
|
|
1623
1622
|
// Rules scope with path filter: list from watch roots intersected with caller globs
|
|
1624
|
-
fileList = await listFilesFromWatchRoots(config.watch.paths, config.watch.ignored
|
|
1623
|
+
fileList = await listFilesFromWatchRoots(config.watch.paths, config.watch.ignored, pathArray, isGitignored);
|
|
1625
1624
|
}
|
|
1626
1625
|
else {
|
|
1627
1626
|
// rules or full: list files from globs
|
|
@@ -1990,8 +1989,7 @@ const packageRoot = packageDirectorySync({ cwd: thisDir });
|
|
|
1990
1989
|
if (!packageRoot) {
|
|
1991
1990
|
throw new Error('Could not find package root from ' + thisDir);
|
|
1992
1991
|
}
|
|
1993
|
-
const
|
|
1994
|
-
const { version } = require$1(resolve(packageRoot, 'package.json'));
|
|
1992
|
+
const version = getPackageVersion(import.meta.url);
|
|
1995
1993
|
/**
|
|
1996
1994
|
* Watcher component descriptor. Single source of truth for service identity,
|
|
1997
1995
|
* config schema, and extension points consumed by core factories.
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { Stats } from 'node:fs';
|
|
|
17
17
|
*/
|
|
18
18
|
declare const watchConfigSchema: z.ZodObject<{
|
|
19
19
|
paths: z.ZodArray<z.ZodString>;
|
|
20
|
-
ignored: z.
|
|
20
|
+
ignored: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
21
21
|
pollIntervalMs: z.ZodOptional<z.ZodNumber>;
|
|
22
22
|
usePolling: z.ZodOptional<z.ZodBoolean>;
|
|
23
23
|
debounceMs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -112,7 +112,7 @@ declare const jeevesWatcherConfigSchema: z.ZodObject<{
|
|
|
112
112
|
}, z.core.$strip>, z.ZodString]>>>;
|
|
113
113
|
watch: z.ZodObject<{
|
|
114
114
|
paths: z.ZodArray<z.ZodString>;
|
|
115
|
-
ignored: z.
|
|
115
|
+
ignored: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
116
116
|
pollIntervalMs: z.ZodOptional<z.ZodNumber>;
|
|
117
117
|
usePolling: z.ZodOptional<z.ZodBoolean>;
|
|
118
118
|
debounceMs: z.ZodOptional<z.ZodNumber>;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { join, dirname, resolve, relative, extname, basename, isAbsolute } from 'node:path';
|
|
2
|
-
import { createConfigQueryHandler as createConfigQueryHandler$1, createStatusHandler, createConfigApplyHandler, DEFAULT_PORTS, getBindAddress, postJson, fetchJson } from '@karmaniverous/jeeves';
|
|
2
|
+
import { createConfigQueryHandler as createConfigQueryHandler$1, createStatusHandler, createConfigApplyHandler, DEFAULT_PORTS, getBindAddress, postJson, fetchJson, getPackageVersion } from '@karmaniverous/jeeves';
|
|
3
3
|
import Fastify from 'fastify';
|
|
4
4
|
import { readdir, stat, readFile } from 'node:fs/promises';
|
|
5
5
|
import { parallel, capitalize, title, camel, snake, dash, isEqual, get, omit } from 'radash';
|
|
@@ -33,7 +33,6 @@ import * as cheerio from 'cheerio';
|
|
|
33
33
|
import mammoth from 'mammoth';
|
|
34
34
|
import { MarkdownTextSplitter, RecursiveCharacterTextSplitter } from '@langchain/textsplitters';
|
|
35
35
|
import { QdrantClient } from '@qdrant/js-client-rest';
|
|
36
|
-
import { createRequire } from 'node:module';
|
|
37
36
|
|
|
38
37
|
/**
|
|
39
38
|
* @module gitignore
|
|
@@ -830,7 +829,7 @@ async function executeReindex(deps, scope, path, dryRun = false) {
|
|
|
830
829
|
}
|
|
831
830
|
else if (scope === 'rules' && pathArray && pathArray.length > 0) {
|
|
832
831
|
// Rules scope with path filter: list from watch roots intersected with caller globs
|
|
833
|
-
fileList = await listFilesFromWatchRoots(config.watch.paths, config.watch.ignored
|
|
832
|
+
fileList = await listFilesFromWatchRoots(config.watch.paths, config.watch.ignored, pathArray, isGitignored);
|
|
834
833
|
}
|
|
835
834
|
else {
|
|
836
835
|
// rules or full: list files from globs
|
|
@@ -1147,7 +1146,7 @@ function createConfigMatchHandler(options) {
|
|
|
1147
1146
|
if (config !== cachedConfig) {
|
|
1148
1147
|
compiledRules = compileRules(config.inferenceRules ?? []);
|
|
1149
1148
|
watchMatcher = picomatch(config.watch.paths, { dot: true });
|
|
1150
|
-
ignoreMatcher = config.watch.ignored
|
|
1149
|
+
ignoreMatcher = config.watch.ignored.length
|
|
1151
1150
|
? picomatch(config.watch.ignored, { dot: true })
|
|
1152
1151
|
: undefined;
|
|
1153
1152
|
cachedConfig = config;
|
|
@@ -1452,7 +1451,7 @@ const watchConfigSchema = z.object({
|
|
|
1452
1451
|
/** Glob patterns to ignore. */
|
|
1453
1452
|
ignored: z
|
|
1454
1453
|
.array(z.string())
|
|
1455
|
-
.
|
|
1454
|
+
.default(['**/node_modules/**'])
|
|
1456
1455
|
.describe('Glob patterns to exclude from watching (e.g., "**/node_modules/**").'),
|
|
1457
1456
|
/** Polling interval in milliseconds. */
|
|
1458
1457
|
pollIntervalMs: z
|
|
@@ -7447,7 +7446,7 @@ class FileSystemWatcher {
|
|
|
7447
7446
|
// Chokidar v5's inline anymatch does exact string equality for string
|
|
7448
7447
|
// matchers, breaking glob-based ignored patterns. Convert to picomatch
|
|
7449
7448
|
// functions that chokidar passes through as-is.
|
|
7450
|
-
const ignored = this.config.ignored
|
|
7449
|
+
const ignored = this.config.ignored.length
|
|
7451
7450
|
? resolveIgnored(this.config.ignored)
|
|
7452
7451
|
: undefined;
|
|
7453
7452
|
// Track initial scan statistics per root for diagnostics.
|
|
@@ -8226,8 +8225,7 @@ const packageRoot = packageDirectorySync({ cwd: thisDir });
|
|
|
8226
8225
|
if (!packageRoot) {
|
|
8227
8226
|
throw new Error('Could not find package root from ' + thisDir);
|
|
8228
8227
|
}
|
|
8229
|
-
const
|
|
8230
|
-
const { version } = require$1(resolve(packageRoot, 'package.json'));
|
|
8228
|
+
const version = getPackageVersion(import.meta.url);
|
|
8231
8229
|
/**
|
|
8232
8230
|
* Watcher component descriptor. Single source of truth for service identity,
|
|
8233
8231
|
* config schema, and extension points consumed by core factories.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@karmaniverous/jeeves-watcher",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"author": "Jason Williscroft",
|
|
5
5
|
"description": "Filesystem watcher that keeps a Qdrant vector store in sync with document changes",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@commander-js/extra-typings": "^14.0.0",
|
|
54
|
-
"@karmaniverous/jeeves": "^0.5.
|
|
54
|
+
"@karmaniverous/jeeves": "^0.5.4",
|
|
55
55
|
"@karmaniverous/jsonmap": "^2.1.1",
|
|
56
56
|
"@langchain/textsplitters": "*",
|
|
57
57
|
"@qdrant/js-client-rest": "*",
|
|
@@ -91,14 +91,14 @@
|
|
|
91
91
|
"@types/better-sqlite3": "^7.6.13",
|
|
92
92
|
"@types/fs-extra": "^11.0.4",
|
|
93
93
|
"@types/js-yaml": "*",
|
|
94
|
-
"@types/node": "^25.5.
|
|
95
|
-
"@types/picomatch": "^4.0.
|
|
94
|
+
"@types/node": "^25.5.2",
|
|
95
|
+
"@types/picomatch": "^4.0.3",
|
|
96
96
|
"@vitest/coverage-v8": "^4.1.2",
|
|
97
97
|
"auto-changelog": "^2.5.0",
|
|
98
98
|
"cross-env": "^10.1.0",
|
|
99
99
|
"fs-extra": "^11.3.4",
|
|
100
100
|
"happy-dom": "^20.8.9",
|
|
101
|
-
"knip": "^6.
|
|
101
|
+
"knip": "^6.3.0",
|
|
102
102
|
"release-it": "^19.2.4",
|
|
103
103
|
"rollup": "^4.60.1",
|
|
104
104
|
"rollup-plugin-dts": "^6.4.1",
|