+
    jHàj#  ã                  óÜ  € R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIHt R(t	Rt
RtRtRt]
R	]R
]R/tRtRtRtRtRtRt]R],           ],           ]R],           ],           ]R],           ],           /tRtR]R,           ],           ],           R]R,           ],           ],           /t]R,           ],           ],           tR],           ],           tR R ltR)R R lltR  R! ltR" R# ltR$ R% ltR& R' ltR# )*u<  Steward classification and refusal text for sealed install trees.

Adapted from the restack branch's ``installation/tree.py``. Our branch has
no ``installation`` package yet â€” detection here is rewritten onto the two
facts this branch already ships:

* ``.git`` at the project root says the tree is a checkout the uninstaller
  / updater may mutate.
* The build stamp (``install-stamp.json``, written by
  ``scripts/write_install_stamp.py``) names the steward in
  ``distribution`` (``desktop-app``, ``docker``, ``nix``, or a future
  package manager) for sealed trees.

A sealed tree (no ``.git``) belongs to a steward: only the steward removes
or replaces its code. The refusal messages below always leave the user a
working next step for their data (``hermes uninstall --data`` / the
desktop app's Settings -> About page).
)ÚannotationsN)ÚPath)ÚOptionalzdesktop-appÚdockerÚnixz
apt-termuxuÜ   âœ— This Hermes runs from inside the desktop app bundle.

Manage updates from within the desktop app.
Prefer a self-managed source install? See:
  https://hermes-agent.nousresearch.com/docs/user-guide/switching-to-sourceu–   âœ— This Hermes runs from the Nix store.

The store path is immutable. Update through your flake:
  nix flake update && rebuild your profile or systemu€   âœ— This Hermes runs from a Termux APT package.

The package manager owns the code tree. Update with:
  pkg upgrade hermes-agentuÜ   âœ— This Hermes is a source checkout running under Termux.

Source installs are not supported on Termux â€” `hermes update` would
build Python packages on the device. Switch to the APT package:
  pkg install hermes-agentzpkg install hermes-agentuŸ   âœ— This Hermes install is managed by {steward}.

The tree has no git checkout, so `hermes update` cannot update it.
Update it with the tool that installed it.z8To delete your Hermes data (chats, configuration, etc),
zrun:
$ hermes uninstall --data
zOOpen Hermes Desktop, go to Settings -> About, and delete your data from there.
u®   âœ— This Hermes runs from a Docker image.

There is no code to uninstall â€” remove the container and image:
  docker rm <container> && docker rmi nousresearch/hermes-agent

u”   âœ— This Hermes was installed by a Termux APT package.

The package manager owns the code tree â€” uninstall it with:
  pkg uninstall hermes-agent

uÍ   âœ— This Hermes was installed by Nix.

The store path is immutable â€” uninstall it the same way you
installed it: remove hermes-agent from your flake / profile
(e.g. `nix profile remove`), then rebuild.

u*   âœ— Hermes is managed by the desktop app.
Úwin32uC   
Remove the app from Windows Settings â†’ Apps â†’ Installed apps.
ÚdarwinzB
Quit the app and drag Hermes.app from Applications to the Trash.
zK
Delete the Hermes AppImage (or app directory) from wherever you
saved it.
u–   âœ— Hermes is managed by {steward}.

The tree has no git checkout, so the uninstaller will not remove it.
Remove it with the tool that installed it.

c               ó    € V ^8„  d   QhRRRR/# )é   ÚstewardÚstrÚreturn© )Úformats   "Ú7/home/ubuntu/.hermes/hermes-agent/hermes_cli/steward.pyÚ__annotate__r       s   € ÷ <ñ < Cð <¨Cñ <ó    c                ód   € \         P                  V 4      pVe   V# \        P                  V R7      # )z3The `hermes update` refusal text for a sealed tree.©r   )ÚSTEWARD_UPDATE_MESSAGESÚgetÚ_STEWARD_UPDATE_FALLBACKr   )r   Úmessages   & r   Ústeward_update_messager       s1   € ä%×)Ñ)¨'Ó2€GØÒØˆÜ#×*Ñ*°7Ð*Ó;Ð;r   c               ó$   € V ^8„  d   QhRRRRRR/# )r
   r   r   Úplatformz
str | Noner   r   )r   s   "r   r   r   ¨   s!   € ÷ ?ñ ? sð ?°jð ?ÈCñ ?r   c                óÚ   € V \         8X  d1   Ve   TM\        P                  p\        P	                  V\
        4      # \        P	                  V 4      pVe   V# \        P                  V R7      # )z-The uninstall refusal text for a sealed tree.r   )	ÚSTEWARD_DESKTOPÚsysr   Ú&_STEWARD_DESKTOP_UNINSTALL_BY_PLATFORMr   Ú"_STEWARD_DESKTOP_UNINSTALL_DEFAULTÚ_STEWARD_UNINSTALL_MESSAGESÚ_STEWARD_UNINSTALL_FALLBACKr   )r   r   Úkeyr   s   &&  r   Ústeward_uninstall_messager$   ¨   s]   € à”/Ô!Ø"Ò.‰h´C·L±LˆÜ5×9Ñ9¸#Ô?aÓbÐbÜ)×-Ñ-¨gÓ6€GØÒØˆÜ&×-Ñ-°gÐ-Ó>Ð>r   c               ó    € V ^8„  d   QhRRRR/# )r
   Úproject_rootr   r   Údictr   )r   s   "r   r   r   ³   s   € ÷ 2ñ 2 Tð 2¨dñ 2r   c                óÎ   € ^ RI Hp  \        P                  ! V! V 4      P	                  RR7      4      p\        T\        4      '       d   T# / #   \
        \        3 d    / u # i ; i)uú   The build stamp of ``project_root``, or ``{}``.

Tolerant by design: steward classification must not crash a refusal
path on a malformed stamp â€” a tree we cannot prove is ours still
refuses (see :func:`sealed_steward`), so garbage degrades safely.
)Úinstall_stamp_pathz	utf-8-sig)Úencoding)	Úpm.pathsr)   ÚjsonÚloadsÚ	read_textÚOSErrorÚ
ValueErrorÚ
isinstancer'   )r&   r)   Údatas   &  r   Úread_install_stampr3   ³   sb   € õ ,ðÜ�zŠzÑ,¨\Ó:×DÑDÈkÐDÓZÓ[ˆô ˜d¤D×)Ò)ˆ4Ð1¨rÐ1øô ”ZÐ ô ØŠ	ðús   ˆ,A ÁA$Á#A$c               ó    € V ^8„  d   QhRRRR/# )r
   r&   r   r   Úboolr   )r   s   "r   r   r   Ã   s   € ÷ ñ  Tð ¨dñ r   c                ót   €  \        \        V 4      4      P                  R4      R8H  #   \         d     R# i ; i)a�  True when ``project_root`` is a bundled desktop payload's ``repo/``.

THE shape predicate for the sealed-bundle branch, and a mirror of the
Electron shell's ``installShape() === 'bundled'``: the build stamp is
the authority, so filesystem coincidences (a sibling ``bin/``, a
surviving ``apps/desktop/package.json``) can never promote a checkout
into it. A missing, foreign, or unreadable stamp means NOT bundled.
ÚpayloadÚbundledF)r3   r   r   Ú	Exception)r&   s   &r   Úis_bundled_payloadr:   Ã   s9   € ðÜ!¤$ |Ó"4Ó5×9Ñ9¸)ÓDÈ	ÑQÐQøÜô Úðús   ‚%( ¨7¶7c               ó    € V ^8„  d   QhRRRR/# )r
   r&   r   r   zOptional[str]r   )r   s   "r   r   r   Ò   s   € ÷ Yñ Y ð Y¨-ñ Yr   c                óÎ   € \        V 4      pVR,          P                  4       '       d   R# \        V4      P                  R4      p\	        V\
        4      '       d   V'       d   V# R# )u†  The steward owning the sealed tree at ``project_root``, or ``None``.

``None`` means the tree is a git checkout (``.git`` present â€” a
directory, or a worktree/submodule gitfile) and is ours to mutate.
Everything else is sealed: the stamp's ``distribution`` names the
steward, and a missing or unreadable stamp gives ``"unknown"`` â€”
a tree we cannot prove is ours is not ours to remove.
z.gitNÚdistributionÚunknown)r   Úexistsr3   r   r1   r   )r&   Úrootr=   s   &  r   Úsealed_stewardrA   Ò   sR   € ô �Ó€DØˆv�×Ñ×ÒÙÜ% dÓ+×/Ñ/°Ó?€LÜ% l´C×8Ò8¿\ˆ<ÐXÈyÐXr   c               ó    € V ^8„  d   QhRRRR/# )r
   r&   r   r   ztuple[str, bool]r   )r   s   "r   r   r   â   s   € ÷ 
ñ 
 4ð 
Ð,<ñ 
r   c                ó,   € \        V 4      pVf   R# VR3# )a  (steward, code_removal_allowed) for the tree at ``project_root``.

A git checkout reports ``("git", True)``; a sealed tree reports its
steward and ``False``. Used by ``gui_install_summary`` so the desktop
UI can gate its destructive options on the same ladder the CLI uses.
F)ÚgitT)rA   )r&   r   s   & r   Úclassify_installrE   â   s$   € ô ˜\Ó*€GØ‚ØÐØ�UÐÐr   )Úselfzapp-installerzelectron-updaterÚexternalzmicrosoft-store)N) Ú__doc__Ú
__future__r   r,   r   Úpathlibr   Útypingr   ÚUPDATE_MECHANISMSr   ÚSTEWARD_DOCKERÚSTEWARD_NIXÚSTEWARD_APT_TERMUXr   ÚSOURCE_ON_TERMUX_UPDATE_MESSAGEÚSOURCE_ON_TERMUX_UPDATE_COMMANDr   Ú_STEWARD_DELETE_DATA_PREAMBLEÚ_STEWARD_DELETE_DATA_CLIÚ_STEWARD_DELETE_DATA_DESKTOPr!   Ú_STEWARD_MANAGED_BY_DESKTOPr   r    r"   r   r$   r3   r:   rA   rE   r   r   r   Ú<module>rV      s¶  ðñõ& #ã Û 
Ý Ý à`Ð à€Ø€Ø€Ø!Ð ð ð	Vð ð	?ð
 ð	%ðÐ ð4!ð  ð #=Ð ð1ð ð !\Ð Ø>Ð ØqÐ ð ð	ð
 	&õ	&ð 	!õ	!ð ð	ð
 	&õ	&ð 	!õ	!ð ð	ð 	&õ	&ð 	!õ	!ð)Ð ð> LÐ ð Ø#ð	Nõ	Nð 	&õ	&ð 	%õ		%ð Ø#ð	Mõ	Mð 	&õ	&ð 	%õ		%ð*Ð &ð$  ðõð "õ	"ð
 !õ!ð #ð	ð "õ"ð õð õ<÷?õ2õ õY÷ 
r   