My agentic slop goes here. Not intended for anyone else!
This is the Sortal library for mapping usernames to contact metadata.
The library follows OCaml best practices with abstract types (type t) per
module, comprehensive constructors/accessors, and proper pretty printers. Each
core concept gets its own module with a clean interface.
Design Principles#
- XDG Storage: All contact data is stored in XDG-compliant locations using the xdge library
- JSON Format: Contact metadata is serialized using jsont for type-safe JSON encoding/decoding
- Nested Modules: The Contact module is nested within the main Sortal module following the canonical
type tpattern - One File Per Contact: Each contact is stored as a separate JSON file named "{handle}.json"
Storage Location#
Contact data is stored in the XDG data directory for the application:
- Default:
$HOME/.local/share/{app_name}/contacts/ - Can be overridden via
${APP_NAME}_DATA_DIRorXDG_DATA_HOME
Metadata Fields#
The Contact type includes the following metadata fields (all optional except handle and names):
- handle: Unique identifier/username
- names: List of full names (primary name first)
- email: Email address
- icon: Avatar/icon URL
- thumbnail: Path to a local thumbnail image file (stored in
thumbnails/subdirectory) - github: GitHub username
- twitter: Twitter/X username
- bluesky: Bluesky handle
- mastodon: Mastodon handle (with instance)
- orcid: ORCID identifier
- url: Personal/professional website
- atom_feeds: List of Atom/RSS feed URLs
Thumbnails#
Contact thumbnails are stored locally in the XDG data directory:
- Location:
$HOME/.local/share/{app_name}/thumbnails/ - Files are named:
{handle}.{jpg|png|gif} - The
thumbnailfield contains a relative path likethumbnails/{handle}.jpg