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[源代码]#

Import a repository's tools and run them, in this process or another.

abstractmethod load(directory, scan, bridge)[源代码]#

Import every module of directory and describe the tools it defines.

参数:
  • 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.

返回类型:

HostedRepo

abstractmethod async invoke(name, arguments)[源代码]#

Run one tool of the loaded repository and return its raw result.

参数:
  • name (str)

  • arguments (dict[str, JsonValue])

返回类型:

ToolResult

abstractmethod close()[源代码]#

Release every process and imported module this host owns.

返回类型:

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)[源代码]#

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

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

参数:

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

返回类型:

None