fix(ci): repair trip assistant checks

Fix the mobile dashboard import and align the assistant UI with client layer and lint rules. Document the OpenRouter setting, share the reservation status schema, and update coverage for external POI identifiers and the empty costs view.
This commit is contained in:
Maurice
2026-12-02 22:56:54 +01:00
parent 3945037ff3
commit 7196ad30da
18 changed files with 635 additions and 514 deletions
+1
View File
@@ -99,6 +99,7 @@ DEMO_MODE=false # Demo mode: resets data hourly
# KITINERARY_EXTRACTOR_PATH= # Full path to the kitinerary-extractor binary. Unset, TREK searches /usr/lib/*/libexec/kf6/ and then PATH; the official image pins it. Set it to run a newer extractor than your distribution packages — the version in use is in the startup log and in GET /api/admin/system-info. (default: auto-detected)
# LLM_TIMEOUT_MS=900000 # Ceiling (ms) for one AI-parsing call before it is abandoned. One value for every provider, and the underlying HTTP client is held to it too. Generous by default so heavier parsing work fits without a code change; lower it on a cloud provider to fail fast. (default: 900000)
# OPENROUTER_PROVIDER= # Optional upstream provider slug for OpenRouter chat and booking extraction. Unset keeps OpenRouter's routing and fallbacks.
# LLM_MAX_OUTPUT_TOKENS=8192 # Longest answer (tokens) one AI-parsing call may ask for. Raise it when a document with many bookings comes back cut off; keep prompt plus cap inside your model's context. (default: 4096 for OpenAI-compatible, 8192 for Anthropic)
# VAPID_PUBLIC_KEY= # Web Push: the public half of the key pair browsers subscribe with (base64url, 65 bytes). Leave both halves unset and TREK generates a pair on first start and keeps it in the database, so it travels with every backup. Set both to use a pair of your own, e.g. printed by `npx web-push generate-vapid-keys`. Changing the pair later means every device has to turn push on again.
@@ -18,7 +18,7 @@ import { AssignmentsService } from '../assignments/assignments.service';
import {
idSchema, transportLegInputSchema, reservationUrlSchema, type TransportLegInput, bookingPriceSchema, bookingBudgetCategorySchema,
TRANSPORT_RESERVATION_TYPES, MCP_CREATABLE_TRANSPORT_TYPES, LEG_RESERVATION_TYPES, BOOKING_RESERVATION_TYPES,
RESERVATION_STATUSES, type ReservationStatus, typeToCostCategory,
RESERVATION_STATUSES, initialReservationStatusSchema, type ReservationStatus, typeToCostCategory,
} from '@trek/shared';
import { RESERVATION_METADATA } from '../../db/json-columns';
import { decodeJson } from '../../utils/json-column';
@@ -367,10 +367,7 @@ export class ReservationsMcp {
tripId: idSchema,
title: z.string().min(1).max(200),
type: z.enum(BOOKING_TYPES).describe('Reservation type: "hotel", "restaurant", "event", "tour", "activity", "parking", or "other"'),
status: z
.enum(['pending', 'confirmed'])
.optional()
.describe('Use confirmed when the provider already confirmed the reservation; otherwise leave pending'),
status: initialReservationStatusSchema.optional().describe('Use confirmed when the provider already confirmed it'),
reservation_time: z.string().optional().describe('ISO 8601 datetime or time string'),
reservation_end_time: z.string().optional().describe('When it ends: a dinner from 19:00 to 21:30, a tour that runs all afternoon. Ignored for hotels, whose span is the check-in/check-out days.'),
url: urlField,
@@ -105,6 +105,7 @@ const NOT_ROW_ID_FIELDS: Record<string, string> = {
client_id: 'an OAuth or OIDC client id is a string',
accessKeyId: 'an S3 access key id is a credential',
google_place_id: 'a Google place id is a provider string',
amap_poi_id: 'an Amap POI id is a provider string',
osm_id: 'an OpenStreetMap id is a provider string such as "node/123"',
placeId: 'a maps provider place id is a provider string',
pickedPlaceId: 'a maps provider place id is a provider string',
@@ -116,7 +116,9 @@ describe('attachedPort', () => {
it('ASTATL-005: the standing instructions say how an attached file is read and booked', () => {
const prompt = systemPrompt('English');
expect(prompt).toContain('Read its content with read_attached_file');
expect(prompt).toContain('If TREK already offered or saved a booking from the file, reuse that proposal or booking.');
expect(prompt).toContain(
'If TREK already offered or saved a booking from the file, reuse that proposal or booking.',
);
expect(prompt).toContain('Only propose create_reservation for a booking that has neither been offered nor saved.');
});