Repository navigation
Idea: programmatic composer draft text + programmatic composer attachments for plugins #5055
Replies: 6 comments
|
Additional finding while testing this on app/daemon 0.8.0: The composer attachment picker does not re-run the source search when it is reopened. It keeps serving the results cached from the first search of the session and only re-queries when the search text changes. Concrete reproduction with our plugin:
Expected: reopening the picker (or opening it in a different workspace/agent) re-runs the source search, so scope-sensitive sources can return per-agent results. Related: the search RPC payload is Both points together would make attachment sources usable for per-agent dynamic drafts. |
|
Second upstream finding from the same plugin: plugins cannot reuse the app's compiled react-native-uitextview for native selection. To get iOS-style word-level selection in plugin-rendered paragraphs, I vendored the library's JS (the native RNUITextView/RNUITextViewChild components are already compiled into the host app, so no new native code is needed). The codegen module then attempts
because the app has already registered them from its own copy of the library. There is no way to reuse the existing registration from plugin code. Two possible upstream accommodations:
Until then, plugin-rendered text can only offer block-level or per-word |
|
Confirming this from a second, independent attempt — and adding one finding that narrows the root cause to the client capability surface. I tried to build exactly API #1 (
A minimal addition that would cover both this discussion and #2926:
The attachment half of your proposal is the harder one, and I think it needs the canonical-message fix rather than just composer wiring: in 0.9.1 the timeline's Reference: I can share the throwaway plugin source if it is useful as a negative-result repro, though it does not do anything you cannot already do better in |
|
Another use case for My team keeps its workflow in a set of agent skills with a shared prefix ( The missing piece is what happens when you pick a skill. The plugin can only send it straight to the agent. That has two problems:
With Inserting at the cursor would also work for this. Replacing the whole draft is enough if the API is limited to an empty composer. |
|
Merged PR #8744 lets your review plugin put editable text into the composer and attach pending comments directly, without the clipboard or attachment-picker round trip. This covers the original composer request; the picker-refresh and native text-selection reports above remain separate. |
|
For your review plugin, merged PR #9207 adds |
Uh oh!
There was an error while loading. Please reload this page.
Context
I built a client+daemon Paseo plugin (paseo-inline-review, public) that lets a user comment on assistant responses inline in the timeline: tap a paragraph, write a comment, and the collected comments are attached to the next message as a review.
Three separate friction points come from one root cause: the composer is fully app-owned and plugins have no programmatic way to contribute to it.
What works today
What's missing
Writing text into the composer — there is no way for a plugin to place editable text in the message textbox. The common workaround is clipboard + manual paste, which works but adds a step and loses the "draft you can edit before sending" experience.
Programmatic composer attachments — attachment sources are search+select by design, so even a single known draft requires the user to open the attachment menu, open the picker, and click the item. A plugin that has already assembled a draft cannot push it as a pill; it can only serve it through the picker.
Proposal
Sketch-level; happy to adjust to whatever fits the existing composer ownership model:
client.setComposerDraft({ workspaceId, agentId, text })(and/or auseComposerDraft()hook) that fills the composer's editable text for the next message. App keeps full ownership of drafts, focus, and submission.client.attachDraft(...)) to push a draft item directly as an attachment pill, skipping the picker when the plugin has exactly one ready-to-attach draft.Why this matters
Review-style plugins (and any workflow that produces structured context the user should see and edit before sending) are blocked at the last step today: the plugin can generate content, but only place it in the clipboard or send it out-of-band. Both APIs keep the app's ownership model intact — they would only be additional inputs the app renders and the user remains in control of.
Tested on app/daemon 0.8.0, plugin SDK 0.8.0/0.9.0-beta.2. Happy to provide the plugin source as a reference implementation and to test any proposed contract.
All reactions