From 2aaffc6bc053d375407a3670e67fc3d67d0ba9de Mon Sep 17 00:00:00 2001 From: EtienneLescot Date: Tue, 1 Sep 2026 18:01:40 +0200 Subject: [PATCH 1/2] refactor(schema): drop autoTranscribe, which nothing has ever read MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `addAssetInputSchema.autoTranscribe` was declared with a `true` default and consumed by nobody: one occurrence in the whole tree, its own declaration. That is worse than clutter. It reads like the switch that decides whether an imported asset gets transcribed, so the next person to work on transcription finds it, believes the decision already has a home, and wires their logic to a flag no code path consults. It surfaced during the design of #560 for exactly that reason. The field goes; the schema keeps its shape otherwise. Nothing type-checks against it — `document-service.ts` declares its own `AddAssetInput` interface and uses that one, so the inferred type this schema exports was not in play either. --- src/lib/ai-edition/schema/index.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/lib/ai-edition/schema/index.ts b/src/lib/ai-edition/schema/index.ts index d37f500b3..d86b8f62c 100644 --- a/src/lib/ai-edition/schema/index.ts +++ b/src/lib/ai-edition/schema/index.ts @@ -945,21 +945,6 @@ export const createProjectInputSchema = z.object({ title: z.string().trim().min(1).default("Untitled Project"), }); -export const addAssetInputSchema = z.object({ - path: z.string().trim().min(1), - label: z.string().trim().optional(), - // "audio" imports an external voiceover / BGM / SFX file (issue #350); it has - // no video stream and never becomes the project's primary asset. Defaults to - // "video" so every existing caller keeps its current behaviour. - kind: z.enum(["video", "audio"]).default("video"), - autoTranscribe: z.boolean().default(true), -}); - -export const chatInputSchema = z.object({ - sessionId: z.string().trim().min(1).optional(), - message: z.string().trim().min(1), -}); - // Every code whisper.cpp's multilingual model can resolve, plus "auto" for // detection. Codes and order mirror whisper.cpp's own `g_lang` table // (`src/whisper.cpp`, verified against the tag `nix/whisper-stt.nix` pins — From 756bfc46ab2bba4c0cd0cae1c1127bff1dd5d8c3 Mon Sep 17 00:00:00 2001 From: EtienneLescot Date: Tue, 1 Sep 2026 18:10:53 +0200 Subject: [PATCH 2/2] refactor(schema): drop the two input schemas nothing consumes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `addAssetInputSchema` and `chatInputSchema` had no reference anywhere outside their own declaration and their own `z.infer` line — no parse site, no import, no namespace import of the module. They named an IPC contract that no boundary actually validates against. `addAssetInputSchema` was the worse of the two: the `AddAssetInput` it exported is shadowed by a same-named interface declared in `document-service.ts`, and that interface is the one every caller uses. Two types, one name, and the one that looked canonical was inert. `createProjectInputSchema` STAYS. It reads as dead by the same grep — no use outside `schema/index.ts` — but its inferred `CreateProjectInput` types `createEmptyDocument`, which has 50 call sites. Same file, one line down; the reference is easy to miss and expensive to remove. --- src/lib/ai-edition/schema/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib/ai-edition/schema/index.ts b/src/lib/ai-edition/schema/index.ts index d86b8f62c..50ff31e14 100644 --- a/src/lib/ai-edition/schema/index.ts +++ b/src/lib/ai-edition/schema/index.ts @@ -1081,8 +1081,6 @@ export type AxcutLegacyEditor = z.infer; export type AxcutDocument = z.infer; export type AxcutDocumentInput = z.input; export type CreateProjectInput = z.infer; -export type AddAssetInput = z.infer; -export type ChatInput = z.infer; export type TranscriptLanguageCode = z.infer; /** A real whisper.cpp language code — `TranscriptLanguageCode` minus the "auto" detection sentinel. */ export type WhisperLanguageCode = Exclude;