build_dependency_graph_with_ai

Builds a dependency graph of the codebase using AI.

Arguments

Name
Type
Description
Required

dependency_prompt

prompt

The prompt to use to extract dependencies and build relationships between files.

exclude_path_patterns

array

The paths to exclude from the constructed graph. This should start at the root and can end at any folder or file and can be a glob pattern with wildcards.

Allowed match patterns:

  1. Wildcard (_): • Matches any sequence of characters (except for the directory separator, /). • Example: _.log ignores all files with the .log extension.

  2. Double Wildcard (**): • Matches any sequence of characters, including directory separators. • Example: **/temp/** ignores all files in any temp directory at any level of the directory hierarchy including the root.

  3. Single Character Wildcard (?): • Matches any single character. • Example: file?.txt matches file1.txt, fileA.txt, etc.

  4. Negation (!): • Includes a pattern no matter what. Trumps other ignores. • Example: !important.log includes important.log in the result.

  5. Directory Separator (/): • Specifies directory paths. A pattern ending with / indicates a directory. • Example: temp/ ignores the temp directory and all its contents. This is the same as temp/*

Args: exclude_patterns (List[str]): List of patterns to exclude files. files (List[str]): List of files to be filtered.

Example patterns with explanation:

  • "*.log": Excludes all files with the .log extension.

  • "/temp/": Excludes all files in any directory named 'temp' at any level.

  • "file?.txt": Excludes files like file1.txt, fileA.txt, etc., where ? matches any single character.

  • "!important.log": Ensures that important.log is included, even if it matches other exclude patterns.

  • "temp/": Excludes the 'temp' directory at the root and all its contents.

preferred_extensions_for_resolution

array

The preferred extensions for resolution of file paths.

cost_limit

number

The maximum cost limit as a whole dollar amount for building the dependency graph.

files_to_index

array

A list of specific files to index for building the dependency graph.

Returns

Type
Description

null

Does not return a value. Builds a graph in memory.

Example

- name: build_dependency_graph_with_ai
  arguments:
    dependency_prompt: <dependency-prompt>
    preferred_extensions_for_resolution: ['.ts', '.tsx']
    exclude_path_patterns:
      - <exclude-path-pattern-1>
      - <exclude-path-pattern-2>
    cost_limit: 100.0
  returns: None

Last updated