+
    „WÝjÁ   ã                  óö  € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	 ^RI
Ht ^RIHtHt ]P                  ! ]4      tRt^],          R3^],          R	3^Z],          R
33tR/tRtR0t^],          tRRRRRR/t]! RR04      t]! 0 R1m4      t]! 0 R2m4      tR R ltR R ltR tR R lt R R lt!R R lt"R3R R llt#R4R R llt$R R  lt%R! R" lt&R# R$ lt'R% R& lt(R' R( lt)R) R* lt*R+ R, lt+R- R. lt,R# )5a–  Install-snapshot fields for version lag, release channel and coarse hardware.

Everything here is read offline: the installed version's own commit date, the install stamp and
per-install channel record, the update check's cached result (never a network call), and cached
``hermes_platform.host`` facts. Only closed enums and buckets leave; the git remote, branch names,
paths and endpoint URLs stay local.
)ÚannotationsN)ÚPath)ÚAny)Úshared_metrics_contract)Ú_bucketÚ_normi€Q Últ_7dÚ	7d_to_30dÚ
30d_to_90dgš™™™™™ñ?ÚstableÚmainÚcanaryÚmasterc               ó$   € V ^8„  d   QhRRRRRR/# )é   Úconfigr   ÚkeyÚstrÚreturn© )Úformats   "ÚcC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\observability\shared_metrics_install.pyÚ__annotate__r   (   s&   € ÷ Añ A�ð A˜3ð A 3ñ Aó    c                óT   € \        V \        4      '       d   V P                  V4      # R # ©N)Ú
isinstanceÚdictÚget)r   r   s   &&r   Ú_subr   (   s!   € Ü(¨´×6Ò6ˆ6�:‰:�c‹?Ð@¸DÐ@r   c               ó    € V ^8„  d   QhRRRR/# )r   Údefaultr   r   r   )r   s   "r   r   r   ,   s   € ÷ ñ ˜3ð  3ñ r   c           	     ó~   €  V ! 4       #   \          d)    \        P                  R \        T RT 4      RR7       Tu # i ; i)z+Shared-metrics install field %s unavailableÚ__name__T)Úexc_info)Ú	ExceptionÚloggerÚdebugÚgetattr)Úreaderr!   s   &&r   Ú_safer*   ,   sA   € ðÙ‹xˆøÜô Ü�‰ÐBÄGÈFÐT^Ð`fÓDgÐrvˆÔwØŠðús   ‚	 ‰0<»<c                 ó   € ^ RI Hp  V ! 4       # )é    ©Úget_version_info)Úhermes_cli.version_infor.   r-   s    r   Ú_version_infor0   4   s   € Ý8áÓÐr   c               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r   s   "r   r   r   :   s   € ÷ ñ �tñ r   c                 ó   € ^ RI Hp  V ! 4       # )r,   ©Úget_project_root)Úhermes_cli.configr4   r3   s    r   Ú_project_rootr6   :   s   € Ý2áÓÐr   c               ó   € V ^8„  d   QhRR/# ©r   r   r   r   )r   s   "r   r   r   @   s   € ÷ 
'ñ 
' cñ 
'r   c                 óz   € ^ RI Hp  ^ RIHp \	        4       pV! V4      P                  R4      R8X  d   R# V ! V4      # )a  ``detect_install_method()``, except the Microsoft Store build, which the stamp names and
that function's update-gating vocabulary has no word for (it would read ``unknown``).
Kept out of ``detect_install_method`` on purpose: update and uninstall branch on its result.)Údetect_install_method)Úread_install_stampÚupdateMechanismzmicrosoft-store)r5   r:   Úhermes_cli.stewardr;   r6   r   )r:   r;   Úroots      r   Údetect_client_install_methodr?   @   s9   € õ 8Ý5ä‹?€DÙ˜$Ó×#Ñ#Ð$5Ó6Ð:KÔKÙ Ù  Ó&Ð&r   c               ó    € V ^8„  d   QhRRRR/# ©r   r   údict[str, Any]r   r   r   )r   s   "r   r   r   M   s   € ÷ 9ñ 9˜Nð 9¨sñ 9r   c                óö   € ^ RI HpHpHp \	        4       pV! W4      pVR8w  g   V! V! V4      4      '       d   \
        P                  VR4      # \        4       P                  pV'       g   R# V\        9   d   R# R# )z­The channel this install follows: a package's baked channel, a source install's channel
record, else the checkout's branch (``main`` for main/master, ``dev`` for any other).)Ú_package_channelÚ_read_stampÚresolve_update_channelr   ÚunknownÚdev)
Úhermes_cli.update_channelrD   rE   rF   r6   Ú	_CHANNELSr   r0   ÚbranchÚ_MAIN_BRANCHES)r   rD   rE   rF   r>   ÚresolvedrK   s   &      r   Úrelease_channelrN   M   sj   € ÷ `Ñ_ä‹?€DÙ% fÓ3€HØ�6ÔÑ-©k¸$Ó.?×@Ò@Ü�}‰}˜X yÓ1Ð1Ü‹_×#Ñ#€FßÙØœ~Ô-ˆ6Ð8°5Ð8r   c               ó    € V ^8„  d   QhRRRR/# )r   Únowúfloat | Noner   r   r   )r   s   "r   r   r   \   s   € ÷ <ñ <˜Lð <°Cñ <r   c                óê   € \        4       P                  p\        V\        4      '       d   V^ 8:  d   R# \	        RT ;'       g    \
        P
                  ! 4       V,
          4      p\        V\        R4      # )zKAge of the INSTALLED version, from its own commit date (stamp or checkout).rG   g        Úgte_90d)r0   Úcommit_dater   ÚintÚmaxÚtimer   Ú_VERSION_AGE_THRESHOLDS)rP   Ú	committedÚages   &  r   Úversion_age_bucketr[   \   sT   € ä“×+Ñ+€IÜ�i¤×%Ò%¨°a¬ÙÜ
ˆc�C×&Ð&œ4Ÿ9š9›;¨)Õ3Ó
4€CÜ�3Ô/°Ó;Ð;r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   ÚhomezPath | NonerP   rQ   r   r   r   )r   s   "r   r   r   e   s!   € ÷ )ñ )˜ð )°ð )Èñ )r   c                óÌ  € ^ RI Hp ^ RIHp \	        4       pT ;'       g    V! 4       R,          V! V4       R2,          p \
        P                  ! VP                  RR7      4      p\        T\        4      '       g   R# TP                  R4      TP                  R	4      TP                  R
4      r˜p\        T\        4      '       d   TP                  R4      MRp
\        T\        4      '       d   TP                  R4      MRp\        4       P                  p\        T
\        4      '       g‹   \        T
\         4      '       du   T
^ 8  gn   \        T	\         \"        34      '       dR   ^ T;'       g    \$        P$                  ! 4       T	,
          u;8:  d   \&        8  d   M R# T'       d   T'       d	   Y¼8w  d   R# \(        P*                  ! T
4      #   \        \        3 d     R# i ; i)zWCommits/releases behind, from the update check's cached result for this exact revision.)Ú
install_id)Úget_hermes_homezsource-checksz.jsonz	utf-8-sig)ÚencodingrG   ÚstatusÚidentityÚtsÚbehindNÚhead)rI   r_   Úhermes_constantsr`   r6   ÚjsonÚloadsÚ	read_textÚOSErrorÚ
ValueErrorr   r   r   r0   ÚcommitÚboolrU   ÚfloatrW   Ú_BEHIND_MAX_AGE_SÚcontractÚcount_bucket)r]   rP   r_   r`   r>   Ú
cache_fileÚcachedrb   rc   rd   re   rf   rm   s   &&           r   Úbehind_bucketru   e   sc  € å4Ý0ä‹?€DØ×+Ð+™/Ó+¨Õ>ÁJÈtÓDTÐCUÐUZÐA[Õ[€JðÜ—’˜J×0Ñ0¸+Ð0ÓFÓGˆô �fœd×#Ò#ÙØ!Ÿ:™: hÓ/°·±¸JÓ1GÈÏÉÐTXÓIY�b€FÜ%/°¼×%=Ò%=ˆV�Z‰Z˜Ô!À4€FÜ#-¨h¼×#=Ò#=ˆ8�<‰<˜ÔÀ4€DÜ‹_×#Ñ#€Fä�6œ4× Ò ¬
°6¼3×(?Ò(?À6ÈAÄ:Ü˜"œs¤E˜l×+Ò+°1¸×9KÐ9KÄÇ	Â	ÃÈrÕ8QÖ3eÔTeÖ3eñ ÷ —V ¤áÜ× Ò  Ó(Ð(øô ”ZÐ ô Úðús   Á &G ÇG#Ç"G#c               ó   € V ^8„  d   QhRR/# r8   r   )r   s   "r   r   r      s   € ÷ Tñ T�Cñ Tr   c                 ó~   € ^ RI Hp  V ! 4       pV'       g   R# \        V\        ,          \        ,          \
        R4      # )r,   )Úram_total_bytesrG   Úgte_128g)Úhermes_platform.host.factsrx   r   Ú_RAM_NOMINAL_FACTORÚ_GIBÚ_RAM_THRESHOLDS)rx   Útotals     r   Ú
ram_bucketr      s-   € Ý:áÓ€EßÙÜ�5Ô.Õ.´Õ5´È
ÓSÐSr   c               ó   € V ^8„  d   QhRR/# r8   r   )r   s   "r   r   r   ˆ   s   € ÷ Añ A�3ñ Ar   c                 óN   € ^ RI Hp  V ! 4       pV\        P                  9   d   V# R# )r,   )Ú	gpu_classrG   )rz   r‚   rq   ÚGPU_CLASSES)Úhost_gpu_classÚvalues     r   r‚   r‚   ˆ   s%   € ÝFáÓ€EØœX×1Ñ1Ô1ˆ5Ð@°yÐ@r   c               ó    € V ^8„  d   QhRRRR/# )r   Úbase_urlr   r   rn   r   )r   s   "r   r   r   �   s   € ÷ 'ñ ' ð '¨ñ 'r   c                óz   € \        V \        4      '       d   V P                  4       '       g   R # ^ RIHp V! V 4      # )F)Úis_local_endpoint)r   r   ÚstripÚagent.model_metadatar‰   )r‡   r‰   s   & r   Ú_is_local_endpointrŒ   �   s,   € Ü�h¤×$Ò$¨H¯N©N×,<Ò,<ÙÝ6á˜XÓ&Ð&r   c               ó    € V ^8„  d   QhRRRR/# )r   Úproviderr   r   r   r   )r   s   "r   r   r   —   s   € ÷ Fñ F˜sð F sñ Fr   c                óp   € ^ RI Hp V! V 4      p\        V\        4      '       d   VP	                  R4      # R# )zŠA ``providers:`` / ``custom_providers:`` entry's endpoint, by ``custom:<name>`` or bare name
(built-in ids shadow entries, as at runtime).)Ú_get_named_custom_providerr‡   N)Ú"hermes_cli.runtime_provider_customr�   r   r   r   )rŽ   r�   Úentrys   &  r   Ú_custom_base_urlr“   —   s2   € õ Ná& xÓ0€EÜ$.¨u´d×$;Ò$;ˆ5�9‰9�ZÓ ÐEÀÐEr   c               ó    € V ^8„  d   QhRRRR/# )r   Úslotr   r   rn   r   )r   s   "r   r   r       s   € ÷ 
]ñ 
]˜ð 
] ñ 
]r   c                ó
  € \        \        V R 4      4      pV\        9   d   R# \        \        V R4      4      '       d   R# ^RIHpHpHp W! V4      V0,
          9   d   R# V\        9  ;'       d    \        \        V4      4      # )rŽ   Tr‡   )ÚCUSTOMr*   Úuser_named_model_providers)
r   r   Ú_LOCAL_PROVIDER_ALIASESrŒ   Úshared_metrics_catalogr—   r*   r˜   Ú_INHERITS_MAINr“   )r•   rŽ   r—   Úcatalog_safer˜   s   &    r   Ú_slot_is_localr�       sr   € Ü”T˜$ 
Ó+Ó,€HØÔ*Ô*ÙÜœ$˜t ZÓ0×1Ò1ÙßaÑaà�<Ð :Ó;¸v¸hÕFÔFÙØœ>Ñ)×\Ð\Ô.@ÔAQÐRZÓA[Ó.\Ð\r   c               ó    € V ^8„  d   QhRRRR/# )r   r•   rB   r   rn   r   )r   s   "r   r   r   ­   s   € ÷ bñ b .ð b°Tñ br   c                óÂ   a € \        S P                  R4      4      \        9  d   R# \        ;QJ d    V 3R lR 4       F  '       d   K   R# 	  R# ! V 3R lR 4       4      # )z÷An auxiliary task off the main model: a named provider, or (mirroring
``agent.auxiliary_client._resolve_task_provider_model``) a bare ``base_url`` + ``api_key``,
which the runtime sends to that endpoint as ``custom`` even under ``provider: auto``.rŽ   Tc              3  ó    <"  € T FC  p\        SP                  V4      \        4      ;'       d    SV,          P                  4       x € KE  	  R # 5ir   )r   r   r   rŠ   )Ú.0Úkr•   s   & €r   Ú	<genexpr>Ú*_aux_slot_routes_itself.<locals>.<genexpr>³   s7   øé € ÐaÑI`ÀAŒz˜$Ÿ(™( 1›+¤sÓ+×?Ð?°°Qµ·±³Ô?ÓI`ùs
   ƒ*A® AF)r‡   Úapi_key)r   r   r›   Úall)r•   s   fr   Ú_aux_slot_routes_itselfr§   ­   sI   ø€ ô ˆT�X‰X�jÓ!Ó"¬.Ô8Ùß‹3ÔaÑI`Óa�3Œ3ÐaŠ3Ðaˆ3ÔaÑI`ÓaÓaÐar   c               ó    € V ^8„  d   QhRRRR/# rA   r   )r   s   "r   r   r   ¶   s   € ÷ Jñ J nð J¸ñ Jr   c                ó¼  € \        V R4      p\        V R4      p\        V\        4      '       d   V.M. p\        V\        4      '       dR   Y2P                  4        Uu. uF0  p\        V\        4      '       g   K  \	        V4      '       g   K.  VNK2  	  up,          p\
        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   R# R# u upi )zU``yes`` when the main model or any auxiliary task runs on a local/self-hosted server.ÚmodelÚ	auxiliaryc              3  ó8   "  € T F  p\        V4      x € K  	  R # 5ir   )r�   )r¡   r•   s   & r   r£   Ú,local_model_provider_used.<locals>.<genexpr>½   s   é € Ð?¹°œ t×,Ð,»ùs   ‚TFÚyesÚno)r   r   r   Úvaluesr§   Úany)r   rª   r«   ÚslotsÚss   &    r   Úlocal_model_provider_usedr´   ¶   s¥   € ä�˜Ó!€EÜ�V˜[Ó)€IÜ! %¬×.Ò.ˆU‰G°B€EÜ�)œT×"Ò"Ø×-Ñ-Ô/ÓfÑ/˜´:¸aÄ×3F”!ÔKbÐcd×Ke—!�!Ñ/ÑfÕfˆß“CÑ?¹Ó?—C—C’CÑ?¹Ó?×?Ò?ˆ5ÐIÀTÐIùò gs   ÁCÁ9CÂCc               ó    € V ^8„  d   QhRRRR/# )r   r   rB   r   zdict[str, str]r   )r   s   "r   r   r   À   s   € ÷ ñ  ~ð ¸.ñ r   c                ól  a € R\        \        R4      R\        \        R4      R\        V 3R lR4      R\        \        R4      R\        V 3R	 lR4      R
\        \        R4      /p\
        P                  pVP                  4        UUu/ uF  w  r4Y4W#,          9   d   TM
VR8X  d   RMRbK!  	  upp# u uppi )zGThe version-lag, channel and hardware dimensions of the daily snapshot.ru   rG   r‚   r´   c                 ó   <€ \        S 4      # r   )r´   ©r   s   €r   Ú<lambda>Ú,install_v4_snapshot_fields.<locals>.<lambda>Å   s   ø€ Ô3LÈVÔ3Tr   r¯   r   rN   c                 ó   <€ \        S 4      # r   )rN   r¸   s   €r   r¹   rº   Ç   s
   ø€ ¬¸Ô)@r   r[   )r*   ru   r‚   r   r[   rq   Ú_INSTALL_V4_SNAPSHOT_DIMENSIONSÚitems)r   ÚfieldsÚallowedr¢   Úvs   f    r   Úinstall_v4_snapshot_fieldsrÁ   À   s¤   ø€ ð 	œœ}¨iÓ8Ø”Uœ9 iÓ0Ø#¤UÔ+TÐVZÓ%[Ø”eœJ¨	Ó2Øœ5Ô!@À)ÓLØœeÔ$6¸	ÓBð€Fô ×6Ñ6€GØou×o{Ño{Ôo}Ô~Ño}ÑgkÐghˆA˜�”O‰q°!Ð7RÔ2R©$ÐXaÒbÑo}Ò~Ð~ùÓ~s   Â%B0i   @))é   Últ_8g)é   Ú	8g_to_16g)é    Ú
16g_to_32g)é@   Ú
32g_to_64g)é€   Ú64g_to_128g>   ÚvllmÚlocalÚollamaÚllamacppÚlmstudioú	llama-cppú	llama.cpp>   Ú Úautor   r   )NN)-Ú__doc__Ú
__future__r   rh   ÚloggingrW   Úpathlibr   Útypingr   rÓ   r   rq   r   r   Ú	getLoggerr#   r&   Ú_DAY_SrX   r|   r{   r}   rp   rJ   Ú	frozensetrL   r™   r›   r   r*   r0   r6   r?   rN   r[   ru   r   r‚   rŒ   r“   r�   r§   r´   rÁ   r   r   r   Ú<module>rÝ      s  ðñõ #ã Û Û Ý Ý å 1ß 3à	×	Ò	˜8Ó	$€à	€Ø �J¨Ð0°2¸µ;ÀÐ2LÈrÐTZÍ{Ð\hÐNiÐjÐ Ø€ð Ð ð€ð ˜•JÐ Ø�x ¨°¸6ÐB€	Ù˜F HÐ-Ó.€á#Ò$qÓrÐ ÙÒ/Ó0€õAõòõõ
'õ9÷<÷)õ4TõAõ'õFõ
]õbõJ÷r   