prompt_resolver: when cmd.Dir cannot be set (remote CWD does not exist
locally), inject PWD=cwd into subprocess env so envsubst in prime sees
the correct working directory.
remote.Server: fetch host_info RPC after connect, expose HostInfo struct
with platform, arch, is_git_repo for the session to pass to prompts.
Dial() now bootstraps ollie-remote on the remote host automatically:
- Computes SHA-256 of the local ollie-remote binary
- Sends a bootstrap script over SSH stdin
- If the remote has a matching cached binary, skips transfer
- Otherwise transfers gzip+base64 encoded binary
- Monitors stderr for OLLIE_LOADER_START/READY signals
- After bootstrap, stdin/stdout switch to JSON-RPC
The local binary is found at ~/bin/ollie-remote (just build output)
or ~/.local/bin/ollie-remote or PATH.
remote.Server.ListTools() now calls the remote via a list_tools RPC
method instead of returning nil. This ensures the model receives
proper tool definitions through the API.
remote.Server.CallTool() now passes the actual tool name (execute_code,
call_tool, pipe) as the RPC method instead of hardcoding execute.
Simplified result handling since resp.Result is already json.RawMessage.
Package remote provides a tools.Server implementation that forwards
tool calls to an ollie-remote process over SSH via JSON-RPC.
Key components:
- Dial(): opens SSH, launches ollie-remote, verifies with ping
- Server: implements tools.Server, forwards CallTool over RPC
- Decl(): factory compatible with tools.NewDispatcherFunc
- Config: SSH target, CWD, tools path, yolo flag
Integration: swap execute.Decl() with remote.Decl() in session
creation when remote= config is set.