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

Types that only their own file reads lose their export, so knip's
unused-exports ratchet does not grow with the attachment work.
This commit is contained in:
Maurice
2026-10-24 21:41:55 +02:00
parent 89c33ac3f4
commit f1a2174f96
4 changed files with 8 additions and 8 deletions
@@ -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;
@@ -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;
@@ -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;
@@ -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;