The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.
TypeScript budget-trackercollaborativedockeritinerarymcp-serveroffline-firstopen-sourceopenstreetmappacking-listpwareal-timeself-hostedselfhostedtraveltravel-apptravel-journaltravel-plannertripitwanderlog
fix(shared): tighten WS payload schemas after the MCP drift fixes
jubnla3c2cfa4b210
diff --git a/shared/src/realtime/events.schema.spec.ts b/shared/src/realtime/events.schema.spec.tsindex ce3fa219c..69b7c5c35 100644--- a/shared/src/realtime/events.schema.spec.ts+++ b/shared/src/realtime/events.schema.spec.ts@@ -113,9 +113,6 @@ const FIXTURES: Record<TrekWsEventName, Record<string, unknown>> = {/** Divergent shapes emitted for the same event today (see DRIFT notes in the registry). */const DRIFT_VARIANTS: Partial<Record<TrekWsEventName, Record<string, unknown>[]>> = {- 'assignment:moved': [{ assignment: { id: 9, day_id: 4 }, oldDayId: 2 }],- 'assignment:reordered': [{ dayId: 2, assignmentIds: [3, 1, 2] }],- 'day:deleted': [{ id: 2 }],'day:reordered': [{ day: { id: 2 } }],'budget:reordered': [{ orderedCategories: ['food', 'transport'] }],'reservation:created': [{}],diff --git a/shared/src/realtime/events.schema.ts b/shared/src/realtime/events.schema.tsindex 00c2e1c64..87a149b33 100644--- a/shared/src/realtime/events.schema.ts+++ b/shared/src/realtime/events.schema.ts@@ -65,17 +65,15 @@ export const TREK_WS_EVENTS = {'assignment:created': { scope: 'trip', payload: z.object({ assignment: entity }) },'assignment:updated': { scope: 'trip', payload: z.object({ assignment: entity }) },'assignment:deleted': { scope: 'trip', payload: z.object({ assignmentId: id, dayId: id }) },- // DRIFT: REST sends { assignment, oldDayId, newDayId }; the MCP tool omits- // newDayId (assignments.mcp.ts) — the client keys a day map on `undefined`.+ // (MCP drift fixed 2026-07-29: move_assignment now includes newDayId and+ // reorder_day_assignments sends orderedIds, matching REST.)'assignment:moved': {scope: 'trip',- payload: z.object({ assignment: entity, oldDayId: id, newDayId: id.optional() }),+ payload: z.object({ assignment: entity, oldDayId: id, newDayId: id }),},- // DRIFT: REST sends { dayId, orderedIds }; the MCP tool sends- // { dayId, assignmentIds } — the client only reads orderedIds.'assignment:reordered': {scope: 'trip',- payload: z.union([z.object({ dayId: id, orderedIds: idList }), z.object({ dayId: id, assignmentIds: idList })]),+ payload: z.object({ dayId: id, orderedIds: idList }),},'assignment:participants': {scope: 'trip',@@ -85,11 +83,8 @@ export const TREK_WS_EVENTS = {// ── Days ─────────────────────────────────────────────────────────────────'day:created': { scope: 'trip', payload: z.object({ day: entity }) },'day:updated': { scope: 'trip', payload: z.object({ day: entity }) },- // DRIFT: REST + plugins send { dayId }; the MCP tool sends { id }.- 'day:deleted': {- scope: 'trip',- payload: z.union([z.object({ dayId: id }), z.object({ id })]),- },+ // (MCP drift fixed 2026-07-29: delete_day now sends { dayId }, matching REST.)+ 'day:deleted': { scope: 'trip', payload: z.object({ dayId: id }) },// Two legitimate shapes: a plain reorder sends { orderedIds }; the// insert-at-position create path re-uses the event with { day }.'day:reordered': {