Files
TREK/shared/src/assistant/assistant-share.schema.ts
T
Maurice b64da26651 feat(assistant): trip assistant chat with your own AI connection
Adds an in-app assistant that reads and plans the open trip. Users connect
their own provider (Sign in with ChatGPT, or an Anthropic, OpenAI, Gemini or
OpenRouter key) or use the one the admin set up, including a custom
OpenAI-compatible server. It is an addon and only shows while a connection
is usable.

The chat runs on the existing MCP tools, pinned to the trip. Every change is
held as a change card the user applies or discards, and applied changes can
be undone. On the desktop it is a floating window that can be moved and
resized; on the phone it is fullscreen. Search results show as place cards
that can go onto a day, weather lookups as a strip, proposed places as
ghost markers on the map with a before/after switch, and an answer can be
shared into the trip chat. Booking files can be dropped in and are read
into change cards.
2026-10-22 21:30:12 +00:00

16 lines
614 B
TypeScript

import { z } from 'zod';
/**
* POST /api/trips/:tripId/assistant/threads/:threadId/messages/:messageId/share:
* posts the text of an assistant answer to the trip's chat, marked as shared
* from the assistant. The text is what the user saw in the preview; the
* server checks that the answer is theirs and in this trip, not the words.
* It answers with the chat message (`collabMessageResponseSchema`).
*/
export const assistantShareRequestSchema = z
.object({
text: z.string().trim().min(1).max(5000),
})
.strict();
export type AssistantShareRequest = z.infer<typeof assistantShareRequestSchema>;