added microbantam
This commit is contained in:
@@ -145,11 +145,39 @@ When enabled, the interactive console uses a subtle ANSI palette: the pending-re
|
||||
- Return value: string
|
||||
- Action: run shell command specified in `command` subject to `shell_timeout` (default 120s) and return `output + '\n\nexit: ' + exit_code` string.
|
||||
|
||||
## MicroBantam
|
||||
|
||||
MicroBantam (`mb`) is a compressed Perl 5 reference implementation of the same agent in **under 100 SLOC** (92 non-blank lines), written to stay readable while keeping the full agentic core. It reads the same `model.cfg` and `system.txt` from the current working directory.
|
||||
|
||||
### Features
|
||||
|
||||
- Full agentic loop: LLM calls, `shell_exec` / `run_subagent` tool execution with JSON argument validation (invalid args are fed back so the model can self-correct), and the 5-level subagent recursion depth limit
|
||||
- A `...requesting...` in-flight indicator: in-place on a TTY (`\r` overwrite, erased on completion), a plain line when output is piped
|
||||
- Session management: `/save`, `/list`, `/load <id>` (exact id only, no prefix matching), and auto-save to `~/.bantam/sessions/autosave.json` after every turn and on exit; session ids get `-1`, `-2`, ... suffixes on same-second collisions
|
||||
- Interactive mode (`/quit`, `/clear`, `/save`, `/list`, `/load <id>`, `/help`) and file input mode
|
||||
- Same built-in default system prompt and `OPENAI_API_KEY` fallback as the full implementation
|
||||
|
||||
### What it drops
|
||||
|
||||
- Streaming (requests are non-streaming; `stream` is ignored)
|
||||
- ANSI coloring/styling (`color` is ignored)
|
||||
- `Term::ReadLine` line editing, Ctrl+J multi-line prompts and readline history (plain single-line prompts)
|
||||
- Fibonacci backoff network retries (a failed request aborts with an `API error` message)
|
||||
- `/compact` context summarization
|
||||
|
||||
### Running
|
||||
|
||||
```bash
|
||||
./mb # interactive (or: perl mb)
|
||||
./mb prompt.txt # file input mode
|
||||
```
|
||||
|
||||
## Repository layout
|
||||
|
||||
- `bantam.py` — Python reference implementation (stdlib only)
|
||||
- `main.go`, `term_linux.go`, `term_darwin.go`, `term_windows.go`, `term_other.go` — Go implementation (stdlib only, module `code.luxferre.top/luxferre/bantam`)
|
||||
- `bantam.pl` — Perl 5 implementation (core modules only)
|
||||
- `mb` — MicroBantam, compressed Perl 5 implementation (core modules only, 92 SLOC)
|
||||
- `model.cfg`, `system.txt` — shared configuration and system prompt
|
||||
- `README.md` — this document
|
||||
|
||||
|
||||
Reference in New Issue
Block a user