diff --git a/.gitmodules b/.gitmodules index ca7733e..acad195 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,9 +19,6 @@ [submodule "kde"] path = kde url = ../ollie-kde.git -[submodule "dbus"] - path = dbus - url = ../ollie-dbus.git [submodule "remote"] path = remote url = ../ollie-remote.git diff --git a/README.md b/README.md index e0b0ec5..dae17e4 100644 --- a/README.md +++ b/README.md @@ -16,15 +16,12 @@ Or after cloning: git submodule update --init --recursive ``` -Build and install (pick one): +Build and install: ```sh -just # 9P path (recommended): core, 9p, acme, kde, httpgw, webui, emacs -just dbus # D-Bus path (KDE-only): core, ollied, kde, httpgw, webui +just # builds core, 9p, acme, kde, httpgw, webui, emacs ``` -These are mutually exclusive — pick the one that matches your setup. - Requires [just](https://github.com/casey/just): ```sh @@ -83,7 +80,6 @@ Monorepo with Git submodules. Each submodule has its own Go module (except `el` | [core/](core/) | Go | Core library: agent loop, backends, tools, config, sandbox | | [9p/](9p/) | Go | 9P filesystem server (`olliesrv`) | | [remote/](remote/) | Go | Remote execution server (`ollie-remote`) for split-brain SSH mode | -| [dbus/](dbus/) | Go | D-Bus session manager daemon (`ollied`) | | [acme/](acme/) | Go | Plan 9 acme editor frontend | | [httpgw/](httpgw/) | Go | HTTP-to-9P gateway (`ollie-httpgw`) | | [webui/](webui/) | TypeScript | Preact SPA browser frontend | @@ -187,26 +183,21 @@ See [doc/REMOTE_EXECUTION.md](doc/REMOTE_EXECUTION.md) for the design. ## Architecture -Ollie has two session manager backends. Both embed the same core library and expose the same features; they differ in interface philosophy and deployment context. +`olliesrv` is a single binary that operates in three modes: -| | 9P (`olliesrv`) | D-Bus (`ollied`) | -|---|---|---| -| Interface | Synthetic filesystem + D-Bus protocol adapter | Desktop bus methods + signals | -| Frontends | All (terminal, acme, Emacs, KDE, web) | KDE only (plasmoid, GUI, Kate, KRunner, tray) | -| Network | Native (mount over TCP) | Local session bus | -| Dependencies | None beyond Go runtime | D-Bus daemon, desktop session | +| Mode | Flags | Interface | Frontends | +|------|-------|-----------|----------| +| +9p +dbus | (default) | 9P filesystem + D-Bus signals | All (terminal, acme, Emacs, KDE, web) | +| +9p -dbus | `-nodbus` | 9P filesystem only | Terminal, acme, Emacs, web | +| -9p +dbus | `-no9p` | D-Bus only | KDE (plasmoid, GUI, Kate, KRunner, tray) | -`olliesrv` is the primary server. It exposes sessions as a 9P synthetic filesystem and embeds a D-Bus protocol adapter that emits the same signals and methods that the KDE frontends expect. All frontends work with `olliesrv`. - -`ollied` is a standalone D-Bus daemon that only supports the KDE frontends. It predates the 9P server's D-Bus adapter and remains available for deployments that don't need 9P. - -Use whichever fits your environment — or both at once. Note that sessions are not shared between them; each backend manages its own session pool. +All modes embed the same core library and session manager. The 9P and D-Bus interfaces are thin adapters over the shared session pool. --- ## 9P: everything is a file -The 9P server exposes the agent runtime as a synthetic filesystem. Every session is a directory; every operation is a read or write. It also embeds a D-Bus protocol adapter on `org.ollie.SessionManager` that streams `StateChanged`, `ChatUpdated`, and lifecycle signals to desktop clients — so the KDE plasmoid, standalone GUI, Kate plugin, and system tray all work without `ollied`. +The 9P server exposes the agent runtime as a synthetic filesystem. Every session is a directory; every operation is a read or write. In default mode, it also embeds a D-Bus adapter on `org.ollie.SessionManager` that streams `StateChanged`, `ChatUpdated`, and lifecycle signals to desktop clients. There is no client library, no SDK, no protocol buffer — `echo`, `cat`, `tail`, and `rm` are the API. @@ -295,7 +286,7 @@ The design follows Plan 9 conventions directly: ## D-Bus: desktop integration -The D-Bus interface (`org.ollie.SessionManager`) is available two ways: embedded in `olliesrv` (recommended) or as the standalone `ollied` daemon. Both expose the same methods and signals. The KDE frontends connect to whichever is running. +The D-Bus interface (`org.ollie.SessionManager`) is embedded in `olliesrv` (enabled by default, or exclusively via `-no9p`). The KDE frontends connect to it over the session bus. ### Typed method calls @@ -337,11 +328,7 @@ The D-Bus interface is what makes native desktop integration possible: - **System tray** — status indicator and quick actions - **Standalone GUI** — full-featured Qt6 chat application -All of these talk to `org.ollie.SessionManager` over D-Bus using Qt's native bindings — no IPC glue code, no subprocess management. They work with either `olliesrv` or `ollied`. - -### Activation and lifecycle - -D-Bus supports socket activation: `ollied` can start on first use and exit when idle. The desktop session manages its lifecycle automatically through a `.service` file — no init scripts, no manual daemon management. +All of these talk to `org.ollie.SessionManager` over D-Bus using Qt's native bindings — no IPC glue code, no subprocess management. ## Credits diff --git a/dbus b/dbus deleted file mode 160000 index 332a90d..0000000 --- a/dbus +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 332a90d6af0432b5bd839941c1f28349a5fbe4b1 diff --git a/doc/ARCHITECTURE.md b/doc/ARCHITECTURE.md index 70c05e7..570c9f1 100644 --- a/doc/ARCHITECTURE.md +++ b/doc/ARCHITECTURE.md @@ -6,12 +6,12 @@ ollie's design philosophy is Emacs: a small, extensible core. The Go runtime (`a The primary integration philosophy is Plan 9's "everything is a file." `olliesrv` exposes agent state and behaviors as files in a 9P namespace. Any program that can read and write files can drive an agent: shell scripts, editors, web apps, cron, containers. -For those less enamored with the Unix philosophy, a standalone D-Bus daemon (`ollied`) wraps the same core with a conventional method/signal interface. The KDE GUI, plasmoid, and web UI connect this way. Both integration layers are thin adapters over the same `agent.Core`. +For desktop-native integration, `olliesrv` embeds a D-Bus adapter (`org.ollie.SessionManager`) alongside its 9P interface. The KDE GUI, plasmoid, and web UI connect this way. For D-Bus-only deployments, `-no9p` disables the 9P listener entirely. Design principles: - **Small extensible core.** The agent runtime is minimal; capabilities come from composing external scripts. - **One built-in tool.** `execute_code` is the only tool compiled into the core. Everything else is a script. -- **Two integration paths.** 9P filesystem (canonical) or D-Bus (conventional). Same core, different surfaces. +- **Two integration paths.** 9P filesystem (canonical) and/or D-Bus (conventional). Same core, different surfaces, selectable via flags. - **No framework lock-in.** Frontends are decoupled via whichever interface they prefer; the core doesn't know or care. ## Repository Structure @@ -22,7 +22,6 @@ The project is a monorepo with Git submodules: ollie/ ├── core/ → ollie-core Go library: agent loop, backends, tools, config ├── 9p/ → ollie-9p 9P filesystem server (olliesrv) -├── dbus/ → ollie-dbus Standalone D-Bus daemon (ollied) ├── kde/ → ollie-kde KDE GUI, plasmoid, Kate plugin, KRunner, tray ├── httpgw/ → ollie-httpgw HTTP-to-D-Bus gateway ├── webui/ → ollie-webui Preact SPA (browser frontend) @@ -60,11 +59,7 @@ ollie/ │ per-session ▼ -Alternative: ollied (pure D-Bus daemon, no 9P — for dbus-only deployments) -┌───────────────────────────────────────────────────────────────────────────┐ -│ ollied (org.ollie.SessionManager) │ -│ Pure D-Bus session manager; same interface, no filesystem. │ -└───────────────────────────────────────────────────────────────────────────┘ +D-Bus-only mode: olliesrv -no9p (same interface, no filesystem listener) ┌────────────────────────────────────────────────────────────────┐ │ agent.Core (per session) │ │ ┌─────────────┐ ┌──────────────┐ ┌────────────────────────┐ │ @@ -250,7 +245,7 @@ The `Manager` handles session lifecycle: ### Embedded D-Bus Adapter (`9p/dbus.go`) `olliesrv` includes an embedded D-Bus adapter that claims `org.ollie.SessionManager` on the session bus. This provides: -- The same method/signal interface as the standalone `ollied` daemon +- The same method/signal interface used by KDE frontends - `SessionCreated`, `SessionKilled`, `StateChanged`, `ChatUpdated` signals - Allows KDE GUI, plasmoid, and web UI (via `httpgw`) to interact with sessions without speaking 9P - Lifecycle watchers that bridge session state changes to D-Bus signals @@ -259,13 +254,7 @@ The adapter is best-effort: if no session bus is available (e.g., headless/conta ## D-Bus Daemon (`dbus/`) -`ollied` is a standalone D-Bus session manager for deployments that don't need 9P. It exposes the same `org.ollie.SessionManager` interface as the embedded adapter in `olliesrv`, with identical methods and signals. - -Key differences from `olliesrv`: -- No filesystem namespace — all interaction is via D-Bus method calls -- No per-session FUSE mounts or 9P principals -- Session persistence uses the same `~/.local/share/ollie/sessions/active/` directory -- Intended for KDE-native or GUI-only workflows +For D-Bus-only deployments (no 9P), run `olliesrv -no9p`. This disables the filesystem listener and per-session FUSE mounts while keeping the full D-Bus interface. Session persistence uses the same `~/.local/share/ollie/sessions/active/` directory. ## KDE Integration (`kde/`)