/**
 * Materialize-Team Logic (Onboarding v3, v0)
 *
 * v0 stub: writes a minimal team `config.json` under `<teamsDir>/<id>/`
 * and flips a project `onboardingComplete` flag. Real provisioning
 * (template-engine wiring, agent-soul generation, system-prompt
 * personalisation) lands Wed–Fri — Sam's brief explicitly says a
 * "logs + flips flag" stub is acceptable for the Mon 5/4 EOD demo.
 *
 * The function is async + injection-friendly: callers pass a
 * `teamsDir`, a `projectFlagPath`, a UUID generator, and a clock — so
 * tests exercise the real write path with tmp dirs and deterministic
 * IDs.
 *
 * Wired downstream: when this module is upgraded post-Mon, swap the
 * inline write for a delegation to
 * `backend/src/services/onboarding/onboarding-provision.service.ts`
 * (it already provisions teams via TemplateService — see that file's
 * `provisionFromOnboarding`).
 *
 * @module services/orchestrator/onboarding/materialize-team
 */
import type { TeamRecommendation } from './recommend-team.js';
/**
 * Side-effects the materialize step needs. Injected so tests can run
 * against a tmp dir without touching the real `~/.crewly` tree.
 */
export interface MaterializeOptions {
    /** Root teams directory (e.g. `~/.crewly/teams`). */
    readonly teamsDir: string;
    /** File path for the project onboarding-complete flag. */
    readonly projectFlagPath: string;
    /** UUID generator — defaults to {@link crypto.randomUUID} when omitted. */
    readonly uuid?: () => string;
    /** Clock — defaults to `() => new Date()` when omitted. */
    readonly now?: () => Date;
    /**
     * Optional logger sink. When provided, the function writes the
     * Mon-EOD-stub log lines through it (so tests can assert).
     */
    readonly log?: (message: string) => void;
}
/**
 * Outcome of a successful materialize call.
 */
export interface MaterializeResult {
    /** Newly-generated team ID (UUID). */
    readonly teamId: string;
    /** Absolute path to the team's `config.json`. */
    readonly teamConfigPath: string;
    /**
     * Always `true` for a successful call — mirrors the brief's spec:
     * "flips `onboardingComplete = true`".
     */
    readonly onboardingComplete: true;
    /** Echo of the recommendation that was materialized (for orc to summarise back to the user). */
    readonly recommendation: TeamRecommendation;
    /**
     * Where the project flag was persisted. The flag is a tiny JSON file
     * (`{ onboardingComplete: true, completedAt }`).
     */
    readonly projectFlagPath: string;
}
/**
 * Materialize a {@link TeamRecommendation} into a team config file +
 * project onboarding-complete flag.
 *
 * v0 (Mon 5/4 EOD) writes a minimal config:
 * ```json
 * {
 *   "id":   "<uuid>",
 *   "name": "<recommendation.templateId> Team",
 *   "createdAt": "...",
 *   "createdBy": "onboarding-v3",
 *   "templateId": "...",
 *   "members": [ ... ]
 * }
 * ```
 * No agent-soul personalisation, no project linkage, no goals.md
 * generation — those land Wed–Fri when this calls into
 * `onboarding-provision.service.ts`.
 *
 * @param recommendation - Output of {@link recommendTeam} that the user confirmed.
 * @param opts - Side-effect injection (teamsDir, projectFlagPath, etc.).
 * @returns The team ID + config path + flag-path on success.
 * @throws If the team config write fails (filesystem error). Caller is
 *         expected to surface a brief, honest error to the user
 *         ("I couldn't create the team — error: …") rather than retry
 *         silently.
 *
 * @example
 * ```ts
 * import { getCrewlyHomePath } from '../../core/crewly-home.utils.js';
 *
 * const crewlyHome = getCrewlyHomePath(); // honours CREWLY_HOME env override
 * const result = await materializeTeam(rec, {
 *   teamsDir: path.join(crewlyHome, 'teams'),
 *   projectFlagPath: path.join(crewlyHome, 'onboarding-complete.json'),
 * });
 * console.log(result.teamId, '→', result.teamConfigPath);
 * ```
 *
 * Do NOT inline `path.join(os.homedir(), '.crewly/teams')` — that
 * ignores CREWLY_HOME and breaks ESTestNode + dry-run-kit isolation
 * (see crewly-home.utils.ts for context).
 */
export declare function materializeTeam(recommendation: TeamRecommendation, opts: MaterializeOptions): Promise<MaterializeResult>;
//# sourceMappingURL=materialize-team.d.ts.map