/**
 * Monorepo workspace detection.
 *
 * Walks up from a project directory looking for a workspace root marker —
 * either `pnpm-workspace.yaml` or a `package.json` with a `workspaces` field
 * (npm, yarn, bun). Returns a `MonorepoContext` describing the monorepo
 * root, the package manager, and the subpath of the target project within
 * the workspace.
 *
 * The rest of the build pipeline uses this context to:
 * 1. Run `install` at the monorepo root (so workspace deps resolve).
 * 2. Build the target package via the pm's workspace filter.
 * 3. Zip the monorepo tree (not just the subpackage) into `.agentuity/`.
 * 4. Emit `launch.json` with `processes[].workingDirectory = subpath`, so
 *    pilot starts the app from inside the right subdirectory.
 *
 * Returns `null` when the project is not part of a workspace, or when
 * `projectDir` *is* the workspace root (single-package mode, or a
 * monorepo-root deploy without a sub-target — out of scope here).
 */
import type { PackageManager } from './types.ts';
/**
 * Result of monorepo detection.
 *
 * `subpath` is always a posix-style relative path (forward slashes) so it
 * can be written directly into `launch.json` and survive a tar/zip round
 * trip onto a Linux container without OS-specific path mangling.
 */
export interface MonorepoContext {
    /** Absolute path to the monorepo root. */
    root: string;
    /**
     * Posix-style path from `root` to the target project (no leading or
     * trailing slash). Empty string would mean "the root itself", but the
     * detector returns `null` in that case rather than an empty subpath.
     */
    subpath: string;
    /** Package manager driving the workspace. */
    packageManager: PackageManager;
}
/**
 * Detect the enclosing monorepo, if any.
 *
 * Walks from `projectDir` toward `/`, stopping at the first directory
 * that contains either:
 *   - `pnpm-workspace.yaml`, or
 *   - a `package.json` with a `workspaces` array (or `{ packages: [...] }`).
 *
 * Returns `null` if no marker is found, or if the marker happens to sit
 * at `projectDir` itself (in that case the user is deploying the
 * monorepo root directly — not the subpackage flow this function
 * exists to support).
 */
export declare function detectMonorepoContext(projectDir: string): Promise<MonorepoContext | null>;
//# sourceMappingURL=monorepo.d.ts.map