
    "<i                     z   d Z ddlZddlZddlmZ ddlmZ ddlZddlZddl	m
Z
 ddlmZ ddlmZ dd	lmZ  ee          Zdddd
dddddededz  dedee         dz  dee         dz  deeef         dz  dededz  dedz  dedz  defdZdddddd
dddd	dedeedz   ej        ddgd          f         deee         dz   ej        dd d!"          f         deee         dz   ej        d#d$d!"          f         deee         dz   ej        d%d&d!"          f         d'eedz   ej        d(d)*          f         dee ej        d+d,d!"          f         d-eedz   ej        d.d/*          f         deedz   ej        d0d1*          f         deedz   ej        d2d3*          f         ddfd4ZdS )5zEMCP configuration JSON generation for FastMCP install using Cyclopts.    N)Path)	Annotated)print)
get_logger)UVEnvironment   )process_common_argsF)with_editablewith_packagesenv_varscopypython_versionwith_requirementsprojectfileserver_objectnamer
   r   r   r   r   r   r   returnc                   	 t          ||pg dgz   ||	|          }
|r|                                  d| }n!t          |                                           }|
                    dd|g          }|d         |dd         d}|r||d	<   ||i}t	          j        |d
          }|r(t          j        |           t          d| d           nt          |           dS # t          $ r}t          d| d           Y d}~dS d}~ww xY w)a  Generate MCP configuration JSON for manual installation.

    Args:
        file: Path to the server file
        server_object: Optional server object name (for :object suffix)
        name: Name for the server in MCP config
        with_editable: Optional list of directories to install in editable mode
        with_packages: Optional list of additional packages to install
        env_vars: Optional dictionary of environment variables
        copy: If True, copy to clipboard instead of printing to stdout
        python_version: Optional Python version to use
        with_requirements: Optional requirements file to install from
        project: Optional project directory to run within

    Returns:
        True if generation was successful, False otherwise
    fastmcp)pythondependenciesrequirementsr   editable:runr   r   N)commandargsenv   )indentz[green]MCP configuration for 'z' copied to clipboard[/green]Tz+[red]Failed to generate MCP configuration: z[/red]F)
r   resolvestrbuild_commandjsondumps	pyperclipr   r   	Exception)r   r   r   r
   r   r   r   r   r   r   
env_configserver_specfull_commandserver_configconfigjson_outputes                    /Users/kimhansen/Desktop/03 Workspace/ceo-agents/chl-effectiveness/mcp-servers/whoop/.venv/lib/python3.11/site-packages/fastmcp/cli/install/mcp_json.pyinstall_mcp_jsonr1      sw   <-"!'-2)<*"
 
 

  	.!\\^^==m==KKdllnn--K "//E;0OPP $A $
 
  	,#+M%  & j222  	N;'''V4VVVWWWW +t   EAEEEFFFuuuuus   CC   
D*DD)	server_namer
   r   r   env_filer   r   r   r   r*   r2   z--namez-nz(Custom name for the server in MCP config)r   helpz--with-editablezVDirectory with pyproject.toml to install in editable mode (can be used multiple times) )r4   negativez--withz;Additional packages to install (can be used multiple times)z--envzFEnvironment variables in KEY=VALUE format (can be used multiple times)r3   z
--env-filez)Load environment variables from .env file)r4   z--copyz=Copy configuration to clipboard instead of printing to stdoutr   z--pythonz(Python version to use (e.g., 3.10, 3.11)z--with-requirementsz.Requirements file to install dependencies fromz	--projectz2Run the command within the given project directoryc       	            K   |pg }|pg }|pg }t          | ||||           d{V \  }
}}}}t          |
|||||||||	
  
        }|st          j        d           dS dS )zGenerate MCP configuration JSON for manual installation.

    Args:
        server_spec: Python file to install, optionally with :object suffix
    N)
r   r   r   r
   r   r   r   r   r   r   r   )r	   r1   sysexit)r*   r2   r
   r   r   r3   r   r   r   r   r   r   r   packagesenv_dictsuccesss                   r0   mcp_json_commandr=   b   s      Z "'RM!'RM~2H:M[-8; ; 5 5 5 5 5 51D-x ##+  G       )__doc__r%   r8   pathlibr   typingr   cycloptsr'   richr   fastmcp.utilities.loggingr   6fastmcp.utilities.mcp_server_config.v1.environments.uvr   sharedr	   __name__loggerr#   listdictboolr1   	Parameterr=    r>   r0   <module>rN      s(   K K  



                        0 0 0 0 0 0 P P P P P P ' ' ' ' ' '	H		 (,&*&*!%%)K K K
K:K K
 :$K 9t#K 38nt#K K $JK d{K D[K 
K K K Kn 	 	 	 	 	 	 	 	 	Kb b bb d
D!;	
 	
 	
	b T
Ti	
 	
 	
	b$ S	DN	
 	
 	
	%b4 S	DY	
 	
 	
	5bD t<	
 	
 	
	EbR P	
 	
 	
	Sbb d
;	
 	
 	
	cbp !t!A	
 	
 	
	qb~ tE	
 	
 	
	bL 
Mb b b b b br>   