MCPcopy Create free account
hub / github.com/OpenRaiser/NanoResearch / __init__

Method __init__

nanoresearch/agents/code_editor.py:180–191  ·  view source on GitHub ↗
(
        self,
        code_dir: Path,
        config: ResearchConfig,
        log_fn: Any = None,
    )

Source from the content-addressed store, hash-verified

178 """LLM-powered interactive code editor with backup/rollback."""
179
180 def __init__(
181 self,
182 code_dir: Path,
183 config: ResearchConfig,
184 log_fn: Any = None,
185 ) -> None:
186 self.code_dir = code_dir.resolve()
187 self.snapshot_mgr = CodeSnapshotManager(self.code_dir)
188 self.config = config
189 self.dispatcher = ModelDispatcher(config)
190 self._log = log_fn or (lambda msg: None)
191 self._history: list[dict[str, str]] = []
192
193 async def preview_instruction(self, instruction: str) -> dict[str, Any]:
194 """Dry-run: ask LLM for edits but do NOT apply them.

Callers

nothing calls this directly

Calls 2

ModelDispatcherClass · 0.90
CodeSnapshotManagerClass · 0.85

Tested by

no test coverage detected