managarten/packages/bot-services/src
Till JS e2f144962c feat: add unified @manacore/shared-llm package and migrate all backends
Create a shared LLM client package that provides a unified interface
to the mana-llm service, replacing 9 individual fetch-based integrations
with consistent error handling, retry logic, and JSON extraction.

Package (@manacore/shared-llm):
- LlmModule with forRoot/forRootAsync (NestJS dynamic module)
- LlmClientService: chat, json, vision, visionJson, embed, stream
- LlmClient standalone class for non-NestJS consumers
- extractJson utility (consolidates 3 markdown-stripping implementations)
- retryFetch with exponential backoff (429, 5xx, network errors)
- 44 unit tests (json-extractor, retry, llm-client)

Migrated backends:
- mana-core-auth: raw fetch → llm.json()
- planta: raw fetch + vision → llm.visionJson()
- nutriphi: raw fetch + regex → llm.visionJson() + llm.json()
- chat: custom OllamaService (175 LOC) → llm.chatMessages()
- context: raw fetch → llm.chat() (keeps token tracking)
- traces: 2x raw fetch → llm.chat()
- manadeck: @google/genai SDK → llm.json() + llm.visionJson()
- bot-services: raw Ollama API → LlmClient standalone
- matrix-ollama-bot: raw fetch → llm.chatMessages() + llm.vision()

New credit operations:
- AI_PLANT_ANALYSIS (2 credits, planta)
- AI_GUIDE_GENERATION (5 credits, traces)
- AI_CONTEXT_GENERATION (2 credits, context)
- AI_BOT_CHAT (0.1 credits, matrix)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 22:06:30 +01:00
..
ai feat: add unified @manacore/shared-llm package and migrate all backends 2026-03-23 22:06:30 +01:00
calendar fix(bot-services): filter events client-side, backend doesn't support date params 2026-02-13 19:46:43 +01:00
clock fix(types): resolve TypeScript errors across multiple packages 2026-01-29 13:33:01 +01:00
contacts feat(mana-bot): add daily morning summary feature 2026-02-17 11:01:47 +01:00
credit feat(bot-services): add credit and gift services for Matrix bots 2026-02-13 23:29:21 +01:00
docs feat(packages): add @manacore/bot-services shared package 2026-01-29 00:07:32 +00:00
gift feat(bot-services): add credit and gift services for Matrix bots 2026-02-13 23:29:21 +01:00
i18n fix(planta-bot): make I18nService optional to diagnose DI issue 2026-02-17 12:51:04 +01:00
morning-summary feat(mana-bot): add daily morning summary feature 2026-02-17 11:01:47 +01:00
nutrition feat(packages): add @manacore/bot-services shared package 2026-01-29 00:07:32 +00:00
planta feat(mana-bot): add daily morning summary feature 2026-02-17 11:01:47 +01:00
quotes feat(packages): add @manacore/bot-services shared package 2026-01-29 00:07:32 +00:00
session fix(session): add auto-refresh for expired JWT tokens 2026-02-14 12:19:08 +01:00
shared feat(packages): add @manacore/bot-services shared package 2026-01-29 00:07:32 +00:00
stats feat(packages): add @manacore/bot-services shared package 2026-01-29 00:07:32 +00:00
todo feat(bots): enable Redis SSO for todo-bot and calendar-bot 2026-02-02 14:51:23 +01:00
transcription feat(bot-services): add API key support to TranscriptionService 2026-02-16 00:11:24 +01:00
weather feat(mana-bot): add daily morning summary feature 2026-02-17 11:01:47 +01:00
index.ts feat(mana-bot): add daily morning summary feature 2026-02-17 11:01:47 +01:00