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


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

# -------------------------
# Package-Level Files for {{ PKG.NAME }}
# -------------------------

- FILE_NAME: "{% raw %}{{ PROJ.ROOT }}/{{ PKG.NAME }}/LICENSE.j2{% endraw %}"
  RENDERED_FILE_NAME: "{{ PROJ.ROOT }}/{{ PKG.NAME }}/LICENSE"
  PROCESS_TYPE: "COPY"
  AGENT_PROMPT_TEMPLATE: "agent_default.j2"
  PROJECT_NAME: "{{ PROJ.NAME }}"
  PACKAGE_NAME: "{{ PKG.NAME }}"
  MODULE_NAME: null
  EXTRAS:
    DEPENDENCIES: []
    PURPOSE: "Defines the license for package {{ PKG.NAME }}."
    DESCRIPTION: "This file contains the license for package {{ PKG.NAME }}."

- FILE_NAME: "{% raw %}{{ PROJ.ROOT }}/{{ PKG.NAME }}/pyproject.toml.j2{% endraw %}"
  RENDERED_FILE_NAME: "{{ PROJ.ROOT }}/{{ PKG.NAME }}/pyproject.toml"
  PROCESS_TYPE: "GENERATE"
  AGENT_PROMPT_TEMPLATE: "{{ PKG.AGENT_PROMPT_TEMPLATE_OVERRIDE | default('agent_default.j2') }}"
  PROJECT_NAME: "{{ PROJ.NAME }}"
  PACKAGE_NAME: "{{ PKG.NAME }}"
  MODULE_NAME: null
  EXTRAS:
    DEPENDENCIES:
      {#- Loop over modules to include their main file as dependencies #}
      {%- for MOD in PKG.MODULES %}
        - "{{ PROJ.ROOT }}/{{ PKG.NAME }}/{{ PKG.NAME }}/{{ MOD.NAME }}.py"
      {%- endfor %}
        - "{{ PROJ.ROOT }}/{{ PKG.NAME }}/{{ PKG.NAME }}/__init__.py"
    PURPOSE: "Specifies package metadata and dependencies for {{ PKG.NAME }}."
    DESCRIPTION: "Configuration for package {{ PKG.NAME }}. Must reference all module source files, README, and LICENSE."
    REQUIREMENTS:
      - "Must reference the main module, README, and LICENSE as applicable."
      - "Must include any third party dependencies, setting the version to '*'"
      - "Must include a comprehensive list of applicable keywords."

- FILE_NAME: "{% raw %}{{ PROJ.ROOT }}/{{ PKG.NAME }}/README.md.j2{% endraw %}"
  RENDERED_FILE_NAME: "{{ PROJ.ROOT }}/{{ PKG.NAME }}/README.md"
  PROCESS_TYPE: "GENERATE"
  AGENT_PROMPT_TEMPLATE: "{{ PKG.AGENT_PROMPT_TEMPLATE_OVERRIDE | default('agent_default.j2') }}"
  PROJECT_NAME: "{{ PROJ.NAME }}"
  PACKAGE_NAME: "{{ PKG.NAME }}"
  MODULE_NAME: null
  EXTRAS:
    DEPENDENCIES:
        - "{{ PROJ.ROOT }}/{{ PKG.NAME }}/{{ PKG.NAME }}/__init__.py"
      {%- for MOD in PKG.MODULES %}
        - "{{ PROJ.ROOT }}/{{ PKG.NAME }}/{{ PKG.NAME }}/{{ MOD.NAME }}.py"
      {%- endfor %}
        - "{{ PROJ.ROOT }}/{{ PKG.NAME }}/pyproject.toml"
    PURPOSE: "Documents package {{ PKG.NAME }}."
    DESCRIPTION: "{{ PKG.EXTRAS.DESCRIPTION  }}"
    REQUIREMENTS:
      - "Purpose: {{ PKG.EXTRAS.PURPOSE  }}"
      - "Authors: {{ PKG.EXTRAS.AUTHORS  | join(', ') }}"
      - "Include all of the HTML header shown in the example output."
      - "Based on the dependencies, create comprehensive installation and usage documentation sections."
      - "The installation and usage documentation sections should be significantly more complete than the example format provided."
      - "Do not include details regarding cloning or forking the repository."

# -------------------------
# Package Source Files
# -------------------------

- FILE_NAME: "{% raw %}{{ PROJ.ROOT }}/{{ PKG.NAME }}/{{ PKG.NAME }}/__init__.py.j2{% endraw %}"
  RENDERED_FILE_NAME: "{{ PROJ.ROOT }}/{{ PKG.NAME }}/{{ PKG.NAME }}/__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: []

{% for MOD in PKG.MODULES %}
- FILE_NAME: "{% raw %}{{ PROJ.ROOT }}/{{ PKG.NAME }}/{{ PKG.NAME }}/{{ MOD.NAME }}.py.j2{% endraw %}"
  RENDERED_FILE_NAME: "{{ PROJ.ROOT }}/{{ PKG.NAME }}/{{ PKG.NAME }}/{{ 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.BASE_FILE %}
              - "{{ MOD.EXTRAS.BASE_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 }}/{{ PKG.NAME }}/{{ PKG.NAME }}/{{ 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 implementation logic for inherited methods when applicable."
      - "Ensure that all methods include complete, comprehensive, and fully functional implementation logic."
    {%- if MOD.EXTRAS.REQUIREMENTS %}
    {%- for req in MOD.EXTRAS.REQUIREMENTS %}
      - "{{ req }}"
    {%- endfor %}
    {%- endif %}
    BASE_CLASS: "{{ MOD.EXTRAS.BASE_NAME }}"
    MIXINS: {{ MOD.EXTRAS.MIXINS | default([]) | tojson }}
    RESOURCE_KIND: "{{ MOD.EXTRAS.RESOURCE_KIND }}"
    EXAMPLES: {{ MOD.EXTRAS.EXAMPLES | default([]) | tojson }}

- FILE_NAME: "{% raw %}{{ PROJ.ROOT }}/{{ PKG.NAME }}/tests/unit/test_{{ MOD.NAME }}.py.j2{% endraw %}"
  RENDERED_FILE_NAME: "{{ PROJ.ROOT }}/{{ PKG.NAME }}/tests/unit/test_{{ 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:
      - "{{ PROJ.ROOT }}/{{ PKG.NAME }}/{{ PKG.NAME }}/{{ MOD.NAME }}.py"
    PURPOSE: "Unit tests for module {{ MOD.NAME }} in package {{ PKG.NAME }}."
    DESCRIPTION: "Tests for module {{ MOD.NAME }}."
    REQUIREMENTS:
      - "Must use pytest."
      - "Must use @pytest.mark.unit decorator to mark test cases."
      - "Where applicable use pytest fixtures and parameterize."
      - "Should import and test the class from the main module."

{% endfor %}

# -------------------------
# Package-Level Tests
# -------------------------

- FILE_NAME: "{% raw %}{{ PROJ.ROOT }}/{{ PKG.NAME }}/tests/i9n/test_i9n__init__.py.j2{% endraw %}"
  RENDERED_FILE_NAME: "{{ PROJ.ROOT }}/{{ PKG.NAME }}/tests/i9n/test_i9n__init__.py"
  PROCESS_TYPE: "GENERATE"
  AGENT_PROMPT_TEMPLATE: "{{ PKG.AGENT_PROMPT_TEMPLATE_OVERRIDE | default('agent_default.j2') }}"
  PROJECT_NAME: "{{ PROJ.NAME }}"
  PACKAGE_NAME: "{{ PKG.NAME }}"
  MODULE_NAME: "None"
  EXTRAS:
    PURPOSE: "Tests the package initializer for {{ PKG.NAME }}."
    DESCRIPTION: "Ensures that the __init__.py in the source folder loads correctly."
    REQUIREMENTS:
      - "Must use pytest."
      - "Must use @pytest.mark.i9n decorator to mark test cases."
      - "Where applicable use pytest fixtures."
    DEPENDENCIES:
      - "{{ PROJ.ROOT }}/{{ PKG.NAME }}/{{ PKG.NAME }}/__init__.py"

{%- endfor %}

# =====================================================
# End of Payload
# =====================================================
