import { createSidecarProxy } from '../../sidecar/create-proxy';

// /api/slskd/* — auth, then forward to officer-slskd. No routes of its own and no slskd knowledge:
// this file must never grow app logic.
//
// Covers both slskd's own API (/api/v0/searches, /api/v0/transfers, …) and the sidecar's Officer-owned
// routes (/_officer/*, features slskd has no concept of). Both are opaque from here; the sidecar injects
// the slskd API key. The full contract is documented at the top of src/servers/sidecar/slskd/index.ts.

const proxy = createSidecarProxy({
  name: 'slskd',
  prefix: '/api/slskd',
});

export const slskdRouter = proxy.router;

/** Base URL of the sidecar's HTTP server, or null if it hasn't reported in yet. */
export const getSlskdServerUrl = proxy.getHttpUrl;
