import { type Tree } from '@nx/devkit'; import type { SetupNestGeneratorSchema } from './schema'; /** * Wires LensMCP into a host NestJS project with **no app-code edits**. * Idempotent. * * Zero-config strategy (Phase 8): rewrite the bootstrap in `src/main.ts` * so `NestFactory.create(AppModule, opts)` becomes * `createLensmcpNestApp(AppModule, { projectName: '', nestOptions: opts })`. * `createLensmcpNestApp` wires `LensmcpModule` + the provider tracker + * auto-instruments every provider's methods under the hood, so the app * module and the providers stay untouched. * * 1. Find the project's `src/main.ts` (the conventional Nest entry). * 2. Replace the `NestFactory.create(...)` call with * `createLensmcpNestApp(...)`, threading the original 2nd arg through * as `nestOptions` and adding the `@lensmcp/nest-instrumentation` * import (dropping the now-unused `NestFactory` import when nothing * else uses it). String/AST-lite — if the file doesn't follow the * canonical shape we print a precise hint and exit non-zero. * 3. Add an `agent-dev` Nx target. */ export declare function setupNestGenerator(tree: Tree, rawOptions: SetupNestGeneratorSchema): Promise; export default setupNestGenerator; export declare function findAppModule(tree: Tree, root: string): string | undefined; /** * Rewrite a Nest `main.ts` bootstrap to the zero-config form. Returns the * original string unchanged when already converted (idempotent), `null` * when no `NestFactory.create(...)` call is present (caller decides), or * the rewritten source otherwise. */ export declare function patchMainBootstrap(src: string, projectName: string): string | null; /** * Legacy module-style wiring. Adds `LensmcpModule.forRoot(...)` into the * `@Module({ imports: [...] })` array. Superseded by the `main.ts` * bootstrap rewrite ({@link patchMainBootstrap}) but kept for hosts whose * entry file doesn't follow the canonical `NestFactory.create` shape. * Idempotent. Returns `null` when no `@Module` imports array is found. */ export declare function patchAppModule(src: string, projectName: string): string | null;