text_editor: route file I/O through RFC for dev mode

linuztx committed Mar 1, 2026 at 10:19 UTC 4b7572ca629eca1af137cad9a38fbcf3850c92b9
2 files changed +7 -17
plugins/text_editor/helpers/file_ops.py
+4 -10
@@ -1,19 +1,13 @@
1 """
2 -File operations for the text_editor plugin.
3 -
4 -Split into two layers:
5 - - _impl functions in python/helpers/rfc_text_editor.py: pure filesystem
6 - I/O with only stdlib deps. These run inside the Docker container
7 - when routed via RFC.
8 - - Public async functions here: orchestrate _impl calls through
9 - runtime.call_development_function and apply token budgeting
10 - (which requires tiktoken, a framework-only dependency).
2 +Async file operations for the text_editor plugin. Routes I/O to the
3 +Docker container via rfc_text_editor._impl functions and applies
4 +token budgeting host-side.
5 """
6
7 from dataclasses import dataclass
8
9 from python.helpers import tokens, runtime
16 -from python.helpers.rfc_text_editor import (
10 +from plugins.text_editor.helpers.rfc_text_editor import (
11 is_binary_impl as _is_binary_impl,
12 read_file_raw_impl as _read_file_raw_impl,
13 write_file_impl as _write_file_impl,
plugins/text_editor/helpers/rfc_text_editor.py renamed
+3 -7
@@ -1,11 +1,7 @@
1 """
2 -RFC-routable filesystem operations for the text_editor plugin.
3 -
4 -These functions run inside the Docker container when invoked via
5 -runtime.call_development_function. They use only stdlib — no
6 -framework dependencies (no tiktoken, no agent context, etc.).
7 -
8 -All args and return values must be JSON-serializable.
2 +Filesystem operations for the text_editor plugin, executed on the
3 +Docker container via RFC. Stdlib only — args and return values
4 +must be JSON-serializable.
5 """
6
7 import os