Commit Graph

346 Commits

Author SHA1 Message Date
Levi Neely 8ef22ab90d rename 9p client to ollie-9p
Avoids shadowing plan9port. Binary auto-discovers server and
identity without flags.
2026-07-27 11:44:55 +02:00
Levi Neely cafe38292f session: remove auto-mount on session creation
Agents now use the 9p client binary directly instead of FUSE mounts.
Remove startMount() calls and OLLIE= env var from session env.
Mounts remain available for human use but are no longer auto-started.
2026-07-27 11:41:42 +02:00
Levi Neely 666acceb0b 9p client: auto-discover aname from \$OLLIE_UNAME
Remove -A flag. The client always attaches with the UID from
\$OLLIE_UNAME. Agents use it transparently without knowing about
9P attach semantics.
2026-07-27 11:35:27 +02:00
Levi Neely 80cc32d0ee 9p: add standalone 9P client binary
Complete 9P client that replaces plan9port dependency.
Subcommands: read, write, rdwr, stat, ls, create, remove, mkdir.
Supports -a addr, -A aname for attach identity, -n for no auth.
Uses 9fans.net/go/plan9/client library (already in go.mod).
2026-07-27 11:32:26 +02:00
Levi Neely e40d266206 session: parallelize session restoration on startup
Load persisted session JSONs sequentially (fast disk reads),
then fan out restoreSession calls in parallel. Each session
restoration involves backend init, prompt resolution, and
potentially SSH connections for remote sessions.
2026-07-27 11:13:36 +02:00
Levi Neely c59f1c57d7 olliesrv: remove SSH agent proxy startup 2026-07-27 11:06:23 +02:00
Levi Neely 238d8214a3 olliesrv: expose elevate/ and s/{id}/elevate via 9P
- /elevate/policy: read/write global policy (YAML)
- /elevate/pending/: list pending requests
- /elevate/pending/<id>: read summary, write approve/deny/persist
- /s/{id}/elevate: read/write session policy (includes global)
2026-07-27 11:03:20 +02:00
Levi Neely 324abd025b olliesrv: start SSH agent proxy alongside elevation broker 2026-07-27 10:49:31 +02:00
Levi Neely 8e348680dc olliesrv: wire integrated elevation broker
Start the elevation broker on $OLLIE_ELEVATE_SOCKET at daemon
startup. D-Bus notifications with approve/deny/persist actions
map back to broker.Resolve() via ActionInvoked signals.

Replaces the external superpowerd adapter.
2026-07-27 10:33:34 +02:00
lkn 76807dd879 sort D-Bus ListModels results 2026-07-26 19:01:19 +02:00
lkn 1a545be58f restore active sessions from data directory 2026-07-26 12:10:11 +02:00
lkn cbd249e5f9 9p: remove daemon subcommands, simplify to foreground-only
Drop start/fgstart/stop/status subcommands. olliesrv now runs
directly in the foreground; lifecycle managed by the supervisor
(systemd, openrc, or xdg-autostart). Keep mount as a convenience
subcommand for mounting remote 9P servers via 9pfuse.

- Remove daemonize(), stopServer(), isRunning(), pid file management
- runServer() no longer takes pidPath
- Move desktop file to main repo services/xdg-autostart/
- Update README examples
2026-07-25 18:20:14 +02:00
Levi Neely af7363cb1d dbus: add remote parameter to CreateSession
The D-Bus method was missing the remote parameter that session.Manager
already supports. Add it as the 6th arg after system_prompt so frontends
can create remote execution sessions via D-Bus.
2026-07-24 11:58:01 +02:00
lkn 32abf7a00c 9p: add ListModelsByBackend D-Bus method 2026-07-21 15:32:41 +02:00
lkn 88a4119707 docs: document peer/ operations (touch/rm/write) 2026-07-21 14:57:30 +02:00
lkn 4a87d25f22 README: add tools, state, peer/, proc/ to filesystem layout 2026-07-21 14:51:18 +02:00
lkn c289f5c7fd prompts: mark 9P as preferred, D-Bus as fallback 2026-07-21 14:45:20 +02:00
lkn c7c8fd1b8b session: inject operational model into restore path
Restored sessions were calling BuildRuntime without baseLayers,
so the 9P/D-Bus operational model never appeared in the system prompt.
Now computes sysPrompt, opModel, envBlock and passes them as BaseLayers.
2026-07-21 14:40:46 +02:00
lkn 87e6c664bd dbus: add systemPrompt arg to CreateSession introspection XML 2026-07-21 14:28:06 +02:00
lkn 17f28647b8 prompts: update D-Bus operational model with all methods, signals, and examples 2026-07-21 14:10:43 +02:00
lkn 590dbb5b4a prompts: rewrite 9P operational model with complete file tree and request-response examples 2026-07-21 14:04:24 +02:00
lkn 5dd0685c10 prompts: update 9P operational model with dns-style endpoints and full file tree 2026-07-21 13:59:38 +02:00
lkn 4964369025 9p: implement /tools write→read (dns pattern) for tool prompt lookup 2026-07-21 13:55:50 +02:00
lkn fe05415ebc 9p: add /tools to root directory listing 2026-07-21 13:50:59 +02:00
lkn 035e4db4b8 add /tools synthetic file with /net/dns pattern
Read: surface listing of all tools (name + description)
Write tool name, then read: full ollie:prompt content
Subsequent read reverts to surface listing (query cleared after use)
2026-07-21 13:36:38 +02:00
lkn 686fa5d0c8 embed layered system prompt: system + operational model + environment
The preamble is now composed as:
  system_prompt + operational_model + environment + agent_prompts

- Embed SYSTEM_PROMPT.md, session-9p.md, session-dbus.md in the binary
- Render environment block at runtime with live cwd/platform/date values
- Inject operational model based on server mode (Enable9P/EnableDBus)
- Accept system_prompt= override in session creation and D-Bus CreateSession
- Agent configs no longer need to reference system/session prompt files
2026-07-21 13:06:55 +02:00
Levi Neely cad8a18950 add -no9p flag for D-Bus only mode
olliesrv now supports three operating modes:
  +9p +dbus (default): full 9P server with embedded D-Bus adapter
  +9p -dbus (-nodbus): pure 9P server, no desktop integration
  -9p +dbus (-no9p): D-Bus only, no filesystem interface

The -no9p flag gates all 9P listener setup (unix + tcp), the 9P
server instance, and per-session FUSE mounts. D-Bus becomes mandatory
in this mode (errors if session bus is unavailable). -no9p and -nodbus
are mutually exclusive.

This replaces the need for the archived standalone ollied daemon.
2026-07-21 11:40:02 +02:00
Levi Neely 21b0cf1543 9p: fix stat Length=0 for session files breaking 9pfuse reads 2026-07-20 13:36:44 +02:00
Levi Neely c4e1950f8c remote: restore sessions with remote= reconnect to remote host 2026-07-19 21:53:01 +02:00
Levi Neely 208db7ba68 streaming: handle tool streaming via empty-content start signal 2026-07-19 21:36:55 +02:00
Levi Neely 4b24b33377 streaming: tool as first-class streaming role in chat log 2026-07-19 21:25:58 +02:00
Levi Neely bba14ddcde session: pass PromptEnvExtra to AgentCoreConfig 2026-07-19 20:37:37 +02:00
Levi Neely 03a29b0877 session: pass PromptEnv to all BuildRuntime calls
Both restore and create paths now include PRIME_* env vars.
Remote path uses HostInfo; local path uses PromptEnv(cwd).
2026-07-19 20:26:52 +02:00
Levi Neely 28232fd833 remote sessions: eager dial, pass host info to prompt resolution
Dial the remote eagerly during session creation so HostInfo is available
for BuildRuntime. Pass PRIME_PLATFORM and PRIME_IS_GIT_REPO as env vars
so the system prompt reflects the remote host, not the local machine.
2026-07-19 20:17:32 +02:00
Levi Neely b95bab0ef8 fix: start FUSE mount for remote sessions
Remote sessions had no local mount because WithMount9P hooks into the
local execute.Server which does not exist for remote sessions. Start
the mount directly and tear it down on kill/shutdown.
2026-07-19 19:43:19 +02:00
Levi Neely fce23afd28 session: store remote target, expose in cfg read
The remote= field is now visible when reading s/{id}/cfg,
and stored on the Session struct for future persistence.
2026-07-19 19:10:02 +02:00
Levi Neely 4f8e0c2768 session: wire remote= config for split-brain execution
When creating a session with remote=user@host, the session manager
uses remote.Decl() instead of execute.Decl() for the tool dispatcher.
This forwards all tool calls over SSH to an ollie-remote process on
the target host.

Usage: printf "cwd=/path\nremote=user@host\n" > \$OLLIE/s/new
2026-07-19 18:57:26 +02:00
Levi Neely eaa32cd94d dbus: emit SessionCreated for restored sessions in WatchExisting
During startup, session.NewManager restores sessions and fires the
OnSessionCreated callback, but dbusAdapter is still nil at that point
so SessionCreated signals were never emitted. WatchExisting runs after
the adapter is live — emit SessionCreated there so GUI clients learn
about pre-existing sessions reliably.
2026-07-19 14:16:10 +02:00
Levi Neely 8fa630f65c share active-sessions dir with dbus backend
Both backends now use ~/.local/share/ollie/sessions/active since
they are mutually exclusive.
2026-07-19 13:27:46 +02:00
Levi Neely 29b08a87ad remove Makefile and mkfile (consolidated into root justfile) 2026-07-19 13:02:47 +02:00
Levi Neely ebc82f338b remove tools/ — now at repo root 2026-07-19 12:37:15 +02:00
Levi Neely f9a2e3249d move prompts/ and skills/ to parent repo
Prompts and skills are shared across frontends (9p, kde, dbus),
so they belong at the repo root rather than duplicated per frontend.
2026-07-19 12:07:18 +02:00
Levi Neely 0b236374c0 9p: fix prompt file permission for FUSE (0466 -> 0666) 2026-07-19 00:20:41 +02:00
Levi Neely b050ef4ab7 9p: replay last 20 messages into chat log on session restore 2026-07-19 00:10:05 +02:00
Levi Neely 3c29fb28bb autostart: run ollie-remount after 3s delay 2026-07-18 23:38:37 +02:00
Levi Neely e53cdc565c add xdg autostart desktop file for olliesrv 2026-07-18 23:37:41 +02:00
Levi Neely f630c644e1 complete: use backend.Generate instead of copilot session 2026-07-18 23:34:24 +02:00
Levi Neely b410133759 readme: document generate, route, complete endpoints (net/dns pattern) 2026-07-18 22:56:11 +02:00
Levi Neely 120a971a0b readme: use relative URLs 2026-07-18 22:41:34 +02:00
Levi Neely fea481e928 readme: move httpgw docs to httpgw/README.md 2026-07-18 22:39:34 +02:00