Commit Graph

125 Commits

Author SHA1 Message Date
Levi Neely 65e26f4a69 codeintel: fix codebase_overview to accept string or int for offset/limit
LLMs sometimes send integer parameters as strings (e.g. "20" instead of 20).
Add flexInt type that unmarshals from either JSON int or string.
2026-10-02 09:32:36 +02:00
Levi Neely a73ef13fb5 tools: remove old individual cmd/ binaries
All tool logic lives in the multicall main.go at each family root.
Move .meta files to data/tools/ (single canonical location).
Expand test-core to cover all tools.
2026-08-19 13:56:21 +02:00
Levi Neely 27ba54a163 tools/lsp: move library code to internal
Moves package lsp and cmdutil under tools/lsp/internal/ so the
multicall binary can live at tools/lsp/main.go — same layout as
codeintel and filetools.
2026-08-19 13:54:39 +02:00
Levi Neely fa99020667 tools: multicall binaries, sandbox fixes
- Multicall pattern for tool families: one binary per family with
  symlinks for each tool name. Reduces tools dir from 156MB to 31MB.
  codeintel (6 tools), filetools (5 tools), lsptools (7 tools).

- Build with -ldflags="-s -w" to strip debug symbols.

- Fix Landlock EINVAL on regular files: filter directory-only access
  rights (READ_DIR, MAKE_*, REMOVE_*) when adding rules for non-
  directory paths.

- Fix toolsrv CWD initialization: pass --cwd flag value to server
  state at startup so {CWD} in sandbox.yaml expands correctly.
2026-08-19 13:51:52 +02:00
Ollie Agent 35c6ee6b44 Simplify file tool interfaces 2026-08-18 08:19:48 +02:00
Ollie Agent 9bd9539b6a Simplify file read ranges 2026-08-18 08:15:18 +02:00
Ollie Agent d90bd77fa0 Make file read integer arguments explicit 2026-08-18 08:07:59 +02:00
Ollie Agent 55d1814aa7 Make LSP shutdown idempotent 2026-08-18 07:05:06 +02:00
Ollie Agent 7182db56cf fix GUI dialog contrast and focus behavior 2026-08-16 23:55:43 +02:00
Ollie Agent 59c4ed23ac merge paths utilities into util 2026-08-16 18:37:03 +02:00
Ollie Agent aca5546ea5 refactor environment utilities and file tools 2026-08-16 18:20:50 +02:00
Ollie Agent e1ac2df3fb Lower tool output cap and add Markdown parsing 2026-08-16 11:31:31 +02:00
Ollie Agent 8567ddaa36 replace file tools with Go binaries and add tests 2026-08-16 10:39:45 +02:00
Ollie Agent 50e465336e Add Tree-sitter code intelligence tools 2026-08-15 21:13:40 +02:00
Ollie Agent 57427b5c93 Add web fetch Markdown tool 2026-08-15 20:32:28 +02:00
Ollie Agent 586edc1332 agent: replace ReadOnly with explicit scope field (read/write/global)
Rename ToolInfo.ReadOnly bool → ToolInfo.Scope string with three values:
- "read"  — path-scoped read, never conflicts (always parallel)
- "write" — path-scoped write, conflicts on same file path only
- "global" — full serialization barrier, runs alone

Tools declare scope in their .meta file. If unset, inferred from path
arg presence (write if path exists, global otherwise).

This correctly classifies lsp_rename as global (cross-file workspace
edits) despite having a path argument. The path arg in lsp_rename is
a symbol coordinate, not a resource scope.

All .meta files updated: readOnly:true → scope:read,
readOnly:false → scope:global, lsp_rename gets scope:global.
2026-08-11 07:56:00 +02:00
Ollie Agent 74635b8e00 refactor: items 8-10, 12, 13 from code review
- Move parseRetryAfter to backend.go (where it's called)
- Extract paths.RuntimeDir() replacing 3 divergent XDG_RUNTIME_DIR impls
- Rename CodeWhispererBackend → KiroBackend, NewCodeWhisperer → NewKiro
- Export RPCRequest/RPCError/OutputNotification from toolsrv/rpcwire.go
- Factor tools/lsp/cmdutil: Run() and RunCustom() for 7 LSP binaries
2026-08-09 11:32:31 +02:00
Ollie Agent eaf0a83a57 move LSP .meta files to live alongside their Go code
Each lsp_*.meta now lives in tools/lsp/cmd/<name>/ alongside
main.go, rather than in data/tools/. The lsp-tools just target
was updated to install both the binary and its .meta sidecar.

AGENTS.md updated to document the pattern for compiled tools.
2026-08-03 01:03:27 +02:00
Ollie Agent 60fafd5381 remove tools/builtin/ — zero built-in tools, all tools are external scripts
With the zero-tools transition complete, the tools/builtin/ package
served no purpose — Builtins() returned nil. Removed:

- tools/builtin/builtins.go and the directory
- builtins field, WithBuiltins, Dispatch from toolsrv.Server
- Handler type from toolsrv (only used by builtins)
- OnPreDispatch/WithOnPreDispatch (dead code)
- Strict field and WithStrict (dead code, never read)
- CallTool simplified — no fallback to Dispatch
- builtin import and WithBuiltins/WithStrict calls from ollie-remote
- tools/builtin from justfile build/test targets

Updated AGENTS.md, ARCHITECTURE.md, README.md, EVOLUTION.md
2026-08-03 00:55:22 +02:00
Ollie Agent e25157ffcd multiplex toolsrv, wip zero-tool server 2026-08-02 19:18:39 +02:00
Levi Neely 7eb022faba remove built-in skill handlers, replace with external tools
skill_list and skill_load are now external shell scripts (data/tools/).
Removed from builtins: SkillList, SkillLoad, SkillActive.
Removed: toolsrv/skills.go, tools/builtin/skill.go, WithSkillsRegistry,
SkillsRegistry accessor, ListSkillsTools.
ollie-remote no longer initializes a skills registry.

The demarcation: built-ins mutate agent internals (tool schema, context
injection). Skills are just file reads — no special treatment needed.
2026-07-31 16:45:37 +02:00
Ollie Agent 46a990cd42 tools/lsp: fix arg field names to match .meta schema
Binaries now read path/line/col (matching the .meta schema the model
sees) instead of file/line/character. Also fix col to be 1-indexed
(matching the schema description) with proper -1 conversion to LSP
0-indexed protocol.
2026-07-30 22:47:27 +02:00
Ollie Agent 77b4b624cf tools/lsp: port LSP tools from Python to Go
Implements a bridge daemon + client architecture in pure Go:
- tools/lsp/ — shared library (adapter registry, LSP server management,
  JSON-RPC framing, bridge daemon, client)
- tools/lsp/cmd/{lsp_definition,lsp_references,lsp_hover,lsp_rename,
  lsp_symbols,lsp_completion,lsp_diagnostics}/ — individual binaries

Each binary:
- Reads JSON args from stdin (same contract as before)
- Connects to bridge daemon over Unix socket (starts it if needed)
- Bridge manages long-lived LSP server processes (gopls, clangd, intelephense)
- Bridge auto-exits after 5min idle

Removes:
- Python LSP tool scripts (data/tools/lsp_*)
- Python LSP library (data/tools/_lib/lsp/)

Adds lsp-tools build target to justfile. The .meta sidecar files remain
in data/tools/ and are installed alongside the compiled binaries.
2026-07-30 22:10:56 +02:00
Ollie Agent 1015536f2c tools: move builtins to tools/builtin/
Prepares tools/ as the umbrella for all tool implementations:
- tools/builtin/ — in-process handlers (shell, reasoning, tool/skill registry)
- tools/lsp/ — (next) Go LSP tools with shared client library

Package rename: ollie/tools → ollie/tools/builtin
2026-07-30 22:04:32 +02:00
Ollie Agent 9b6ddb7df1 flatten: absorb submodules into single Go module
- Remove submodules: core, 9p, acme, httpgw, remote, el
- Keep submodules: kde, webui (separate build systems)
- Collapse core/ packages into root: agent/, backend/, detach/, elevate/,
  env/, log/, paths/, sandbox/, session/, skills/, tools/, toolsrv/
- Collapse 9p/ packages: fs/session/, mount/, dbus/, cmd/olliesrv/
- Move binaries: acme/ → cmd/Ollie/, httpgw/ → cmd/ollie-httpgw/,
  remote/ → cmd/ollie-remote/, 9p/cmd/ollie-9p/ → cmd/ollie-9p/
- Move data: agents/, prompts/, tools/, scripts/, skills/ → contrib/
- Move services/ → contrib/services/, experiments/ → doc/experiments/
- Delete .beads/, .claude/, .kiro
- Single go.mod at root (module ollie)
- Fix all import paths, merge fs/ + session/ packages
- Extract dbus/ and elevate/notify.go from 9p server package
- Update justfile for new paths and single-module build
2026-07-30 18:57:51 +02:00
Levi Neely d4f7b2c086 tools: remove reasoning_think script (now a builtin) 2026-07-30 09:24:39 +02:00
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
Ollie Agent af32aff641 delete SYSTEM_PROMPT.md, remove from justfile, update docs to reference embedded prompt 2026-07-28 23:31:10 +02:00
Levi Neely 01bf124ec0 migrate from FUSE mounts to 9p client
- prompts/session-9p.md: all operations use `9p` commands
- LSP tools: sys.path from $OLLIE_TOOLS_PATH (no mount needed)
- 9p: removed auto-mount + OLLIE= env var from sessions

Agents now use the standalone 9p client binary for all 9P access.
Mounts remain available for human convenience but are not required.
2026-07-27 11:42:02 +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 2f61f0ce3d file_write: ensure newline before closing diff fence 2026-07-21 15:03:52 +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 71a3734ad0 tools: add ollie:prompt blocks to all core tool scripts
Migrate usage documentation from separate tools-*.md prompt files
into the tool scripts themselves via ollie:prompt...ollie:end blocks.
BuildRuntime automatically extracts and appends these to the preamble.

Migrated: file_read, file_write, file_edit, file_glob, file_grep,
lsp_definition, lsp_references, lsp_hover, lsp_rename, lsp_symbols,
lsp_diagnostics, lsp_completion, reasoning_think, memory_remember,
memory_recall.
2026-07-21 13:23:28 +02:00
Ollie Agent fb09d0e366 file_read: add ollie:prompt block for auto-discovery
Usage documentation is now embedded in the script header and
automatically extracted into the system prompt by BuildRuntime.
This replaces the corresponding section in tools-file.md.
2026-07-21 13:18:57 +02:00
Ollie Agent 5cb0f6190c file_glob: fall back to find when rg is unavailable 2026-07-19 20:43:54 +02:00
Ollie Agent 965fe76ca5 file_grep: fall back to GNU grep when rg is unavailable 2026-07-19 20:40:56 +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 e2e8243c62 Update file_read tool and 9p permissions 2026-06-01 09:52:20 +02:00
Levi Neely 2515ed3479 tune memory_recall for efficiency 2026-05-29 15:40:51 +02:00
Levi Neely 16ae3e1308 memory: never forget without explicit user instruction 2026-05-27 12:51:02 +02:00
Levi Neely 1b73b22064 memory: add staleness indicator to recall, remove body length limit 2026-05-27 12:49:27 +02:00
Ollie Agent f4d49d2420 Add librarian agent; update LSP tools 2026-05-26 11:58:17 +02:00
Levi Neely 84f5d26d60 webui: chat rendering refactor + image_read PNG compression 2026-05-25 23:13:03 +02:00
lkn 0eb6cad285 add image_read tool, update core and file_read 2026-05-25 22:18:39 +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
Ollie Agent c3fab7714d docs: update filesystem descriptions to match 9P implementation
SYSTEM_PROMPT:
- Replace separate backend/model/agent/cwd files with unified cfg
- Add prompt permission note (agent can't write to own prompt)
- Add missing files: usage, cost, env
- Add missing root paths: u/, x/, tmp/
- Update operations section: use cfg and ctl properly
- Fix session creation example (printf for newlines)

ARCHITECTURE:
- Already updated in prior commit

tools/route:
- Fix backend resolution to read from cfg instead of nonexistent
  separate backend file
2026-05-20 09:53:04 +02:00
Ollie Agent 9465e2f4a8 route: per-backend tier model mapping, --backend flag
- Resolves model from OLLIE_TIER_{WORKER|EXPERT}_{backend}
- Falls back to legacy OLLIE_CASCADE_MODEL/OLLIE_ESCALATE_MODEL
- --backend flag lets orchestrator pick a different backend
- Inherits parent session's backend by default
- OLLIE_ENABLED_BACKENDS documents available backends
- README updated with tier config examples
2026-05-20 09:30:55 +02:00