jeeves-watcher
    Preparing search index...

    Filesystem watcher. A change source only reports events (D120); this class filters them, keeps the inventory (D99) and maps them to the processing queue.

    Implements

    Index
    • Create a new FileSystemWatcher.

      Parameters

      • config: {
            changeSource?: "chokidar" | "parcel";
            debounceMs?: number;
            ignored: string[];
            indexCheckOnStart?: boolean;
            moveDetection?: { bufferMs: number; enabled: boolean };
            paths: (
                | string
                | {
                    path: string;
                    vcs?: {
                        accessToken?: string;
                        author?: { email: string; name: string };
                        branch?: string;
                        circuitBreakerCooldownMs?: number;
                        commitMessage?: {
                            apiKey?: string;
                            enabled: boolean;
                            model: string;
                            provider: string;
                        };
                        commitThrottleMs?: number;
                        defaultAccessToken?: string;
                        enabled?: boolean;
                        maxBatchSize?: number;
                        maxConsecutiveFailures?: number;
                        maxFileBytes?: string
                        | number;
                        remote?: string;
                        retention?: {
                            maxAgeDays: number;
                            maxVersions: number;
                            squashCron: string;
                        };
                        staleLockThresholdMs?: number;
                    };
                }
            )[];
            pollIntervalMs?: number;
            reconcileIntervalMs?: number;
            respectGitignore?: boolean;
            stabilityThresholdMs?: number;
            usePolling?: boolean;
        }

        Watch configuration.

        • OptionalchangeSource?: "chokidar" | "parcel"

          The local change source (D125); usePolling: true forces chokidar.

        • OptionaldebounceMs?: number

          Debounce delay in milliseconds for file change events.

        • ignored: string[]

          Glob patterns to ignore.

        • OptionalindexCheckOnStart?: boolean

          Index check at start (D197).

        • OptionalmoveDetection?: { bufferMs: number; enabled: boolean }

          Move detection configuration for correlating unlink+add as file moves.

          • bufferMs: number

            Buffer time in ms for holding unlink events before treating as deletes. Default: 2000.

          • enabled: boolean

            Enable move correlation. Default: true.

        • paths: (
              | string
              | {
                  path: string;
                  vcs?: {
                      accessToken?: string;
                      author?: { email: string; name: string };
                      branch?: string;
                      circuitBreakerCooldownMs?: number;
                      commitMessage?: {
                          apiKey?: string;
                          enabled: boolean;
                          model: string;
                          provider: string;
                      };
                      commitThrottleMs?: number;
                      defaultAccessToken?: string;
                      enabled?: boolean;
                      maxBatchSize?: number;
                      maxConsecutiveFailures?: number;
                      maxFileBytes?: string
                      | number;
                      remote?: string;
                      retention?: {
                          maxAgeDays: number;
                          maxVersions: number;
                          squashCron: string;
                      };
                      staleLockThresholdMs?: number;
                  };
              }
          )[]

          Glob patterns or watch path objects to watch.

        • OptionalpollIntervalMs?: number

          Polling interval in milliseconds.

        • OptionalreconcileIntervalMs?: number

          Periodic reconciliation interval (D111); 0 disables it.

        • OptionalrespectGitignore?: boolean

          Whether to respect .gitignore files when processing.

        • OptionalstabilityThresholdMs?: number

          Time in milliseconds a file must be stable before processing.

        • OptionalusePolling?: boolean

          Whether to use polling instead of native watchers.

      • queue: EventQueue

        The event queue.

      • processor: DocumentProcessorInterface

        The document processor.

      • logger: Logger

        The logger instance.

      • options: FileSystemWatcherOptions = {}

        Optional health/fatal error options.

      Returns FileSystemWatcher

    • get restartsToRebuild(): boolean

      Whether a rebuild must exit for a restart (D196): the running source, or one this watcher stopped (its watches stay live), cannot release its watches in-process (parcel on Windows).

      Returns boolean

    • The inventory's file paths (absolute, as the source reported them): matched files only, never directories or filtered files (D83). No filesystem I/O; empty before start.

      Returns string[]

    • Re-arm the periodic reconcile timers with the live interval: a reload that changed only watch.reconcileIntervalMs needs no rebuild (D111).

      Returns void

    • Start watching the filesystem and processing events. With parcel the roots are subscribed first, then walked in the background (D58).

      Returns Promise<void>

      ChangeSourceLoadError when parcel is selected and cannot load.