Files
strukto-ai--mirage/python/mirage/core/linear/stat.py
T

35 lines
1.5 KiB
Python

# ========= 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 ContentType, FileType
stat = make_stat(
detect_scope,
readdir,
entry_stats={
"team": entry_stat("team_id", FileType.DIRECTORY),
"team_json": entry_stat("team_id", ContentType.JSON),
"member": entry_stat("user_id", ContentType.JSON),
"issue": entry_stat("issue_id", FileType.DIRECTORY),
"issue_json": entry_stat("issue_id", ContentType.JSON),
"comments_jsonl": entry_stat("issue_id", ContentType.TEXT),
"project": entry_stat("project_id", ContentType.JSON),
"cycle": entry_stat("cycle_id", ContentType.JSON),
"document": entry_stat("document_id", ContentType.JSON),
},
)