Vibe.Files (vibe v0.2.1)

Copy Markdown View Source

File read, write, and edit operations for agent tools.

Summary

Types

edit()

@type edit() :: %{old_text: String.t(), new_text: String.t()}

Functions

diff(old, new)

@spec diff(String.t(), String.t()) :: String.t()

edit_file(path, edits, opts \\ [])

@spec edit_file(String.t(), [edit() | map()], keyword()) ::
  {:ok, map()} | {:error, String.t()}

language(path)

@spec language(Path.t()) :: String.t()

read_file(path, opts \\ [])

@spec read_file(
  String.t(),
  keyword()
) :: {:ok, Vibe.Files.ReadResult.t()} | {:error, String.t()}

write_file(path, content, opts \\ [])

@spec write_file(String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, String.t()}