#!/usr/bin/env bash
# Single source of truth for "which shipped files does the framework own".
# Sourced by deploy/install.sh and deploy/install_mam.sh. Paths are workspace
# relative (e.g. ".agents/hooks.json"); no leading "./".

# Framework-owned == shipped by this repo and safe to refresh in place.
# Anything outside this set is the user's file and is only ever created
# when absent.
is_framework_owned() {
  case "$1" in
    .agents/skills/*)              return 0 ;;
    .agents/hooks.json)            return 0 ;;
    .agents/hooks/*)               return 0 ;;
    .agents/MULTI_AGENT_RULES*.md) return 0 ;;
    .agents/INSTALL.md)            return 0 ;;
    *)                             return 1 ;;
  esac
}

# Registry files are key-value documents that BOTH sides legitimately write:
# we ship framework hooks, the user registers their own. Preserving such a
# file wholesale pins the workspace to its old hook set, so these get a
# key-level 3-way merge instead.
is_registry_file() {
  case "$1" in
    .agents/hooks.json) return 0 ;;
    *)                  return 1 ;;
  esac
}
