How immortal-protocols/lastbook works
Lastbook is an offline survival library for desktop, with a source-only iPad app. The desktop workflow is: a person opens the app, selects or installs library data, then uses the embedded interface to browse manuals and videos, explore maps, or ask questions; chat retrieves library passages and can optionally use a local model. Separate branches cover first-run downloads, saved video moments, address lookup, and updates. The iPad has its own library, installation, and API layers. Some connections are documented in the README or SOURCE INDEX; unsampled implementation details are not asserted.
Main entry points: server.py Request handler · app.js App interface · assistant.py Cited assistant · api.py Setup service
Components 26
Desktop app
- Desktop entry
app/main.py - Bridge and shells
app/bridge.py - App interface
web/app.js - Request handler
server.py
Library and discovery
- Library access
engine/library.py - Search retrieval
retrieval.py - Cited assistant
assistant.py - Local AI runner
llm_local.py - Offline encyclopedias
engine/encyclopedias.py - Address lookup
engine/address_search.py - Saved moments
engine/saved_pages.py
Setup and updates
- Setup interface
web/setup.js - Setup service
engine/setup/api.py - Checked downloads
engine/setup/download.py - Library installer
engine/setup/install.py - Hardware check
engine/setup/hardware.py - App updates
engine/update.py
iPad app
- iPad shell
mobile/ipad/Lastbook/Shell/LastbookApp.swift - iPad request router
mobile/ipad/Lastbook/Engine/Router.swift - iPad feature APIs
mobile/ipad/Lastbook/API/Routes.swift - iPad library
mobile/ipad/Lastbook/Engine/Library.swift - iPad install plan
mobile/ipad/Lastbook/Engine/Install/InstallPlan.swift - iPad installer
mobile/ipad/Lastbook/Engine/Install/Installer.swift - iPad install catalog
mobile/ipad/Lastbook/Engine/Install/InstallCatalog.swift - iPad map install
mobile/ipad/Lastbook/Engine/Install/MapInstall.swift
Other components
- Person
Connections 29
- Person → Desktop entry: opens
README.md - Desktop entry → Bridge and shells: opens shell
app/main.py - Bridge and shells → App interface: serves interface
README.md - App interface → Request handler: requests features
README.md - Request handler → Library access: reads library
server.py - Request handler → Search retrieval: uses search
server.py - Request handler → Cited assistant: routes chat
server.py - Request handler → Address lookup: looks up addresses
server.py - Request handler → Offline encyclopedias: uses ZIM data
server.py - Cited assistant → Search retrieval: retrieves passages
assistant.py - Cited assistant → Local AI runner: requests model turns
assistant.py - Cited assistant → Offline encyclopedias: uses encyclopedia
assistant.py - Request handler → Saved moments: manages saved items
server.py - App interface → Setup interface: opens setup
- Setup interface → Setup service: submits setup
engine/setup/api.py - Setup service → Checked downloads: starts downloads
engine/setup/api.py - Setup service → Library installer: installs data
engine/setup/api.py - Setup service → Hardware check: checks capability
engine/setup/api.py - App interface → App updates: checks updates
README.md - App updates → Checked downloads: fetches update data
engine/update.py - Person → iPad shell: opens
README.md - iPad shell → iPad request router: routes app requests
- iPad request router → iPad feature APIs: dispatches routes
mobile/ipad/Lastbook/API/Routes.swift - iPad request router → iPad library: reads library
mobile/ipad/Lastbook/Engine/Router.swift - iPad request router → iPad install plan: plans installs
- iPad install plan → iPad install catalog: uses catalog
mobile/ipad/Lastbook/Engine/Install/InstallPlan.swift - iPad install plan → iPad installer: runs install plan
mobile/ipad/Lastbook/Engine/Install/InstallPlan.swift - iPad installer → iPad map install: installs map sets
mobile/ipad/Lastbook/Engine/Install/Installer.swift - iPad map install → iPad library: resets library cache
mobile/ipad/Lastbook/Engine/Install/MapInstall.swift