Skip to content

feat(connectors): Apple ecosystem connectors — @notes and @icloud#45

Open
ojowwalker77 wants to merge 2 commits into
release-1.2.3from
claude/blissful-mclaren-6b48d5
Open

feat(connectors): Apple ecosystem connectors — @notes and @icloud#45
ojowwalker77 wants to merge 2 commits into
release-1.2.3from
claude/blissful-mclaren-6b48d5

Conversation

@ojowwalker77

Copy link
Copy Markdown
Owner

Adds two local connectors in the existing @-mention family (search → chip → render into the compiled prompt at copy time). Both read the Mac directly — no entitlements (the app isn't sandboxed).

@notes — Apple Notes

Search Notes by title, pick one, and its text renders into the prompt. Notes.app has no public framework, so NotesService drives it over Apple Events (JXA) via osascript — the same shell-out path @browser/@finder use, so it works under the hardened runtime with only the one-time Automation TCC grant.

  • Title-only search (scanning every body's HTML is slow on large accounts); results surface the folder name, so a Recently-Deleted note reads as such (trash folder is localized — no locale-proof exclude).
  • WebKit-free HTML→text; byId render with a linear-scan fallback.

@icloud — iCloud Drive

Search iCloud Drive by filename via Spotlight (mdfind, scoped to the CloudDocs container), pick a file/folder, and its path + contents render into the prompt. A sibling of @finder, but scoped to ~/Library/Mobile Documents/com~apple~CloudDocs, which @finder deliberately excludes.

  • Reuses FinderService rendering via a new heading param (labeled "iCloud Drive").
  • Filters the same dev cruft @finder excludes (node_modules, .git, .build, DerivedData, …) — needed because a synced code folder or Desktop & Documents drags those into iCloud Drive.

Wiring (both)

AppReference (token codec), MentionToken (catalog + On-this-Mac category), AppConnectors (registry), MentionStyle (Notes.app icon), SemanticLintService (resolved-connector switch + lint hints).

Tests

swift test green (44) — added token round-trips for both connectors, @notes scan-from-prose, and HTML flattening. @notes search/render and @icloud mdfind search were also validated live against the real apps on macOS 26.

Search Apple Notes by title and pull a note's text into the compiled
prompt at copy time, mirroring the @notion connector. Notes.app has no
public framework, so NotesService drives it over Apple Events (JXA) via
osascript — the same shell-out path @browser/@finder use, which keeps it
working under the hardened runtime without an apple-events entitlement
(only the one-time Automation TCC grant).

- New: NotesService (bulk title/id/date fetch, per-hit folder lookup,
  byId render with a linear-scan fallback, WebKit-free HTML→text).
- Wire @notes through AppReference (token codec), MentionToken (catalog,
  On-this-Mac category), AppConnectors (registry), MentionStyle (Notes.app
  icon), and SemanticLintService (resolved-connector switch + lint hints).
- Tests: token round-trip, scan-from-prose, HTML flattening.

Search matches titles only (scanning every body's HTML is slow on large
accounts); results surface the folder name, so a Recently-Deleted note
reads as such (the trash folder is localized — no locale-proof exclude).
Type @iCloud, search your iCloud Drive by filename, pick a file or
folder, and its path + contents render into the compiled prompt at copy
time. A sibling of @finder, but scoped to the iCloud Drive container
(~/Library/Mobile Documents/com~apple~CloudDocs), which @finder
deliberately excludes.

- New: ICloudService — Spotlight (mdfind) search scoped to the CloudDocs
  container, with the same dev-cruft exclusions @finder uses (node_modules,
  .git, .build, DerivedData, …) since a synced code folder or Desktop &
  Documents drags those into iCloud Drive.
- Reuse: FinderService.render gains a `heading` param so @iCloud renders
  files/folders through the exact same path, labeled "iCloud Drive".
- Wire @iCloud through AppReference (token codec, reusing FinderReference),
  MentionToken (catalog, On-this-Mac), AppConnectors, and SemanticLintService.
- Test: @iCloud token round-trip.

No entitlement needed — the app isn't sandboxed, so the container is read
as an ordinary path.
@github-actions github-actions Bot added size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant