# =====================================================
# Global Project Files
# =====================================================


# =====================================================
# Begin Package File Entries
# =====================================================
{%- for PKG in PROJ.PKGS %}


# -------------------------
# Package Source Files
# -------------------------
{% for MOD in PKG.MODULES %}

- FILE_NAME: "{% raw %}{{ PROJ.ROOT }}/base/swarmauri_base/{{ MOD.EXTRAS.RESOURCE_KIND }}/__init__.py.j2{% endraw %}"
  RENDERED_FILE_NAME: "{{ PROJ.ROOT }}/base/swarmauri_base/{{ MOD.EXTRAS.RESOURCE_KIND }}/__init__.py"
  PROCESS_TYPE: "COPY"
  AGENT_PROMPT_TEMPLATE: "agent_default.j2"
  PROJECT_NAME: "{{ PROJ.NAME }}"
  PACKAGE_NAME: "{{ PKG.NAME }}"
  MODULE_NAME: null
  EXTRAS:
    PURPOSE: "Initializes the source package for {{ PKG.NAME }}."
    DESCRIPTION: "This file makes the directory a Python package."
    DEPENDENCIES: []

- FILE_NAME: "{% raw %}{{ PROJ.ROOT }}/base/swarmauri_base/{{ MOD.EXTRAS.RESOURCE_KIND }}/{{ MOD.NAME }}.py.j2{% endraw %}"
  RENDERED_FILE_NAME: "{{ PROJ.ROOT }}/base/swarmauri_base/{{ MOD.EXTRAS.RESOURCE_KIND }}/{{ MOD.NAME }}.py"
  PROCESS_TYPE: "GENERATE"
  AGENT_PROMPT_TEMPLATE: "{{ MOD.AGENT_PROMPT_TEMPLATE_OVERRIDE | default(PKG.AGENT_PROMPT_TEMPLATE_OVERRIDE | default('agent_default.j2')) }}"
  PROJECT_NAME: "{{ PROJ.NAME }}"
  PACKAGE_NAME: "{{ PKG.NAME }}"
  MODULE_NAME: "{{ MOD.NAME }}"
  EXTRAS:
    DEPENDENCIES:
      {%- if MOD.EXTRAS.INTERFACE_FILE %}
              - "{{ MOD.EXTRAS.INTERFACE_FILE }}"
      {%- endif %}
      {%- if MOD.EXTRAS.EXTERNAL_DOC_FILES %}
        {%- for doc in MOD.EXTRAS.EXTERNAL_DOC_FILES %}
              - "{{ doc }}"
        {%- endfor %}
      {%- endif %}
      {%- if MOD.EXTRAS.DEPENDENCIES %}
        {%- for dep in MOD.EXTRAS.DEPENDENCIES %}
          {%- if "/" in dep %}
              - "{{ dep }}"
          {%- else %}
            {%- set parts = dep | split('.') %}
            {%- if parts | length > 2 %}
              - "{{ PROJ.ROOT }}/{{ (parts)[0] }}/{{ (parts)[0] }}/{{ (parts)[1] }}.{{ (parts)[2] }}"
            {%- else %}
              - "{{ PROJ.ROOT }}/base/swarmauri_base/{{ dep }}"
            {%- endif %}
          {%- endif %}
        {%- endfor %}
      {%- endif %}
      {%- if MOD.EXTRAS.MIXIN_FILES %}
        {%- for mf in MOD.EXTRAS.MIXIN_FILES %}
              - "{{ mf }}"
        {%- endfor %}
      {%- endif %}
    PURPOSE: "{{ MOD.EXTRAS.PURPOSE }}"
    DESCRIPTION: "{{ MOD.EXTRAS.DESCRIPTION }}"
    REQUIREMENTS:
      - "Implement the functionality for module {{ MOD.NAME }}."
      - "Provide a base implementation of all abstractmethods of {{ MOD.EXTRAS.INTERFACE_NAME }}, Do not Implement the logic."
      - "Raise NotImplementedError for all abstract methods with appropriate message."
    {%- if MOD.EXTRAS.REQUIREMENTS %}
    {%- for req in MOD.EXTRAS.REQUIREMENTS %}
      - "{{ req }}"
    {%- endfor %}
    {%- endif %}
    RESOURCE_KIND: "{{ MOD.EXTRAS.RESOURCE_KIND }}"
    INTERFACE_NAME: "{{ MOD.EXTRAS.INTERFACE_NAME }}"
    EXAMPLES: {{ MOD.EXTRAS.EXAMPLES | default([]) | tojson }}

{% endfor %}

{%- endfor %}
# =====================================================
# End of Payload
# =====================================================
