#!/usr/bin/env bash
# Mnemon skill loop runtime config.
# Copy this file next to GUIDE.md, then edit values in place or add env.local.sh.

MNEMON_SKILL_LOOP_ENV_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MNEMON_SKILL_LOOP_CONFIG_DIR="$(cd "${MNEMON_SKILL_LOOP_ENV_DIR}/.." && pwd)"

export MNEMON_SKILL_LOOP_ENV="${MNEMON_SKILL_LOOP_ENV:-${MNEMON_SKILL_LOOP_ENV_DIR}/env.sh}"

if [[ -f "${MNEMON_SKILL_LOOP_ENV_DIR}/env.local.sh" ]]; then
  # shellcheck source=/dev/null
  source "${MNEMON_SKILL_LOOP_ENV_DIR}/env.local.sh"
fi

export MNEMON_SKILL_LOOP_DIR="${MNEMON_SKILL_LOOP_DIR:-${MNEMON_SKILL_LOOP_ENV_DIR}}"
export MNEMON_SKILL_LOOP_LIBRARY_DIR="${MNEMON_SKILL_LOOP_LIBRARY_DIR:-${MNEMON_SKILL_LOOP_DIR}/skills}"
export MNEMON_SKILL_LOOP_ACTIVE_DIR="${MNEMON_SKILL_LOOP_ACTIVE_DIR:-${MNEMON_SKILL_LOOP_LIBRARY_DIR}/active}"
export MNEMON_SKILL_LOOP_STALE_DIR="${MNEMON_SKILL_LOOP_STALE_DIR:-${MNEMON_SKILL_LOOP_LIBRARY_DIR}/stale}"
export MNEMON_SKILL_LOOP_ARCHIVED_DIR="${MNEMON_SKILL_LOOP_ARCHIVED_DIR:-${MNEMON_SKILL_LOOP_LIBRARY_DIR}/archived}"
export MNEMON_SKILL_LOOP_USAGE_FILE="${MNEMON_SKILL_LOOP_USAGE_FILE:-${MNEMON_SKILL_LOOP_LIBRARY_DIR}/.usage.jsonl}"
export MNEMON_SKILL_LOOP_PROPOSALS_DIR="${MNEMON_SKILL_LOOP_PROPOSALS_DIR:-${MNEMON_SKILL_LOOP_DIR}/proposals}"
export MNEMON_SKILL_LOOP_HOST_SKILLS_DIR="${MNEMON_SKILL_LOOP_HOST_SKILLS_DIR:-${MNEMON_SKILL_LOOP_CONFIG_DIR}/skills}"
export MNEMON_SKILL_LOOP_REVIEW_MIN_EVENTS="${MNEMON_SKILL_LOOP_REVIEW_MIN_EVENTS:-20}"
export MNEMON_SKILL_LOOP_PROTECTED_SKILLS="${MNEMON_SKILL_LOOP_PROTECTED_SKILLS:-skill_observe,skill_curate,skill_author,skill_manage,memory_get,memory_set}"
