Expand description
§archivist-core
Platform-neutral core for the FicHub companion bot.
This crate contains ALL business logic shared by every platform adapter:
api— typed FicHub REST API client (FichubClient)model— response/request structscache— Redis pagination + response cache shared with FicHubstore— token store (/linkflow) + pending-link codesconfig— environment-drivenBotConfigerror—BotError(no platform-specific variants)util— URL detection, word formatting, truncationcore— the platform-neutralPlatformMessageIR +RichItem+ buttonsdispatch—CoreCtx+ everydo_*command (search, ask, quote, body, recs, roll, download, bookmark, metadata, help, kudos)intent— free-form natural-language classification (optional LLM via Ollama, heuristic fallback)lemmy— Lemmy/Piefed community monitor (poll-based)ratelimit— cross-platform rate limiting (shared Redis buckets)debug— diagnostics
Adapters (fanfic-archivist-discord, -matrix, -telegram, -slack, -irc,
-fediverse, CLI, web) depend on this crate and render PlatformMessage
natively. This crate never imports a platform SDK.
Re-exports§
Modules§
- api
- Typed HTTP client for the FicHub REST API.
- cache
- Redis-backed pagination cache for list commands.
- config
- Bot configuration loaded from environment variables.
- core
- Platform-neutral message IR (intermediate representation).
- debug
- Automatic LLM-assisted debugging for failed search requests.
- dispatch
- Core command logic — platform-neutral.
- error
- Error types for the bot.
- intent
- Free-form mention handling — “talk to the Archivist and it does the thing.”
- lemmy
- Lemmy/Reddthat community monitor.
- model
- Typed response models matching the FicHub REST API.
- ratelimit
- Cross-platform rate limiting.
- store
- Redis-backed auth token store.
- util
- Utility helpers: supported-site URL detection, embed formatting.
Constants§
- VERSION
- Version of the bot core.