+
    „°ñjÀ  ã                   óÀ  a € R3 t0 t R t^ RIt^ RIHtHt ^ RIHt  ! R R]4      tRRRR	R
RR/RRRR	R
RR/RRRR	RRR/RRRR	RRR/RRRR	RRR//t	] ^ k R R lt
R]
RR RR /t] ^k R R ltR R ltR RR!RR"]P                  R#,          R#,          R$R%R&R//R'RR(]P                  '       * /t] ^k R4tR) R* lt]! 4       t] ^k R5R+ R, lltR- R. ltR/ R0 ltR1 R2 ltR# )6zÛ
Feature flags module for ComfyUI WebSocket protocol negotiation.

This module handles capability negotiation between frontend and backend,
allowing graceful protocol evolution while maintaining backward compatibility.
N)ÚAnyÚ	TypedDict)Úargsc                   ó,   a € ] tR t^t o V 3R ltRtV tR# )ÚFeatureFlagInfoc                ó>   <€ V ^8„  d   Qh/ S[ ;R&   S[;R&   S[ ;R&   # )é   ÚtypeÚdefaultÚdescription©Ústrr   )ÚformatÚ__classdict__s   "€Ú;C:\Ai_Coding\apps\studio\ComfyUI\comfy_api\feature_flags.pyÚ__annotate__ÚFeatureFlagInfo.__annotate__   s&   ø‡ ‚ Ù
�Iñ á�Lñ ñ Ñò ó    © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      s   ø‡ ‡ „ r   r   Úshow_signin_buttonr	   Úboolr
   Fr   z?Show the sign-in button in the frontend even when not signed inÚenable_telemetryz8Signal the frontend that telemetry collection is enabledÚpartner_run_gate_enabledTzNGate the local Run button behind sign-in when the graph contains partner nodesÚpartner_node_tokenz_Queue Local API-node prompts with a renewable partner-node token instead of the workspace tokenÚlocal_web_ssozaOffer Sign in with browser (Cloud OAuth + PKCE) on Local ComfyUI opened at localhost or 127.0.0.1c                ó0   € V ^8„  d   QhR\         R\        /# )r   ÚvÚreturn)r   r   )r   s   "r   r   r   3   s   € ÷ ?ñ ?”Cð ?œDñ ?r   c                ód   € V P                  4       pVR8X  d   R# VR8X  d   R# \        RV : 24      h)zÌStrict bool coercion: only 'true'/'false' (case-insensitive).

Anything else raises ValueError so the caller can warn and drop the flag,
rather than silently treating typos like 'ture' or 'yes' as False.
ÚtrueTÚfalseFz expected 'true' or 'false', got )ÚlowerÚ
ValueError)r#   r(   s   & r   Ú_coerce_boolr*   3   s7   € ð �G‰G‹I€EØ�„ÙØ�ÔÙÜ
Ð7¸±uÐ=Ó
>Ð>r   Úintc                 ó   € \        V 4      # ©N)r+   ©r#   s   &r   Ú<lambda>r/   C   s   € ”S˜”Vr   Úfloatc                 ó   € \        V 4      # r-   )r0   r.   s   &r   r/   r/   D   s   € ”u˜Q”xr   c                ó<   € V ^8„  d   QhR\         R\         R\        /# )r   ÚkeyÚ	raw_valuer$   r   )r   s   "r   r   r   H   s!   € ÷ ñ œCð ¬Cð ´Cñ r   c                óŒ   € \         P                  V 4      pVf   V# \        P                  VR,          4      pVf   V# V! V4      # )a)  Coerce a raw string value using the registry type, or keep as string.

Returns the raw string if the key is unregistered or the type is unknown.
Raises ValueError/TypeError if the key is registered with a known type but
the value cannot be coerced; callers are expected to warn and drop the flag.
r	   )ÚCLI_FEATURE_FLAG_REGISTRYÚgetÚ_COERCE_FNS)r3   r4   ÚinfoÚcoerces   &&  r   Ú_coerce_flag_valuer;   H   sG   € ô %×(Ñ(¨Ó-€DØ‚|ØÐÜ�_‰_˜T &�\Ó*€FØ‚~ØÐÙ�)ÓÐr   c                óF   € V ^8„  d   QhR\         \        \        3,          /# ©r   r$   ©Údictr   r   )r   s   "r   r   r   X   s   € ÷ ñ ¤$¤s¬C x¥.ñ r   c                 óº  € / p \        \        R. 4       FW  pVP                  R4      w  r#pVP                  4       pV'       g   K1  V'       g   Rp \	        W$P                  4       4      W&   KY  	  V #   \
        \        3 dY   p\        P                  T/ 4      p\        P                  ! RY$P                  4       TP                  RR4      T4        Rp?KÁ  Rp?ii ; i)a9  Parse --feature-flag key=value pairs from CLI args into a dict.

Items without '=' default to the value 'true' (bare flag form).
Flags whose value cannot be coerced to the registered type are dropped
with a warning, so a typo like '--feature-flag some_bool=ture' does not
silently take effect as the wrong value.
Úfeature_flagÚ=r&   z@Could not coerce --feature-flag %s=%r to %s (%s); dropping flag.r	   Ú?N)Úgetattrr   Ú	partitionÚstripr;   r)   Ú	TypeErrorr6   r7   ÚloggingÚwarning)ÚresultÚitemr3   Úsepr4   Úer9   s          r   Ú_parse_cli_feature_flagsrN   X   s½   € ð  €FÜœ˜n¨bÖ1ˆØ"Ÿn™n¨SÓ1Ñˆ�)Ø�i‰i‹kˆßÙßØˆIð	Ü,¨S·/±/Ó2CÓDˆF‹Kñ 2ð €Møô œIÐ&ô 	Ü,×0Ñ0°°bÓ9ˆDÜ�OŠOØRØ—_‘_Ó&¨¯©°¸Ó(=¸q÷ò ûð	ús   ÁA1Á1CÂACÃCÚsupports_preview_metadataÚsupports_model_type_tagsÚmax_upload_sizei   Ú	extensionÚmanagerÚsupports_v4Únode_replacementsÚassetsc                óF   € V ^8„  d   QhR\         \        \        3,          /# r=   r>   )r   s   "r   r   r   �   s   € ÷ Eñ Eœt¤C¬ H�~ñ Er   c                 ó  € \         P                  4        U Uu/ uF  w  rWR,          bK  	  pp p\        4       P                  4        U Uu/ uF!  w  rV \        9  g   K  V \        9  g   K  WbK#  	  pp p/ VC\        CVC# u upp i u upp i )zˆRegistry defaults, then core flags, then CLI flags. CLI flags cannot overwrite core or server-set flags; main.py may still set "assets".r
   )r6   ÚitemsrN   Ú_CORE_FEATURE_FLAGSÚ_SERVER_SET_FEATURE_FLAGS)Úkr9   Úregistry_defaultsr#   Ú	cli_flagss        r   Ú_server_feature_flagsr_   �   s™   € ä;T×;ZÑ;ZÔ;\Ô]Ñ;\±°˜ �OÒ+Ñ;\ÐÑ]ä1Ó3×9Ñ9Ô;ôÙ;‘�ØÔ'Ñ'ô 	Ø,-Ô5NÑ,Nô 	ˆŠÑ;ð ñ ð EÐÐDÔ#6ÐD¸)ÐDÐDùó ^ùós   ˜B Á
BÁBÁ+Bc          
      ó˜   € V ^8„  d   QhR\         \        \         \        \        3,          3,          R\        R\        R\        R\        /# )r   Úsockets_metadataÚsidÚfeature_namer
   r$   r>   )r   s   "r   r   r   Ž   sS   € ÷ Uñ UÜœ3¤¤S¬# X¥Ð.Õ/ðUä	ðUô ðUô ð	Uô
 	ñUr   c                ó`   € W9  d   V# W,          P                  R/ 4      P                  W#4      # )a)  
Get a feature flag value for a specific connection.

Args:
    sockets_metadata: Dictionary of socket metadata
    sid: Session ID of the connection
    feature_name: Name of the feature to check
    default: Default value if feature not found

Returns:
    Feature value or default if not found
Úfeature_flags)r7   )ra   rb   rc   r
   s   &&&&r   Úget_connection_featurerf   Ž   s0   € ð$ Ô"ØˆàÕ ×$Ñ$ _°bÓ9×=Ñ=¸lÓTÐTr   c                óŒ   € V ^8„  d   QhR\         \        \         \        \        3,          3,          R\        R\        R\        /# )r   ra   rb   rc   r$   )r?   r   r   r   )r   s   "r   r   r   ¦   sH   € ÷ Vñ VÜœ3¤¤S¬# X¥Ð.Õ/ðVä	ðVô ðVô 
ñ	Vr   c                ó    € \        WVR4      RJ # )zý
Check if a connection supports a specific feature.

Args:
    sockets_metadata: Dictionary of socket metadata
    sid: Session ID of the connection
    feature_name: Name of the feature to check

Returns:
    Boolean indicating if feature is supported
FT)rf   )ra   rb   rc   s   &&&r   Úsupports_featureri   ¦   s   € ô  "Ð"2¸ÀuÓMÐQUÐUÐUr   c                óF   € V ^8„  d   QhR\         \        \        3,          /# r=   r>   )r   s   "r   r   r   ¹   s   € ÷ 'ñ 'œT¤#¤s (�^ñ 'r   c                 ó*   € \         P                  4       # )zR
Get the server's feature flags.

Returns:
    Dictionary of server feature flags
)ÚSERVER_FEATURE_FLAGSÚcopyr   r   r   Úget_server_featuresrn   ¹   s   € ô  ×$Ñ$Ó&Ð&r   c                ó4   € V ^8„  d   QhR\         R\        RR/# )r   ÚnameÚvaluer$   Nr   )r   s   "r   r   r   Ã   s!   € ÷ 'ñ 'œSð '¬ð '°ñ 'r   c                ó   € V\         V &   R# )zRSet a server feature flag reported to clients and returned by get_server_features.N)rl   )rp   rq   s   &&r   Úset_server_featurers   Ã   s   € à!&Ô˜Ór   c                ó@  € V ^8„  d   Qh/ ^ \         9   d   \        \        \        3,          ;R&   ^\         9   d   \        \        \        3,          ;R&   ^\         9   d   \        \        \        3,          ;R&   ^\         9   d   \        \        \        3,          ;R&   # )r   r6   r8   rZ   rl   )Ú__conditional_annotations__r?   r   r   r   )r   s   "r   r   r      sˆ   € ÷ ñ ÷*ò œ4¤¤_Ð 4Õ5ñ ñ+÷@ò ŒT”#”s�(�^ñ ñA÷fò ”Tœ#œs˜(•^ñ ñg÷T ?Ò >”dœ3¤˜8•nÑ >òUr   )Údeploy_to_cloud)F)ru   Ú__doc__rH   Útypingr   r   Úcomfy.cli_argsr   r   r6   r*   r8   r;   rN   rQ   Údisable_assetsrZ   r[   r_   rl   rf   ri   rn   rs   r   )ru   s   @r   Ú<module>r{      sa  øðöó ß !å ô�iô ð Ø�Ø�5ØÐXðð
 Ø�Ø�5ØÐQðð
 Ø�Ø�4ØÐgð!ð
 Ø�Ø�4ØÐxðð
 Ø�Ø�4ØÐzðð+9Ð ó õ:?ð ˆLØ	ÑØÑð€ó õõ ð:   Ø Ø�t×+Ñ+¨dÕ2°TÕ9Ø�)˜m¨TÐ2Ð3Ø˜à�$×%Ñ%Ô%ð'Ð ó ð 1Ð õEñ (=Ó'>Ð Ó >÷Uõ0Võ&'÷'r   