Commit Graph

14 Commits

Author SHA1 Message Date
Levi Neely a640257dbf registry: refresh schemas on tool_list and reload on tool_load
tool_load always re-reads the tool from disk (reload semantics).
tool_list calls RefreshLoaded to update schemas for all promoted tools.
Skills registry gets the same treatment: dynamic discovery, no cache.
2026-07-30 09:36:54 +02:00
Levi Neely 6fc2e001ac tools: promote reasoning_think to builtin
Zero-context-cost scratchpad tool. The thought is recorded in history
but returns empty — no output tokens wasted. Registered in ListTools
schema and builtins map.
2026-07-30 09:24:08 +02:00
Levi Neely 10bd60980a toolsrv: dynamic tool discovery, drop global cache
Registry.Summaries() and Load() now scan the tools directory on every
call instead of reading from a startup cache. New tools dropped into
the directory are immediately visible without restarting the server.

When tool_list is called, the OnToolsChanged hook fires and updates
the preamble's '# Available Tools' section in the live agent runtime.
No agent reload or session restart required.
2026-07-30 09:16:01 +02:00
Levi Neely cadcb62fcd tools: consolidate into shell.go, tool.go, skill.go
One file per domain, all related handlers together.
2026-07-29 23:20:01 +02:00
Levi Neely a21c256efa tools: one file per builtin tool
Each tool is a single file, single function. builtins.go is the registry.
2026-07-29 23:19:03 +02:00
Levi Neely 18beb15698 split: toolsrv/ (server framework) + tools/ (builtin handlers)
toolsrv/ owns the Server struct, execution engine, registry, discovery.
tools/ owns the built-in handlers (Shell, ToolList, SkillLoad, etc.)

Dependency flows one way: tools/ imports toolsrv/.
Server.Dispatch uses a handler map populated via WithBuiltins().
2026-07-29 23:17:22 +02:00
Levi Neely 873f83464f tools: decompose code.go into server.go + shell.go
server.go: Server struct, options, lifecycle, dispatch routing, tool_* handlers
shell.go: execution engine (sandbox, elevation, detach), validation, limitedWriter
2026-07-29 23:07:00 +02:00
Levi Neely 10e0731a0a merge execute/ into tools/
tools.Server is now a concrete struct (the local execution engine).
tools.Runner is the minimal 2-method interface for polymorphism
(satisfied by both Server and RemoteServer).

Deleted: Dispatcher, CWDSetter, EnvSetter, ToolRestrictionSetter
interfaces. Agent uses inline type assertions where needed.

The execute/ package no longer exists.
2026-07-29 23:01:47 +02:00
Levi Neely 2ea13cd611 restructure: drop pkg/, split tools/execute into focused packages
- Drop pkg/ prefix (Go anti-pattern): ollie/pkg/X → ollie/X
- Split tools/execute god package:
  - execute/: shell execution, sandboxing, elevation client, remote SSH
  - tools/: interfaces + registry + discovery + schema parsing
  - detach/: background process management (ring buffer, signal)
- Promote internal/sandbox → sandbox/
- Absorb config/ into agent/config.go (agent definition loading)
- Merge remote/ into execute/remote.go (RemoteServer)

All tests pass.
2026-07-29 18:10:25 +02:00
Levi Neely c5b16e739e Restructure: pkg/core interface, internal/ packages, cmd/ollie TUI entry point
- pkg/core: public Core interface (Submit/Prompt/Interrupt) + Event/EventHandler types
- internal/agentcore: AgentCore implementation of Core (session, tools, commands)
- internal/tui: TUI package (readline loop, splitInput, signals, bracketed paste)
- internal/agent,backend,config,exec,mcp,tools: moved from root to internal/
- cmd/ollie: minimal main() that wires agentcore + tui together (~130 lines)
- mkfile: update build target to ./cmd/ollie

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 21:00:04 +02:00
Levi Neely ea07f6d3a0 mcp,tools,main: shut down MCP servers on agent switch
Client gains a Close() method that closes stdin (giving the subprocess
a clean EOF) then kills and reaps the process. Executor.Close() calls
Close() on all registered clients. agentEnv now carries the mcpExec so
the /agent command can close the outgoing executor before building the
new one.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 20:36:20 +02:00
Levi Neely 01b128fdf5 Restore MCP server support alongside built-in execute_code
Bring back ollie/mcp and ollie/tools packages. Config MCPServers
field restored. MCP tools are discovered at startup and added to
the agent tool list alongside execute_code. Dispatch routes by
server name for MCP tools, falls back to built-in execute_code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 00:34:09 +02:00
Levi Neely 06ccc80da6 Remove MCP layer; execute_code is the sole built-in tool
Drop ollie/mcp, ollie/tools, ollie/ollama packages. Config now only
carries hooks. main.go wires a single execute_code tool directly to
the agent loop — no MCP discovery or dispatch needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 23:13:05 +02:00
Levi Neely 12b8950ea5 Initial commit 2026-02-21 20:47:38 +01:00