Skip to content

Agent Zero AI framework

2.4 KB
Raw Blame

text_editor_remote tool

Read, write, and patch files on a connected A0 CLI host. Shown when a connected A0 CLI advertises remote file access. Reads, writes, and patches files on the machine where that CLI is running. Use this tool, not server-side file tools, when the user asks for files on the connected local machine, A0 CLI host, or explicitly says not to use Docker/server files. For complex remote edits, optionally load skill host-file-editing.

Availability and permissions are checked when the tool runs. If no CLI is connected, remote file access is disabled, or a write/patch needs Read&Write, report that to the user instead of falling back to server-side file tools.

Arguments

  • action: read, write, or patch
  • path: file path on the CLI host filesystem
  • read: optional line_from, line_to
  • write: requires content
  • patch: requires one of old_text + new_text, patch_text, or edits

Notes

  • Prefer read before line-number edits.
  • If the user says patch, change without rewriting, or don't rewrite, use action: "patch" instead of write.
  • For simple "change X to Y" requests, prefer exact replace with old_text and new_text; old_text must match one exact current span.
  • Prefer patch_text for context-anchored changes and edits only for fresh, surgical line ranges.
  • If freshness checks reject a line patch, reread the file and retry with updated ranges.
  • Reads are text previews capped at 2,000 lines and 256 KiB. When the result says it was truncated, continue from its next_line only if another bounded text slice is sufficient.
  • Write and patch content is capped at 256 KiB. For a complete large file or any binary file, use the authenticated CLI/Core HTTP upload or download path; do not retry it through this WebSocket tool. If no HTTP-facing action is available in the current task, ask the user to attach/upload the file through A0 CLI.
  • Relative paths are relative to the CLI host filesystem. Do not rewrite them to /a0/usr/workdir; that path belongs to the Agent Zero server/Docker side.

Usage

{
  "thoughts": [
    "The user asked for a file on the connected local machine, so I should read it through the A0 CLI host."
  ],
  "headline": "Reading file on connected local machine",
  "tool_name": "text_editor_remote",
  "tool_args": {
    "action": "read",
    "path": "README.md",
    "line_from": 1,
    "line_to": 80
  }
}