feat(plugins): let a plugin read files outside the project (#2006)

Adds the API 1.3 `fs` import behind the existing `fs.read:<path>` capability: `read-file` (decoded like the editor, unsaved contents win), `read-bytes`, `stat` and `read-dir` (sorted, at most 4096), all at most 16 MiB. Paths are absolute or `~/`; the requested path and the grant are both resolved to their real location before the prefix check, so `..`, symlinks and name-prefix siblings can't climb out, and a whole-file-system grant is refused. A refusal is `denied` naming the `fs.read:<path>` to declare. Reuses `workspace.file-kind` / `file-stat`; SDK `host::fs`. Closes #1822, closes #1825.

Co-authored-by: chaoes <[email protected]>
Цей коміт міститься в:
WangTongchaoтаchaoes authored and GitHub committed 2026-11-07 23:45:21 +08:00
1 джерело dc69c36604
коміт 377a8c8379
60 files changed
+760 -66

No files matched your search

Бінарний файл не відображається.
+1 -1
Переглянути файл
@@ -1 +1 @@
8bb9095d0dae184aabbc8f2abfe9a3bf6c44ff97e73b7eda6f39d3504d040340
3805e5469c539186fd83fef1f4eef831149d4ba846c54d16e1f9b941d49acb04