# ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========

from mirage.core.hierarchy.stat import entry_stat, make_stat
from mirage.core.linear.readdir import readdir
from mirage.core.linear.scope import detect_scope
from mirage.types import FileType

stat = make_stat(
    detect_scope,
    readdir,
    entry_stats={
        "team": entry_stat("team_id", FileType.DIRECTORY),
        "team_json": entry_stat("team_id", FileType.JSON),
        "member": entry_stat("user_id", FileType.JSON),
        "issue": entry_stat("issue_id", FileType.DIRECTORY),
        "issue_json": entry_stat("issue_id", FileType.JSON),
        "comments_jsonl": entry_stat("issue_id", FileType.TEXT),
        "project": entry_stat("project_id", FileType.JSON),
        "cycle": entry_stat("cycle_id", FileType.JSON),
        "document": entry_stat("document_id", FileType.JSON),
    },
)
