@skill-map/cli 0.15.0 → 0.16.0

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.
@@ -364,13 +364,13 @@ declare class Registry {
364
364
  }
365
365
 
366
366
  /**
367
- * `.skill-mapignore` parser + filter facade. Wraps `ignore` (kaelzhang)
367
+ * `.skillmapignore` parser + filter facade. Wraps `ignore` (kaelzhang)
368
368
  * with the project-local layering: bundled defaults → `config.ignore`
369
- * (from `.skill-map/settings.json`) → `.skill-mapignore` file content.
369
+ * (from `.skill-map/settings.json`) → `.skillmapignore` file content.
370
370
  *
371
371
  * Why a wrapper instead of exposing `ignore` directly:
372
372
  *
373
- * 1. Single-source defaults — `src/config/defaults/skill-mapignore` is
373
+ * 1. Single-source defaults — `src/config/defaults/skillmapignore` is
374
374
  * the canonical default list, loaded once at module init (or at
375
375
  * explicit build time, depending on bundling). The runtime never
376
376
  * re-reads it per scan.
@@ -1523,7 +1523,7 @@ interface RunScanOptions {
1523
1523
  /**
1524
1524
  * Filter that decides which paths the Providers skip. Composed by the
1525
1525
  * caller (typically the CLI) from bundled defaults + `config.ignore`
1526
- * + `.skill-mapignore`. Providers that omit this option fall back to
1526
+ * + `.skillmapignore`. Providers that omit this option fall back to
1527
1527
  * their own defensive defaults (just enough to keep `.git` /
1528
1528
  * `node_modules` out).
1529
1529
  */
@@ -1787,7 +1787,7 @@ declare class InMemoryProgressEmitter implements ProgressEmitterPort {
1787
1787
  * The watcher does NOT call into the orchestrator itself. That decision
1788
1788
  * is deliberate: the CLI owns the scan-and-persist pipeline (`runScan`,
1789
1789
  * `persistScanResult`, optional rebuild of the ignore filter when
1790
- * `.skill-mapignore` itself changes). Pulling that into the watcher
1790
+ * `.skillmapignore` itself changes). Pulling that into the watcher
1791
1791
  * would couple the kernel module to `SqliteStorageAdapter`, which the
1792
1792
  * Server wouldn't want. Keep this module side-effect free
1793
1793
  * apart from filesystem subscription.
@@ -1825,8 +1825,24 @@ interface ICreateFsWatcherOptions {
1825
1825
  cwd: string;
1826
1826
  /** Debounce window in milliseconds. `0` triggers `onBatch` synchronously per event. */
1827
1827
  debounceMs: number;
1828
- /** Optional ignore filter — same instance the scan walker uses. */
1829
- ignoreFilter?: IIgnoreFilter | undefined;
1828
+ /**
1829
+ * Optional ignore filter — same instance the scan walker uses.
1830
+ *
1831
+ * Two shapes are accepted:
1832
+ *
1833
+ * - **`IIgnoreFilter`** (the static one) — captured by reference at
1834
+ * construction. Use this when the filter never changes for the
1835
+ * lifetime of the watcher (the typical CLI `sm watch` flow).
1836
+ *
1837
+ * - **`() => IIgnoreFilter | undefined`** (a getter) — re-evaluated
1838
+ * on EVERY chokidar `ignored` predicate call. Use this when the
1839
+ * filter can change at runtime — e.g. the BFF rebuilds it after
1840
+ * a `.skillmapignore` or `.skill-map/settings.json` edit and
1841
+ * wants chokidar to immediately respect the new patterns without
1842
+ * tearing down and rebuilding the watcher. A getter that returns
1843
+ * `undefined` disables ignore filtering for that call.
1844
+ */
1845
+ ignoreFilter?: IIgnoreFilter | (() => IIgnoreFilter | undefined) | undefined;
1830
1846
  /** Called once per debounced batch. Awaited; concurrent batches are serialised. */
1831
1847
  onBatch: (batch: IWatchBatch) => void | Promise<void>;
1832
1848
  /**
@@ -102,7 +102,7 @@ import yaml from "js-yaml";
102
102
  // package.json
103
103
  var package_default = {
104
104
  name: "@skill-map/cli",
105
- version: "0.15.0",
105
+ version: "0.16.0",
106
106
  description: "skill-map reference implementation \u2014 kernel + CLI + adapters.",
107
107
  license: "MIT",
108
108
  type: "module",
@@ -161,7 +161,7 @@ var package_default = {
161
161
  },
162
162
  dependencies: {
163
163
  "@hono/node-server": "2.0.1",
164
- "@skill-map/spec": "0.15.0",
164
+ "@skill-map/spec": "0.16.0",
165
165
  ajv: "8.18.0",
166
166
  "ajv-formats": "3.0.1",
167
167
  chokidar: "5.0.0",
@@ -1326,11 +1326,14 @@ import { resolve as resolve3, relative as relative2, sep } from "path";
1326
1326
  import chokidar from "chokidar";
1327
1327
  function createChokidarWatcher(opts) {
1328
1328
  const absRoots = opts.roots.map((r) => resolve3(opts.cwd, r));
1329
- const ignoreFilter = opts.ignoreFilter;
1330
- const ignored = ignoreFilter ? (path) => {
1329
+ const ignoreFilterOpt = opts.ignoreFilter;
1330
+ const getFilter = ignoreFilterOpt === void 0 ? void 0 : typeof ignoreFilterOpt === "function" ? ignoreFilterOpt : () => ignoreFilterOpt;
1331
+ const ignored = getFilter ? (path) => {
1332
+ const filter = getFilter();
1333
+ if (!filter) return false;
1331
1334
  const rel = relativePathFromRoots(path, absRoots);
1332
1335
  if (rel === null) return false;
1333
- return ignoreFilter.ignores(rel);
1336
+ return filter.ignores(rel);
1334
1337
  } : void 0;
1335
1338
  const watcher = chokidar.watch(absRoots, {
1336
1339
  ignoreInitial: true,