<?php

declare(strict_types=1);

/** APO-195 Card 7 — GET /api/v1/content/pages/manager */
final class MyronListPagesForManagerAction implements MyronAction
{
    public function __construct(private readonly MyronContentRepository $repo) {}
    public function metadata(): MyronActionMetadata
    {
        return new MyronActionMetadata(
            uri: '/api/v1/content/pages/manager', method: 'GET',
            domain: 'content', resource: 'page-manager', verb: 'list',
            inputSchema: ['type' => 'object', 'properties' => []],
            outputSchema: ['type' => 'object', 'properties' => ['items' => ['type' => 'array']]],
            requiredScope: MyronApiScopes::CONTENT_READ,
            summary: 'List pages with operator-manager metadata, including singleton public page roles.',
            audienceClass: 3,
            snapshotInclude: false,
            exposeToMcp: true,
        );
    }
    public function execute(array $input, MyronActionCallerContext $caller): MyronActionResult
    {
        return MyronActionResult::ok(['items' => $this->repo->listPagesForManager()]);
    }
}
