+
    „WÝjø  ã                  ón   € R t ^ RIHt ^ RIt^ RIHt R R ltR R ltR R	 lt]	! 4       t
]
3R
 R lltR# )a*  What ``save_config`` persists when the process serves a frozen session config.

A managed worker binds its session's creation-time config (``agent.safe_worker_policy``), so its
``load_config()`` is that snapshot, not the profile file. A read-modify-write in such a worker
(an ``always`` approval, a connector enable) must land only what it changed on the LIVE file:
writing the whole snapshot back would revert every profile edit made since the session was
created. Outside a frozen worker this is ``save_config``'s ordinary ``merge_existing`` handling.
)ÚannotationsN)ÚAnyc               ó(   € V ^8„  d   QhRRRRRRRR/# )é   Úconfigúdict[str, Any]Úlive_rawÚmerge_existingÚboolÚreturn© )Úformats   "ÚQC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\config_worker_save.pyÚ__annotate__r      s*   € ÷ ñ ˜Nð °nð ÐVZð Ð_mñ ó    c                óØ   € ^ RI Hp VP                  4       pVe/   \        T;'       g    / WP	                  4       \        V4      4      # V'       d   V'       d   VP                  W4      # V # )é    )r   )Ú
hermes_clir   Ú_worker_config_snapshotÚ
_three_wayÚload_configÚ_frozen_for_deletionÚ_merge_partial_save)r   r   r	   Ú_configÚsnapshots   &&&  r   Úrebase_for_saver      sY   € Ý,à×.Ñ.Ó0€HØÒÜ˜(Ÿ.˜. b¨&×2EÑ2EÓ2GÔI]Ð^fÓIgÓhÐhßŸ(Ø×*Ñ*¨8Ó<Ð<Ø€Mr   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r   r      s   € ÷ <ñ < >ð <°cñ <r   c                ón   € ^ RI Hp V! 4       pVe   VP                  '       g   V # ^ RIHp \        W4      # )aj  The snapshot branches that count as operator state.

An ordinary snapshot only contains what the profile had at creation, so an explicit
empty allowlist is a real branch. A bypass worker (safe mode, ``--ignore-user-config``)
freezes a copy of the schema, so a branch that is still the schema default was never
an operator choice and must not count as a deletion.)Ú_current_policy)ÚDEFAULT_CONFIG)Úagent.safe_worker_policyr   Úignore_user_configÚhermes_cli.config_defaultsr   Ú_schema_default_branch)r   r   Úpolicyr   s   &   r   r   r      s2   € õ 9áÓ€FØ‚~˜V×6×6Ð6ØˆÝ9ä! (Ó;Ð;r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   Údefaultsr   r   )r   s   "r   r   r   ,   s!   € ÷ ñ  Sð °Cð ¸Cñ r   c                óÞ  € \        V \        4      '       d   \        V\        4      '       g   \        P                  ! V 4      # / pV P	                  4        F”  w  r4W19  d   \        P                  ! V4      W#&   K%  W,          pWE8X  d   K5  \        V\        4      '       d2   \        V\        4      '       d   \        WE4      pV'       d   WbV&   Kz  K|  \        P                  ! V4      W#&   K–  	  V# )zD*snapshot* without branches whose value is still the schema default.)Ú
isinstanceÚdictÚcopyÚdeepcopyÚitemsr#   )r   r&   ÚkeptÚkeyÚvalueÚdefaultÚnesteds   &&     r   r#   r#   ,   s¶   € ä�h¤×%Ò%¬Z¸Ä$×-GÒ-GÜ�}Š}˜XÓ&Ð&Ø€DØ—n‘nÖ&‰
ˆØÔÜŸš eÓ,ˆD‰IÙØ•-ˆØÔÙÜ�eœT×"Ò"¤z°'¼4×'@Ò'@Ü+¨EÓ;ˆFßØ"�S“	ñ ô Ÿš eÓ,ˆD‹Iñ 'ð €Kr   c          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )r   Úliver   ÚdesiredÚbaseÚfrozenr   r   )r   s   "r   r   r   D   s0   € ÷ ""ñ ""�Sð "" 3ð ""¨cð ""¸3ð ""ÐSVñ ""r   c           
     óð  € V\         J d   TpW8X  d   \        P                  ! V 4      # \        V\        4      '       Edd   \        V\        4      '       EdM   \        V \        4      '       Ed6   \        V\        4      '       d   TM/ p\        P                  ! V 4      pVP                  4        Fï  w  rgWb9  d   \        P                  ! V4      WV&   K%  WrV,          8w  g   K4  \        W&,          \        4      '       d   \        M#\        W&,          \        4      '       d   \        MRpV P                  V4      p	Ve<   \        W˜4      '       g+   W`9   g   Wd9   d   K®  \        P                  ! W&,          4      p	\        W—W&,          VP                  V/ 4      4      WV&   Kñ  	  V# \        V\        4      '       d›   \        V\        4      '       d…   \        V \        4      '       do   V U
u. uF  qªV9  g   K  V
NK  	  pp
V  U
u. uF  qªV9  g   K  V
NK  	  pp
YÁ U
u. uF)  qªV9  g   K  W¬9  g   K  \        P                  ! V
4      NK+  	  up
,           # \        P                  ! V4      # u up
i u up
i u up
i )aÒ  *live* with the caller's edits (*desired* relative to the *base* it loaded) applied.
Mappings recurse; list edits add/remove items; a key the caller dropped is left alone. A
mapping/list branch deleted (or retyped) on *live* since *base* stays as live has it: a
leaf edit must not resurrect the stale snapshot subtree around it.

*frozen* is the operator-owned snapshot under *base* (``load_config()`` merges the schema
defaults over the raw snapshot). A branch in neither *frozen* nor *live* came only from the
defaults, so nothing deleted it: the edit applies to the default (a fresh profile's first
``always`` grant, including one made in safe mode). A branch the operator set and the live
file then lost stays deleted.N)	Ú_SAME_AS_BASEr*   r+   r(   r)   r,   ÚlistÚgetr   )r3   r4   r5   r6   Ú
frozen_mapÚmergedr.   r/   ÚkindÚcurrentÚitemÚremovedr-   s   &&&&         r   r   r   D   sÑ  € ð ”ÓØˆØ„Ü�}Š}˜TÓ"Ð"Ü�'œ4× Ó ¤Z°´d×%;Ó%;Ä
È4ÔQU×@VÓ@VÜ)¨&´$×7Ò7‘V¸Rˆ
Ü—’˜tÓ$ˆØ!Ÿ-™-ž/‰JˆCØŒÜ"Ÿmšm¨EÓ2�“Ø˜s�)Ö#Ü)¨$­)´T×:Ò:•tÌ
ÐSWÕS\Ô^b×HcÒHcÅÐim�ØŸ(™( 3›-�ØÒ#¬J°w×,EÒ,EØ”{ cÔ&7Ù Ü"Ÿmšm¨D­IÓ6�GÜ(¨¸½ÀJÇNÁNÐSVÐXZÓD[Ó\�“ñ *ð ˆÜ�'œ4× Ò ¤Z°´d×%;Ò%;Ä
È4ÔQU×@VÒ@VÙ$(Ó@¡D˜D¸Ñ,?—4�4¡DˆÐ@Ù!%Ó=¡˜°WÑ)<—�¡ˆÐ=Ø°wÓh±w¨tÈdÑBRÔ*ÐW[ÑWgÔ*”t—}’} TÖ*±wÑhÕhÐhÜ�=Š=˜Ó!Ð!ùò AùÚ=ùÚhs*   Ç)I)Ç6I)ÈI.ÈI.ÈI3È(I3È0I3)Ú__doc__Ú
__future__r   r*   Útypingr   r   r   r#   Úobjectr8   r   r   r   r   Ú<module>rE      s>   ðñõ #ã Ý õõ<õ"ñ* “€ð BO÷ ""ñ ""r   