Checks if the total size of files exceeds a specified limit.
If the limit is exceeded, prints an error message and exits the process.
Collects a list of target files within a directory, applying custom ignore patterns.
Respects ignore rules from .repconignore file if provided.
Returns a vector of relative paths to the files that are not ignored.
Formats a file size in bytes into a human-readable string with appropriate units (B, KB, MB, GB).
Returns the formatted string.
Calculates the total size of a list of files, given their relative paths and root directory.
Returns the total size in bytes.
Splits the target files into chunks based on a maximum file size.
Generates multiple files if necessary, each containing a portion of the target files.
Returns a vector of paths to the generated files.
Asynchronously uploads a file to OpenAI using the provided API key.