Skip to content

Add Notes smart folders, tags and note links - #351

Merged
mattt merged 11 commits into
mattt:mainfrom
oliverames:feat/notes-topotext-phase3
Nov 20, 2026
Merged

mattt merged 11 commits into
mattt:mainfrom
oliverames:feat/notes-topotext-phase3

Conversation

@oliverames

@oliverames oliverames commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Builds on mattt/TopoText#3 (open, draft) to read smart folders, tags and note links from the Notes database.

It adds notes_smart_folders and notes_tags. It also adds keywords and linkedNotes to notes_fetch and notes_read, plus linkedFrom backlinks on notes_read.

Not mergeable until TopoText#3 is released. For now the package points at my TopoText fork branch (oliverames/TopoText), so this waits on a TopoText release; the dependency should be pointed back at mattt/TopoText then. It also raises the deployment target from 15.0 to 15.1 for TopoText. Its notes_tags overlaps the one in #337 and should replace it.

What changed

  • Notes.swift: the new tools and fields above. NotesInline.swift: reading inline tags and links from note content.
  • Package pin and project file updated for the TopoText dependency.

Testing

  • NotesInlineTests covers the inline tag and link parsing.
  • CI: both jobs pass (macOS 26 with Xcode 26.0 and macOS 27 with Xcode 27.0). Each runs lint, a Debug build and the imcp-serverTests suite.

Not verified

  • I have not run this against my real notes.
  • The tools have not been called through a client against a live Notes store.

Oliver Ames added 2 commits November 16, 2026 18:04
Add notes_smart_folders and notes_tags (from TopoText's tag records, no note
decoding), keywords and linkedNotes on notes_fetch and notes_read, and
linkedFrom on notes_read. TopoText now comes from oliverames/TopoText on
feat/smart-folders-tags-links until it is released.
@oliverames
oliverames marked this pull request as ready for review November 18, 2026 18:26
mattt/TopoText#3 is merged and released as 0.3.0, so the package reference moves from the fork's branch to that release.
oliverames pushed a commit to oliverames/iMCP that referenced this pull request Nov 20, 2026
@mattt
mattt merged commit 858c025 into mattt:main Nov 20, 2026
2 checks passed
@oliverames
oliverames deleted the feat/notes-topotext-phase3 branch November 20, 2026 21:34
oliverames pushed a commit to oliverames/iMCP that referenced this pull request Nov 20, 2026
# Conflicts:
#	App/Services/Notes.swift
#	iMCP.xcodeproj/project.pbxproj
oliverames pushed a commit to oliverames/iMCP that referenced this pull request Nov 20, 2026
oliverames pushed a commit to oliverames/iMCP that referenced this pull request Nov 21, 2026
oliverames pushed a commit to oliverames/iMCP that referenced this pull request Nov 23, 2026
oliverames pushed a commit to oliverames/iMCP that referenced this pull request Nov 24, 2026
mattt pushed a commit that referenced this pull request Nov 24, 2026
* Notes: read filters, accounts, stats, tags, and attachment listing

* Notes: create notes and folders behind Allow writes

* Bound Notes metadata scans, drop duplicate entitlement and html format, leave notes_tags to #351

* Address Mattt's review of the Notes tools

Mattt's pre-merge findings on #384:

- The scan budget counts the notes the search examined
  (scannedNoteCount), not the notes it returned, and the page request is
  capped by what is left of the budget, so a text query with few matches
  cannot scan far past it.
- Unreadable notes are reported whether or not they matched, so the
  warning is not dropped for a plain text search.
- Tag filters read the same database tag records that keywords does, and
  keywords is no longer overwritten by tags parsed from the note text.
- The Markdown table converter does not pad a short row to the header's
  width.
- TagTally and its test are gone; notes_tags uses the database records.

The filters now run inside notes_fetch's snapshot, alongside the search,
instead of in a second pass over the results.

* Notes: cap scanLimit by the budget, dedup unreadable IDs, resolve created ids, balance link parens

- notes_fetch search is now searchNotes over a NoteSearchSource, so tests drive it; each request's scanLimit is capped by the remaining scan budget
- unreadable note IDs are reported once; a tag filter throws when tag records can't be read
- notes_create and notes_create_folder return the scripting id as scriptIdentifier and the database id as identifier only when one note or folder matches
- Markdown link targets keep balanced parentheses
- README: drop the stale create and smart folder sentence; the 2,000-note budget covers every notes_fetch scan

* Test that a link address with parentheses survives where the label repeats it

* Cap Markdown link nesting, stop scanning a line with no closing bracket, test unreadable notes that don't match

* Match Markdown brackets, parentheses and emphasis runs in one pass

---------

Co-authored-by: Oliver Ames <[email protected]>
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.

2 participants