"""Shared imports/constants for model context bundle service.""" from __future__ import annotations import json from datetime import datetime, timezone from typing import Any, Optional from uuid import uuid4 from sqlalchemy import and_, select from sqlalchemy.ext.asyncio import AsyncSession from ....models import AICallLog from ..model_routing import ModelRoutingService from ...project_knowledge_graph_service import ProjectKnowledgeGraphService from ...task_brief import ( HIGH_CONTRACT_TEMPLATE_ID, HIGH_TEMPLATE_ID, LOW_TEMPLATE_ID, TaskBriefService, ) CONTEXT_BUNDLE_MARKER = "PMFLOW_CONTEXT_BUNDLE_V1" CONTEXT_BUNDLE_KEYS = ("knowledge_graph", "task_template", "contract_sync") TARGET_FUNCTION_CONTEXT: dict[str, dict[str, Any]] = { "classify_intent_ai_pmo_kernel": { "tier": "low", "template_ids": [LOW_TEMPLATE_ID], }, "signal_planner_analyze": { "tier": "low", "template_ids": [LOW_TEMPLATE_ID], }, "classify_intent_complex": { "tier": "high", "template_ids": [HIGH_TEMPLATE_ID, HIGH_CONTRACT_TEMPLATE_ID], }, } __all__ = [ "AICallLog", "Any", "AsyncSession", "CONTEXT_BUNDLE_KEYS", "CONTEXT_BUNDLE_MARKER", "ModelRoutingService", "Optional", "ProjectKnowledgeGraphService", "TARGET_FUNCTION_CONTEXT", "TaskBriefService", "and_", "datetime", "json", "select", "timezone", "uuid4", ]