Skip to content

[app][plugins] Annotate any block: anchored comments on a snapshot, sent to agents in batches (working plugin prototype) #51

Open

Description

@hyper-stition

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):

  1. 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.
  2. cx.browser:call fails 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.
  3. The 50 ms window-hook budget is used up by ordinary things: tern.process.run takes about 41 ms just to start cmd.exe (so no clipboard read from a command), and require took 15-29 ms per small module against 1.5-6 ms to compile the same source with loadstring. 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)

Proposal

  1. 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.
  2. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions