service:
  name: planner-agent
  owner_node: solaria
  exposure: private
  dependencies:
    - redis
    - ollama

  ports: []   # no external port; communicates via Redis pub/sub

  healthcheck:
    type: file
    path: /opt/homelab/state/planner-agent.heartbeat
    max_age_seconds: 300      # 5 minutes — matches COOLDOWN_SECONDS
    interval: 60s
    timeout: 10s
    retries: 3

  restart_policy: unless-stopped

  persistence:
    paths:
      - /opt/homelab/actions
      - /opt/homelab/events
      - /opt/homelab/state

  runtime:
    directories:
      - /opt/homelab/actions/pending
      - /opt/homelab/actions/approved
      - /opt/homelab/actions/running
      - /opt/homelab/actions/completed
      - /opt/homelab/actions/failed
      - /opt/homelab/actions/rejected
      - /opt/homelab/actions/cancelled
      - /opt/homelab/events
      - /opt/homelab/state
    env_vars:
      - REDIS_URL           # redis://100.108.208.3:6379
      - OLLAMA_HOST         # http://100.108.208.3:11434
      - OLLAMA_MODEL        # qwen2.5:7b
      - ANTHROPIC_API_KEY   # for claude-haiku/sonnet fallback
      - NODE_NAME           # solaria
      - COOLDOWN_SECONDS    # default 300
      - RUNTIME_PATH        # default /opt/homelab
