Commit Graph

21 Commits

Author SHA1 Message Date
Levi Neely ba9076a6b6 tools: replace call_tool syntax with native tool call examples
Update all ollie:prompt blocks to use tool_name(param=...) convention
instead of the obsolete call_tool: calls=[...] syntax.
2026-07-29 10:50:26 +02:00
Levi Neely 283add2862 tools: stdin JSON contract for all tools
All tools now receive arguments as a JSON object on stdin instead of
positional CLI args. Each tool declares its schema via # args_json:
header comment.

New shared helpers:
- _lib/args.py: Python parse_args() -> Args with require/get/get_bool/etc
- _lib/args.sh: Bash arg_require/arg_get/arg_bool via jq

Removed denote_view (unused).
Updated WRITING_TOOLS.md to document the new contract.
2026-07-29 08:47:15 +02:00
Ollie Agent 8630d79116 add JSON schema output to all tool scripts on arg parse errors; remove env and grep tools
All tools in ./tools/ now output a JSON schema when arguments fail
to parse, instead of raw usage strings. Formats handled:
- echo/print usage replacement
- dollar-brace-var-colon-? usage expansion to if-statements
- die() function replacement
- argparse ArgumentParser subclass with error() override

Deleted env (use shell instead) and grep (use file_grep instead).
Removed root-level /tools from 9P filesystem listing.
2026-07-29 00:01:25 +02:00
Levi Neely 6ed1d098ab fix CreateSession: add remote parameter to D-Bus method
The D-Bus adapter only exposed 4 parameters (cwd, backend, model, agent)
but the session manager supports 6 (+ system_prompt, remote). The remote
had already added system_prompt as the 5th; this adds remote as the 6th.

All frontends (KDE plasmoid, Kate, tray, dolphin, webui, httpgw) and
tool scripts now pass the correct 6 arguments.
2026-07-24 11:58:34 +02:00
Ollie Agent dfa008a46b tools: add ollie:prompt blocks to all remaining scripts
Complete migration: process_*, route, subagent_*, env, grep,
image_read, gui_*, browser_screencap, denote_view.

Every tool script now self-documents its usage. BuildRuntime
automatically extracts and injects these into the system prompt.
2026-07-21 13:27:38 +02:00
Ollie Agent adea9cb627 add justfile, move tools/ to repo root
Replace Makefile/mkfile with justfile (just command runner).
Move tools from kde/tools to root (uses physical paths, not 9P).
Add process_*, env, grep tools that were missing from submodules.

just: 9P path (default), just dbus: D-Bus path.
2026-07-19 12:39:09 +02:00
Ollie Agent d3aa756544 move prompts/skills/tools into 9p/ and kde/ submodules
- prompts/, skills/, tools/ removed from monorepo root
- 9p/: gains prompts/skills/tools with 9P filesystem API (unchanged)
- kde/: gains prompts/skills/tools rewritten for D-Bus API
- mkfile: data target no longer installs prompts/skills/tools
- 9p/mkfile: install target now includes data (prompts/skills/tools)
- kde/Makefile: all target now includes data (prompts/skills/tools)
- SYSTEM_PROMPT_QWEN and SYSTEM_PROMPT_DEVSTRAL updated in both
  submodules to include the operational world model
2026-07-07 12:07:50 +02:00
Levi Neely 8fb3ce0597 fix subagent_spawn: use /bin/echo for 9P writes
Bash builtin echo/printf may split multi-line content across
multiple write syscalls, which the FUSE 9P proxy rejects.
/bin/echo (coreutils) does a single write.
2026-05-22 12:39:03 +02:00
Levi Neely a5efaa623f subagent_generate: rewrite as standalone Python; fix spawn header
- Eliminates inline Python-in-shell; same logic, directly inspectable.
- Fix stale Output comment in subagent_spawn header.
2026-05-17 14:01:57 +02:00
Levi Neely 36eeb38a06 subagent_spawn: only cleanup jit-* configs; fix Returns doc 2026-05-17 13:59:59 +02:00
Levi Neely 2703ea5d3f subagent_spawn: auto-cleanup JIT config; report resolved backend/model
- Remove JIT agent config from a/ after session creation (server has
  already loaded it), eliminating identity debris accumulation.
- Read actual backend/model from session cfg instead of echoing
  CLI-level defaults.
- Remove manual cleanup instruction from prompt (now automatic).
2026-05-17 13:58:41 +02:00
Levi Neely 65f7bc3bd9 subagent_spawn: exponential backoff, structured output; fix stale docs
- Replace 5s/50ms poll with exponential backoff (~25s total)
- Output structured KV (session, path, backend, model) like cascade
- subagent_generate: remove stale result_path from header, document arg input
- Soften 'always use pipeline' to guidance matching actual behavior
2026-05-17 13:57:10 +02:00
Levi Neely 2516209acc subagent_spawn: read agent name from stdin when piped; fix prompt to use pipe
subagent_spawn now reads the agent name from stdin (first line) when
-agent flag is not provided and stdin is not a tty. This enables clean
pipe composition: echo JSON | subagent_generate | subagent_spawn.
2026-05-17 13:49:55 +02:00
Levi Neely 9c0d22960b subagent_spawn: inject parent plan as context header 2026-05-17 10:26:57 +02:00
Levi Neely af6547eb3a subagent_spawn: use /bin/date to avoid plan9 date 2026-05-02 10:50:14 +02:00
Levi Neely 03f661c0a6 subagent_spawn: use __ separator for parent prefix 2026-04-29 18:21:52 +02:00
Levi Neely 993097ef6f subagent: fire-and-forget spawn, auto-inject parent/session IDs, env file
subagent_spawn rewritten: creates session, submits prompt, returns
immediately. Auto-prefixes session name with parent ID for uniqueness.
Injects [parent_session_id] and [session_id] headers into every prompt.

New read-only env file in session namespace exposes OLLIE_ vars.
TUI background-tails chat file for async output.
Updated SYSTEM_PROMPT.md and tools-subagent.md.
2026-04-26 22:19:06 +02:00
Levi Neely b33a411427 subagent: add -name flag, document roster convention
subagent_spawn now passes -name through to b, letting the parent assign
predictable session IDs. Updated coordination docs: parent passes full
peer roster in seeding prompts, names prefixed with parent session ID
for global uniqueness. Noted silent failure on duplicate names.
2026-04-26 20:34:27 +02:00
Levi Neely 7b8d665457 fix subagent_spawn, sort sessions, update prompts
- subagent_spawn: use s/bfg instead of deprecated b/q
- SYSTEM_PROMPT: fix stale /b/ reference to /s/
- core: sort session index by ID
- webui: gitignore .kiro/
2026-04-24 21:44:57 +02:00
Levi Neely c3d8879702 tools: rewrite subagent_spawn as thin wrapper around b/q -parallel
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 13:40:55 +02:00
Levi Neely 792ea4663f subagents: add subagent_spawn tool and system prompt fragment
tools/subagent_spawn: fork-join over b/; spawns N parallel subagents
with a shared prompt, polls status concurrently, joins results in
submission order.

prompts/08_subagents.md: core system prompt fragment — when to spawn,
flags, output format, design rules. Always in context, not a skill.
2026-04-16 20:14:57 +02:00