import { createSidecarProxy } from '@@/sidecar/create-proxy'; import { mountPrefix } from '@@/plugins/manifest'; import { manifest } from '../manifest'; // /api/transcribe/* — auth, then forward to officer-transcribe. No routes of its own and no Whisper // knowledge: the whole contract lives in ../sidecar/index.ts. // // ── The prefix is DERIVED, not written ── // // `mountPrefix` returns `/transcribe` for this first-party publisher; a literal '/api/transcribe' would // be right only by coincidence and wrong the moment anyone else publishes this plugin. Same reasoning as // `plugins/photos/api/router.ts` and `plugins/music/api/router.ts`. const proxy = createSidecarProxy({ name: 'transcribe', prefix: `/api${mountPrefix({ appName: 'transcribe', manifest })}`, // whisper.cpp runs at roughly 8x realtime, so a long voice memo (the moved `transcribe.ts` was tuned // for recordings past 40 minutes, and disables Bun's own 300s fetch ceiling for exactly that reason) // can hold this hop open for minutes. 1800s gives it the same headroom on the platform->sidecar leg. timeoutSeconds: 1800, }); export const router = proxy.router;