feat(llm-parse): read a forwarded booking mail and name its trip in one request

MailReadService sends one mail as one document: its subject, body and up to
three attachments inside data tags the prompt calls untrusted, with the
person's trips under references made up for the call. Answers keep only
offered trip references and known field names. BookingImportService reads
a mail's machine-readable parts and maps an AI reading to booking items.
This commit is contained in:
Maurice
2026-11-13 15:39:09 +01:00
parent baa906fb6b
commit aa84d71302
11 changed files with 930 additions and 100 deletions
@@ -7,11 +7,13 @@ import { LlmConfigResolver } from './llm-config.resolver';
import { LlmLocalController } from './llm-local.controller';
import { LlmLocalService } from './llm-local.service';
import { LlmParseService } from './llm-parse.service';
import { MailReadService } from './mail-read.service';
import { MikroOrmModule } from '@mikro-orm/nestjs';
import { Module } from '@nestjs/common';
/**
* Provides the LLM booking-import fallback; imported by BookingImportModule.
* Exports MailReadService for the booking mail import (MailIngestModule).
* Exports LlmConfigResolver for the plugin host surface (HostSurfaceRpc), and
* LlmLocalService for the AI assistant, which lists a custom server's models
* the same way the admin screen does.
@@ -26,7 +28,7 @@ import { Module } from '@nestjs/common';
@Module({
imports: [AppConfigModule, SettingsModule, AddonsModule, MikroOrmModule.forFeature([Addons])],
controllers: [LlmLocalController, LlmCapabilitiesController],
providers: [LlmParseService, LlmLocalService, LlmConfigResolver],
exports: [LlmParseService, LlmConfigResolver, LlmLocalService],
providers: [LlmParseService, LlmLocalService, LlmConfigResolver, MailReadService],
exports: [LlmParseService, LlmConfigResolver, LlmLocalService, MailReadService],
})
export class LlmParseModule {}