Skip to content

feat(agent-gui): accept external captures in chat drafts - #170

Closed
CCshpeech wants to merge 2 commits into
AIDotNet:mainfrom
CCshpeech:feat/external-capture-draft
Closed

CCshpeech wants to merge 2 commits into
AIDotNet:mainfrom
CCshpeech:feat/external-capture-draft

Conversation

@CCshpeech

@CCshpeech CCshpeech commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #155

What

Adds an opt-in local receiver so a screenshot tool can put a capture and its context into a chat draft, like "capture a window and hand it to the agent" in other coding tools.

  • Settings → General → Accept external captures, off by default. Turning it off closes the listener.
  • On macOS, Octopus listens on a Unix socket under the data directory (0700 directory, 0600 socket, peer user-ID check).
  • One message = versioned JSON (version, source, context, optional cardBounds request) + PNG, with size limits (2 MB metadata, 40 MB PNG, 24 MP). Malformed messages are rejected.
  • The capture goes to the most recently used, still-open GUI chat that accepts images, as a thumbnail card. Existing draft text and attachments are kept. Removing the card removes its context; on Send the agent gets the original PNG and the full context.
  • Octopus brings its window forward (also from minimized, tray-hidden or another Space) and selects that chat. If the client asks, the reply includes the card's screen rectangle once the window and layout have settled, so the client can animate on its own side.
  • If there is no eligible chat, the capture is rejected and the client keeps it.
  • While the listener is running, a small template octopus icon appears in the macOS menu bar (separate from the existing Octopus tray icon, which is unchanged). It switches to a check mark for ~1.7 s when a capture lands in a draft, and its menu toggles the setting or opens it. It disappears when the setting is off or the listener fails. (Second commit — easy to drop if you'd rather not have it.)

Protocol: docs/external-capture.md. Not tied to any particular capture tool.

Scope

macOS only for now; on Linux and Windows the receiver never starts and the setting is hidden.

Testing

  • dotnet build passes; new tests (20 cases) cover parsing, limits, permissions, card add/remove, send payload and replies, plus menu-bar icon tests (visibility follows the setting and listener state, check-mark timing, menu actions).
  • Manual on macOS with an isolated profile and a small reference client: card appears, × removes card and context, Send delivers the PNG (hash matches) and full context; minimized / tray-hidden / other-Space cases restore the window and return correct coordinates.
  • Full suite: the failures I saw also occur on unmodified main or pass when re-run on their own.

Happy to adjust naming, the default, the transport, or split it up if you'd prefer.

Add an opt-in macOS socket for versioned PNG captures with context. Keep the image and its context together in the draft and return thumbnail coordinates when requested.

Co-Authored-By: GPT-6.2 sol via Codex
Use the OctoScope vector templates in a compact AppKit status item. Reflect the listener state, confirm accepted drafts, and open the capture settings from the status menu.

Co-Authored-By: GPT-6.2 sol via Codex
@CCshpeech

Copy link
Copy Markdown
Contributor Author

Closing this for now — I'm reworking it into a fuller PR that also bundles the capture tool, so the feature works out of the box without a separate app. I'll link the new PR here and in #155.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: let external screenshot tools add a capture and context to a chat draft (macOS)

1 participant