<?php

declare(strict_types=1);

/** APO-196 Card 6 — GET /api/v1/administration/site-setup */
final class MyronGetSiteSetupStateAction implements MyronAction
{
    public function __construct(private readonly MyronOnboardingStateRepository $repo) {}
    public function metadata(): MyronActionMetadata
    {
        return new MyronActionMetadata(
            uri: '/api/v1/administration/site-setup', method: 'GET',
            domain: 'administration', resource: 'site-setup-state', verb: 'get',
            inputSchema: ['type' => 'object', 'properties' => []],
            outputSchema: ['type' => 'object', 'properties' => []],
            requiredScope: MyronApiScopes::ADMINISTRATION_READ,
            summary: 'Get the current site setup state (active bundle, archetype theme, selection manifest).',
            audienceClass: 3,
            snapshotInclude: true, snapshotKey: 'administration.siteSetup',
            exposeToMcp: true,
        );
    }
    public function execute(array $input, MyronActionCallerContext $caller): MyronActionResult
    {
        return MyronActionResult::ok((array) $this->repo->getState());
    }
}
