Commit Graph

23 Commits

Author SHA1 Message Date
Levi Neely fee8d1bf36 kill mgr/ package: replace Manager with session/ package functions
The session tree IS the session collection. No Manager struct —
rootState is unexported, stored in tree.Data. All CRUD exposed
as package functions (NewRoot, Lookup, Create, Kill, Rename, etc).

- mgr/ → session/ (package rename + Manager elimination)
- server.Config.SessionMgr → SessionTree (*fs.Tree)
- dbus adapter takes *fs.Tree directly
- Tests pass, build + vet clean
2026-07-30 00:02:36 +02:00
Levi Neely e88e0a6f4c naming: use explicit context names throughout
- Session field: Ctx → SessionCtx (clarifies what ctx this is)
- Session creation: ctx → sessionCtx, cancel → sessionCancel
- Daemon ctx passed as s.cfg.Ctx (unchanged — named in ManagerConfig)
- Fixed stale ctx reference in create.go Submit call
2026-07-29 22:35:11 +02:00
Levi Neely 3a8b1ba4a5 9p: use agent.Complete directly, remove mgr/complete.go
Code completion no longer routes through the manager. Callers
invoke agent.Complete() — the one-shot ephemeral agent.
2026-07-29 22:19:22 +02:00
Levi Neely 82a7f585f2 9p: remove all peer code
Peers were removed from core but lingered in the 9P layer.
Deleted: PeerAdd, PeerRemove, PeerList, PeerSubmit (D-Bus + manager),
peer directory listing, peer file handling, peer stat, peer
creation/removal, HasPeer, peers field on Session.
2026-07-29 22:17:39 +02:00
Levi Neely aeef7ff718 9p: route all agent operations through .Agent()
Interrupt, Queue, Detach, ListDetached, SignalDetached,
GetDetachedOutput, DismissDetached, InjectSystemEvent
now go through sess.Core.Agent() directly.

Session only provides: Agent(), Bus(), Close(), SetEnv(),
CWD(), SetCWD(), SetSessionID(), WaitChange(), SaveSession().
2026-07-29 22:05:56 +02:00
Levi Neely 50601ebf46 9p: call Agent() directly for all agent operations
Session pass-throughs are removed. All agent operations go through
sess.Core.Agent().Method() — proper encapsulation boundary.

Session-level: Bus(), Close(), SetEnv(), CWD(), SetCWD(), Interrupt(),
Queue(), InjectSystemEvent(), SetSessionID(), SaveSession().

Agent-level (via .Agent()): Submit(), State(), Reply(), BackendName(),
ModelName(), IsRunning(), CtxSz(), UsageStr(), Context(), etc.
2026-07-29 21:58:04 +02:00
Levi Neely e630714403 9p: update imports for agent/ package extraction
Types moved from ollie/session to ollie/agent:
AgentConfig, AgentConfigPath, AgentsDirs, BuildRuntime, Load, Event,
PersistedAgent, LoadPersistedAgent, RestoreHistory, PromptEnv,
History, Runtime, ErrInterrupted, WatchState.

ollie/session is no longer imported directly in top-level 9p/ files
or mgr/format.go and mgr/sessionfile.go (they only need agent types).

WatchAgent const inlined as string literal.
2026-07-29 21:46:00 +02:00
Levi Neely a6a7fae7ca 9p: rename session/ → mgr/, drop agent import alias
Rename the internal olliesrv/session package to olliesrv/mgr to resolve
the naming conflict with ollie/session (the core session package).

This allows importing ollie/session without an alias — the temporary
`agent "ollie/session"` scaffolding is removed. All references now
use the natural package name: session.X for core types, mgr.X for the
9P session manager.
2026-07-29 21:20:56 +02:00
Levi Neely d46cd21bdf update imports: ollie/agent → ollie/session (aliased as agent) 2026-07-29 19:13:33 +02:00
Levi Neely c96982c1ec update imports for core/ restructure
ollie/pkg/X → ollie/X, execute.Registry → tools.Registry,
remote.Dial → execute.RemoteDial, config.Load → agent.Load
2026-07-29 18:10:32 +02:00
Levi Neely 2d4ce13272 dbus: emit ConfigChanged on agent switch, fix agent default override
- Add agent watcher goroutine that emits ConfigChanged(session, key, value)
  D-Bus signal when the per-session agent name changes
- Add ConfigChanged to introspection XML
- Fix CreateSession: only apply OLLIE_DEFAULT_AGENT when no agent arg was
  explicitly provided. Previously, passing agent=default would trigger the
  env override, making it impossible to select a specific agent from the GUI.
2026-07-29 11:04:01 +02:00
lkn 35cc360b08 add GetReactions D-Bus method 2026-07-27 19:47:18 +02:00
lkn 8c7dba5cf7 9P/D-Bus ReactTo and assistant:id headers 2026-07-27 19:12:12 +02:00
lkn ad66560091 add React method to D-Bus introspection XML 2026-07-27 18:12:09 +02:00
Levi Neely 4a60edc893 add React D-Bus method
Exposes React(sessionID, emoji) over D-Bus so GUI clients can
send emoji reactions without direct 9P access.
2026-07-27 15:33:24 +02:00
lkn 76807dd879 sort D-Bus ListModels results 2026-07-26 19:01:19 +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 87e6c664bd dbus: add systemPrompt arg to CreateSession introspection XML 2026-07-21 14:28:06 +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 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 da611d3ef2 dbus: add Complete and missing session methods; readme: add -nodbus flag 2026-07-18 22:36:24 +02:00
Levi Neely f065429d24 9p: add embedded D-Bus protocol adapter
Expose org.ollie.SessionManager on the session bus directly from olliesrv.
The adapter emits StateChanged, ChatUpdated, SessionCreated, SessionKilled,
SessionRenamed, ProcessDetached, and ProcessExited signals. All KDE frontends
work without ollied.

Fixes:
- ListSessions: use Manager.List() instead of broken Readdir("")
- RenameSession: delegate to Manager.RenameSession()
- WatchExisting: start signal watchers for sessions restored at startup
- Introspection XML: declare all methods and signals
2026-07-18 21:36:07 +02:00