
    !<i              	       &   d dl Z d dlZd dlmZmZ d dlmZ d dlmZm	Z	m
Z
mZmZ d dlmZ ej        dk     rd dlmZ nd dlmZ erd dlma  ed	          Zda	 	 ddede j        dz  de
d         fdZedededdef         f         de
d         defd            Zededef         de
d         defd            Zedddededde	f         f         dedz  de	fd            Zedddede	f         dedz  de	fd            Zdddedz  fdZdS )    N)Callable	Coroutine)partial)TYPE_CHECKINGAnyLiteralTypeVaroverload)ResultAction)      )assert_neverAppVasynciocommandboundbackend)r   trioc                    t          j        |           s|
 |             S  | |j        i |j        S |dk    rHddl}||                     |                       S |                     | |j        i |j                  S |dk    rHddl}||                    |           S |                    t          | g|j        R i |j                  S t          |           dS )a  Run a command, handling both sync and async cases.

    If the command is async, an async context will be created to run it.

    Parameters
    ----------
    command : Callable
        The command to execute.
    bound : inspect.BoundArguments | None
        Bound arguments for the command. If None, command is called with no arguments.
    backend : Literal["asyncio", "trio"]
        The async backend to use if the command is async.

    Returns
    -------
    return_value: Any
        The value the command function returns.
    Nr   r   r   )	inspectiscoroutinefunctionargskwargsr   runr   r   r   )r   r   r   r   r   s        /Users/kimhansen/Desktop/03 Workspace/ceo-agents/chl-effectiveness/mcp-servers/whoop/.venv/lib/python3.11/site-packages/cyclopts/_run.py_run_maybe_async_commandr      s   . &w// 8=7997EJ7%,777)=;;wwyy)));;ww
CelCCDDD	F		=88G$$$88GGIejIIIELIIJJJW    callable.result_actionreturn_valuereturnc                   d S N r    r!   s     r   r   r   F   s    ororr   c                   d S r%   r&   r'   s     r   r   r   J   s    X[X[r   r!   c                   d S r%   r&   r'   s     r   r   r   N   s	     #r   c                   d S r%   r&   r'   s     r   r   r   T   s    _b_br   c               ~    t           ddlm } |a t          |          }|                    |             |            S )a  Run the given callable as a CLI command.

    The callable may also be a coroutine function.
    This function is syntax sugar for very simple use cases, and is roughly equivalent to:

    .. code-block:: python

        from cyclopts import App

        app = App()
        app.default(callable)
        app()

    Parameters
    ----------
    callable
        The function to execute as a CLI command.
    result_action
        How to handle the command's return value. If not specified, uses the default
        ``"print_non_int_sys_exit"`` which calls :func:`sys.exit` with the appropriate code.
        Can be set to ``"return_value"`` to return the result directly for testing/embedding.

    Example usage:

    .. code-block:: python

        import cyclopts


        def main(name: str, age: int):
            print(f"Hello {name}, you are {age} years old.")


        cyclopts.run(main)
    Nr   r   r)   )r   cyclopts.coredefault)r    r!   _Appapps       r   r   r   X   sN    J {------
M
*
*
*CKK355Lr   )Nr   )r   syscollections.abcr   r   	functoolsr   typingr   r   r   r	   r
   cyclopts._result_actionr   version_infotyping_extensionsr   r-   r   r   BoundArgumentsr   r   r&   r   r   <module>r9      s}    



 / / / / / / / /       A A A A A A A A A A A A A A 0 0 0 0 0 0g.......###### "!!!!!!GCLL 
 ,0*3, ,,!D(, &', , , ,^ 
 r(3	$a- 889 rPWXfPg rlm r r r 
 r 
 [(36" [9P [UV [ [ [ 
 [ 
dh  sIdD#o667NZ]aNa   

 
QU b b b(38$ b<$;N bZ] b b b 
 b >B , , ,|d': , , , , , ,r   