Skip to content

Read resource text, Spanish references, license-aware catalog, user documents (+3 fixes) - #12

Open
prcontreras23 wants to merge 10 commits into
robrawks:mainfrom
prcontreras23:feat/read-text-spanish-documents
Open

prcontreras23 wants to merge 10 commits into
robrawks:mainfrom
prcontreras23:feat/read-text-spanish-documents

Conversation

@prcontreras23

Copy link
Copy Markdown

Summary

Six commits that make the server useful for actually reading the library and for Spanish-speaking users, plus three bug fixes found along the way. 24 → 30 tools, 133 → 155 tests, all passing.

New: read resource text (macOS)

  • read_panel_text — Logos resource files are encrypted (LRES01) and the CEF reader panel has no accessibility tree and no Select All, so the only text path is the app itself: a small Swift CGEvent helper drag-selects the visible panel, Cmd+C copies it, and the clipboard is returned together with the citation block Logos appends (%T/%E/%I/%D/%P). pages scrolls with Page Down and merges screens (overlap removed); panel picks left/right/largest when several panels are open.
  • read_resource_atopen_resource + wait + read_panel_text in one call.
  • Quirks handled (documented in code): Logos keeps the selection after copy and a drag starting on selected text becomes drag-and-drop, so the tool retries and clears the selection afterwards; CGWindowList exposes phantom Logos windows that overlap real panels, filtered by overlap.
  • All "SIDE EFFECT ONLY" tools now tell the model to follow up with read_panel_text.

New: Spanish references + default Bible

  • Reference parser accepts Spanish book names and Reina-Valera abbreviations (accent-insensitive) without shadowing existing English aliases.
  • Passages are normalised to English before hitting the Biblia API (it only knows English names).
  • LOGOS_DEFAULT_BIBLE env var overrides the LEB default.

New: catalog license/language filters

  • Availability = 2 = licensed/downloaded, 3 = in catalog but not owned (verified against titles the user confirmed not owning and against the resource files on disk). get_library_catalog / get_resource_types default to licensed resources and accept language.

New: user documents

  • get_sermons / get_sermon (Sermon Builder, rendered as Markdown with passage references), get_reading_plans (schedule + progress), get_passage_lists.

Fixes

  • Bible book numbering: Logos numbers the deuterocanon 40–60 and the NT 61–87 (verified: bible.61.7.16 = Matthew 7:16). The table had Matthew = 40, so every NT anchor in get_user_notes was mislabelled. Existing tests updated to the real scheme.
  • Reading-plan status join: ReadingPlanStatus.SyncId is the plan's ScheduleId stored as a .NET mixed-endian GUID blob.
  • better-sqlite3 11 aborts under Node 24 (RemoveEnvironmentCleanupHook assertion when a closed Database is GC'd) — bumped to ^12.

Test plan

  • npm test — 155 passing
  • Live on macOS / Logos v48: read_resource_at on a Spanish commentary at 1 Corintios 1:10, 3 screens, citation parsed
  • get_bible_text "Romanos 8:28" with LOGOS_DEFAULT_BIBLE=RVR60
  • Catalog: known-unowned titles hidden by default, shown flagged with licensed_only=false
  • 183 sermons / 28 reading plans (progress correct) / 60 passage lists read from a real profile
  • Windows: read_panel_text / read_resource_at return a clear "macOS only" error there (not tested on a Windows machine)

🤖 Generated with Claude Code

prcontreras23 and others added 10 commits September 6, 2026 15:47
…t + clipboard

Logos resources (.logos4) are encrypted and the CEF reader panel has no
accessibility tree or Select All, so the only text path is a synthetic
mouse drag (Swift CGEvent helper) + Cmd+C + pbpaste. Returns the text and
the citation block Logos appends. Supports multi-screen reads (pages),
panel selection (left/right/largest/index) and an automatic retry, since
a drag starting on an existing selection becomes a drag-and-drop.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- reference-parser: accept Spanish book names and Reina-Valera
  abbreviations (Romanos, 1 Co, Sal, Hch, Stg…), accent-insensitive,
  without shadowing existing English aliases (Judg vs Jud, Is, etc.)
- biblia-api: normalise passages to English before calling Biblia, which
  only understands English names; unparseable input passes through
- config: LOGOS_DEFAULT_BIBLE env var overrides the LEB default
- tool descriptions and README updated; 6 new tests (139 total)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The catalog mixes owned resources with ones merely available for purchase.
Verified against titles the user confirmed not owning: Availability = 2
means licensed/downloaded (matches the files on disk), 3 means not
licensed. get_library_catalog and get_resource_types now default to
licensed resources, flag unlicensed ones when asked to include them, and
accept an ISO language filter. Results include languages and license
status. 2 new tests (141 total).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
New documents-reader service and four tools: get_sermons (list + full-text
search), get_sermon (outline rendered as Markdown with passage references
and sources), get_reading_plans (schedule and progress, next unread
reading) and get_passage_lists (decoded reference lists).

Fixes found along the way:
- Bible book numbering: Logos puts the deuterocanon at 40–60 and the New
  Testament at 61–87 (verified against sermon passage blocks), so every NT
  anchor in get_user_notes was mislabelled. Table corrected, tests updated.
- Reading-plan status joins on the plan's ScheduleId stored as a .NET
  mixed-endian GUID blob; converted accordingly.
- better-sqlite3 11 aborts under Node 24 when a closed Database is garbage
  collected (RemoveEnvironmentCleanupHook assertion); upgraded to ^12.

150 tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- read_resource_at: open a resource at a passage, wait, then read N
  screens with read_panel_text — one call instead of two.
- panel-text: mergeOverlap() removes the text a Page Down leaves visible
  from the previous screen when joining pages.
- Every side-effect-only tool now says how to read what it opened
  (read_panel_text / read_resource_at) instead of pointing only at
  screenshots. 5 new tests (155 total). README updated.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…v1.1.0

- ui-lock: every tool that drives the Logos UI (drags, keystrokes,
  logos4:/logosres: dispatches, screenshots) now runs under one in-process
  lock, so concurrent MCP calls cannot interleave on screen. Composite
  read_resource_at takes the lock once for open → wait → read.
- panel-text: when no panel window is distinguishable and we fall back to
  the main window, skip the icon sidebar so the drag cannot click a
  sidebar button; re-check that Logos is frontmost before every page and
  every drag (keystrokes go to the frontmost app); report when fewer
  screens were read than requested.
- deps: @modelcontextprotocol/sdk 1.26 → 1.30 and npm audit fix — the 8
  transitive advisories (hono/express, unused stdio-only) are gone;
  engines node >=20 to match better-sqlite3 12.
- version 1.1.0; README tool counts and Node requirement updated.
- 2 new tests (157 total).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…OS_SIDEBAR_WIDTH)

The drag rectangle was hard-coded to Logos v48's panel chrome. Offsets from
the panel edges can now be set as top,left,right,bottom pixels; malformed
values fall back to the measured defaults, a degenerate rectangle raises a
clear error naming the current offsets, and LOGOS_DEBUG=1 prints the panel
and rectangle used for calibration. README documents the knobs. 3 new tests
(160 total).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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