# =============================================================================
# DAGI Agent Registry - Single Source of Truth
# =============================================================================
# Version: 1.0.0
# 
# ВАЖЛИВО: Це ЄДИНЕ джерело істини для всіх агентів.
# НЕ редагуйте gateway prompts, router-config.yml, crewai config вручну!
# Використовуйте: tools/agents generate
#
# Класи агентів:
#   - top_level: Domain orchestrator (user-facing або private)
#   - internal: Platform service agent (не user-facing)
#
# Scope:
#   - global: Один інстанс на всю мережу
#   - node_local: Окремий інстанс на кожній ноді
# =============================================================================

schema_version: 1
version: "1.1.0"
feature_flags:
  registry_enabled: true
  generate_prompts: true
  generate_router_config: true
  generate_crewai_config: true
  generate_crewai_teams: true

# =============================================================================
# LLM Profiles (referenced by agents)
# =============================================================================
llm_profiles:
  reasoning:
    provider: deepseek
    model: deepseek-chat
    temperature: 0.2
    max_tokens: 2048
    description: "Складні задачі, reasoning, аналіз"
  
  science:
    provider: ollama
    model: qwen3:8b
    temperature: 0.1
    max_tokens: 2048
    description: "Наукові агенти, точність"
  
  community:
    provider: ollama
    model: mistral:7b-instruct
    temperature: 0.35
    max_tokens: 2048
    description: "Community, CRM, підтримка"
  
  strategist:
    provider: ollama
    model: qwen3:8b
    temperature: 0.15
    max_tokens: 2048
    description: "Стратегічні рішення"
  
  fast:
    provider: ollama
    model: qwen2.5:3b-instruct-q4_K_M
    temperature: 0.2
    max_tokens: 768
    description: "Швидкі сервісні задачі"

  grok:
    provider: grok
    model: grok-2-1212
    temperature: 0.2
    max_tokens: 2048
    description: "Grok API (SOFIIA primary)"

# =============================================================================
# AGENTS
# =============================================================================
agents:

  # ---------------------------------------------------------------------------
  # DAARWIZZ - Meta-Orchestrator
  # ---------------------------------------------------------------------------
  - id: daarwizz
    display_name: DAARWIZZ
    class: top_level
    visibility: public
    scope: global
    telegram_mode: public
    public_channels:
      telegram: true
    
    canonical_role: "Meta-Orchestrator & Digital Mayor of DAARION.city"
    mission: |
      Головний координатор екосистеми DAARION. Перший цифровий мер DAARION.city.
      Вхідна точка для новачків, маршрутизація до спеціалізованих агентів,
      координація multi-agent сценаріїв через CrewAI.
    
    domains:
      - dao
      - tokenomics
      - governance
      - strategy
      - onboarding
      - ecosystem
    
    routing:
      priority: 100
      keywords:
        - daarion
        - dao
        - microdao
        - токен
        - governance
        - екосистема
        - допомога
        - з чого почати
    
    llm_profile: strategist
    prompt_file: daarwizz_prompt.txt
    
    crewai:
      enabled: true
      orchestrator: true
      can_delegate_to_all: true
      team: []  # Делегує іншим top-level агентам
    
    handoff_contract:
      accepts_from: [any]
      can_delegate_to: [all_top_level]

  # ---------------------------------------------------------------------------
  # HELION - Energy Union
  # ---------------------------------------------------------------------------
  - id: helion
    display_name: Helion
    class: top_level
    visibility: public
    scope: global
    telegram_mode: public
    public_channels:
      telegram: true
    
    canonical_role: "Energy Research Lead & Voice of Energy Union"
    mission: |
      Голос платформи Energy Union. Дослідження енергетики, біомаси, 
      сталого розвитку. Координує енергетичні проекти та BioMiner стратегію.
    
    domains:
      - energy
      - biomass
      - sustainability
      - renewables
      - market_analysis
      - biominer
    
    routing:
      priority: 85
      keywords:
        - енергія
        - energy
        - біомаса
        - biomass
        - сонячна
        - вітрова
        - biominer
        - ecominer
        - сталий
        - renewable
    
    llm_profile: reasoning
    prompt_file: helion_prompt.txt

    orchestration:
      mode: hybrid
      crew:
        enabled: true
        default_profile: default
        profile_hints:
          core: [ROI, tokenization, compliance, GDPR, MiCA, legal, GGU, BioMiner]
        profiles:
          default:
            team_name: HELION Energy Council
            parallel_roles: true
            max_concurrency: 3
            synthesis:
              role_context: HELION Orchestrator
              system_prompt_ref: roles/helion/orchestrator_synthesis.md
              llm_profile: reasoning
            team:
              - id: energy_researcher
                role_context: Energy Researcher
                system_prompt_ref: roles/helion/energy_researcher.md
                llm_profile: science
              - id: systems_modeler
                role_context: Systems Modeler
                system_prompt_ref: roles/helion/systems_modeler.md
                llm_profile: reasoning
              - id: policy_analyst
                role_context: Policy Analyst
                system_prompt_ref: roles/helion/policy_analyst.md
                llm_profile: science
              - id: risk_assessor
                role_context: Risk Assessor
                system_prompt_ref: roles/helion/risk_assessor.md
                llm_profile: reasoning
              - id: communicator
                role_context: Communicator
                system_prompt_ref: roles/helion/communicator.md
                llm_profile: fast
            delegation:
              enabled: false
          core:
            team_name: HELION Core (Energy DAO)
            parallel_roles: true
            max_concurrency: 4
            synthesis:
              role_context: Executive Synthesis (CEO-mode)
              system_prompt_ref: roles/helion/HELION_CORE/orchestrator_synthesis.md
              llm_profile: reasoning
            team:
              - id: orchestrator_front_desk_router
                role_context: Orchestrator (Front Desk / Router)
                system_prompt_ref: roles/helion/HELION_CORE/orchestrator_front_desk_router.md
                llm_profile: reasoning
              - id: knowledge_curator_rag_librarian
                role_context: Knowledge Curator (L1-L3 RAG Librarian)
                system_prompt_ref: roles/helion/HELION_CORE/knowledge_curator_rag_librarian.md
                llm_profile: science
              - id: safety_anti_hallucination_gate
                role_context: Safety & Anti-Hallucination Gate
                system_prompt_ref: roles/helion/HELION_CORE/safety_anti_hallucination_gate.md
                llm_profile: reasoning
              - id: legal_compliance_gdpr_mica_aml_kyc
                role_context: Legal & Compliance (GDPR/MiCA/AML/KYC)
                system_prompt_ref: roles/helion/HELION_CORE/legal_compliance_gdpr_mica_aml_kyc.md
                llm_profile: reasoning
              - id: security_anti_fraud_anti_fake
                role_context: Security & Anti-Fraud / Anti-Fake
                system_prompt_ref: roles/helion/HELION_CORE/security_anti_fraud_anti_fake.md
                llm_profile: reasoning
              - id: energy_systems_engineer
                role_context: Energy Systems Engineer (GGU/BioMiner/SES)
                system_prompt_ref: roles/helion/HELION_CORE/energy_systems_engineer.md
                llm_profile: science
              - id: finance_roi_modeler
                role_context: Finance & ROI Modeler
                system_prompt_ref: roles/helion/HELION_CORE/finance_roi_modeler.md
                llm_profile: reasoning
              - id: dao_guide_governance_onboarding
                role_context: DAO Guide (Governance & Onboarding)
                system_prompt_ref: roles/helion/HELION_CORE/dao_guide_governance_onboarding.md
                llm_profile: community
              - id: tokenization_rwa_nft_architect
                role_context: Tokenization & RWA/NFT Architect
                system_prompt_ref: roles/helion/HELION_CORE/tokenization_rwa_nft_architect.md
                llm_profile: reasoning
              - id: growth_soft_selling_cx
                role_context: Growth & Soft-Selling CX
                system_prompt_ref: roles/helion/HELION_CORE/growth_soft_selling_cx.md
                llm_profile: community
              - id: operations_integrations_crm_payments_kyc_hub
                role_context: Operations & Integrations (CRM/Payments/KYC Hub)
                system_prompt_ref: roles/helion/HELION_CORE/operations_integrations_crm_payments_kyc_hub.md
                llm_profile: fast
              - id: observability_eval_analyst
                role_context: Observability & Eval Analyst
                system_prompt_ref: roles/helion/HELION_CORE/observability_eval_analyst.md
                llm_profile: science
            delegation:
              enabled: false
      a2a:
        enabled: false
        allow_top_level_agents: []
        max_hops: 2
        forbid_self: true
      response_contract:
        user_visible_speaker: self
        crew_roles_user_visible: false
    
    crewai:
      enabled: true
      orchestrator: true
      team:
        - role: "Energy Analyst"
          skills: [market_research, data_analysis]
        - role: "Biomass Specialist"
          skills: [biomass_tech, processing]
        - role: "Strategy Advisor"
          skills: [investment, planning]
    
    handoff_contract:
      accepts_from: [daarwizz]
      can_delegate_to: [helion_team]

  # ---------------------------------------------------------------------------
  # AISTALK - Autonomous Cyber Detective Agency
  # ---------------------------------------------------------------------------
  - id: aistalk
    display_name: AISTALK
    class: top_level
    visibility: private
    scope: global
    telegram_mode: "off"
    lifecycle_status: planned
    public_channels:
      telegram: false

    canonical_role: "Autonomous Cyber Detective Agency Orchestrator"
    mission: |
      AISTALK - автономне агентство кібердетективів для розслідувань загроз і
      вразливостей у Web2, Web3, AI, media-forensics та quantum-risk сценаріях.
      На етапі планування агент працює як внутрішній оркестратор команди
      спеціалізованих ролей з асинхронним case lifecycle.

    domains:
      - cybersecurity
      - threat_intelligence
      - incident_response
      - web3_security
      - ai_security
      - quantum_risk
      - osint
      - vulnerability_management

    routing:
      priority: 84
      keywords:
        - aistalk
        - cyber
        - cybersecurity
        - кібер
        - osint
        - incident
        - threat
        - vulnerability
        - redteam
        - blueteam
        - bughunter
        - quantum risk
        - media forensics
        - video analysis
        - deepfake

    llm_profile: reasoning
    prompt_file: aistalk_prompt.txt

    orchestration:
      mode: hybrid
      crew:
        enabled: true
        default_profile: default
        profile_hints:
          default: [osint, threat_hunt, vulns, web3, ai, red-blue, media_forensics, video, audio, photo, forensic, deepfake]
        profiles:
          default:
            team_name: AISTALK Cyber Detective Unit
            parallel_roles: true
            max_concurrency: 7
            synthesis:
              role_context: AISTALK Orchestrator & Analyst
              system_prompt_ref: roles/aistalk/orchestrator_synthesis.md
              llm_profile: reasoning
            team:
              - id: tracer
                role_context: Tracer (OSINT Collector)
                system_prompt_ref: roles/aistalk/tracer.md
                llm_profile: science
              - id: shadow
                role_context: Shadow (Covert Intelligence)
                system_prompt_ref: roles/aistalk/shadow.md
                llm_profile: reasoning
              - id: stealth
                role_context: Stealth (Low-Noise Recon)
                system_prompt_ref: roles/aistalk/stealth.md
                llm_profile: reasoning
              - id: graph
                role_context: Graph (Entity Relationship Mapper)
                system_prompt_ref: roles/aistalk/graph.md
                llm_profile: science
              - id: risk
                role_context: Risk (Scoring and Prioritization)
                system_prompt_ref: roles/aistalk/risk.md
                llm_profile: reasoning
              - id: neuron
                role_context: Neuron (Deep Analysis)
                system_prompt_ref: roles/aistalk/neuron.md
                llm_profile: reasoning
              - id: aurora
                role_context: Aurora (Autonomous Media Forensics)
                system_prompt_ref: roles/aistalk/aurora.md
                llm_profile: science
                skills: [video_enhancement, audio_forensics, photo_restoration, chain_of_custody]
              - id: vault
                role_context: Vault (Secrets and Confidential Data Guard)
                system_prompt_ref: roles/aistalk/vault.md
                llm_profile: fast
              - id: redteam
                role_context: RedTeam (Ethical Attack Simulation)
                system_prompt_ref: roles/aistalk/redteam.md
                llm_profile: reasoning
              - id: bughunter
                role_context: BugHunter (Static Security Scan)
                system_prompt_ref: roles/aistalk/bughunter.md
                llm_profile: science
              - id: devteam
                role_context: DevTeam (Remediation Designer)
                system_prompt_ref: roles/aistalk/devteam.md
                llm_profile: reasoning
              - id: blueteam
                role_context: BlueTeam (Defense Hardening)
                system_prompt_ref: roles/aistalk/blueteam.md
                llm_profile: reasoning
              - id: purpleteam
                role_context: PurpleTeam (Attack-Defense Loop)
                system_prompt_ref: roles/aistalk/purpleteam.md
                llm_profile: community
              - id: quantum
                role_context: Quantum (Post-Quantum Risk Assessor)
                system_prompt_ref: roles/aistalk/quantum.md
                llm_profile: science
            delegation:
              enabled: false
      a2a:
        enabled: false
        allow_top_level_agents: []
        max_hops: 2
        forbid_self: true
      response_contract:
        user_visible_speaker: self
        crew_roles_user_visible: false

    crewai:
      enabled: true
      orchestrator: true
      team:
        - role: "Tracer"
          skills: [osint, digital_footprint]
        - role: "Shadow"
          skills: [darkweb_recon, covert_collection]
        - role: "Graph"
          skills: [entity_resolution, link_analysis]
        - role: "Risk"
          skills: [cvss, mitre_mapping]
        - role: "Aurora"
          skills: [media_forensics, video_enhancement, audio_forensics, photo_analysis]
        - role: "Analyst"
          skills: [synthesis, reporting]

    handoff_contract:
      accepts_from: [daarwizz, yaromir]
      can_delegate_to: [aistalk_team]

  # ---------------------------------------------------------------------------
  # ALATEYA - Research Lab OS
  # ---------------------------------------------------------------------------
  - id: alateya
    display_name: Aletheia
    class: top_level
    visibility: public
    scope: global
    telegram_mode: public
    public_channels:
      telegram: true
    
    canonical_role: "Interdisciplinary Research Agent & Lab OS"
    mission: |
      Міждисциплінарний дослідницький агент та операційна система лабораторії.
      Виявляє приховану істину в системах, пропонує рішення що спрощують.
      Міст між епохами: мудрість минулого + технології сьогодення + бачення майбутнього.
    
    domains:
      - research
      - science
      - interdisciplinary
      - triz
      - innovation
      - hypothesis
      - experiments
    
    routing:
      priority: 80
      keywords:
        - дослідження
        - research
        - наука
        - science
        - гіпотеза
        - hypothesis
        - експеримент
        - triz
        - аналіз
        - synthesis
    
    llm_profile: science
    prompt_file: alateya_prompt.txt
    
    mentor:
      name: "Олександр Вертій (Алвєр)"
      telegram: "@archenvis"
      email: "alverjob@gmail.com"
      site: "https://alverjob.xyz"
      youtube: "https://www.youtube.com/@alverjob72"
    
    crewai:
      enabled: true
      orchestrator: true
      team:
        - role: "Prof-Erudite"
          skills: [search, verification, analogies]
        - role: "Prof-Analyst"
          skills: [decomposition, triz, formalization]
        - role: "Prof-Creative"
          skills: [lateral_thinking, cross_domain]
        - role: "Prof-Optimizer"
          skills: [feasibility, risk_assessment]
        - role: "Prof-Communicator"
          skills: [synthesis, presentation]
    
    handoff_contract:
      accepts_from: [daarwizz]
      can_delegate_to: [alateya_team]

  # ---------------------------------------------------------------------------
  # DRUID - Ayurvedic R&D
  # ---------------------------------------------------------------------------
  - id: druid
    display_name: DRUID
    class: top_level
    visibility: public
    scope: global
    telegram_mode: public
    public_channels:
      telegram: true
    
    canonical_role: "Alchemical Formulation & Ayurvedic R&D (cosmetics & hygiene)"
    mission: |
      Дослідження аюрведи та алхімії для створення формул косметології 
      та гігієнічних засобів. Пояснює інгредієнти, сумісність, базову безпеку,
      INCI-логіку та прототипування.
    
    domains:
      - ayurveda
      - herbalism
      - formulation_science
      - cosmetics_rnd
      - hygiene_products
      - ingredients
      - inci
      - safety_basics
    
    routing:
      priority: 75
      keywords:
        - ayurveda
        - аюрведа
        - herbs
        - трави
        - tincture
        - настоянка
        - formulation
        - формула
        - emulsion
        - емульсія
        - surfactant
        - preservative
        - консервант
        - inci
        - balm
        - бальзам
        - shampoo
        - шампунь
        - soap
        - мило
        - deodorant
        - дезодорант
        - hygiene
        - косметика
        - cosmetics
    
    llm_profile: science
    prompt_file: druid_prompt.txt
    
    crewai:
      enabled: true
      orchestrator: true
      team:
        - role: "Formulation Researcher"
          skills: [sourcing, synthesis]
        - role: "Ingredient Analyst"
          skills: [compatibility, inci]
        - role: "Safety & QA"
          skills: [contraindications, stability_basics]
    
    handoff_contract:
      accepts_from: [daarwizz]
      can_delegate_to: [druid_team]

  # ---------------------------------------------------------------------------
  # NUTRA - Nutraceutical Agent
  # ---------------------------------------------------------------------------
  - id: nutra
    display_name: NUTRA
    class: top_level
    visibility: public
    scope: global
    telegram_mode: public
    public_channels:
      telegram: true
    
    canonical_role: "Nutraceutical Research & Health Optimization Agent"
    mission: |
      Нутріцевтичний агент. Допомагає з формулами нутрієнтів, біомедичних добавок 
      та лабораторних інтерпретацій. Консультує з питань харчування, вітамінів 
      та оптимізації здоровя.
    
    domains:
      - nutrition
      - supplements
      - biomarkers
      - health_optimization
      - lab_interpretation
      - vitamins
      - microbiome
    
    routing:
      priority: 75
      keywords:
        - нутрієнти
        - nutrients
        - вітаміни
        - vitamins
        - добавки
        - supplements
        - біомаркери
        - biomarkers
        - здоровя
        - health
        - дієта
        - diet
        - мікробіом
        - microbiome
        - аналізи
        - lab
    
    llm_profile: science
    prompt_file: nutra_prompt_v4_full.txt

    orchestration:
      mode: hybrid
      crew:
        enabled: true
        default_profile: default
        profiles:
          default:
            team_name: NUTRA Wellness Team
            parallel_roles: true
            max_concurrency: 4
            synthesis:
              role_context: NUTRA Orchestrator
              system_prompt_ref: roles/nutra/nutra/orchestrator_synthesis.md
              llm_profile: reasoning
            team:
              - id: ai_nutritionist
                role_context: AI-Нутрициолог
                system_prompt_ref: roles/nutra/nutra/ai_nutritionist.md
                llm_profile: science
              - id: ai_clinical_nutritionist
                role_context: AI-Клінічний нутрициолог
                system_prompt_ref: roles/nutra/nutra/ai_clinical_nutritionist.md
                llm_profile: science
              - id: ai_detox_mentor
                role_context: AI-Детокс-наставник
                system_prompt_ref: roles/nutra/nutra/ai_detox_mentor.md
                llm_profile: community
              - id: ai_endocrine_guide
                role_context: AI-Ендокрин-гід
                system_prompt_ref: roles/nutra/nutra/ai_endocrine_guide.md
                llm_profile: reasoning
              - id: ai_fitness_trainer
                role_context: AI-Фітнес-тренер
                system_prompt_ref: roles/nutra/nutra/ai_fitness_trainer.md
                llm_profile: community
              - id: ai_gastro_assistant
                role_context: AI-Гастро-асистент
                system_prompt_ref: roles/nutra/nutra/ai_gastro_assistant.md
                llm_profile: science
              - id: ai_psychologist_coach
                role_context: AI-Психолог-коуч
                system_prompt_ref: roles/nutra/nutra/ai_psychologist_coach.md
                llm_profile: community
              - id: ai_cosmetologist_expert
                role_context: AI-Косметолог-експерт
                system_prompt_ref: roles/nutra/nutra/ai_cosmetologist_expert.md
                llm_profile: reasoning
              - id: ai_trichologist
                role_context: AI-Трихолог
                system_prompt_ref: roles/nutra/nutra/ai_trichologist.md
                llm_profile: science
              - id: ai_sleep_expert
                role_context: AI-Сон-експерт
                system_prompt_ref: roles/nutra/nutra/ai_sleep_expert.md
                llm_profile: science
              - id: ai_foodhacker
                role_context: AI-Фудхакер
                system_prompt_ref: roles/nutra/nutra/ai_foodhacker.md
                llm_profile: science
              - id: face_fitness_trainer
                role_context: Фейс-Фітнес Тренер
                system_prompt_ref: roles/nutra/nutra/face_fitness_trainer.md
                llm_profile: community
              - id: body_trainer
                role_context: Тренер Тіла
                system_prompt_ref: roles/nutra/nutra/body_trainer.md
                llm_profile: community
              - id: cycle_mentor
                role_context: Наставниця Циклу
                system_prompt_ref: roles/nutra/nutra/cycle_mentor.md
                llm_profile: community
              - id: motherhood_mentor
                role_context: Наставниця Материнства
                system_prompt_ref: roles/nutra/nutra/motherhood_mentor.md
                llm_profile: community
              - id: healer
                role_context: Цілителька
                system_prompt_ref: roles/nutra/nutra/healer.md
                llm_profile: community
              - id: diet_log_analyst
                role_context: AI-Аналітик Раціону
                system_prompt_ref: roles/nutra/nutra/diet_log_analyst.md
                llm_profile: science
            delegation:
              enabled: false
      a2a:
        enabled: false
        allow_top_level_agents: []
        max_hops: 2
        forbid_self: true
      response_contract:
        user_visible_speaker: self
        crew_roles_user_visible: false
    
    crewai:
      enabled: true
      orchestrator: true
      team:
        - role: "Nutritional Scientist"
          skills: [research, formulation]
        - role: "Lab Interpreter"
          skills: [biomarkers, analysis]
        - role: "Protocol Designer"
          skills: [supplementation, dosing]
    
    handoff_contract:
      accepts_from: [daarwizz]
      can_delegate_to: [nutra_team]

  # ---------------------------------------------------------------------------
  # AGROMATRIX - Agricultural Analytics
  # ---------------------------------------------------------------------------
  - id: agromatrix
    display_name: "Степан Матрікс"
    class: top_level
    visibility: public
    scope: global
    telegram_mode: public
    public_channels:
      telegram: true
    
    canonical_role: "Digital Field Agent for AgroMatrix Platform"
    mission: |
      Польовий цифровий агент платформи AgroMatrix. Перетворює агровиробництво 
      на керовану, вимірювану й прибуткову систему через дані, процеси та автоматизацію.
    
    domains:
      - agriculture
      - agronomy
      - crop_planning
      - field_management
      - operations
      - logistics
      - farm_economics
    
    routing:
      priority: 80
      keywords:
        - агро
        - agro
        - ферма
        - farm
        - поле
        - field
        - урожай
        - crop
        - сівба
        - посів
        - добрива
        - fertilizer
        - техніка
        - агроматрикс
        - agromatrix
    
    llm_profile: science
    prompt_file: agromatrix_prompt.txt
    
    crewai:
      enabled: true
      orchestrator: true
      team:
        - role: "Agronomist"
          skills: [crop_planning, soil_analysis]
        - role: "Operations Manager"
          skills: [logistics, scheduling]
        - role: "Farm Economist"
          skills: [budgeting, profitability]
    
    handoff_contract:
      accepts_from: [daarwizz]
      can_delegate_to: [agromatrix_team]

  # ---------------------------------------------------------------------------
  # GREENFOOD - Craft Food ERP
  # ---------------------------------------------------------------------------
  - id: greenfood
    display_name: GREENFOOD
    class: top_level
    visibility: public
    scope: global
    telegram_mode: public
    public_channels:
      telegram: true
    
    canonical_role: "AI-ERP for Craft Food Producers & Cooperatives"
    mission: |
      AI-асистент для крафтових виробників органічної продукції, кооперативів 
      та малих фермерських господарств. Облік, логістика, сертифікація, продажі.
    
    domains:
      - erp
      - inventory
      - logistics
      - organic_certification
      - cooperatives
      - food_production
      - sales
    
    routing:
      priority: 75
      keywords:
        - erp
        - облік
        - inventory
        - логістика
        - logistics
        - партія
        - batch
        - сертифікат
        - organic
        - кооператив
        - cooperative
        - продукція
        - product
        - greenfood
    
    llm_profile: community
    prompt_file: greenfood_prompt.txt
    
    crewai:
      enabled: true
      orchestrator: true
      team:
        - role: "Inventory Specialist"
          skills: [tracking, batches]
        - role: "Logistics Coordinator"
          skills: [routing, delivery]
        - role: "Certification Expert"
          skills: [organic_standards, compliance]
    
    handoff_contract:
      accepts_from: [daarwizz]
      can_delegate_to: [greenfood_team]

  # ---------------------------------------------------------------------------
  # CLAN - Community Spirit
  # ---------------------------------------------------------------------------
  - id: clan
    display_name: CLAN
    class: top_level
    visibility: public
    scope: global
    telegram_mode: public
    public_channels:
      telegram: true
    
    canonical_role: "Spirit of Community & Collective Wisdom Keeper"
    mission: |
      Дух Общини в екосистемі DAARION.city. Втілення колективної свідомості, 
      духу співпраці та взаємодопомоги. Підтримує звязки між учасниками, 
      зберігає традиції, допомагає в колективних рішеннях.
    
    domains:
      - community
      - traditions
      - collective_decisions
      - onboarding
      - culture
      - facilitation
    
    routing:
      priority: 70
      keywords:
        - община
        - community
        - клан
        - clan
        - традиції
        - traditions
        - спільнота
        - голосування
        - voting
        - культура
        - culture
    
    llm_profile: community
    prompt_file: clan_prompt.txt
    
    crewai:
      enabled: true
      orchestrator: true
      team:
        - role: "Community Facilitator"
          skills: [moderation, conflict_resolution]
        - role: "Culture Keeper"
          skills: [traditions, storytelling]
        - role: "Event Coordinator"
          skills: [planning, engagement]
    
    handoff_contract:
      accepts_from: [daarwizz]
      can_delegate_to: [clan_team]

  # ---------------------------------------------------------------------------
  # EONARCH - Consciousness Evolution
  # ---------------------------------------------------------------------------
  - id: eonarch
    display_name: EONARCH
    class: top_level
    visibility: public
    scope: global
    telegram_mode: public
    public_channels:
      telegram: true
    
    canonical_role: "Guide of Consciousness Evolution & New Paradigm Architect"
    mission: |
      Провідник еволюції свідомості. Супроводжує людство на шляху трансформації 
      від індивідуалізму до колективної мудрості, від матеріалізму до цілісного 
      світогляду. Міст між епохами, архітектор нової парадигми.
    
    domains:
      - consciousness
      - evolution
      - philosophy
      - integral_theory
      - transformation
      - spirituality
    
    routing:
      priority: 65
      keywords:
        - свідомість
        - consciousness
        - еволюція
        - evolution
        - трансформація
        - transformation
        - духовність
        - spirituality
        - філософія
        - philosophy
        - інтегральний
        - integral
    
    llm_profile: community
    prompt_file: eonarch_prompt.txt
    
    crewai:
      enabled: true
      orchestrator: true
      team:
        - role: "Philosopher"
          skills: [synthesis, frameworks]
        - role: "Practice Guide"
          skills: [meditation, rituals]
        - role: "Integration Facilitator"
          skills: [embodiment, application]
    
    handoff_contract:
      accepts_from: [daarwizz]
      can_delegate_to: [eonarch_team]

  # ---------------------------------------------------------------------------
  # YAROMIR - Private Technical Lead
  # ---------------------------------------------------------------------------
  - id: yaromir
    display_name: YAROMIR
    class: top_level
    visibility: private
    scope: global
    telegram_mode: whitelist
    public_channels:
      telegram: true
    
    canonical_role: "Private Technical Lead & Strategic Builder"
    mission: |
      Приватний агент для техлідства, архітектури, ревю, стратегічних рішень 
      і збірки. Доступ тільки через RBAC/Entitlements або whitelist.
    
    domains:
      - architecture
      - development
      - infrastructure
      - security
      - code_review
      - strategy
    
    routing:
      priority: 60
      keywords:
        - architecture
        - архітектура
        - refactor
        - рефакторинг
        - review
        - ревю
        - infra
        - deploy
        - security
        - безпека
    
    llm_profile: strategist
    prompt_file: yaromir_prompt.txt
    
    access_control:
      mode: whitelist
      allowed_users: []  # Configured via RBAC
      allowed_roles: [admin, tech_lead, developer]
    
    crewai:
      enabled: true
      orchestrator: true
      team:
        - role: "Code Reviewer"
          skills: [code_review, best_practices]
        - role: "Infra Builder"
          skills: [docker, ci, linux]
        - role: "Security Analyst"
          skills: [audit, vulnerabilities]
    
    handoff_contract:
      accepts_from: [daarwizz]
      can_delegate_to: [yaromir_team]

  # ---------------------------------------------------------------------------
  # SOUL - Spiritual Guide (Optional)
  # ---------------------------------------------------------------------------
  - id: soul
    display_name: SOUL
    class: top_level
    visibility: public
    scope: global
    telegram_mode: public
    public_channels:
      telegram: true
    
    canonical_role: "Spiritual Mentor & Living OS Guide"
    mission: |
      Духовний гід комюніті. Ментор живої операційної системи.
      Пояснює місію, підтримує мораль, працює із soft-skills.
    
    domains:
      - spirituality
      - motivation
      - soft_skills
      - mission
      - values
      - wellbeing
    
    routing:
      priority: 50
      keywords:
        - душа
        - soul
        - spirit
        - дух
        - мотивація
        - motivation
        - цінності
        - values
        - місія
        - mission
        - wellbeing
    
    llm_profile: community
    prompt_file: soul_prompt.txt
    
    crewai:
      enabled: true
      orchestrator: true
      team:
        - role: "Motivator"
          skills: [encouragement, perspective]
        - role: "Values Guardian"
          skills: [ethics, alignment]
    
    handoff_contract:
      accepts_from: [daarwizz]
      can_delegate_to: [soul_team]


  # ---------------------------------------------------------------------------
  # SENPAI - Trading & Capital Markets
  # ---------------------------------------------------------------------------
  - id: senpai
    display_name: SENPAI
    class: top_level
    visibility: public
    scope: global
    telegram_mode: public
    public_channels:
      telegram: true
    
    canonical_role: "Trading Advisor & Capital Markets Strategist"
    mission: |
      Gordon Senpai — radnik z rynkiv kapitalu ta tsyfrovykh aktyviv.
      Dopomagaye z treydyngom, ryzyk-menedzhmentom, analizom rynkiv.
      Maye dostup do real-time market data cherez tool market_data.
    
    domains:
      - trading
      - crypto
      - market_analysis
      - risk_management
      - defi
      - portfolio
    
    routing:
      priority: 80
      keywords:
        - trading
        - price
        - bitcoin
        - btc
        - eth
        - crypto
        - market
        - portfolio
        - risk
        - senpai
        - gordon
    
    llm_profile: grok
    prompt_file: senpai_prompt.txt
    
    specialized_tools:
      - market_data

    orchestration:
      mode: llm_only
      crew:
        enabled: false
        default_profile: default
        profiles: {}
      a2a:
        enabled: false
        allow_top_level_agents: []
        max_hops: 2
        forbid_self: true
      response_contract:
        user_visible_speaker: self
        crew_roles_user_visible: false
    
    crewai:
      enabled: false
      orchestrator: false
      team: []
    
    handoff_contract:
      accepts_from: [daarwizz]
      can_delegate_to: []

  # ---------------------------------------------------------------------------
  # 1OK - Window Master Assistant
  # ---------------------------------------------------------------------------
  - id: oneok
    display_name: "1OK"
    class: top_level
    visibility: private
    scope: global
    telegram_mode: whitelist
    public_channels:
      telegram: true

    canonical_role: "Асистент віконного майстра (лід -> замір -> КП)"
    mission: |
      Доменно-спеціалізований асистент для віконного бізнесу.
      Проводить користувача через повний цикл: кваліфікація ліда,
      підготовка до заміру, формування комерційної пропозиції.
      Працює з мінімізацією персональних даних та структурованим виходом.

    domains:
      - windows
      - window_measurement
      - quote_generation
      - sales_ops
      - crm
      - scheduling
      - installation

    routing:
      priority: 82
      keywords:
        - 1ok
        - 1ок
        - вікна
        - окна
        - windows
        - замір
        - замер
        - склопакет
        - профіль
        - монтаж
        - фурнітура
        - калькуляція
        - комерційна пропозиція
        - кп

    llm_profile: reasoning
    prompt_file: oneok_prompt.txt

    mentor:
      name: "Ілля Титар"
      telegram: "@Titar240581"

    primary_user:
      name: "Ілля Титар"
      telegram: "@Titar240581"

    access_control:
      mode: whitelist
      allowed_users: ["@Titar240581"]
      allowed_roles: [admin, sales, operator]

    specialized_tools:
      - espocrm
      - calcom
      - window_calculator
      - gotenberg
      - qdrant

    orchestration:
      mode: llm_only
      crew:
        enabled: false
        default_profile: default
        profiles: {}
      a2a:
        enabled: false
        allow_top_level_agents: []
        max_hops: 2
        forbid_self: true
      response_contract:
        user_visible_speaker: self
        crew_roles_user_visible: false

    crewai:
      enabled: false
      orchestrator: false
      team: []

    handoff_contract:
      accepts_from: [daarwizz, helion, greenfood]
      can_delegate_to: []

  # ---------------------------------------------------------------------------
  # SOFIIA - Chief AI Architect
  # ---------------------------------------------------------------------------
  - id: sofiia
    display_name: Sophia
    class: top_level
    visibility: private
    scope: global
    telegram_mode: whitelist
    public_channels:
      telegram: true
    
    canonical_role: "Chief AI Architect & Technical Sovereign"
    mission: |
      Sophia — Chief AI Architect ta Technical Sovereign ekosystemy DAARION.city.
      Koordynuye R&D, arkhitekturu, bezpeku ta evolyutsiyu platformy.
    
    domains:
      - architecture
      - ai_research
      - security
      - platform_evolution
      - technical_leadership
    
    routing:
      priority: 90
      keywords:
        - architecture
        - sophia
        - sofiia
        - platform
        - security
        - evolution
    
    llm_profile: grok
    prompt_file: sofiia_prompt.txt
    
    access_control:
      mode: whitelist
      allowed_users: []
      allowed_roles: [admin, architect]

    orchestration:
      mode: llm_only
      crew:
        enabled: false
        default_profile: default
        profiles: {}
      a2a:
        enabled: false
        allow_top_level_agents: []
        max_hops: 2
        forbid_self: true
      response_contract:
        user_visible_speaker: self
        crew_roles_user_visible: false
    
    crewai:
      enabled: false
      orchestrator: false
      team: []
    
    handoff_contract:
      accepts_from: [daarwizz, yaromir]
      can_delegate_to: []

  # ---------------------------------------------------------------------------
  # MONITOR - Node-Local Service Agent
  # ---------------------------------------------------------------------------
  - id: monitor
    display_name: MONITOR
    class: internal
    visibility: internal
    scope: node_local
    telegram_mode: "off"
    public_channels:
      telegram: "false"
    
    canonical_role: "Node Monitor & Incident Responder"
    mission: |
      Локальний агент ноди: метрики, алерти, діагностика, інцидент-дії (allowlist).
      Не user-facing, доступ тільки через NATS/HTTP + RBAC.
    
    domains:
      - observability
      - incident
      - metrics
      - logs
      - uptime
      - diagnostics
    
    routing:
      priority: 5
      keywords:
        - alerts
        - metrics
        - latency
        - errors
        - uptime
        - restart
        - health
        - logs
    
    llm_profile: fast
    prompt_file: null  # No Telegram prompt needed
    
    node_binding:
      instance_id_format: "monitor@{node_id}"
      permissions_profile: "node_sre_allowlist"
    
    crewai:
      enabled: true
      orchestrator: false
      team: []
    
    handoff_contract:
      accepts_from: [any]
      can_delegate_to: []

  # ---------------------------------------------------------------------------
  # DEVTOOLS - Internal Development Agent
  # ---------------------------------------------------------------------------
  - id: devtools
    display_name: DevTools
    class: internal
    visibility: internal
    scope: global
    telegram_mode: "off"
    public_channels:
      telegram: "false"
    
    canonical_role: "Development Tools & Code Assistant"
    mission: |
      Допомагає розробникам з аналізом коду, рефакторингом, тестами, git операціями.
      Внутрішній агент, не user-facing.
    
    domains:
      - development
      - code_analysis
      - testing
      - git
      - refactoring
    
    routing:
      priority: 10
      keywords:
        - code
        - test
        - git
        - refactor
        - debug
        - lint
    
    llm_profile: fast
    prompt_file: null
    
    crewai:
      enabled: false
      orchestrator: false
      team: []
    
    handoff_contract:
      accepts_from: [yaromir, daarwizz]
      can_delegate_to: []

  # ---------------------------------------------------------------------------
  # COMFY - Image & Video Generation Service (NODE3)
  # ---------------------------------------------------------------------------
  - id: comfy
    display_name: Comfy
    class: internal
    visibility: internal
    scope: node_local
    telegram_mode: "off"
    public_channels:
      telegram: "false"
    
    canonical_role: "Image & Video Generation Specialist"
    mission: |
      Спеціалізований агент для генерації зображень та відео через ComfyUI.
      Працює на NODE3 з GPU (RTX 3090). Підтримує text-to-image, text-to-video (LTX-2),
      та image-to-video workflows. Доступ через NATS або REST API.
    
    domains:
      - image_generation
      - video_generation
      - comfyui
      - stable_diffusion
      - ltx2
      - creative
    
    routing:
      priority: 70
      keywords:
        - image
        - зображення
        - video
        - відео
        - generate
        - генерувати
        - picture
        - картинка
        - render
        - візуалізація
        - comfy
    
    llm_profile: null  # No LLM needed, direct ComfyUI integration
    prompt_file: null
    
    node_binding:
      instance_id_format: "comfy@{node_id}"
      node_id: "node-3-threadripper-rtx3090"
      api_endpoint: "http://212.8.58.133:8880"
      nats_subject: "agent.invoke.comfy"
    
    specialized_tools:
      - comfy_generate_image
      - comfy_generate_video
    
    capabilities:
      - text-to-image
      - text-to-video
      - image-to-video
      - workflow-execution
    
    crewai:
      enabled: false
      orchestrator: false
      team: []
    
    handoff_contract:
      accepts_from: [any]
      can_delegate_to: []
