tools: add tools.sh discovery script; update prompt for schema-less tools
tools.sh reads # description/# Args headers from all scripts and prints a summary — one call replaces the schema injection built-in tools get for free. Prompt now directs the model to run it before using unfamiliar tools. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
df79fcb382
commit
995d72a776
|
|
@ -43,17 +43,21 @@ The ollie 9P filesystem is mounted at `${OLLIE_9MOUNT:-$HOME/mnt/ollie}`. All pe
|
|||
|
||||
Tool scripts live at `${OLLIE_9MOUNT:-$HOME/mnt/ollie}/t/`. Run them with `execute_tool` or as steps in an `execute_pipe` pipeline.
|
||||
|
||||
```sh
|
||||
ls ${OLLIE_9MOUNT:-$HOME/mnt/ollie}/t/ # list available tools
|
||||
Supported languages are detected from the script's shebang line:
|
||||
- `#!/usr/bin/env bash` — runs with `bash -c`
|
||||
- `#!/usr/bin/env python3` — runs with `python3 -c`; `sys.argv` is set automatically when args are provided
|
||||
|
||||
Unlike built-in tools, shell tools have no injected schema. Before using an unfamiliar tool, discover available tools and their usage:
|
||||
|
||||
```
|
||||
execute_tool {tool: "tools"} # list all tools with descriptions and args
|
||||
```
|
||||
|
||||
Supported languages are detected from the script's shebang line:
|
||||
- `#!/usr/bin/env bash` (or any bash shebang) — runs with `bash -c`
|
||||
- `#!/usr/bin/env python3` (or any python shebang) — runs with `python3 -c`; `sys.argv` is set automatically when args are provided
|
||||
|
||||
Task planning tools are available in `t/`:
|
||||
- `task_plan` — create a plan: `execute_tool {tool: "task_plan", args: ["<goal>", "<step1>", "<step2>", ...]}`
|
||||
- `task_complete` — mark a step done: `execute_tool {tool: "task_complete", args: ["<filename>", "<step-substring>"]}`
|
||||
Each tool's header also documents itself directly:
|
||||
```
|
||||
# description: <what it does>
|
||||
# Args: <arg1> [arg2] ...
|
||||
```
|
||||
|
||||
# Skills
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
# description: List all available tools with their descriptions and usage
|
||||
set -euo pipefail
|
||||
|
||||
OLLIE="${OLLIE_9MOUNT:-$HOME/mnt/ollie}"
|
||||
|
||||
for f in "$OLLIE/t/"*; do
|
||||
[ -f "$f" ] || continue
|
||||
name=$(basename "$f")
|
||||
desc=$(grep -m1 "^# description:" "$f" 2>/dev/null | sed 's/^# description: *//')
|
||||
args=$(grep -m1 "^# [Aa]rgs:" "$f" 2>/dev/null | sed 's/^# [Aa]rgs: *//')
|
||||
printf '%-28s %s\n' "$name" "$desc"
|
||||
[ -n "$args" ] && printf '%-28s Args: %s\n' "" "$args"
|
||||
done
|
||||
Loading…
Reference in New Issue