extra tools path added

This commit is contained in:
Luxferre
2026-08-28 10:56:49 +03:00
parent 699bb429fb
commit 0fd886ed86
2 changed files with 23 additions and 0 deletions
+9
View File
@@ -150,6 +150,8 @@ If the API rejects the request with an `Invalid assistant message: content or to
- `max_al_iterations` (max tool-call loop iterations per `AL()` invocation, default 1000)
- `context_window` (context window size in tokens, auto-discovered from `/models` API if available, fallback to this setting, default 200000)
- `bantam_tools_dir` (optional path to a directory of extra shell tools; the Go port appends `"Extra shell tools can be found at <dir>"` to the system prompt at startup when set. The `BANTAM_TOOLS_DIR` environment variable overrides this and is checked first; if neither is set, nothing is appended. Note: this is an agent-internal hint, not forwarded to the API.)
The Go port's built-in editor tracks the cursor with its own column math (terminal auto-wrap aware) and redraws from the first line of the buffer, so wrapped input stays clean at any terminal width.
When enabled, the interactive console uses a subtle ANSI palette: the pending-request status `...requesting...` is darkened bold, reasoning markers are cyan, reasoning text is dim, `[tool call: ...]` traces are yellow, `[tool result: ...]` headers are green, tool result bodies are dim (red for tool errors/unknown tools), and errors/network retries are red. Tool result payloads fed back to the LLM are never colored.
@@ -208,8 +210,11 @@ MicroBantam (`mb`) is a compressed Perl 5 reference implementation of the same a
The `extras/` directory contains small, dependency-light shell scripts that extend Bantam without changing its core. Because Bantam's only built-in tools are `shell_exec` and `run_subagent`, these helpers can be invoked directly by the agent through `shell_exec` to give it real-world capabilities (web search, live weather) that the base model alone does not have. They are plain `/bin/sh` scripts depending only on `curl` (and `jq` where noted), so the agent can discover and run them just like any other command.
If you keep your own collection of helper scripts, point Bantam at them with the `BANTAM_TOOLS_DIR` environment variable or the `bantam_tools_dir` key in `model.cfg`. When either is defined (environment variable taking precedence over the config key), the Go port appends the line `Extra shell tools can be found at <dir>` to the loaded system prompt at startup, so the agent is aware of where to look for them. This hint is propagated to child agents as well (via the `run_subagent` system prompt). The `extras/` scripts shipped here are just examples of what such a directory can contain.
### `extras/websearch`
A simple web search tool for Bantam built on [Exa's MCP server](https://mcp.exa.ai/mcp)
(Streamable HTTP). It speaks the JSON-RPC MCP protocol (`initialize` ->
`notifications/initialized` -> `tools/call` with `web_search_exa`) and prints
@@ -290,6 +295,10 @@ Dependencies: `curl`, `jq`.
The default system prompt instructs the agent to respect `AGENTS.md`/`GEMINI.md`/`CLAUDE.md` files.
### How do I tell Bantam about extra shell tools?
Set the `BANTAM_TOOLS_DIR` environment variable (or the `bantam_tools_dir` key in `model.cfg`) to a directory containing your helper scripts. When defined, the Go port appends `Extra shell tools can be found at <dir>` to the system prompt at startup, making the agent aware of them. The environment variable takes precedence over the config key; if neither is set, nothing is appended.
### Is there any common config place for Bantam?
No, loading `model.cfg` and `system.txt` is deliberately only supported from the current working directory. This allows natural separation of configs and system prompts per project. In case there's no `system.txt` inside the project, the concise and sensible default system prompt will be loaded. In case there's no `model.cfg` inside the project, Bantam will use the free Big Pickle model from OpenCode Zen with the temperature 0.7. Big Pickle has been chosen as the default because it has no set expiration date, unlike other OpenCode's keyless tiers.