'use server';
/**
 * loadCuratedIssues — server action backing the LaneChooser ↔ CuratedIssuesList
 * interaction on the contributor onboarding view (spec 097, task-47). Resolves
 * GetCuratedIssuesByLaneUseCase from the DI container and returns the curated
 * list, or `{ error }` when the use case throws. No API route is needed in v1.
 */
import { resolve } from '../../lib/server-container.js';
import { GetContributorOnboardingConfig } from './shared/contributor-onboarding-config.js';
export async function loadCuratedIssues(lane) {
    try {
        const { owner, repo } = GetContributorOnboardingConfig();
        const useCase = resolve('GetCuratedIssuesByLaneUseCase');
        const result = await useCase.execute({ owner, repo, lane });
        return { issues: result.issues };
    }
    catch (error) {
        return { error: error instanceof Error ? error.message : 'Failed to load curated issues' };
    }
}
