import { defineConfig } from 'tsup';

/**
 * Bundle config for `@hover-dev/pentest`.
 *
 * Two entries:
 *   - `index.ts`  — the PURE library (objective + report). Inlines the private
 *     `@hover-dev/probe-engine` via `noExternal`; no runtime deps, so the CLI
 *     and @hover-dev/security can consume it without dragging in a runtime.
 *   - `plugin.ts` — the Hover widget plugin (RED pentest mode). Imports
 *     `@hover-dev/security` (the shared MITM runtime) and `@hover-dev/core`'s
 *     plugin-api — both kept EXTERNAL (real dep / peer), so the singleton proxy
 *     in @hover-dev/security stays a shared module instance and core isn't
 *     double-bundled. Only the engine is inlined.
 */
export default defineConfig({
  entry: ['src/index.ts', 'src/plugin.ts'],
  format: ['esm'],
  dts: true,
  clean: true,
  sourcemap: true,
  target: 'node20',
  splitting: false,
  noExternal: ['@hover-dev/probe-engine'],
});
