Commit Graph

48 Commits

Author SHA1 Message Date
Levi Neely 18b36c09cd Add ollie:// KIO worker for Dolphin
Implements a KIO worker that maps ollie:///path to the Ollie 9P
namespace. Supports listing, reading, writing, mkdir, delete, and
rename — all operations Dolphin needs for full file manager integration.

Works with both KF5 (RealWorkerFactory) and KF6 (WorkerFactory).
Type ollie:/// in Dolphin's location bar to browse sessions and agents.
2026-08-13 12:26:15 +02:00
Levi Neely 70390097b0 fix KF6 auto-detect on distros without monolithic KF6Config.cmake 2026-08-07 18:58:42 +02:00
Levi Neely ca4dc2d412 gui: eliminate all subprocess calls, use native 9P streaming
Replace StreamFsm and NinePConnection (QProcess-based) with NativeStreamer
which uses the new libollie9p streaming API (open/read_fid/close_fid).

All 9P operations now go through the native library:
- Chat, statewait, eventwait streams use threaded NativeStreamer
- Request/response operations use Lib9pClient directly
- No more subprocess spawning for any 9P operation

Remove ninepBin, ollie9pBin, serverAddr, run9p helper functions.
Remove streamfsm.cpp/h, ninepconnection.cpp/h from build.
2026-08-07 18:02:45 +02:00
Levi Neely 60c273e94a cmake: auto-detect KF5/KF6, fall back to KF5 if KF6 not found 2026-08-07 17:41:54 +02:00
Levi Neely 2d6e0ed787 gui: extract dialogs and chat delegate into components
Phase 1 of GUI cleanup - component extraction:
- SettingsDialog.qml: theme and font settings (118 lines)
- NewSessionDialog.qml: session creation form (79 lines)
- NewAgentDialog.qml: agent creation form (174 lines)
- ChatBlockDelegate.qml: chat block with text/diagram segments (322 lines)

main.qml reduced from 1685 to 1030 lines (39% reduction).
Updated CMakeLists.txt for both Qt6 and KF5 builds.
2026-08-07 17:40:09 +02:00
Levi Neely 07232b94df Add PlantUML and Mermaid diagram rendering
- Detect plantuml/mermaid code fences and render as diagrams
- PlantUML: POST to localhost:8080/svg for SVG output
- Mermaid: GET to localhost:8081/img/ with base64 for JPEG output
  (SVG not usable - Qt doesn't support foreignObject)
- Cache rendered diagrams by content hash
- Toggle between source code and rendered image view
- Copy button for source text or image data
- Fall back to source display on render errors
- Add ClipboardHelper for image clipboard support
- Clear diagram cache on session reset
2026-08-07 14:59:20 +02:00
Levi Neely 7aad74dafe kate: simplify plugin — remove chat panel, keep context actions + ghost text
Strip the plugin down to its core value:
- Context menu actions (explain, fix, refactor, document, test, review diff)
- Ghost text completion (unchanged)
- Git++ review diff integration
- Auto agent-per-project matching (silent, no UI)
- Status bar indicator showing current agent

Removed:
- Chat panel (side panel UI, streaming, renderer)
- Inline annotations
- Emoji processing
- Config page (use env vars: OLLIE_COMPLETE_BACKEND, etc)
- Apply code blocks
- libkateprivate/diff viewer integration

3109 LOC → 1192 LOC. Use the KDE GUI app tiled alongside Kate for chat.
2026-08-06 13:39:30 +02:00
Levi Neely ce36dcde52 Update KDE README and remove D-Bus dependencies
- Rewrite README.md with accurate 9P-based architecture
- Remove all D-Bus dependencies:
  - Update dolphin/ollie-ask to use ollie-9p rdwr generate
  - Update kate/ollie_ghost.cpp to use ollie-9p rdwr complete
  - Remove QDBusInterface from ollie_ghost.h
  - Fix OllieGhostProvider constructor in ollie_kate.cpp
  - Remove D-Bus comments from gui/main.cpp and kate/ollie_kate.cpp
  - Remove QtDBus from CMakeLists.txt (KF5 and KF6)
  - Delete D-Bus test scripts test-e2e.sh and test-peers.sh
- Clarify no system tray component exists
- Update build/install instructions with just commands
2026-08-05 18:53:30 +02:00
Levi Neely 73e262ffaf kate: fix agent selection, block rendering, project change detection
- newAgent() is idempotent: selects existing agent by cwd if one exists
- Use rdwr() to get new agent ID from server instead of ls() ordering
- selectAgentForProject() returns bool for caller branching
- Connect to Kate project plugin projectChanged signal
- Update chat block parser to [[[type]]] / [[[end]]] format
- Guard pluginViewCreated for KF5 < 5.78
2026-08-05 17:51:27 +02:00
Levi Neely 0e9a7016a3 native 9P client via libollie9p
Replace subprocess spawning (run9p) with native 9P connection for hot paths:
- refreshSessions() - called on every sessionsChanged event
- loadRootBackends() - called on daemon connect
- loadRootAgents() - called on daemon connect

Lib9pClient wraps the Go shared library with a Qt-friendly C++ API.
Connection persists across operations, eliminating ~2-5ms per-call
process spawn overhead.

Requires libollie9p.so from parent repo's lib9p/ package.
2026-08-03 20:04:17 +02:00
Levi Neely 5e22545b2e cmake: disable kate plugin build (needs rework)
The kate plugin code remains in the tree but is not built or
installed until it's updated for the current 9P namespace.
2026-08-03 10:59:00 +02:00
Levi Neely 34d4a97b3d gui: complete KF5 build with full feature parity
- Add chatblockmodel.cpp and thememanager.cpp to KF5 GUI target
- Link KF5::ConfigCore and KF5::SyntaxHighlighting to GUI
- Strip Qt6-only grouped palette syntax from QML at configure time
  (ThemeManager::applyPalette handles palette via QGuiApplication)
- Fix QStringList brace-init ambiguity in Qt5
- Fix QList::remove(pos,count) not available in Qt5 (use erase)
2026-08-03 09:03:12 +02:00
Levi Neely 6e7245dd99 connection statuses 2026-08-02 23:35:14 +02:00
Levi Neely 67b33f95d2 refactor: StreamFsm lifecycle + chatblock model FSM fix
- Introduce StreamFsm class wrapping QProcess lifecycle with
  Oneshot/Looping/Guarded restart policies
- Replace raw QProcess management in Ollie9pClient with StreamFsm
- Fix chatblockmodel FSM to properly handle [[[end]]] and fence
  transitions with a combined State enum (Outside/InBlock/InFence)
- Add Q_INVOKABLE to setActiveSessionId for direct QML access
- Add streamfsm.cpp to CMakeLists.txt for both KF5 and KF6 builds
2026-08-02 11:11:05 +02:00
Levi Neely 24edd5941a gui: syntax-highlight fenced code/diff blocks at stream end
- Add fence state machine (NoFence → InFence) to ChatBlockModel
- On closing ```, render via KSyntaxHighlighting or inline diff colorizer
- Store rendered HTML in ChatBlock.renderedHtml, emit dataChanged on RenderedHtmlRole
- QML shows RichText Label when renderedHtml is populated, falls back to PlainText
- Add KF6::SyntaxHighlighting dependency for ollie-gui target
2026-08-01 11:36:43 +02:00
Levi Neely da1f7f02dd restore ThemeManager (color scheme, font settings) from git history 2026-08-01 09:57:39 +02:00
Levi Neely 857a919b64 streaming INI parser: ChatBlockModel with per-block decorations 2026-08-01 09:37:48 +02:00
Levi Neely b28921c39f fix qt_add_resources: add BASE gui so main.qml is at qrc:/main.qml 2026-08-01 08:43:41 +02:00
Levi Neely e7b3291826 cleanup: delete all dead D-Bus code and unused UI components
Removed:
- plasmoid/ (entire directory — QML plugin, D-Bus client, metadata)
- tray/ (entire directory — KStatusNotifierItem, D-Bus watcher)
- gui/chatblockmodel.* (replaced by plain text streaming)
- gui/thememanager.* (unused — Basic style handles palette)
- gui/ChatPane.qml, SessionGraph.qml (complex delegate system, gone)
- gui/emojis.js (emoji shortcode completion, can re-add later)
- gui/main-kf5.qml (duplicate of main.qml)

What remains in gui/:
- main.cpp, main.qml — 9P-based minimal GUI
- ollie9pclient.cpp/h — QProcess-based 9P transport
- qml.qrc, ollie.svg, desktop file
2026-07-31 20:44:22 +02:00
Levi Neely 1ceeeeb39c kate: complete 9P conversion, remove all D-Bus dependencies
Replace all 28+ D-Bus call sites with 9P operations via plan9port's
9p command. Chat streaming via persistent QProcess reading the chat
file. State updates via statewait process restart loop.

Ghost text provider disabled (needs separate 9P port).

The entire KDE submodule is now D-Bus-free for server communication.
D-Bus is only used internally by KDE frameworks (KRunner plugin loading,
KStatusNotifierItem, etc.) — not for ollie protocol.
2026-07-31 20:25:04 +02:00
Levi Neely e89b723627 kill D-Bus: krunner+tray use 9P, remove plasmoid+tray, disable kate
- KRunner: rewritten to use plan9port 9p command for all operations
  (list sessions, kill, one-shot generate). No D-Bus dependency.

- Tray: removed. Was a thin D-Bus status wrapper, not useful enough
  to justify maintaining.

- Plasmoid: removed. GUI is standalone now.

- Kate: temporarily disabled in CMake. Header partially converted to
  9P (D-Bus includes removed, QProcess/9P helpers declared). Full
  conversion is next.

- All ninepBin() helpers use $PLAN9/bin/9p (not hardcoded path).

- CMake: removed Qt5::DBus, KF5::Notifications, KF5::Plasma deps.
  Only remaining link deps: Qt5::Core, Qt5::Widgets, Qt5::Quick,
  Qt5::QuickControls2, KF5::Runner.
2026-07-31 20:16:25 +02:00
Levi Neely f4161fcabc gui: replace D-Bus with native 9P streaming
Kill the entire D-Bus rendering pipeline. The GUI now uses plan9port's
9p command as a subprocess for all server communication:

- Chat streaming: persistent 'read chat' process, readyReadStandardOutput
  delivers tokens directly to QML (no polling, no signals, no offsets)
- State: 'read statewait' process, restarts on each state change
- Session list: 'read session/idx' one-shot
- Submit/stop/kill: 'write prompt/ctl' one-shot

The QML is stripped to fundamentals: session list + monospace streaming
text (last 8KB tail) + input field. No ChatBlockModel, no ThemeManager,
no OllieDBusClient, no syntax highlighting, no markdown rendering.

This eliminates the multi-second GUI freezes caused by:
- QTextDocument relayout on 200KB+ accumulated text
- loadEarlier cascade creating hundreds of delegates
- KSyntaxHighlighting::Repository blocking init
- Offset mismatch triggering synchronous D-Bus calls

Features will be re-added incrementally on this proven foundation.
D-Bus retained only for plasmoid/tray/KRunner (desktop integration).
2026-07-31 20:06:05 +02:00
Levi Neely 29c74b2837 feat(gui): render PlantUML, Mermaid, and draw.io diagrams as images
- Detect mermaid/plantuml/drawio/mxgraph code fences as 'diagram' sub-blocks
- Render via local servers (PlantUML :8080, Mermaid :8081, draw.io :8082)
- Fall back to CLI tools (plantuml, mmdc, drawio) if servers unavailable
- Cache rendered SVGs in ~/.cache/*/diagrams/ keyed by content hash
- Show rendered image with white background (dark theme friendly)
- Collapsible source toggle (▶/▼) below rendered diagram
- Middle-click to invalidate cache and re-render
- Left-click opens fullscreen pannable/zoomable viewer
- Fullscreen: scroll-wheel zoom, drag to pan, Esc/right-click/dbl-click to close
- Both kf5 and kf6 builds
2026-07-29 15:23:29 +02:00
Levi Neely 90fe8e3478 kf5 corrections 2026-07-20 10:25:27 +02:00
Levi Neely cf637b2674 fix plugin install paths for user-local KDE install
- Kate plugin: ktexteditor -> kf6/ktexteditor (KF6), kf5/ktexteditor (KF5)
- Add 99-ollie.sh plasma env script for QT_PLUGIN_PATH and QML_IMPORT_PATH
- Plugins now found without sudo or system-wide install
2026-07-19 13:22:31 +02:00
Levi Neely b9e02a972a gui: inline video embeds in chat
Detect video URLs (YouTube, Vimeo, Dailymotion, Twitch, direct media)
in chat responses. Direct .mp4/.webm/.ogv files play inline via
QtMultimedia Video. Other video sites show a card with play button
that opens in the system browser.

Adds Qt6::Multimedia dependency.
2026-07-18 18:46:35 +02:00
Levi Neely 2699044b3b gui: split-pane sessions (Ctrl+* to split, Ctrl+W to close)
Major refactor: extracted chat UI into ChatPane.qml (self-contained
with own ChatBlockModel, D-Bus signal filtering, prompt input).
Main content area is now a SplitView with dynamic pane creation.
Auto-layout: splits horizontal if window wider than tall.
Sidebar click updates the focused pane session.

New OllieDBusClient methods: getChat, getConfig, getState (per-session).
New signal: chatAppended (emitted for all sessions, not just active).
2026-07-16 22:35:35 +02:00
Levi Neely 6362e399bd gui: session topology graph
Circular node layout showing all sessions with peer relationship edges.
Nodes are color-coded by state (green=idle, blue=thinking, orange=calling),
pulse when active. Click a node to select that session.
Toggle between list and graph view in sidebar toolbar.
Adds peerList() to OllieDBusClient.
2026-07-16 22:06:08 +02:00
Levi Neely 483981a9cd fix(gui): include emojis.js in Qt6 resource bundle
qt_add_resources was only bundling main.qml, causing ollie-gui to fail
at startup with 'Script qrc:/gui/emojis.js unavailable'.
2026-07-16 17:26:06 +02:00
Levi Neely 2929bb6b04 kde: visual enhancements, emoji completion, scroll/layout fixes
ollie-gui:
- Structured chat blocks (user/assistant bubbles, tool/call with left borders)
- Tool/call blocks always visible (not collapsible), whitespace preserved
- User interrupt blocks (amber warning style)
- Copy buttons on bubbles (32x32, hover-visible)
- Emoji completion with popup selector + quick emoticons
- Backend/model display in header bar
- Session state updates on switch
- Scroll flicker fix (debounced, guarded)
- Null guards on delegate block properties
- Binding loop fixes

Kate plugin:
- Diff viewer integration via Kate DiffWidget (libkateprivate)
- Diff mode config (unified/side-by-side/raw)
- Emoji processing in prompt input (quick emoticons + :shortcode:)
- Increased chat font size
- Scroll position preservation

Dbus client:
- activeModel/activeBackend properties from GetConfig
2026-07-16 11:19:22 +02:00
Levi Neely d3c8aece38 kate: extract chat_renderer, simplify kate plugin 2026-07-16 08:57:55 +02:00
Levi Neely f6b218bef7 kf5: sync gui with kf6 features, fix install paths
- main-kf5.qml: port all KF6 gui enhancements (chat bubbles, structured
  blocks, markdown, syntax highlighting, diff coloring, collapsible
  call/tool blocks, lazy-load scrolling)
- CMakeLists.txt: add chatblockmodel.cpp and KF5::SyntaxHighlighting to
  KF5 gui target; fix Kate plugin INSTALL_NAMESPACE (ktexteditor, not
  kf5/ktexteditor or kf6/ktexteditor)
- Makefile: fix KF6 kate install path; add icon+desktop to kf5-install
- main.qml + main-kf5.qml: fix prose font size (use root.font.pointSize
  instead of Qt.application.font.pixelSize)
2026-07-16 08:43:25 +02:00
Levi Neely 6e03064d0f rich output rendering for ollie-gui
Replace flat TextArea chat view with structured ListView:
- ChatBlockModel parses raw chat text into typed blocks (user,
  assistant, reasoning, call, tool, error, info)
- Sub-blocks parsed from markdown: prose, fenced code, diffs
- Code blocks rendered with KSyntaxHighlighting (auto light/dark theme)
- Diff blocks with red/green line coloring
- Copy button on code and diff blocks
- File paths linkified and clickable (opens with xdg-open)
- Reasoning/call/tool blocks collapsible (click to expand)
- User blocks highlighted with subtle accent background
- Error blocks in red
- Scroll pinning preserved (auto-scroll when at bottom)
2026-07-16 06:29:18 +02:00
Levi Neely fcc3cd2313 kate stop button, sorted sessions, scroll pinning, install fix
- Kate: add always-visible stop button next to prompt input
- All front-ends: sort sessions alphabetically by ID
- All front-ends: only auto-scroll chat if at bottom, show
  floating go-to-bottom button when scrolled away
- CMakeLists: set KDE_INSTALL_PLUGINDIR to QT6_INSTALL_PLUGINS
  so plugins install to lib64/qt6/plugins/ (where Kate looks)
2026-07-16 06:03:15 +02:00
Levi Neely 16e8fc7a75 feat: ghost-text code completion via InlineNoteProvider
Adds OllieGhostProvider that renders AI completions as translucent
gray text after the cursor. Uses the new Complete D-Bus method with
500ms debounce. Tab accepts, Escape dismisses, any edit clears.
Works on both KF5 and KF6 builds.
2026-07-14 12:30:18 +02:00
Levi Neely dc1816f023 gui: fix Qt5/KF5 compatibility
- Remove placeholderText from QML palette block (not available in Qt5)
- Use theme.placeholderTextColor directly instead of palette.placeholderText
- Add Qt version guards for QFontDatabase static vs instance API
- Add Qt version guard for QVariant::typeId vs QVariant::type
- Link KF5::ConfigCore for ollie-gui KF5 build
2026-07-09 11:26:10 +02:00
Levi Neely 7f93543e56 gui: theme manager with KDE color schemes, font settings, and native folder dialogs 2026-07-09 00:07:47 +02:00
Levi Neely c294670df1 fix: correct resource prefix for ollie-gui QML 2026-07-08 19:55:00 +02:00
Levi Neely 8a644d8d7c feat: add ollie-gui QtQuick standalone application
Session list with create/kill/rename, chat view, prompt input,
folder dialogs for cwd. Reuses OllieDBusClient from plasmoid plugin.
Supports both Qt5 (KF5) and Qt6 (KF6) builds.
2026-07-08 19:46:10 +02:00
Levi Neely a988930dbc fix: use xdg-desktop-portal for folder dialog in plasmoid
plasmashell is QGuiApplication so QFileDialog (QtWidgets) cannot work.
Use org.freedesktop.portal.FileChooser.OpenFile via D-Bus instead.
Also fix StandardPaths ReferenceError in main.qml.
2026-07-08 19:33:48 +02:00
Levi Neely d97d2fb1af feat: use native QFileDialog for new session folder selection
QML FolderDialog does not work inside the plasmoid sandbox.
Move folder selection to C++ via QFileDialog::getExistingDirectory
and expose as createSessionWithDialog(). Applies to both kf5 and kf6.
2026-07-08 19:31:22 +02:00
Levi Neely d457be9524 remove daemon (moved to ollie-dbus submodule) 2026-07-07 13:02:34 +02:00
Levi Neely e79cb33adb update kde plasmoid and build config 2026-07-06 18:22:38 +02:00
Levi Neely 22771d3c8d phase 7c: Kate plugin
- Side panel (right dock) with live chat view, streaming via ChatUpdated
- Prompt input at bottom, enter to send
- Context actions: 'Ask File' (describe current file), 'Explain' (explain selection)
- Auto-creates session in current file's directory
- Adopts existing sessions on load
2026-07-06 00:05:51 +02:00
Levi Neely e052424d62 phase 5: KRunner plugin
- 'ollie <prompt>': one-shot mode (create, submit, await, notify, kill)
- 'ollie list': show active sessions with state
- 'ollie kill <id>': terminate a session
- KNotification shows result when one-shot completes
- Installs to /usr/lib64/qt6/plugins/kf6/krunner/
2026-07-05 23:30:09 +02:00
Levi Neely f4b5ce3ea0 phase 4: plasma widget (plasmoid)
- QML plasmoid with session list, live chat view, inline prompt input
- C++ QML plugin (OllieDBusClient) for D-Bus interaction
- Real-time updates via D-Bus signals (ChatUpdated, StateChanged)
- State indicators: ○ idle, ● thinking, ⚡ calling tool
- Auto-scroll chat, interrupt button, new session button
- Makefile: plasmoid-install/uninstall targets for local dev
2026-07-05 23:17:09 +02:00
Levi Neely 238efabcb5 phase 3: system tray icon
- KStatusNotifierItem with status indication (passive/active/attention)
- Tooltip: session count and active count
- Right-click menu: New Session, Sessions submenu (per-session kill),
  Stop All, Quit Daemon
- Live updates via D-Bus signals (SessionCreated, SessionKilled,
  StateChanged)
- Builds as ollie-tray (104KB), links KF6StatusNotifierItem + Qt6
2026-07-05 22:50:42 +02:00
Levi Neely 318153493d phase 1: C API + D-Bus daemon skeleton
- lib/capi.go: 18 cgo exports wrapping ollie/core (session lifecycle,
  interaction, state queries, callbacks)
- daemon/: Qt6 D-Bus service (org.ollie.SessionManager) bridging C API
  to D-Bus methods/signals
- Makefile: orchestrates Go c-shared build then CMake build
2026-07-05 22:41:16 +02:00