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 directory and 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:

HostedRepo

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:

ToolResult

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_load starts a fresh one instead of assuming the old tools still work.

bind_dispatch(dispatch)[source]#

Accept the agent-side dispatcher used to answer nested harness calls.

The in-process host calls the harness directly and ignores it.

Parameters:

dispatch (Callable[[str, dict[str, JsonValue]], Awaitable[ToolResult]])

Return type:

None