+
    Q(i                         R t ^ RIt^ RIHt ^ RIHtHt ^ RIHtH	t	H
t
 ]'       d   ^ RIHt ^ RIHt ]	 ! R R4      4       tR# )	z9Lazy-loadable command specification for deferred imports.N)chain)TYPE_CHECKINGAny)FactorydefinefieldApp)Groupc                      a  ] tR t^t o RtRt]! ]4      tRt	Rt
Rt]! RRR7      t]V 3R lR l4       t]! RRRR7      tV 3R	 lR
 lt]V 3R lR l4       tV 3R ltRtV tR# )CommandSpeca>  Specification for a command that will be lazily loaded on first access.

This allows registering commands via import path strings (e.g., "myapp.commands:create")
without importing them until they're actually used, improving CLI startup time.

Parameters
----------
import_path : str
    Import path in the format "module.path:attribute_name".
    The attribute should be either a function or an App instance.
name : str | tuple[str, ...] | None
    CLI command name. If None, will be derived from the attribute name via name_transform.
    For function imports: used as the name of the wrapper App.
    For App imports: must match the App's internal name, or ValueError is raised at resolution.
app_kwargs : dict
    Keyword arguments to pass to App() if wrapping a function.
    Raises ValueError if used with App imports (Apps should be configured in their own definition).

Examples
--------
>>> from cyclopts import App
>>> app = App()
>>> # Lazy load - doesn't import myapp.commands until "create" is executed
>>> app.command("myapp.commands:create_user", name="create")
>>> app()
Nshow)defaultaliasc                    < V ^8  d   QhRS[ /#    returnbool)format__classdict__s   "[/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/cyclopts/command_spec.py__annotate__CommandSpec.__annotate__4   s      d     c                :    V P                   f   R# V P                   # )NT)_showselfs   &r   r   CommandSpec.show3   s    ::zzr   F)initr   reprc                "   < V ^8  d   QhRRRR/# )r   
parent_appr	   r    )r   r   s   "r   r   r   ;   s     n n% nE nr   c                   V P                   e   V P                   # V P                  P                  R4      w  r#pV'       d	   V'       g   \        RV P                  : R24      h \        P
                  ! V4      p \        YT4      p^ RI	H
p \        Yx4      '       d   T P                  '       d)   \        RT P                  : RT P                  : R24      hT P                  e   TP                  ^ ,          T P                  8w  d_   \        RT P                  : RTP                  ^ ,          : RT P                  : RT P                   RTP                  ^ ,           R24      h^ RI	Hp	 T	! Yq4       Ypn         M\        T P                  4      p
^ RI	Hp T
P#                  RTP$                  4       T
P#                  RTP&                  4       RT
9  d   TP(                  e   TP(                  T
R&   T! Y4       T! RRT P                  /T
B T n         T P                   P+                  T4       T P,                  e   T P,                  T P                   n        T P.                  e   T P.                  T P                   n        T P0                  e   T P0                  T P                   n        T P2                  e   T P2                  T P                   n        T P                   P6                  f   TP8                  T P                   n        \;        T P                   P$                  T P                   P&                  4       F  pRT P                   T,          n        K  	  T P                   #   \         d$   p\        RT: RT P                  : 24      ThRp?ii ; i  \         d)   p\        RT: RT: R	T P                  : R
24      ThRp?ii ; i)a(  Import and resolve the command on first access.

Parameters
----------
parent_app : App
    Parent app to inherit defaults from (help_flags, version_flags, groups).
    Required to match the behavior of direct command registration.

Returns
-------
App
    The resolved App instance, either imported directly or wrapping a function.

Raises
------
ValueError
    If import_path is not in the correct format "module.path:attribute_name".
ImportError
    If the module cannot be imported.
AttributeError
    If the attribute doesn't exist in the module.
N:zInvalid import path: z/. Expected format: 'module.path:attribute_name'zCannot import module z from zModule z has no attribute z (from import path )r   z8Cannot apply configuration to imported App. Import path z0 resolves to an App, but kwargs were specified: z.. Configure the App in its definition instead.z(Imported App name mismatch. Import path z resolves to an App with name=z., but it was registered with CLI command name=z. Either use app.command('z	', name='z%') or change the App's name to match.)_apply_parent_defaults_to_app)_apply_parent_groups_to_kwargs
help_flagsversion_flagsversionnameFr%   )	_resolvedimport_path
rpartition
ValueError	importlibimport_moduleImportErrorgetattrAttributeErrorcyclopts.corer	   
isinstance
app_kwargsr.   r)   dictr*   
setdefaultr+   r,   r-   r   helpsort_keygroupr   r   _name_transformname_transformr   )r   r$   module_path_	attr_namemoduleetargetr	   r)   r:   r*   flags   &&           r   resolveCommandSpec.resolve;   sV   . >>%>>! %)$4$4$?$?$D!	)'(8(8';;jk 
	h,,[9F	V/F 	&f"" ##'#3#3"6 7226//1D ECD  yy$Q499)D ##'#3#3"66TU[U`U`abUcTf gCCG99- P//3/?/?.@	&++VW.IY Z9:  D)&=#N doo.JD!!,
0E0EF!!/:3K3KL
*z/A/A/M(2(:(:
9%*:B >dii>:>DNNN""6* 99 "&))DNN==$&*mmDNN#::!#'::DNN ::!"&**DNN>>))1,6,E,EDNN) $..33T^^5Q5QRD(-DNN4 % S ~~U  	h 5k_F4K[K[J^_`fgg	h
  	 +(:9-GZ[_[k[kZnnop	s0   $M# ;N #N.NNO#OOc                    < V ^8  d   QhRS[ /# r   r   )r   r   s   "r   r   r      s     * *T *r   c                    V P                   RJ# )z9Check if this command has been imported and resolved yet.Nr/   r   s   &r   is_resolvedCommandSpec.is_resolved   s     ~~T))r   c                   < V ^8  d   Qh/ S[ ;R&   S[ S[S[ R3,          ,          R,          ;R&   S[S[ S[3,          ;R&   S[ R,          ;R&   S[;R&   R;R	&   S[R,          ;R
&   R;R&   # )r   r0   .Nr.   r:   r=   r>   z,Group | str | tuple[Group | str, ...] | Noner?   r   z
App | Noner/   )strtupler;   r   r   )r   r   s   "r   r   r      s     : ; < c3h
$
&-= > S#X.? @ *A B C D :@E F $;:G V IW r   rM   )__name__
__module____qualname____firstlineno____doc__r.   r   r;   r:   r=   r>   r?   r   r   propertyr   r/   rI   rN   __annotate_func____static_attributes____classdictcell__)r   s   @r   r   r      s     8 *.D!(JDH<@Et6:E 
 $5IIn n` * *}  r   r   )rW   r3   	itertoolsr   typingr   r   attrsr   r   r   r8   r	   cyclopts.groupr
   r   r%   r   r   <module>r`      s<    ?   % ( (!$ _* _* _*r   