Built-in sandbox SHIM: ls — the DIRECTORY listing available inside Python.
Mapping a tree is the cheapest question there is and the one a model asks
most, so ls(dir) runs inside the python_execution block already in flight.
It answers with one compact tree STRING, ready to print. Structured rows would
cost the reader a second rendering step and the context every quoted brace; the
tree is the shortest form that still says name, kind, size and shape.
The walk itself stays on the HOST: editing/list-directories is fff's
ignore-aware listing (.gitignore, .ignore, cache directories, the vis.yml
overlay), an order of magnitude faster than a guest os.scandir recursion that
would honour none of those rules. Rows cross as JSON so the shim renders native
Python dicts, not foreign proxies. Failures use the standard host-tool boundary
and the same declarative error hook as the editing tools.
:fs/access is asked by list-directories itself, so an extension that hides
a tree hides it from the listing exactly as it hides it from every read.
Built-in sandbox SHIM: `ls` — the DIRECTORY listing available inside Python. Mapping a tree is the cheapest question there is and the one a model asks most, so `ls(dir)` runs inside the `python_execution` block already in flight. It answers with one compact tree STRING, ready to print. Structured rows would cost the reader a second rendering step and the context every quoted brace; the tree is the shortest form that still says name, kind, size and shape. The walk itself stays on the HOST: `editing/list-directories` is fff's ignore-aware listing (`.gitignore`, `.ignore`, cache directories, the `vis.yml` overlay), an order of magnitude faster than a guest `os.scandir` recursion that would honour none of those rules. Rows cross as JSON so the shim renders native Python dicts, not foreign proxies. Failures use the standard host-tool boundary and the same declarative error hook as the editing tools. `:fs/access` is asked by `list-directories` itself, so an extension that hides a tree hides it from the listing exactly as it hides it from every read.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |