Metadata-Version: 2.5
Name: jharness-tools
Version: 0.7.0
Summary: Ready-to-use filesystem, shell, interaction, and agent tools for JHarness
Project-URL: Documentation, https://github.com/Ezio2000/jharness/blob/main/packages/jharness-tools/README.md
Project-URL: Repository, https://github.com/Ezio2000/jharness.git
Author: JHarness contributors
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: jharness-kernel==0.7.0
Requires-Dist: regex>=2024.11.6
Description-Content-Type: text/markdown

# jharness-tools

Ready-to-use filesystem, shell, interaction, and child-agent tools implementing the
JHarness kernel tool contracts.

```bash
uv add jharness-tools
```

```python
from jharness.tools import GlobTool, GrepTool, LsTool, ReadTool
```

Filesystem tools are rooted in one workspace and reject path escapes. `BashTool` uses
a bounded non-interactive Bash process and a minimal environment by default, but it is
not an operating-system sandbox: commands retain the filesystem and network access
granted by the host. `inherit_environment=True` explicitly exposes the full host
environment.

Workspace path checks are not a mount namespace; mutually untrusted writers need
dedicated filesystem isolation and hard-link controls. Process-tree cleanup is best
effort, so containers—especially PID 1—must forward signals and reap child processes.

Interaction tools suspend for a host response. Child-agent tools accept the narrow
`AgentBackend` protocol. For a single-process host, `InMemoryAgentBackend` provides
concurrent supervision, parent-run authorization, idempotent creation, waiting, and
cancellation:

```python
from jharness.kernel import Runtime
from jharness.tools.agent import InMemoryAgentBackend

child_runtime = Runtime(model=model, tools=child_tool_catalog)
agent_backend = InMemoryAgentBackend(
    child_runtime,
    system_prompt="Follow the delegated task and return a concise result.",
)
```

Pass `agent_backend` to `AgentTool`, `AgentGetTool`, `AgentWaitTool`, and
`AgentCancelTool`. After a parent suspension, the host can await the in-memory
implementation's `wait_for_terminal(agent_id, requester=parent_context)` and deliver
the snapshot with `resume_agent`; other backend implementations may use their own
durable notification mechanism. The in-memory backend retains idempotency records for
its lifetime, stores them only in its process, and must be used from one asyncio event
loop. Hosts requiring bounded retention, crash recovery, or shared workers should
implement `AgentBackend` with durable storage. The host remains responsible for
choosing trusted child Runtime configuration and recording telemetry.

Installing this distribution installs the exact matching `jharness-kernel` version.
