Update app/models/infrastructure_intents.py
Browse files
app/models/infrastructure_intents.py
CHANGED
|
@@ -1,12 +1,45 @@
|
|
| 1 |
from pydantic import BaseModel, Field, field_validator
|
| 2 |
from typing import Optional, Literal, List, Any, Dict
|
|
|
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
class BaseIntentRequest(BaseModel):
|
|
|
|
| 1 |
from pydantic import BaseModel, Field, field_validator
|
| 2 |
from typing import Optional, Literal, List, Any, Dict
|
| 3 |
+
from enum import Enum
|
| 4 |
|
| 5 |
+
# ---------------------------------------------------------------------------
|
| 6 |
+
# Fallback enums – used when the proprietary core engine is not installed.
|
| 7 |
+
# These mirror the canonical definitions from the public specification.
|
| 8 |
+
# ---------------------------------------------------------------------------
|
| 9 |
+
class ResourceType(str, Enum):
|
| 10 |
+
DATABASE = "database"
|
| 11 |
+
STORAGE_ACCOUNT = "storage_account"
|
| 12 |
+
VM = "vm"
|
| 13 |
+
VIRTUAL_NETWORK = "virtual_network"
|
| 14 |
+
# enterprise-only types omitted for public sandbox
|
| 15 |
+
|
| 16 |
+
class PermissionLevel(str, Enum):
|
| 17 |
+
READ = "read"
|
| 18 |
+
WRITE = "write"
|
| 19 |
+
ADMIN = "admin"
|
| 20 |
+
|
| 21 |
+
class Environment(str, Enum):
|
| 22 |
+
DEV = "dev"
|
| 23 |
+
STAGING = "staging"
|
| 24 |
+
PROD = "prod"
|
| 25 |
+
|
| 26 |
+
class ChangeScope(str, Enum):
|
| 27 |
+
MINOR = "minor"
|
| 28 |
+
MAJOR = "major"
|
| 29 |
+
CRITICAL = "critical"
|
| 30 |
+
# ---------------------------------------------------------------------------
|
| 31 |
+
|
| 32 |
+
# Optional import from protected core engine – not available in public Spaces
|
| 33 |
+
try:
|
| 34 |
+
from agentic_reliability_framework.core.governance.intents import (
|
| 35 |
+
ResourceType,
|
| 36 |
+
PermissionLevel,
|
| 37 |
+
Environment,
|
| 38 |
+
ChangeScope,
|
| 39 |
+
)
|
| 40 |
+
except ImportError:
|
| 41 |
+
# The fallback enums defined above are used.
|
| 42 |
+
pass
|
| 43 |
|
| 44 |
|
| 45 |
class BaseIntentRequest(BaseModel):
|