Fs List

List files and directories under scenarios/<world_name>/fs; returns one Note whose body is a text listing (like ls).

bdambrosio 849cb07 3 files · 7.6 KB Updated

File contents

fs-list

List files and directories within the filesystem sandbox for the current world.

Input

  • path: Relative path under scenarios/<world_name>/fs (default: root)
  • recursive: Whether to recurse into subdirectories (default: false)
  • include_files: Include files (default: true)
  • include_dirs: Include subdirectory lines in the listing (default: true)
  • max_entries: Max lines to emit before truncation (default: 200)

Output

Success returns:

  • resource_id: Note ID (not a Collection)
  • The Note's text body is a human-readable directory listing:
    • First line: the listed path (relative)
    • Directories: dirname/ (trailing slash)
    • Files: filename (size) — e.g. readme.md (2.1K), note.txt (219B)
    • Truncation line if max_entries reached

Read the listing with get_text("$your_out_var"). Do not use get_items — that is only for Collections.

How to interpret the text for a given goal is left to the planner.

Examples

{"type":"fs-list","path":".","out":"$root"}
{"type":"fs-list","path":"docs","recursive":true,"out":"$docs_tree"}

After out="$root", read the body with get_text("$root").

bdambrosio/cognitive_workbench/tree/main/src/world-tools/fs/fs-list commit 849cb07a55

Frequently asked questions

npx skillmds@latest add bdambrosio/fs-list