
    7i                         d Z ddlZddlZddlmZmZ ddlmZ  ed      Zedz  dz  Zedz  d	z  Z	d
Z
dZdZg dg dg ddZddededefdZdedefdZdededdfdZy)uL  
PROMETHEUS — Capabilities & New Tech General
=============================================
Fires evaluation agents to assess and integrate new capabilities, MCPs, and models.

Usage:
    from core.generals.prometheus import spawn_prometheus
    results = spawn_prometheus("Evaluate Gemini 2.5 Flash vs MiniMax for coding tasks")
    N)datetimetimezone)Pathz/mnt/e/genesis-systemdataswarm_progresshiveprogressa  You are PROMETHEUS, the Capabilities & New Tech evaluator for Genesis.

Capability to evaluate: {capability}
Evaluation dimension {agent_index} of {total_agents}: {dimension}

Instructions:
1. Research this capability/model/tool thoroughly
2. Test it against Genesis use cases (ReceptionistAI, voice widget, GHL integration)
3. Benchmark against current Genesis stack
4. Identify integration path (native? custom code? MCP?)
5. Write capability card to: {output_file}

Capability Card format:
## Capability: {capability}
### Dimension: {dimension}
### Summary
### Performance vs Current Stack
### Integration Complexity (1-5 scale)
### Cost Impact ($USD/month estimate)
### Recommendation: ADOPT / TRIAL / REJECT
### Integration Path
### Next Steps
u	  You are PROMETHEUS, building a new MCP server for Genesis.

MCP to build: {capability}
Component {agent_index} of {total_agents}: {component}

Instructions:
1. Read existing MCP servers in /mnt/e/genesis-system/mcp-servers/ for patterns
2. Build this MCP component following the standard structure
3. Write to: {output_file}
4. Include: manifest.json, main handler, tool definitions, README

MCP Structure:
- index.js (or main.py) — tool handlers
- manifest.json — tool definitions
- README.md — usage instructions
a  You are a PROMETHEUS benchmark runner.

Model under test: {capability}
Benchmark suite {agent_index} of {total_agents}: {dimension}

Run these Genesis-specific benchmarks:
1. Code generation: Write a FastAPI endpoint with Pydantic models
2. Reasoning: Solve a multi-step orchestration problem
3. Context handling: Summarize a 10K token session transcript
4. Cost efficiency: Tokens used vs output quality
5. Speed: Time-to-first-token

Write results to: {output_file}
)z3Code generation quality vs MiniMax and Claude Haikuz#Reasoning depth vs Gemini 2.5 Flashz'Context window utilization (1M+ tokens)z&Cost per task vs current Genesis stackzSpeed and latency benchmarks)zTool capability coveragez#Integration complexity with GenesiszSecurity and sandboxingzPerformance and rate limitszDocumentation quality)z!Use case fit for Genesis missionszIntegration path and complexityzCost impact analysiszRisk assessmentzImplementation roadmap)modelmcp
capabilitycapability_to_evaluateagent_countreturnc                    t         j                  dd       t        j                  dd       dt        j                         j
                  dd  }t        |z  }|j                  dd       | j                         dv xs
 dv xs dv }t        fd	d
D              }|rdn|rdnd}|rdnd}t        j                  |t        d         d| }|rt        nt        }	|dd| dd  ||t        |      dddt        j                  t        j                         j#                         t%        |      d}
t         | dz  }t'        |      D ]}  \  }}|d|dz   ddz  }|	j)                  | |dz   t        |      ||t%        |            }|d|dz   ddz  j+                  |       t-        d|dz    dt        |       d|dd          t/        ||
       t-        d | d!t        |       d"| dd         |
S )#aS  
    Spawn evaluation agents for a new capability, model, or MCP.

    Parameters
    ----------
    capability_to_evaluate : str
        What to evaluate (model name, MCP name, capability description)
    agent_count : int
        Number of parallel evaluation agents (default 3)

    Returns
    -------
    dict with swarm metadata
    T)parentsexist_okprometheus_N   r   serverbuildc              3   &   K   | ]  }|v  
 y w)N ).0kw	cap_lowers     1/mnt/e/genesis-system/core/generals/prometheus.py	<genexpr>z#spawn_prometheus.<locals>.<genexpr>~   s     jr2?js   )r
   geminiclaudeminimaxdeepseekkimir
   r   zanthropic/claude-sonnet-4-5zanthropic/claude-haiku-4-5
PROMETHEUSz
Evaluate: P   r   running)swarm_idgeneralmissionr
   	task_typer   stories_completedstories_completed_this_hourstatus
started_at
output_dirz.jsoneval_   02dz
_output.md)r   agent_indextotal_agents	dimension	componentoutput_filez
_prompt.mdz[PROMETHEUS] Agent /z	 queued: <   z[PROMETHEUS] Swarm u    — z evaluators for: )SWARM_PROGRESS_DIRmkdirHIVE_PROGRESS_DIRuuiduuid4hexloweranyEVAL_DIMENSIONSgetPROMETHEUS_MCP_BUILD_PROMPTPROMETHEUS_EVAL_PROMPTlenr   nowr   utc	isoformatstr	enumerateformat
write_textprint_save_state)r   r   r&   r.   is_mcpis_modelr)   r
   
dimensionsprompt_templateswarm_state
state_fileir4   r6   promptr   s                   @r   spawn_prometheusrW   f   sJ    TD9D48TZZ\--bq123H"X-JTD1&,,.IiP8y#8PGy<PFj-ijjHg|I-3)9UE $$Y0MN|P[\J5;1AWO  6s ;<=:'(ll8<<0::<*oK $
%&88J!*- V9 U1Q3s):#>> ''-AZK( ( 
 
ac#Yj1	1==fE 	#AaC5#j/):)IcrNCSTUV  
K(	zs:.??PQghkikQlPm
no    c                     t        |       S )u>   Alias for spawn_prometheus — used by genesis_hive.py router.)rW   )r   s    r   spawnrZ      s    233rX   pathstatec                 Z    | j                  t        j                  |dt                     y )N   )indentdefault)rL   jsondumpsrI   )r[   r\   s     r   rN   rN      s    OODJJuQ<=rX   )   )__doc__ra   r<   r   r   pathlibr   	REPO_ROOTr9   r;   rD   rC   CAPABILITY_BENCHMARK_PROMPTrA   rI   intdictrW   rZ   rN   r   rX   r   <module>rj      s      ' ()	'*:: &3  0 " "2AS As A4 AH4# 4$ 4
>d >4 >D >rX   