@karmaniverous/jeeves-watcher 0.17.1 → 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.
@@ -289,6 +289,9 @@
289
289
  "type": "string"
290
290
  },
291
291
  "__schema7": {
292
+ "default": [
293
+ "**/node_modules/**"
294
+ ],
292
295
  "description": "Glob patterns to exclude from watching (e.g., \"**/node_modules/**\").",
293
296
  "allOf": [
294
297
  {
@@ -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?.length
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
- .optional()
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-BAJ-z4d0.js');
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 ?? [], pathArray, isGitignored);
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 require$1 = createRequire(import.meta.url);
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.ZodOptional<z.ZodArray<z.ZodString>>;
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.ZodOptional<z.ZodArray<z.ZodString>>;
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 ?? [], pathArray, isGitignored);
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?.length
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
- .optional()
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 require$1 = createRequire(import.meta.url);
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.1",
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.3",
54
+ "@karmaniverous/jeeves": "^0.5.4",
55
55
  "@karmaniverous/jsonmap": "^2.1.1",
56
56
  "@langchain/textsplitters": "*",
57
57
  "@qdrant/js-client-rest": "*",