This repository has been archived on 2026-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
ollie-kde/README.md

7.4 KiB

ollie-kde

KDE-native integration for ollie — a long-lived D-Bus daemon that manages AI agent sessions, with thin KDE clients (system tray, Plasmoid, KRunner, Kate plugin, Dolphin menus).

Architecture

┌──────────────────────────────────────────────────────────────┐
│                     Plasma Desktop                            │
│  System Tray │ KRunner │ Plasmoid │ Kate Plugin │ Dolphin    │
└──────────────────────────┬───────────────────────────────────┘
                           │ D-Bus (org.ollie.SessionManager)
┌──────────────────────────┴───────────────────────────────────┐
│                    ollie-kde daemon                           │
│         C++ Qt6 │ D-Bus adaptor │ libollie.so (Go)           │
└──────────────────────────────────────────────────────────────┘

The daemon owns all sessions and the Go runtime (libollie.so). KDE components are pure D-Bus clients — lightweight, stateless, and independently restartable.

Dependencies

  • Go 1.25+
  • Qt 6 (Core, DBus, Widgets, Quick)
  • KDE Frameworks 6 (StatusNotifierItem, Runner, TextEditor, CoreAddons, Config)
  • Plasma 6 (for Plasmoid)
  • ECM (Extra CMake Modules)
  • ollie/core (sibling directory at ../ollie/core)

Build

make          # builds libollie.so (Go) then ollie-kde + ollie-tray (CMake)

Outputs:

  • build/libollie.so — Go shared library (cgo c-shared)
  • build-cmake/ollie-kde — D-Bus daemon
  • build-cmake/ollie-tray — system tray icon
  • build-cmake/lib/kf6/krunner/krunner_ollie.so — KRunner plugin
  • build-cmake/lib/kf6/ktexteditor/ollie_kate.so — Kate plugin
  • build-cmake/org/ollie/private/ — Plasmoid QML plugin

Install

# Daemon + tray
sudo install -m755 build-cmake/ollie-kde /usr/bin/
sudo install -m755 build/libollie.so /usr/lib64/

# KRunner plugin
sudo cp build-cmake/lib/kf6/krunner/krunner_ollie.so /usr/lib64/qt6/plugins/kf6/krunner/

# Kate plugin
sudo cp build-cmake/lib/kf6/ktexteditor/ollie_kate.so /usr/lib64/qt6/plugins/kf6/ktexteditor/

# Plasmoid
make plasmoid-install

# KRunner (restart needed)
make krunner-install

# Dolphin service menus
make dolphin-install

# System tray (optional standalone)
sudo install -m755 build-cmake/ollie-tray /usr/bin/

Service Setup

systemd (user unit)

cp services/ollie-kde.service ~/.config/systemd/user/
systemctl --user enable --now ollie-kde

OpenRC (user service, 0.60+)

sudo cp services/ollie-kde.openrc /etc/user/init.d/ollie-kde
rc-update --user add ollie-kde default
rc-service --user ollie-kde start

Manual

make run   # foreground, for development

Usage

D-Bus API

The daemon registers as org.ollie.SessionManager on the session bus.

# Create a session
dbus-send --session --dest=org.ollie.SessionManager --type=method_call --print-reply \
  /org/ollie/SessionManager org.ollie.SessionManager.CreateSession \
  string:"$HOME" string:"" string:"" string:"default"

# Submit a prompt
dbus-send --session --dest=org.ollie.SessionManager --type=method_call --print-reply \
  /org/ollie/SessionManager org.ollie.SessionManager.Submit \
  string:"<session_id>" string:"your prompt here"

# Get chat output
gdbus call --session --dest org.ollie.SessionManager --object-path /org/ollie/SessionManager \
  --method org.ollie.SessionManager.GetChat "<session_id>" 0

KRunner

  • ollie <prompt> — one-shot: creates session, submits, shows popup with result
  • ollie list — show active sessions
  • ollie kill <id> — terminate a session

Dolphin

Right-click any file or directory:

  • Ask Ollie about this — one-shot prompt with file context, shows result in kdialog
  • Start Ollie session here — creates a persistent session in that directory

Kate

Enable the "Ollie" plugin in Settings → Configure Kate → Plugins. Panel appears on the right with:

  • Session indicator + CWD label
  • New — create session in project/file directory
  • Ask File — send current file path for description
  • Explain — send selected text for explanation
  • Prompt input for free-form messages
  • Live-streaming chat view

Plasmoid

Add the "Ollie" widget to your panel or desktop:

  • Session list with state indicators (○ idle, ● thinking, ⚡ tool call)
  • Live chat view with auto-scroll
  • Inline prompt input
  • Real-time updates via D-Bus signals

System Tray

  • Tooltip: session count
  • Status: passive (no sessions), active (sessions idle), attention (agent working)
  • Right-click: New Session, Sessions submenu (kill each), Stop All, Quit

D-Bus Interface

Methods:

  • CreateSession(cwd, backend, model, agent) → session_id
  • ListSessions() → [id\tstate\tmodel\tagent, ...]
  • KillSession(session_id) → success
  • RenameSession(session_id, new_name) → success
  • Submit(session_id, prompt) → success
  • Interrupt(session_id) → success
  • GetState(session_id) → state
  • GetChat(session_id, offset) → text, new_offset
  • GetUsage(session_id) → usage
  • GetCost(session_id) → cost
  • GetConfig(session_id) → key=value pairs
  • SetConfig(session_id, key, value) → success
  • GetContext(session_id) → JSONL messages
  • ListBackends() → [names]
  • ListModels(session_id) → [names]
  • ListAgents() → [names]
  • PeerAdd(session_id, peer_id) → success
  • PeerRemove(session_id, peer_id) → success
  • PeerList(session_id) → [peer_ids]
  • PeerSubmit(session_id, peer_id, prompt) → success

Signals:

  • SessionCreated(session_id)
  • SessionKilled(session_id)
  • StateChanged(session_id, new_state)
  • ChatUpdated(session_id, offset, new_text)

File Layout

ollie-kde/
├── Makefile                        # Go + CMake orchestration
├── CMakeLists.txt
├── lib/
│   └── capi.go                     # cgo exports (libollie.so)
├── daemon/
│   ├── main.cpp                    # D-Bus registration, event loop
│   ├── session_manager.h/cpp       # D-Bus adaptee, bridges C API
│   └── org.ollie.SessionManager.xml
├── tray/
│   ├── main.cpp
│   └── ollie_tray.h/cpp            # KStatusNotifierItem
├── krunner/
│   ├── metadata.json
│   └── ollie_runner.h/cpp          # KRunner plugin
├── kate/
│   ├── metadata.json
│   └── ollie_kate.h/cpp            # KTextEditor plugin
├── plasmoid/
│   ├── metadata.json
│   ├── contents/ui/main.qml
│   └── plugin/
│       └── olliedbusclient.h/cpp   # QML singleton (D-Bus client)
├── dolphin/
│   ├── ollie-actions.desktop       # Service menu entries
│   ├── ollie-ask                   # One-shot helper script
│   └── ollie-session-here          # Session creation helper
├── services/
│   ├── ollie-kde.service           # systemd user unit
│   └── ollie-kde.openrc            # OpenRC service
└── test-e2e.sh                     # End-to-end test script