Raxol.Agent.Actions.Vfs (Raxol Agent v2.6.0)

Copy Markdown View Source

Virtual filesystem actions for AI agents.

Each action exposes a VFS operation as an LLM-callable tool via the Raxol.Agent.Action behaviour. The agent maintains VFS state in its model and passes it through context[:vfs]. Mutating actions return the updated VFS in the result under the :vfs key.

Usage with ToolConverter

tools = ToolConverter.to_tool_definitions(Raxol.Agent.Actions.Vfs.actions())

# After LLM returns a tool call:
context = %{vfs: model.vfs}
{:ok, result} = ToolConverter.dispatch_tool_call(tool_call, actions(), context)
new_vfs = Map.get(result, :vfs, model.vfs)

Summary

Functions

Returns all VFS action modules.

Resolve VFS from params (pipeline state) or context.

Functions

actions()

@spec actions() :: [module()]

Returns all VFS action modules.

get_vfs(params, context)

@spec get_vfs(map(), map()) :: Raxol.Commands.FileSystem.t()

Resolve VFS from params (pipeline state) or context.

In a Pipeline, previous action results merge into params, so an updated VFS flows forward automatically. For direct calls, VFS comes from context.