Skip to content

armgit / TREK

Public Imported from GitHub
0

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.

chore(assistant): the attachment work exports only what other files use

Mauricef1a2174f96d6
diff --git a/server/src/db/repositories/AssistantAttachments.repository.ts b/server/src/db/repositories/AssistantAttachments.repository.ts
index 6ef783295..8eff3c060 100644
--- a/server/src/db/repositories/AssistantAttachments.repository.ts
+++ b/server/src/db/repositories/AssistantAttachments.repository.ts
@@ -7,7 +7,7 @@ import { TrekRepository } from './_shared/trek-repository';
export type AssistantAttachmentTextStatus = 'ok' | 'empty' | 'scanned' | 'unsupported' | 'failed';
/** One `assistant_attachments` row as stored, the text included. */
-export interface AssistantAttachmentRow {
+interface AssistantAttachmentRow {
id: string;
thread_id: number;
user_id: number;
@@ -30,7 +30,7 @@ const _assistantAttachmentRowKeys: AssertRowKeys<AssistantAttachmentRow, Assista
export type AssistantAttachmentSummary = Omit<AssistantAttachmentRow, 'text'>;
/** A new attachment, as AssistantAttachmentsService writes it. */
-export interface AssistantAttachmentInsert {
+interface AssistantAttachmentInsert {
id: string;
threadId: number;
userId: number;
diff --git a/server/src/nest/assistant/assistant-attachments.service.ts b/server/src/nest/assistant/assistant-attachments.service.ts
index e1e522a8d..687e94f3c 100644
--- a/server/src/nest/assistant/assistant-attachments.service.ts
+++ b/server/src/nest/assistant/assistant-attachments.service.ts
@@ -49,7 +49,7 @@ const ORPHAN_GRACE_MS = 60 * 60_000;
const UNREAD_EXTENSIONS: ReadonlySet<string> = new Set([...LLM_PHOTO_EXTENSIONS, '.pkpass']);
/** A file stored for a turn that has not written its rows yet. */
-export interface PreparedAttachment {
+interface PreparedAttachment {
id: string;
name: string;
mime: string;
@@ -67,7 +67,7 @@ const ATTACHMENT_CHANGES: ReadonlySet<string> = new Set([READ_ATTACHED_FILE_TOOL
const NOT_SHARED = 'The user has not let you read this file yet.';
/** What a turn knows of its thread's files: the list without their texts, and the texts the model may read. */
-export interface TurnAttachments {
+interface TurnAttachments {
attached: AssistantAttachmentSummary[];
/** The texts of the files the user let the model read, by attachment id, cut to one model request. */
texts: Map<string, string>;
@@ -81,7 +81,7 @@ interface TextReader {
}
/** Where a change on an attachment runs: the user, and the thread and trip of the conversation. */
-export interface AttachmentChangeAt {
+interface AttachmentChangeAt {
userId: number;
threadId: number;
tripId: number;
diff --git a/server/src/nest/assistant/assistant-booking-import.service.ts b/server/src/nest/assistant/assistant-booking-import.service.ts
index a88c20a3a..39a0f4296 100644
--- a/server/src/nest/assistant/assistant-booking-import.service.ts
+++ b/server/src/nest/assistant/assistant-booking-import.service.ts
@@ -31,7 +31,7 @@ export const BOOKING_READ_REASONS = ['ai_not_configured', 'ai_failed', 'no_text'
export type BookingReadReason = (typeof BOOKING_READ_REASONS)[number];
/** What reading a file found: at most a step's worth of bookings, and why there were none. */
-export interface BookingRead {
+interface BookingRead {
items: BookingImportPreviewItem[];
/** Null when the file held bookings. */
reason: BookingReadReason | null;
diff --git a/server/src/nest/assistant/assistant-file-answer.service.ts b/server/src/nest/assistant/assistant-file-answer.service.ts
index ef1f922ae..99e69d224 100644
--- a/server/src/nest/assistant/assistant-file-answer.service.ts
+++ b/server/src/nest/assistant/assistant-file-answer.service.ts
@@ -24,7 +24,7 @@ import { randomUUID } from 'node:crypto';
const FILE_UNREADABLE = 'The file could not be read.';
/** The turn a file was attached in: who, on which trip, the thread, the answer's first row and the file kept. */
-export interface FileTurn extends AssistantClientCtx {
+interface FileTurn extends AssistantClientCtx {
userId: number;
tripId: number;
threadId: number;
@@ -43,7 +43,7 @@ export interface FileAnswerRows {
}
/** Where the answer goes: the stream, the signal that the client went away, and the row. */
-export interface FileAnswerOut {
+interface FileAnswerOut {
w: UiStreamWriter;
signal: AbortSignal;
rows: FileAnswerRows;