clyops Node API
    Preparing search index...

    Function watchTools

    • loadTools, then reload whenever something under the tools directory changes, calling onChange when the set of tools (or their schemas or descriptions) differs. Changes are debounced, so a burst of writes (an editor saving, a checkout) reloads once. A reload that fails keeps the previous set and is reported to onError.

      Parameters

      • root: string
      • opts: {
            debounceMs?: number;
            filter?: ToolFilter;
            name?: string;
            onChange?: (loaded: { tools: Tool[]; tree: Group }) => void;
            onError?: (cmd: Command | null, err: Error) => void;
        } = {}
        • OptionaldebounceMs?: number
        • Optionalfilter?: ToolFilter
        • Optionalname?: string

          Program, command, option, or argument name as declared in its containing type.

        • OptionalonChange?: (loaded: { tools: Tool[]; tree: Group }) => void
        • OptionalonError?: (cmd: Command | null, err: Error) => void

      Returns Promise<ToolsWatcher>