Skip to content

Add a native text selection assistant#1887

Draft
mimeding wants to merge 16 commits into
osaurus-ai:mainfrom
mimeding:selection-assistant-readiness
Draft

Add a native text selection assistant#1887
mimeding wants to merge 16 commits into
osaurus-ai:mainfrom
mimeding:selection-assistant-readiness

Conversation

@mimeding

@mimeding mimeding commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Captures selected text through macOS Accessibility when the focused field can be verified as safe, without changing the clipboard.
  • Adds a compact selection assistant with Summarize, Rewrite, Extract actions, and Ask commands. The selected text is attached to the draft and is never sent automatically.
  • Retains the existing assistant-message Copy action and does not modify text in the source application.

Privacy and safety

  • Shares one Accessibility text policy with Computer Use so secure-field and readable-role decisions cannot diverge.
  • Password, secure, unknown, unavailable, and unverified fields fail closed without posting Cmd+C when the source app is known.
  • Missing Accessibility permission has a distinct actionable result instead of being reported as an unverified field.
  • Synthetic Copy is reserved for the rare case where macOS cannot identify a source application; its bounded transaction restores the complete clipboard baseline or refuses to publish the capture.
  • Native and synthetic captures enforce the same 256 KiB UTF-8 limit.
  • Diagnostics include only the source application, character/byte counts, route, and typed outcome. Selected text is never logged.
  • The overlay opens at its UI deadline during native capture while preserving the short focus grace required after synthetic Copy.

Validation

  • swift test --package-path Packages/OsaurusCore --filter ClipboardContentDiagnosticsTests (35 tests)
  • bash scripts/i18n/check.sh
  • focused strict SwiftLint
  • git diff --check
  • unsigned Release CLI and app build with code signing disabled

Manual verification

  • Select text in TextEdit, invoke the configured chat hotkey, choose an action, review the generated draft, and send explicitly.
  • Verify missing Accessibility permission reports the required recovery action.
  • Verify empty selections, secure fields, and unclassified fields show typed outcomes without changing the clipboard.

@mimeding
mimeding marked this pull request as ready for review July 6, 2026 15:23
@mimeding
mimeding force-pushed the selection-assistant-readiness branch from 20bbac4 to 95dfe09 Compare July 11, 2026 01:57
@mimeding

mimeding commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Earlier validation completed successfully: focused diagnostics tests and SwiftLint passed, and CI run 29138348141 was green across test-core, test-cli, test-evals, shellcheck, and swiftlint. A current-main repair is now addressing delayed pasteboard updates and rapid repeated hotkey invocations before the PR is presented again for review.

@mimeding
mimeding force-pushed the selection-assistant-readiness branch from b4acb1f to 3162e97 Compare July 11, 2026 19:34
@mimeding
mimeding marked this pull request as draft July 11, 2026 19:35
@mimeding
mimeding marked this pull request as ready for review July 11, 2026 19:56
@mimeding
mimeding marked this pull request as draft July 12, 2026 02:49
@mimeding mimeding changed the title Add selection grab readiness diagnostics Add a native text selection assistant Jul 12, 2026
@mimeding
mimeding marked this pull request as ready for review July 12, 2026 03:12
@mimeding
mimeding marked this pull request as draft July 18, 2026 22:53
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.

1 participant