import type { Project, SourceFile } from 'ts-morph';
/** Context passed to each package install script. */
export interface PackageInstallerContext {
    /**
     * Resolved absolute path to the backend workspace root (the directory that
     * contains `src/`, `tsconfig.json`, `.env`, etc.). Use this for file-system
     * operations on non-`src/` files (e.g. `.env`, `docs/`) that cannot go
     * through `ctx.sourceFile` (design O1).
     */
    cwd: string;
    /** Execute a shell command in the workspace directory. */
    exec: (cmd: string, args: string[]) => Promise<void>;
    /** Install packages via `pnpm --filter` from the monorepo root. */
    install: (packages: string[], opts?: {
        dev?: boolean;
    }) => Promise<void>;
    /** ts-morph Project pre-configured with the target project's tsconfig. */
    project: Project;
    /** Get a source file from the target project's `src/` directory. */
    sourceFile: (...segments: string[]) => SourceFile;
}
/**
 * Default export signature every package `install.ts` must implement.
 * Returns an optional post-install message string that the caller (the `add`
 * command spinner) will print AFTER `spinner.succeed()`, so banners are not
 * interleaved with the spinner output.
 */
export type PackageInstaller = (ctx: PackageInstallerContext) => Promise<string | undefined>;
