Commit Graph

17 Commits

Author SHA1 Message Date
Levi Neely 05dd33c1cf kate: remove git++ plugin integration
Use only Kate's built-in project git features. The reviewDiff action
now uses the active document text directly.
2026-10-09 12:13:01 +02:00
Levi Neely 83cae21957 kate: simplify diff review to git-based actions
Remove complex DiffWidget detection and context menu injection.
Add 'Review Staged Changes' and 'Review Unstaged Changes' to editor
context menu when in a git repo. Uses git diff directly.

-119 lines of code removed.
2026-10-09 12:11:44 +02:00
Levi Neely f822bf6c32 prompts: enforce terse output more aggressively
- Changed 'brief' to 'TERSE' with explicit one-sentence-per-action rule
- Added 'instant failure' framing for banned patterns
- Banned multi-sentence summaries explicitly
- Removed hedging allowances
- Simplified task completion to 'ONE sentence. Stop.'

Also: kate plugin diff widget detection with debug logging
2026-10-09 11:53:58 +02:00
Levi Neely e37d3b5c5b kate: simplify diff extraction from Kate's DiffWidget
Based on Kate source analysis (apps/lib/diff/diffwidget.*):
- DiffWidget uses DiffEditor children (QPlainTextEdit subclass)
- In Raw/Unified mode, editors contain the actual diff text
- Use looksLikeDiff() to identify which editor has valid diff

Simplified from multi-strategy approach to single focused method.
Removed unused QTextEdit and functional includes.
2026-10-09 11:25:19 +02:00
Levi Neely 0b09461dea kate: expose context actions as Q_INVOKABLE for cross-plugin triggering
Make the six context-menu action methods (askAboutFile, explainSelection,
submitSelectionPrompt, sendVerbatim, reviewDiff, startSession) public
Q_INVOKABLE so sibling plugins can trigger them by name via
QMetaObject::invokeMethod. The Deft radial menu uses this to offer an 'Ollie'
submenu when this plugin is enabled. No behaviour change for existing callers.
2026-10-09 10:54:51 +02:00
Levi Neely a4c659f591 kate: add Ollie context menu to project tree view
Right-click on files/directories in Kate's project panel now shows
Ollie actions:

For directories:
- Ask about directory (explain purpose/structure)
- Start Session Here

For files:
- Ask about file (explain purpose/design)
- Review file (code review)
- Write tests

Constructs file paths by walking up the tree model and joining with
the project base directory.
2026-10-09 10:51:35 +02:00
Levi Neely 1548af81af kate: find GitWidget's button bar and insert Ollie button there
The GitWidget delays initialization until showEvent. Find the
QHBoxLayout containing QToolButtons (the button bar) and insert
our button there, next to Commit/Push/Pull buttons.
2026-10-08 10:40:04 +02:00
Levi Neely b745170898 kate: add Ollie button to git tool view instead of context menu
The GitWidget creates local QMenu objects that can't be intercepted.
Instead, add a QToolButton with dropdown menu to the git tool view:

- Review Staged Changes
- Review Unstaged Changes
- Explain Selected Files

This approach doesn't require Kate source modification.
2026-10-08 10:36:27 +02:00
Levi Neely c3782dd3b7 kate: fix git widget integration via ChildAdded event filter
The previous approach using QMetaObject::invokeMethod on gitWidget()
failed because that method isn't Q_INVOKABLE. The new approach:

- Find git tool view by object name or 'git' in name
- Install event filter to catch QEvent::ChildAdded
- When a QMenu child is added, connect to aboutToShow
- Add Ollie actions to the menu before it's shown

Also add retry timer for setupProjectGitWidget since the plugin
view may not exist at construction time.
2026-10-08 10:34:06 +02:00
Levi Neely a546b8721a kate: integrate with project plugin git widget and diff viewer
- setupProjectGitWidget(): Hook into kateprojectplugin's GitWidget
  via gitWidget() method, install event filter on tree view
- addOllieActionsToGitContextMenu(): Add 'Review Staged Changes' and
  'Ask About Selection' to the git widget's context menu
- reviewStagedChanges(): Get staged (or unstaged) diff via git process
- askAboutGitSelection(): Ask Ollie about selected files in git view
- onWidgetAdded(): Detect DiffWidget additions by shouldClose() method
- onDiffWidgetContextMenu(): Add 'Review This Diff' to diff widget
- reviewDiffFromWidget(): Extract diff from widget and send to Ollie
2026-10-08 10:29:12 +02:00
Levi Neely f7a52088db per-agent cwd override with session-level inheritance
- Agent cwd is optional; empty = inherit session cwd (the common case)
- Session cwd is required at creation and is the inheritance root
- toolsrv maintains agentCWD map, resolved per call from agent= field
- Override set via agent cfg (cwd=...) or ctl (cwd [<dir>|-])
- Agent.SyncCwdToToolServer re-pushes on every (re)connect
- GUI NewAgentDialog shows '(inherit: <sessionCwd>)' as placeholder
- proc_test.go covers per-agent cwd isolation
- Kate and acme scripts updated for new session/agent creation flow
- AGENTS.md documents the architecture
2026-10-07 15:14:04 +02:00
Levi Neely d5efe575ce consistent agent naming: parent:prefix convention
Agent names derived from cwd using parent:prefix format:
- /home/user/src/ollie -> src:ollie
- /home/user/proj/ABC-123_feature/repo -> abc-123:repo

Updates:
- Kate plugin: one agent per project, git root fallback if no project plugin
- acme-ollie-ensure: single 'acme' session, per-project agents
- ollie-session-here: single 'default' session, per-project agents

Also fixed write -> rdwr for session/agent creation endpoints
2026-10-07 14:39:47 +02:00
Levi Neely 1c02b50add proc events, bypass shortcuts, Kate session fix
Backend:
- Add proc.start/proc.exit events for background process lifecycle
- Add proc idx ctl command for machine-readable process listing (TSV)
- Add event.pub file for external event publishing
- Add ListProcsIdx to toolclient and toolsrv
- Fix bypass commands to use Setpgid for process group isolation

GUI:
- Add configurable bypass approval shortcuts (Ctrl+Y/Ctrl+N default)
- Add Keyboard Shortcuts section to Settings dialog
- Store shortcuts in theme.conf

Kate:
- Fix 'Start Session Here' - use rdwr for session/new endpoint
2026-10-07 14:22:44 +02:00
Ollie Agent 72239fe3d5 kde: remove KF5/Qt5 support, build KF6/Qt6 only
Drop the OLLIE_KF5 CMake option and the entire Qt5/KF5 build branch;
delete KF5-only assets (99-ollie-kf5.sh, ollie-actions-kf5.desktop);
collapse all QT_VERSION_MAJOR and KTEXTEDITOR_VERSION_MAJOR conditionals
to the KF6 path in the KRunner, Kate, KIO, and GUI sources; update
Makefile, README, and docs. Verified: KF6 configure + full build of
ollie-gui, krunner_ollie, ollie_kate, kio_ollie.
2026-09-29 16:44:12 +02:00
Levi Neely 8a1efe0907 session: require cwd, make agent cwd read-only, sanitize message history
Session creation now requires cwd= parameter (no fallback to daemon cwd).
Agent cwd is read-only — agents inherit from session, cannot override.

Frontends updated:
- NewSessionDialog: added Directory field with Browse button
- NewAgentDialog: removed Directory field
- createAgent(): removed cwd parameter
- Kate plugin: passes cwd when creating kate session
- Dolphin: removed cwd from agent/new call

Message history sanitization (backend.SanitizeMessages):
- Removes dangling tool calls (assistant with ToolCalls but missing results)
- Removes orphan tool results (tool message without preceding call)
- Applied before sub-agent context inheritance
- Applied before session persistence save
- Applied after compaction (defensive)

Includes unit tests for all sanitization cases.
2026-08-17 14:15:55 +02:00
Ollie Agent 68616cb247 update Kate integration prompts 2026-08-17 00:05:35 +02:00
Ollie Agent 1e0f9cacd0 Integrate KDE frontend into main repository 2026-08-16 15:08:33 +02:00