Commit Graph

2613 Commits

Author SHA1 Message Date
Levi Neely 9f69654d0c o: use slash separator in tui spawned commands
Slash is primary separator. Agent names may contain colons but
session names don't contain slashes, so slash is unambiguous.
2026-10-09 12:30:08 +02:00
Levi Neely 1d688d9944 o: sanitize agent name for tmux session too
Agent names like src:ollie need colon replaced with dash.
2026-10-09 12:29:14 +02:00
Levi Neely 9b063a24ce o: fix context parsing - slash is primary separator
Agent names may contain colons (e.g., src:ollie), so slash must
be the primary separator. Colon separator is only for the rare
case where session names contain slashes.

default/src:ollie now correctly parses as:
  session = default
  agent = src:ollie
2026-10-09 12:28:02 +02:00
Levi Neely aa939b0f84 o: fix tmux session targeting in tui command
Remove = prefix from tmux -t arguments - it doesn't work with
pane specifiers (:0.1). Also changed -g to -t for mouse option.
2026-10-09 12:24:35 +02:00
Levi Neely c30c75cea9 o: fix tui with session names containing slashes
- Sanitize tmux session name (replace / and : with -)
- Include agent name in tmux session for uniqueness
- Quote context arg in spawned o commands
- Use colon separator for robustness
2026-10-09 12:23:08 +02:00
Levi Neely e1d01716f3 o: support colon separator and quoted names in context arg
- session:agent works as alternative to session/agent
- Colon takes precedence (allows slashes in session names)
- Quoted arguments with spaces now work: o "my session:agent" prompt
- Removed set -- $* which broke quoted arguments
- Updated help with examples
2026-10-09 12:21:20 +02:00
Levi Neely 56f6d3c655 gui: add Peers button and peer management window
Canvas-based graph visualization of agents in current session:
- Nodes represent agents, colored by state
- Edges represent peer connections
- Drag nodes to reposition
- Click two nodes to toggle connection
- Double-click to start connecting
- Right-click for context menu
- Pan with middle mouse, zoom with scroll wheel
- Auto-layout arranges nodes in circle

9P API methods: listPeers, addPeer, removePeer, listAgentsInSession
2026-10-09 12:19:42 +02:00
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 fd6829479c gui: set minimum window size for KDE tiling
Add minimumWidth: 320 and minimumHeight: 240 to allow the window to
resize properly when tiled by KDE's window manager. Without explicit
minimums, Qt calculates implicit minimums from content that may be
too large for narrow tile slots.
2026-10-09 11:04:29 +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 2381ba4fbd prompts: add brevity constraints to all agent prompts
Added Output sections with explicit bans on narration, hedging, and
verbose summaries to all agent-*.md files:
- author, conductor, copilot, foreman, observer, panelist, reviewer, theo
- Strengthened existing Output sections in explorer, librarian, navigator, taskmanager

All agents now have consistent brevity guidelines.
2026-10-09 10:45:21 +02:00
Levi Neely dda056e3b1 prompts: explicit bans on verbose patterns
Added concrete examples of banned output patterns:
- Preambles (Great question!, I'd be happy to help!)
- Narration (Let me..., I'll now...)
- Hedging (It seems like, It appears that)
- Over-explaining and self-congratulation
- Summaries that restate what was just done

Added positive guidance: start with the answer, state task
completion in one sentence, end when information is delivered.

Models respond better to explicit prohibitions with examples than
to general instructions to 'be brief'.
2026-10-09 10:41:14 +02:00
Levi Neely 50ebcedb8a gui: support multiple concurrent bypass requests per agent
Frontend changes to match the backend's multi-request support:

- bypassResolved signal now includes the request ID
- ChatPane tracks pendingBypasses as a map (id -> request)
- onBypassRequested adds to the map; onBypassResolved removes by ID
- currentBypass shows the first pending request for the active agent
- Switching agents updates the banner to show that agent's pending request
- Approve/Deny now remove only the specific resolved request

This allows each agent to have multiple pending bypass requests without
blocking other agents, and the banner correctly shows requests only for
the currently active agent.
2026-10-09 10:21:09 +02:00
Levi Neely 5c0f463e4d session: add unit tests for concurrent bypass requests
Tests cover:
- Multiple concurrent pending requests from different agents
- BypassPendingByID lookup
- ResolveBypass removes only the resolved request
- ResolveBypass fails for non-existent ID
- Empty session has no pending requests
2026-10-09 10:17:37 +02:00
Levi Neely 412b8513e6 session: support multiple concurrent bypass requests
Previously a session tracked only one pending bypass request. If
agent A1 had a pending bypass, agent A2's bypass request would block
waiting to be read from toolsrv's channel, effectively blocking all
agents in the session.

Now bypassPending is a map keyed by request ID:
- SetBypassPending adds to the map instead of overwriting
- BypassPending returns all pending requests (slice)
- BypassPendingByID returns a specific request
- ResolveBypass removes from the map by ID
- 9P bypass file returns JSON array of all pending

The bypass loop reads requests continuously without waiting for
resolution, so multiple agents can have concurrent pending requests.
2026-10-09 10:16:17 +02:00
Levi Neely cc56fda862 gui: procs output panel resizable and toggle-able
- SplitView allows dragging the divider between process list and output
- Show/Hide Output button toggles output panel visibility
- View Output and double-click auto-show the panel if hidden
2026-10-09 09:43:25 +02:00
Levi Neely 9b8715d625 gui: increase procs output panel font size to 11pt 2026-10-09 09:42:27 +02:00
Levi Neely 16c5a4cd13 gui: procs window shows '(no output)' for empty output 2026-10-09 09:41:49 +02:00
Levi Neely 84d45d051b gui: procs window improvements
- Output panel always visible with placeholder text
- View Output clears panel before refreshing
- Added Dismiss button to close window
- Process list has fixed height, output panel fills remaining space
2026-10-09 09:40:55 +02:00
Levi Neely a5e2535b5a gui: replace context-dependent templates with skill loader
Removed 'Explain this', 'Fix the bug', 'Write tests', 'Summarize',
'Refactor', 'Add comments' — these require context from Kate which
isn't available in the GUI. Replaced with 'Load skills and tools...'
which inserts 'Load all required skills and tools, then ' into the
prompt for user to complete.
2026-10-09 09:36:39 +02:00
Levi Neely 94e5d76b5b agent: clarify in system-proc-background tag that output requires idle
The tag text now explicitly says output is injected when the agent is
IDLE (not making tool calls), not just 'when available'.
2026-10-08 18:48:58 +02:00
Levi Neely 35fefefdc7 prompts: clarify background output requires agent idle state
Background process output is only injected when the agent is idle.
If the agent keeps making tool calls, the output won't arrive until
the turn ends.
2026-10-08 18:47:57 +02:00
Levi Neely cdadcd7543 gui: _ is word delimiter for double-click selection
Double-click on snake_case selects one segment. B3 path expansion still
includes _ (isfilec charset), so paths expand fully.
2026-10-08 18:07:05 +02:00
Levi Neely e669be7b81 gui: include _ in isfilec for B3 path expansion
Paths like /path/to/snake_case_file.php:82 now expand fully on B3.
2026-10-08 18:06:17 +02:00
Levi Neely 445a5232c2 gui: B3 plumbs without selecting; _ included in word chars
B3 (right-click) on a word now plumbs it directly without visually
selecting it first. Double-click word selection includes underscores,
so snake_case selects the whole identifier.
2026-10-08 18:03:21 +02:00
Levi Neely 53a085f034 gui: exclude _ from word delimiters
Double-click word selection now stops at underscores, so snake_case
identifiers select one segment at a time.
2026-10-08 18:00:05 +02:00
Levi Neely 8147b3885f gui: use TapHandler for double-click pair selection
MouseArea's onDoubleClicked doesn't fire when placed on a TextEdit with
selectByMouse:true — the TextEdit's internal mouse handling consumes the
events. TapHandler coexists with TextEdit's mouse handling and reliably
receives double-tap events.

Double-click on a bracket or quote delimiter now selects the content
between the matching pair. Quotes use parity to decide opener/closer
direction. Falls back to word selection when no delimiter is adjacent.

Works in chat blocks (mainTextEdit, textComponent) and prompt textarea.
2026-10-08 17:57:40 +02:00
Levi Neely 840723de3b gui: fix coordinate mapping for prompt textarea double-click
The MouseArea (chordArea) is a sibling of the ScrollView containing
promptInput, so mouse.x/y are relative to the parent Item, not the
TextArea. Map coordinates via mapToItem before calling positionAt.
2026-10-08 17:49:53 +02:00
Levi Neely 7cfd472193 gui: shared TextSelection.js for bracket/quote pair selection
Extract selectBracketPair, selectWordAt, and helpers into TextSelection.js
and import it in both ChatBlockDelegate.qml and ChatPane.qml. Prompt
textarea now has the same double-click behavior as chat blocks:
delimiter adjacent to cursor -> select pair content, else -> word select.

Quotes use parity to decide direction and scan document-wide, so
multi-line content between the pair is selected in full.
2026-10-08 17:47:05 +02:00
Levi Neely 794cecfa6c gui: quote-pair selection spans full document, not one line
Quote matching now scans the whole block text and computes opener/closer
parity document-wide, so content between a '' "" `` pair that spans
multiple lines is selected in full. The adjacent quote (left or right of
the cursor) sets the direction; the matching end quote is found by
scanning that way.
2026-10-08 17:42:50 +02:00
Levi Neely 4b2c14943d gui: do word select ourselves on double-click
The overlay MouseArea swallows the B1 double-click, so returning
mouse.accepted=false did not make the TextEdit perform its native
word select — a non-delimiter double-click selected nothing. Now the
handler selects the word directly via selectWordAt when no bracket or
quote pair is under the cursor, so double-click is deterministic:
delimiter -> pair select, otherwise -> word select.
2026-10-08 17:37:03 +02:00
Levi Neely 5170361e90 gui: fix chat block binding loop breaking rendering
The Item wrapper added in 1cfa424 set height: mainTextEdit.height while
the TextEdit used anchors.fill: parent, so the TextEdit height depended
on the Item height and vice versa. The resulting binding loop collapsed
the block layout into visual garbage. Size the TextEdit from
width: parent.width and let its content height drive the Item.
2026-10-08 17:33:41 +02:00
Levi Neely 86977b3ca3 gui: extend double-click pair selection to quotes
selectBracketPair now also handles '' "" `` quote pairs. Since a
quote char opens and closes with the same glyph, a quote to the right
of the cursor scans forward for its match, and a quote to the left
scans backward.
2026-10-08 17:30:34 +02:00
Levi Neely 1cfa424220 gui: bracket-pair selection on double-click
Double-clicking next to a bracket (()[]{}) selects the text between
the matching pair, including nested pairs. Falls through to the
default word-select when no bracket is adjacent.

Also: B3-click on word now highlights it before plumbing.
2026-10-08 17:23:16 +02:00
Levi Neely 36e8b0abd3 gui: fix B2/B3 mouse handling in editable TextEdit
Handle events in onPressed instead of onClicked so they work
with editable text. Remove propagateComposedEvents since we
want to intercept middle/right clicks completely.
2026-10-08 16:23:12 +02:00
Levi Neely b119668965 gui: B3-click on word expands to file path (acme-style)
RMB on text without selection now expands to the word at cursor using
acme's isfilec character set: alphanumeric + . - + / : @

This matches acme behavior for clicking on file paths like foo.go:42
2026-10-08 16:20:29 +02:00
Levi Neely 5bf29198ff gui: pass session cwd as plumb wdir for relative path resolution
Plumb messages now include the current session's cwd as wdir.
Added sessionCwd() helper to ChatPane and ChatBlockDelegate.
Updated plumber.plumb() to accept optional wdir parameter.
2026-10-08 15:44:39 +02:00
Levi Neely 5add387cc8 gui: suppress RMB context menus in prompt and chat blocks
B3 (right-click) now only plumbs selection when available — no fallback
context menu. Mouse chording (B1+B2 cut, B1+B3 paste) still works.
Removed contextMenuComponent and promptContextMenu entirely.
2026-10-08 15:40:31 +02:00
Levi Neely fa58b0f033 gui: make chat block text editable for scratchpad use
Remove readOnly from TextEdit components in ChatBlockDelegate.
Users can now edit text in-place — changes are local only, not persisted.
2026-10-08 15:35:37 +02:00
Levi Neely 9618c79232 gui: native 9P plumb client with edit receiver and mouse chording
Replace QProcess plumb binary shell-out with proper 9P2000 plumb client:
- ninep.h/cpp: minimal 9P2000 protocol client for plan9port plumber
- plumbmsg.h/cpp: plumb message pack/unpack wire codec
- plumber.h/cpp: full plumb client with:
  - socketPath() resolving $NAMESPACE/plumb or display fallback
  - send()/sendTo() write packed messages to send port via 9P
  - PlumbReader thread blocks on edit port, emits edit(file,addr,wdir)
  - startReader() starts the receive loop
  - available() checks plumb socket existence

Add Acme-style mouse chording to ChatBlockDelegate.qml:
- B1+B2 = cut (snarf)
- B1+B3 = paste
- Context menu now includes Cut/Paste with chord hints

Legacy plumb()/plumbTo() methods preserved as aliases to send()/sendTo().
2026-10-08 15:34:29 +02:00
Levi Neely 4774cb9fe9 gui: convert ProcManager to separate Window, sync to active session
- Convert from Dialog to Window (not modal, separate window)
- Title shows current session name
- Syncs to activeSessionId/activeAgentId changes in main window
- Header shows which session is being displayed
- Double-click row to view output
- Sort processes by PID descending (newest first)
- Clear selection when session changes
2026-10-08 14:57:25 +02:00
Levi Neely 491f5ff2ae gui: add 'Open Workdir' context menu for sessions and agents
- Add openDirectory() method using QDesktopServices::openUrl
- Session context menu: opens session cwd
- Agent context menu: opens agent's effective cwd
2026-10-08 13:38:29 +02:00
Levi Neely af21dfa770 kde: remove KF5 .protocol file, use KF6 JSON metadata
The ollie.protocol file was being installed to kservices5/, which is
the KF5 mechanism. KF6 KIO workers embed protocol metadata in the
plugin's JSON file (ollie.json), which we already have.

Remove:
- kio/ollie.protocol file
- CMake install rule for .protocol file

Manual cleanup needed: sudo rm -rf /usr/local/share/kservices5/
2026-10-08 12:24:48 +02:00
Levi Neely 01360b961d gui: add process manager dialog
- Add procStarted signal to Ollie9pClient for proc.start events
- Add listProcs(), procTerm(), procKill(), procOutput() methods
- Create ProcManagerDialog.qml showing background processes for
  the active session/agent with status, runtime, commands
- Add 'Procs' button to action toolbar to open the dialog
- Auto-refresh every 2 seconds when dialog is visible
- Support terminate, kill, and view output actions
2026-10-08 12:14:02 +02:00
Levi Neely 414dae05f8 dispatch: include no-wait instruction in system-proc-background
Every background process emission now includes:
'Do NOT sleep, poll, or wait. Continue with other work —
output will be injected automatically when available.'
2026-10-08 11:21:40 +02:00
Levi Neely 8da78f4deb prompts: never sleep/poll/wait for background processes
Add explicit instruction that models must not use sleep, loops,
or any blocking mechanism to wait for background process output.
The system injects updates automatically.
2026-10-08 11:13:54 +02:00