feat(connectors): Apple ecosystem connectors — @notes and @icloud#45
Open
ojowwalker77 wants to merge 2 commits into
Open
feat(connectors): Apple ecosystem connectors — @notes and @icloud#45ojowwalker77 wants to merge 2 commits into
ojowwalker77 wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 NotesSearch Notes by title, pick one, and its text renders into the prompt. Notes.app has no public framework, so
NotesServicedrives it over Apple Events (JXA) viaosascript— the same shell-out path@browser/@finderuse, so it works under the hardened runtime with only the one-time Automation TCC grant.byIdrender with a linear-scan fallback.@icloud— iCloud DriveSearch 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@finderdeliberately excludes.FinderServicerendering via a newheadingparam (labeled "iCloud Drive").@finderexcludes (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 testgreen (44) — added token round-trips for both connectors,@notesscan-from-prose, and HTML flattening.@notessearch/render and@icloudmdfindsearch were also validated live against the real apps on macOS 26.