"""Completion metadata for SDL language-service helpers."""

from __future__ import annotations

REFERENCE_COMPLETION_TARGETS = {
    ("nodes", "features"): "features",
    ("nodes", "conditions"): "conditions",
    ("nodes", "injects"): "injects",
    ("nodes", "vulnerabilities"): "vulnerabilities",
    ("infrastructure", "links"): "infrastructure",
    ("infrastructure", "dependencies"): "infrastructure",
    ("features", "dependencies"): "features",
    ("conditions", "proposition"): "propositions",
    ("propositions", "subjects"): "targetable",
    ("propositions", "evidence_requirements"): "evidence_requirements",
    ("assertions", "proposition"): "propositions",
    ("events", "assertions"): "assertions",
    ("events", "injects"): "injects",
    ("scripts", "events"): "events",
    ("stories", "scripts"): "scripts",
    ("content", "target"): "nodes",
    ("accounts", "node"): "nodes",
    ("accounts", "domain_ref"): "identity_domains",
    ("identity_domains", "authority_account_ref"): "accounts",
    ("relationships", "source"): "targetable",
    ("relationships", "target"): "targetable",
    ("relationships", "controller_refs"): "nodes",
    ("agents", "entity"): "entities",
    ("agents", "starting_accounts"): "accounts",
    ("agents", "starting_assertions"): "assertions",
    ("agents", "target_ref"): "nodes",
    ("agents", "account_ref"): "accounts",
    ("behavior_specifications", "participant_refs"): "agents",
    ("behavior_specifications", "action_contract_refs"): "action_contracts",
    ("behavior_specifications", "observation_boundary_refs"): "observation_boundaries",
    ("behavior_specifications", "outcome_interpretation_rule_refs"): "outcome_interpretation_rules",
    ("behavior_specifications", "authority_scope_refs"): "targetable",
    ("evidence_requirements", "source_refs"): "targetable",
    ("evidence_requirements", "scope_refs"): "targetable",
    ("evidence_requirements", "channel_refs"): "targetable",
    ("evidence_requirements", "trigger_ref"): "targetable",
    ("evidence_requirements", "boundary_ref"): "targetable",
    ("objectives", "agent"): "agents",
    ("objectives", "entity"): "entities",
    ("objectives", "targets"): "targetable",
    ("objectives", "depends_on"): "objectives",
    ("objectives", "assertions"): "assertions",
    ("injects", "from_entity"): "entities",
    ("injects", "to_entities"): "entities",
    ("workflows", "start"): "workflow_steps",
    ("workflows", "assertions"): "assertions",
}

SECTION_FIELD_COMPLETIONS = {
    "realization": ("default", "scopes"),
    "nodes": ("type", "description", "os", "resources", "features", "conditions", "services", "roles"),
    "infrastructure": ("count", "links", "dependencies", "properties"),
    "features": ("type", "source", "version", "dependencies"),
    "conditions": ("proposition", "command", "interval", "source", "description"),
    "propositions": (
        "description",
        "subjects",
        "basis",
        "predicate",
        "quantifier",
        "threshold",
        "evidence_requirements",
    ),
    "assertions": ("description", "proposition", "role", "polarity"),
    "vulnerabilities": ("name", "description", "technical", "class"),
    "entities": ("name", "role", "facts", "entities"),
    "injects": ("source", "from_entity", "to_entities"),
    "events": ("assertions", "injects"),
    "scripts": ("start_time", "end_time", "speed", "events"),
    "stories": ("speed", "scripts"),
    "content": ("type", "target", "format", "source", "path", "items"),
    "accounts": ("username", "node", "password_strength", "spn", "domain_ref"),
    "identity_domains": ("profile", "dns_name", "netbios_name", "authority_account_ref"),
    "relationships": (
        "type",
        "source",
        "target",
        "properties",
        "domain_controller",
        "domain_join",
    ),
    "agents": (
        "entity",
        "actions",
        "starting_accounts",
        "starting_assertions",
        "initial_knowledge",
        "interactive_access",
    ),
    "behavior_specifications": (
        "semantic_version",
        "lifecycle_state",
        "participant_refs",
        "participant_role_refs",
        "action_contract_refs",
        "observation_boundary_refs",
        "outcome_interpretation_rule_refs",
        "authority_scope_refs",
        "behavior_mode",
        "ai_offensive_behavior_refs",
        "offensive_behavior_refs",
        "realization_profile_ref",
        "backend_feature_support_refs",
        "evidence_contract_refs",
        "extension_policy",
        "extensions",
    ),
    "evidence_requirements": (
        "source_refs",
        "source_class",
        "scope_refs",
        "scope",
        "window",
        "trigger_ref",
        "boundary_ref",
        "boundary_kind",
        "channel",
        "channel_refs",
        "artifact_role",
        "media_types",
        "sensitivity",
        "redaction",
        "integrity",
        "retention",
        "loss_disclosure",
    ),
    "objectives": ("agent", "entity", "actions", "targets", "success", "window", "depends_on"),
    "workflows": ("start", "steps"),
    "variables": ("type", "default", "required", "allowed_values", "description"),
}
