INNER CODE UNIT · Python

normalized_identifier

viticci/shortcuts-playground-plugin · claude/skills/shortcuts-playground/scripts/lookup_action_grounding.py:198

def normalized_identifier(value: str) -> str:
    if value.startswith("is.workflow.actions."):
        return value
    return f"is.workflow.actions.{value}"


def find_by_identifier(catalog: dict[str, Any], value: str) -> tuple[str, dict[str, Any]] | None:
    tools = catalog.get("tools") or {}
    structural = catalog.get("structuralActions") or {}
    candidates = {**tools, **structural}
    for key in (value, normalized_identifier(value)):
        if key in candidates:
            return key, candidates[key]
    suffix = value.removeprefix("is.workflow.actions.")
    matches = [
        (identifier, entry)
        for identifier, entry in candidates.items()
        if identifier.endswith(f".{suffix}") or identifier.rsplit(".", 1)[-1] == suffix

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…