import { createSidecarProxy } from '@@/sidecar/create-proxy'; import { mountPrefix } from '@@/plugins/manifest'; import { manifest } from '../manifest'; /** * `/api/av-club/*` — authenticate, then forward to the officer-av-club sidecar. * * No routes of its own and no media knowledge: the whole contract is `../sidecar/index.ts`, and the * reasoning behind what it will and will not accept is `../docs/SECURITY.md`. * * ── The prefix is derived ── * * `mountPrefix` returns `/av-club` for this first-party publisher. Writing `/api/av-club` literally * would be right by coincidence and wrong the moment anybody else publishes this plugin. * * ── Why the timeout is long ── * * A 4K transcode is minutes of work, and the sidecar already sets `idleTimeout: 255` because Bun's * ten-second default was killing encodes mid-flight. A short timeout on THIS hop would reintroduce the * same failure one layer up: the platform hanging up while ffmpeg is still working, which the caller * sees as a dead request rather than as a limit. Same reasoning as transcribe, whose whisper runs are * long for the same kind of reason. */ const proxy = createSidecarProxy({ name: 'av-club', prefix: `/api${mountPrefix({ appName: 'av-club', manifest })}`, timeoutSeconds: 1800, }); export const router = proxy.router;