Packages
AI agent framework for Elixir built on OTP. TEA-based agents with crash isolation, inter-agent messaging, team supervision, and real SSE streaming to Anthropic, OpenAI, Ollama, and more.
Current section
Files
Jump to
Current section
Files
lib/raxol/agent/actions/vfs/write_file.ex
defmodule Raxol.Agent.Actions.Vfs.WriteFile do
use Raxol.Agent.Action,
name: "vfs_write_file",
description: "Create a file with content in the virtual filesystem",
schema: [
input: [
path: [type: :string, required: true, description: "File path to create"],
content: [type: :string, required: true, description: "File content"]
]
]
@spec run(map(), map()) :: {:ok, map()} | {:error, term()}
@impl true
def run(%{path: path, content: content} = params, context) do
fs = Raxol.Agent.Actions.Vfs.get_vfs(params, context)
case Raxol.Commands.FileSystem.create_file(fs, path, content) do
{:ok, new_fs} -> {:ok, %{path: path, size: byte_size(content), vfs: new_fs}}
{:error, reason} -> {:error, reason}
end
end
end