/**
 * Build output packaging.
 *
 * After a framework adapter builds the project, the packager:
 * 1. Generates launch metadata (how to start the app)
 * 2. Writes a Procfile for compatibility
 * 3. Optionally generates additional metadata
 *
 * The output is a self-contained directory ready for deployment
 * as a buildpack image layer or traditional zip upload.
 */
import { join } from 'node:path';
import { writeFileSync } from 'node:fs';
import { generateLaunchMetadata, writeLaunchMetadata } from "./launch.js";
/**
 * Package a build result into a deployment-ready directory.
 */
export function packageBuildOutput(framework, buildResult, outputDir) {
    // Generate launch metadata
    const launch = generateLaunchMetadata(framework, buildResult);
    // Write launch metadata to the output directory
    writeLaunchMetadata(outputDir, launch);
    // Write a .buildpack-ready marker file
    const markerPath = join(outputDir, '.agentuity-build');
    const markerContent = {
        version: 1,
        framework: framework.name,
        runtime: framework.runtime,
        buildDate: new Date().toISOString(),
    };
    writeFileSync(markerPath, JSON.stringify(markerContent, null, 2), 'utf-8');
    return {
        outputDir,
        launch,
        hasStaticAssets: !!buildResult.staticDir,
        staticDir: buildResult.staticDir,
    };
}
//# sourceMappingURL=index.js.map