Skip to content

mappings

mappings

map_patterns_to_actions

map_patterns_to_actions(
    patterns: list[str],
) -> list[dict[str, Any]]

Map analyzer function patterns to suggested actions.

Parameters:

Name Type Description Default
patterns list[str]

List of string pattern IDs reported by analyzer

required

Returns:

Type Description
list[dict[str, Any]]

A list of SuggestedAction-like dicts

Source code in src/crew_dcs/integrations/agents/script_analyzer/mappings.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
def map_patterns_to_actions(patterns: list[str]) -> list[dict[str, Any]]:
    """Map analyzer function patterns to suggested actions.

    Args:
        patterns: List of string pattern IDs reported by analyzer

    Returns:
        A list of SuggestedAction-like dicts
    """
    suggestions: list[dict[str, Any]] = []
    for p in patterns:
        info = BASIC_MAPPINGS.get(p)
        if info:
            suggestions.append({**info})
    return suggestions