+
    Q(i#                         R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIH	t	 ]	'       d   ^ RI
Ht ^ RIHt ]R 4       tR R	 ltR# )
z.Load Cyclopts App objects from Python scripts.N)contextmanager)Path)TYPE_CHECKINGApp)CommandSpecc               #  p   "   ^ RI Hp  V P                  pR p W n        Rx  Wn        R#   Yn        i ; i5i)zTemporarily disable App.__call__ to prevent execution during module loading.

This context manager replaces App.__call__ with a no-op function, allowing
scripts that call app() at module level to be imported without executing.
r   c                    R# )z9No-op replacement for App.__call__ during module loading.N )selfargskwargss   &*,U/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/cyclopts/loader.py_dummy_call,_suppress_app_execution.<locals>._dummy_call   s        N)cycloptsr   __call__)r   original_callr   s      r   _suppress_app_executionr      s/      LLM%"$}s   6
+ 636c                `    V ^8  d   QhR\         \        ,          R\        R\         3,          /# )   scriptreturnr   )strr   tuple)formats   "r   __annotate__r   %   s+     q qt qeSj0A qr   c                	  a ^ RI Hp Rp\        V 4      pRV9   dx   VP                  R^4      w  poS'       dO   \        ;QJ d    V3R lR 4       F  '       g   K   RM	  RM! V3R lR 4       4      '       g   Sp\        V4      pM\        V 4      pM\        V 4      pVP                  4       pVP                  4       '       g6   \        RV R2\        P                  R	7       \        P                  ! ^4       VP                  R
8X  g6   \        RV R2\        P                  R	7       \        P                  ! ^4       \        P                  P                  RV4      pVe   VP                   f6   \        RV R2\        P                  R	7       \        P                  ! ^4       \        P                  P#                  V4      pV\        P$                  R&   \'        4       ;_uu_ 4        VP                   P)                  V4       RRR4       V'       d   \+        Wr4      '       g9   \        RV RV R2\        P                  R	7       \        P                  ! ^4       \-        Wr4      p\/        W4      '       g6   \        RV R2\        P                  R	7       \        P                  ! ^4       W3# . p	\1        V4       FL  p
V
P3                  R4      '       d   K  \-        Wz4      p\/        W4      '       g   K:  V	P5                  W34       KN  	  V	'       g6   \        RV R2\        P                  R	7       \        P                  ! ^4       \7        V	4      ^8  d   . pV	 FI  w  r\+        VR4      '       g   K  VP9                  R VP:                  P=                  4        4       4       KK  	  V	 U
Uu. uF  w  rW9  g   K  W3NK  	  pp
pV'       d   Tp	\7        V	4      ^8  dt   RP?                  R V	 4       4      p\/        V \
        4      '       d   \        V 4      MT p\        RV RV R2\        P                  R	7       \        P                  ! ^4       V	^ ,          w  rW3#   + '       g   i     ELj; iu upp
i )a  Load a Cyclopts App object from a Python script.

Parameters
----------
script : str | Path
    Python script path, optionally with ``':app_object'`` notation to specify
    the :class:`App` object. If not specified, will search for :class:`App`
    objects in the script's global namespace.

Returns
-------
tuple[App, str]
    The loaded :class:`App` object and its name.

Raises
------
SystemExit
    If the script cannot be loaded, no App objects are found, or multiple
    App objects exist without specification.
r   N:c              3   ,   <"   T F	  qS9   x  K  	  R # 5iNr
   ).0seppotential_app_names   & r   	<genexpr>'load_app_from_script.<locals>.<genexpr>E   s     )[{1C*C{s   TFzError: Script 'z' not found.)filez.pyzError: 'z' is not a Python file.__cyclopts_doc_modulez#Error: Could not load module from 'z'.zError: No object named 'z' found in 'z' is not a Cyclopts App object._z)Error: No Cyclopts App objects found in '	_commandsc              3   V   "   T F  p\        V\        4      '       d   K  Vx  K!  	  R # 5ir!   )
isinstancer   )r"   cmds   & r   r%   r&      s      *u:P3XbcfhsXt33:Ps   )
)z, c              3   *   "   T F	  w  rVx  K  	  R # 5ir!   r
   )r"   namer)   s   &  r   r%   r&      s     !Bk74$ks   z#Error: Multiple App objects found: z. Please specify one using 'z:app_name'.)/\) r   r   r   rsplitanyr   resolveexistsprintsysstderrexitsuffix	importlibutilspec_from_file_locationloadermodule_from_specmodulesr   exec_modulehasattrgetattrr,   dir
startswithappendlenextendr*   valuesjoin)r   r   app_name
script_strscript_path_strscript_pathspecmoduleapp_objapp_objectsr/   objregistered_appsr)   appfiltered_appsnamesr$   s   &                @r   load_app_from_scriptrX   %   sv   ,  HVJ
j.8.?.?Q.G++ cc)[{)[ccc)[{)[&[&[)H/K v,K6l%%'K}L9

K&%<=CJJO >>112I;WD|t{{*3K=C#**U^^,,T2F+1CKK'(	 	"	"' 
# v((,XJl;-rRY\YcYcdHHQK&+'''HXJ&EFSZZXHHQK   KD??3''f+c''&&{3	   =k]"MTWT^T^_HHQK{a !O%3,,#***u#--:N:N:P*uu & ;Fd+YTIc[d[+Md+;!#		!Bk!BB,6vt,D,DS[&
9%@\]g\hhst #A}i 
#	"	"J es   *Q'3
Q;Q;'Q8	)__doc__importlib.utilr;   r7   
contextlibr   pathlibr   typingr   r   r   cyclopts.command_specr   r   rX   r
   r   r   <module>r_      s:    4  
 %    - % %*qr   