JITToolHost#
Let a model keep its own tools and notes in a repository on disk. See the guide.
- class zett_agent.jit_harness.host.JITToolHost[source]#
Import a repository’s tools and run them, in this process or another.
- abstractmethod load(directory, scan, bridge)[source]#
Import every module of
directoryand describe the tools it defines.- Parameters:
directory (Path) – Repository root.
scan (RepoScan) – What the files looked like before the import.
bridge (HarnessCalls) – The object repository code sees as
harness. Hosts that run the code elsewhere use their own proxy and ignore it.
- Return type:
- abstractmethod async invoke(name, arguments)[source]#
Run one tool of the loaded repository and return its raw result.
- Parameters:
name (str)
arguments (dict[str, JsonValue])
- Return type:
- abstractmethod close()[source]#
Release every process and imported module this host owns.
- Return type:
None
- property needs_reload: bool#
Whether the loaded version must be imported again even if its source did not change.
A host whose code runs elsewhere reports True after its process died, so
repo_loadstarts a fresh one instead of assuming the old tools still work.
- bind_dispatch(dispatch)[source]#
Accept the agent-side dispatcher used to answer nested
harnesscalls.The in-process host calls the harness directly and ignores it.
- Parameters:
dispatch (Callable[[str, dict[str, JsonValue]], Awaitable[ToolResult]])
- Return type:
None