# Code generated by highflame-policy-codegen. DO NOT EDIT.
# Source: schemas/guardrails/schema.cedarschema

"""Entity metadata for Guardrails policy editor."""

from typing import TypedDict

class ServiceEntityMetadata(TypedDict):
    """Entity metadata for a service, extracted from Cedar schema appliesTo blocks."""

    principals: list[str]
    resources: list[str]
    actions: list[str]


class ActionEntityMetadata(TypedDict):
    """Entity metadata for a specific action."""

    principals: list[str]
    resources: list[str]


# Guardrails entity metadata for UI components.
GUARDRAILS_ENTITIES: ServiceEntityMetadata = {
    "principals": ["Agent", "User"],
    "resources": ["App", "Session"],
    "actions": ["call_tool", "connect_server", "process_prompt", "read_file", "write_file"],
}

# Per-action entity mapping for Guardrails.
GUARDRAILS_ACTION_ENTITIES: dict[str, ActionEntityMetadata] = {
    "call_tool": {
        "principals": ["User", "Agent"],
        "resources": ["Session"],
    },
    "connect_server": {
        "principals": ["User", "Agent"],
        "resources": ["Session"],
    },
    "process_prompt": {
        "principals": ["User", "Agent"],
        "resources": ["App", "Session"],
    },
    "read_file": {
        "principals": ["User", "Agent"],
        "resources": ["Session"],
    },
    "write_file": {
        "principals": ["User", "Agent"],
        "resources": ["Session"],
    },
}
