Commit Graph

12 Commits

Author SHA1 Message Date
Levi Neely 267f438e9e clean up OLLIE_* env vars: replace with XDG conventions
- Remove all OLLIE_*_PATH vars (TOOLS_PATH, CFG_PATH, DATA_PATH, etc.)
  Use XDG_CONFIG_HOME/ollie/* and XDG_DATA_HOME/ollie/* instead
- Replace OLLIE_<TAG>_LOG per-component logging with single OLLIE_LOG={level}
- Remove Route()/RouteRequest/RouteResult (replaced by direct backend selection)
- Update sandbox config to use XDG paths instead of OLLIE_*_PATH tokens
- Update docs accordingly
2026-08-07 07:12: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 4ac5fc94be rename Runtime.ExecServer → Runtime.ToolServer 2026-07-29 23:22:32 +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 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 d6bc89d3e2 agent: eliminate Dispatcher, use tools.Server directly
Runtime.Dispatcher → Runtime.ExecServer (tools.Server). The Dispatcher
abstraction routed to exactly one server ('execute') — unnecessary
indirection. BuildRuntime now takes tools.Server directly.

Agent.newDispatcher → Agent.newToolServer. AgentCfg/Config updated.
All GetServer('execute') calls replaced with direct ExecServer access.
exec closure simplified: direct CallTool, no tool-name lookup.
2026-07-29 22:50:01 +02:00
Levi Neely 0524f38db0 agent: remove redundant runtime nil checks
Runtime is guaranteed non-nil by the caller (session.New ensures it).
Remove defensive checks that can never fire. execServer() retains
the Dispatcher nil check (agents without tools are valid).
2026-07-29 22:41:58 +02:00
Levi Neely cde16ada08 agent: unexport ExecServer → execServer
No external callers — only used internally by the detach methods
(Detach, ListDetached, SignalDetached, GetDetachedOutput, DismissDetached).
The accessor is now private, no longer leaking the dispatcher interface.
2026-07-29 22:38:08 +02:00
Levi Neely ec62eb9189 session: remove Interrupt, Queue, Detach, and all remaining agent pass-throughs
Session now has only genuinely session-level methods:
- Agent(), Bus() — access points
- Close(), SetEnv() — lifecycle
- CWD(), SetCWD(), SetSessionID() — filesystem identity
- WaitChange() — field watching for 9P
- SaveSession(), saveSession(), flushSave() — persistence

Everything else (Interrupt, Queue, Detach, Reactions, etc.) lives on Agent.
Callers go through session.Agent() to reach agent operations.
2026-07-29 22:05:46 +02:00
Levi Neely 8e4cdaa4bd session: extract agent/ as separate package
Agent is now in ollie/agent with proper encapsulation:
- Unexported fields, exported methods as the API
- Own constructor (agent.NewAgent)
- Owns: turn execution, history, runtime, hooks, commands, compaction
- Session never reaches into agent internals

Session (ollie/session) is a thin host:
- Owns: persistence, session ID, env, detach delegation
- Delegates all agent operations through exported Agent methods
- handleCommand dispatches to agent.HandleCommand for agent-level commands

Agent-level commands (/model, /backend, /compact, /agent, etc.) live
in agent/commands.go and access internals directly (same package).

Session-level commands (/sessions, /save, /resume, /cwd, /help)
remain in session/commands.go.

Test files temporarily removed pending rewrite against new API.
The fifo_test.go passes as a sanity check.
2026-07-29 21:43:49 +02:00
Levi Neely 6ee949bd7c rename agent/ → session/, absorb session.Session into harness
The agent/ package is now session/ — because a session is the
top-level concept. The package contains:
- harness: implements Core, the session orchestrator
- Agent: the reasoning entity (history, runtime, tools)
- History: conversation accumulator
- Fifo, loop, compaction, hooks, commands

The old session/ package (which just held extracted fields) is
dissolved back into the harness. One package, clean ownership.
2026-07-29 19:13:26 +02:00
Levi Neely bda9c9cb1d agent: rename reasoning.go → agent.go 2026-07-29 18:42:55 +02:00