Local Files
Daftar, stat, baca (UTF-8 atau base64, dibatasi dengan tanda terpotong), cari berdasarkan glob nama atau isi teks, dan penulisan bertahap yang tidak pernah menimpa kecuali node memintanya. Cek realpath, tanpa FIFO, device atau hard link, penulisan oleh agent harus diizinkan, hapus hanya lewat node
Tentang
Plugin Graphrt untuk file di folder yang kamu izinkan. Workflow dan agent bisa menampilkan, mengecek, membaca dan mencari file di sana, serta menulis file baru. Tidak ada yang bisa dijangkau di luar LOCAL_FILES_ALLOWED_DIRS, agent hanya bisa membaca kecuali kamu izinkan, dan meskipun diizinkan agent hanya bisa membuat file baru.
Yang bisa dilakukan
- list_allowed_directories: the allowed roots as real paths, and whether each exists.
- list_directory: name, type, size and modified time, sorted, max_depth (1–10) recurses, limit (default 500, at most 5000) caps the entries and sets truncated. Hidden names only with include_hidden.
- stat: type (file, directory, symlink, fifo, socket, device), size, modified/created/accessed times, permission bits and hard-link count, without opening the file. Regular files with more than one hard link are refused (their metadata could belong to a file outside the allowlist).
- read_file: UTF-8 text or base64, from offset, at most max_bytes (default 256 KiB, never more than LOCAL_FILES_MAX_READ_BYTES). A capped read returns truncated: true and next_offset, a UTF-8 slice never ends in the middle of a character. Bytes that are not valid UTF-8 are refused with a hint to use base64.
- search_files: by file-name glob (*, ?) and/or a plain-text substring per line (no regular expressions, so no ReDoS), case-insensitive by default, bounded by max_depth, max_results, max_matches_per_file (default 10, files_with_more_matches counts files that had more) and LOCAL_FILES_MAX_SEARCH_FILES (every entry visited counts, directories included, see entries_scanned). Name globs use a linear two-pointer matcher, so hostile patterns cannot stall it. Binary, oversized and hard-linked files are skipped and counted in skipped_files.
- write_file: UTF-8 or base64 content to a new file, staged and published atomically, create_parents makes missing directories inside the allowlist. overwrite: true (workflow nodes only) replaces an existing regular file and keeps its permission bits.
- delete_path (workflow nodes only): one file, symlink (the link itself) or empty directory.
Aksi
Setiap aksi adalah langkah yang bisa ditambahkan ke workflow. Agent juga bisa memakai sebagian besar aksi sebagai tool.
- List allowed directories
local-files.list_allowed_directories - Stat a path
local-files.stat - Read a file
local-files.read_file - List a directory
local-files.list_directory - Search files
local-files.search_files - Write a file
local-files.write_file - Delete a file or empty directory
local-files.delete_path
Pengaturan
Graphrt menyalakan plugin dengan environment yang bersih. Hanya nilai ini yang sampai ke plugin, dan secret tidak masuk log.
-
LOCAL_FILES_ALLOWED_DIRS(required)Comma-separated directories (absolute or ~/...), subdirectories included. Relative paths in calls start at the first one. -
LOCAL_FILES_TOOL_ALLOW_WRITES(off)1 lets agents call write_file to create new files. Workflow nodes can always write. -
LOCAL_FILES_MAX_READ_BYTES1 MiBMost bytes one read_file returns (1024 to 64 MiB), also the largest file search_files reads -
LOCAL_FILES_MAX_WRITE_BYTES10 MiBLargest write_file content (1024 to 1 GiB) -
LOCAL_FILES_MAX_SEARCH_FILES10000Most entries (files, directories, symlinks) one search_files call visits (10 to 200000)
Cara memakainya
Di Graphrt Desktop
- Buka Plugins dan cari Local Files.
- Klik Install lalu setujui.
- Ikuti langkah setup di halaman plugin, lalu tempel pengaturan yang dibutuhkan.
- Jelaskan pekerjaan yang membutuhkannya, dan builder menambahkan langkahnya.
Dengan CLI
$ graphrt plugin install local-files - { id: save, type: local-files.write_file, path: reports/today.md, content: "{{#llm.text#}}", create_parents: true }
- { id: read, type: local-files.read_file, path: reports/today.md }