Repository navigation
Description
What I want
A built-in way to comment on a passage of any block (an omp reply, a file, a web page, a terminal) and send those comments to an agent later. Select a passage, pick edit request / question / note / to-do, write a line. Edit requests stay as drafts and are sent to the agent on demand or as one batch. Questions are answered in a side thread (Carly) without touching the main conversation. To-dos go to a board. Comments persist, thread, and re-attach to the text if it changes.
Why it matters
Agents produce a lot of text and most of it is nearly right. Fixing one paragraph today means retyping a prompt that quotes it, once per paragraph, while I'm still reading. I'd rather read, leave anchored comments as I go, and send them together, like a PR review: draft comments, then "submit review". It also keeps passing remarks out of the main agent thread, and stops generated documents piling up in the folder because there is nowhere to say "this bit is wrong" without writing another file.
Why it has to come from Tern
Related to #44, same cause. Measured on Tern 0.8.3 (e2b8656), Windows 11 (10.0.26200):
- Selection and the context menu are Tern's own. A plugin can't read the selection of a terminal, chat, file or browser block, or add a right-click entry there. My prototype makes you copy the text and paste it into a prompt.
cx.browser:callfails with "browser automation needs Tern on macOS or Linux", so a plugin can't read a page on Windows. The prototype fetches the page's address and strips the HTML, which misses anything JavaScript renders.- The 50 ms window-hook budget is used up by ordinary things:
tern.process.runtakes about 41 ms just to startcmd.exe(so no clipboard read from a command), andrequiretook 15-29 ms per small module against 1.5-6 ms to compile the same source withloadstring. One overrun disables the hook until reload. The prototype is therefore split into small modules, loaded one per timer tick after startup, with a watchdog that reloads the plugin when its timers stop.
What already exists (so this isn't a duplicate)
- A working prototype, MIT: https://github.com/hyper-stition/tern-annotate. A review panel per block (a
cx.canvas), four comment kinds, reply threads, send modes (manual, immediately, batched), Refresh re-attaching comments by unit id then by quote, Carly answering questions through a plugin export, to-dos throughcx.board. It is a prototype: on my window a hook still occasionally trips the budget and gets disabled. - [app] Reply with selection: quote selected transcript text into the omp composer #44 asks for quoting a selection into the composer, which is the single-comment case of this.
Proposal
- Native: a Comment action on a selection in any block (popup or context menu), a per-block list of comments, and "send drafts to agent" as a batch. The prototype is a reference for the data model: units plus quote-anchored comments with states open, sent, applied, resolved.
- If not native, then plugin API: the selected text for a block or context-menu action (as in [app] Reply with selection: quote selected transcript text into the omp composer #44), context-menu entries from plugins for non-plugin blocks, page text for browser blocks on Windows, and a budget that doesn't count module compile time.
@can1357, could you consider this as a Tern feature? You're welcome to use the prototype code however you like.
Activity