+
    .pÐjv0  ã                  ód   € R t ^ RIHt ^ RIt^ RIHt ^ RIHt RtR t	R R lt
R	 R
 ltR R ltR# )z;``hermes gateway`` and ``hermes proxy`` subcommand parsers.)ÚannotationsN)ÚCallable)Úadd_accept_hooks_flagz�Start a separate gateway for this profile even when the default multiplexer already serves it (not recommended: two pollers on one bot token, port conflicts)c               ó2   € V P                   ! VR RRV/VB  R# )ÚactionÚ
store_trueÚhelpN)Úadd_argument)Úparserr   ÚnamesÚkws   &$*,Ú-/opt/hermes/hermes_cli/subcommands/gateway.pyÚ_flagr      s   € Ø
×Ò˜ÐE |ÐE¸$ÐEÀ"ÔEó    c               ó    € V ^8„  d   QhRRRR/# ©é   r
   zargparse.ArgumentParserÚreturnÚNone© )Úformats   "r   Ú__annotate__r      s   € ÷ Oñ OÐ&=ð OÀ$ñ Or   c                óJ   € V P                  RR\        P                  R7       R# )zåAccept stale `gateway <verb> --platform X` docs without advertising it.

Lifecycle commands operate on the gateway process, not one adapter; Photon briefly
printed a per-platform start command during setup, so keep it parseable.
z
--platformÚplatform©Údestr   N)r	   ÚargparseÚSUPPRESS©r
   s   &r   Ú_add_compat_platform_flagr      s   € ð ×Ñ˜¨:¼H×<MÑ<MÐÖNr   c               ó    € V ^8„  d   QhRRRR/# r   r   )r   s   "r   r   r      s   € ÷ Tñ TÐ4ð T¸ñ Tr   c                ó"   € \        V R RR7       R# )ú--systemz-Target the Linux system-level gateway service©r   N)r   r   s   &r   Ú_add_system_flagr$      s   € Ü	ˆ&�*Ð#R×Sr   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   Úcmd_gatewayr   Ú	cmd_proxyÚcmd_gateway_enrollr   r   r   )r   s   "r   r   r   #   s2   € ÷ x2ñ x2Ø (ðx2Ø5=ðx2ØS[ðx2à	ñx2r   c               ó	  € V P                  RRRR7      pVP                  RR7      pVP                  RRR	7      pVP                  R
RR^ RR7       VP                  RRRRR7       VP                  RRRR7       VP                  RRRR7       VP                  RRRR7       \        VRRR	7       \	        V4       \	        V4       VP                  RRR	7      p\        V4       \        VRRR	7       \        VR\        R	7       \        V4       VP                  R R!R	7      p\        V4       \        VRR"R	7       VP                  R#R$R	7      p	\        V	4       \        V	RR%R	7       \        V	R\        R	7       \        V	4       VP                  R&R'R	7      p
\        V
R(R)R	7       \        V
R*R+R,R	7       \        V
4       \        V
4       VP                  R-R.R	7      p\        VRR/R	7       \        VR0R1R	7       VP                  R2R3R4R57       \        VR6R7R8R9R:7       VP                  R;R7R<R=R>7       \        VR?R@R8RAR:7       VP                  RBR@R<RCR>7       \        VRDRERFR57       \        VRGRHRIR57       \        VRJRK\        P                  R57       VP                  RLRMR	7      p\        V4       VP                  RNROR	7       VP                  RPRQR	7       VP                  RRRSRTR7      p\        VRURVRWR57       \        VRXRYRZR[R57       VP                  R\R]R^R7      p\        VR_R`RaR57       \        VRURVRbR57       \        VRXRYRZRcR57       VP                  RdReRfR7      pVP                  RgR8RhRi7       VP                  RjRkR8RlR:7       VP                  RmRnR8RoR:7       VP                  RpRqR8RrR:7       VP                  VRs7       V P                  RtRuRvR7      pVP                  RwR7      pVP                  RRxR	7      pVP                  RyRzR{Ri7       VP                  R|R8R}Ri7       VP                  R~\        R8RR€7       VP                  R&R�R	7       VP                  R‚RƒR	7       VP                  VRs7       VP                  VRs7       R8# )„zCAttach the ``gateway`` and ``proxy`` subcommands to ``subparsers``.ÚgatewayzMessaging gateway managementzLManage the messaging gateway (Telegram, Discord, WhatsApp, Weixin, and more))r   ÚdescriptionÚgateway_command)r   Úrunz:Run gateway in foreground (recommended for WSL and Docker)r#   z-vz	--verboseÚcountz2Increase stderr log verbosity (-v=INFO, -vv=DEBUG))r   Údefaultr   z-qz--quietr   zSuppress all stderr log output)r   r   z	--replacez:Replace any existing gateway instance (useful for systemd)z--forcezÝStart a foreground gateway even when a systemd/launchd/s6 service already supervises this profile. Without --force, the command refuses because a second dispatcher escapes the service and can corrupt shared gateway state.z--no-supervisea¯  Inside the s6-overlay Docker image, normally `gateway run` is automatically redirected to the supervised s6 service (so the gateway gets auto-restart on crash, plus a supervised dashboard if HERMES_DASHBOARD is set). Pass --no-supervise to opt out and get the historical pre-s6 foreground behavior: the gateway is the container's main process and the container exits with the gateway's exit code. No effect outside an s6 container.z--external-supervisorzøDeclare that an external process manager owns this foreground gateway. In-chat restarts and updates exit back to that manager instead of spawning a detached replacement. Use this when a launchd/systemd wrapper strips its native environment markers.Ústartz6Start the installed systemd/launchd background servicez--allzDKill ALL stale gateway processes across all profiles before startingÚstopzStop gateway servicez.Stop ALL gateway processes across all profilesÚrestartzRestart gateway servicez@Kill ALL gateway processes across all profiles before restartingÚstatuszShow gateway statusz--deepzDeep status checkz-lz--fullz9Show full, untruncated service/log output where supportedÚinstallz7Install gateway as a systemd/launchd background servicezZForce reinstall, and install even when the default multiplexer already serves this profiler"   z8Install as a Linux system-level service (starts at boot)z--run-as-userÚrun_as_userz3User account the Linux system service should run asr   z--start-nowÚ	start_nowNz6Start the gateway service immediately after installing)r   r/   r   z--no-start-nowÚstore_falsez1Do not start the gateway service after installing)r   r   r   z--start-on-loginÚstart_on_loginz7Enable the service to start automatically on login/bootz--no-start-on-loginz0Do not enable the service to start on login/bootz--if-missingÚ
if_missingz6Do nothing when a gateway service is already installedz--force-unit-pathÚforce_unit_pathzFRepoint a service definition that pins another HERMES_HOME at this onez--elevated-handoffÚelevated_handoffÚ	uninstallzUninstall gateway serviceÚlistz*List all profiles and their gateway statusÚsetupzConfigure messaging platformszmigrate-legacyz;Remove legacy hermes.service units from pre-rename installszÖStop, disable, and remove legacy Hermes gateway unit files (e.g. hermes.service) left over from older installs. Profile units (hermes-gateway-<profile>.service) and unrelated third-party services are never touched.z	--dry-runÚdry_runz+List what would be removed without doing itz-yz--yesÚyeszSkip the confirmation promptÚmigratez<Converge every per-profile gateway onto the ONE host gatewaya  Converge this host onto the one-gateway-per-host model: stop and uninstall each secondary profile's gateway and its supervisor unit (systemd, launchd, Windows Scheduled Task), then restart the default profile's gateway so it serves every profile. Runs a preflight first (duplicate bot tokens, port-binding platforms without a /p/<profile>/ ingress) and changes nothing when blocked. Safe to re-run: a half-migrated host converges on the next run. Per-profile gateways are not a supported topology any more, so there is no rollback command.z--multiplexÚ	multiplexz,Converge onto the one host gateway (default)z5Print the plan and blockers without changing anythingzApply without confirmationÚenrollzLEnroll this gateway with a relay connector (writes relay auth creds to .env)a–  Redeem a single-use enrollment token with a relay connector. Authenticates as your Nous Portal account (the connector derives the authoritative tenant from it), mints this gateway's per-gateway secret and per-tenant delivery key, and writes GATEWAY_RELAY_ID / GATEWAY_RELAY_SECRET / GATEWAY_RELAY_DELIVERY_KEY into ~/.hermes/.env. Requires being logged in (hermes setup). Not available in managed installs.z--tokenz†The single-use enrollment token from the connector (delivered with your gateway config). Also settable via GATEWAY_RELAY_ENROLL_TOKEN.)r/   r   z--connector-urlÚconnector_urlz®The connector base/relay URL, e.g. wss://connector.example.com/relay or https://connector.example.com. Also settable via GATEWAY_RELAY_URL / gateway.relay_url in config.yaml.z--gateway-idÚ
gateway_idz[A stable id for this gateway instance (kill-switch granularity). Defaults to gw-<hostname>.z
--wake-urlÚwake_urlua  Phase 5 Â§5.2 wake URL: a reachable URL the connector pokes (payload-free GET) to wake this gateway when buffered work arrives while it's idle/suspended, so it reconnects and drains. Persisted as GATEWAY_RELAY_WAKE_URL in ~/.hermes/.env and forwarded at provision. Optional â€” without it the gateway still drains whenever it next reconnects on its own.)ÚfuncÚproxyz0Local OpenAI-compatible proxy to OAuth providerszÝRun a local HTTP server that forwards OpenAI-compatible requests to an OAuth-authenticated provider (e.g. Nous Portal). External apps can point at the proxy with any bearer token; the proxy attaches your real credentials.Úproxy_commandzRun the proxy in the foregroundz
--providerÚnouszMUpstream provider: nous or xai (default: nous). See `hermes proxy providers`.z--hostz@Bind address (default: 127.0.0.1). Use 0.0.0.0 to expose on LAN.z--portzBind port (default: 8645))Útyper/   r   z$Show which proxy upstreams are readyÚ	providersz'List available proxy upstream providers)Ú
add_parserÚadd_subparsersr	   r   r   r$   Ú_FORCE_SERVED_PROFILE_HELPr   r   r   Úset_defaultsÚint)Ú
subparsersr&   r'   r(   Úgateway_parserÚgateway_subparsersÚgateway_runÚgateway_startÚgateway_stopÚgateway_restartÚgateway_statusÚgateway_installÚgateway_uninstallÚgateway_migrate_legacyÚgateway_migrateÚgateway_enrollÚproxy_parserÚproxy_subparsersÚproxy_starts   &$$$               r   Úbuild_gateway_parserrb   #   s–  € ð  ×*Ñ*¨9Ð;YØbð +ó d€Nà'×6Ñ6Ð<MÐ6ÓNÐà$×/Ñ/ØÐPð 0ó €Kð ×ÑØØØØØAð ô ð ×ÑØˆi Ð3Sð ô ð ×ÑØØØIð ô ð
 ×ÑØØð,ð	 ô 	ð ×ÑØØðFð	 ô ô 
ˆ+Ð.ðMõNô
 ˜+Ô&Ü˜.Ô)à&×1Ñ1ØÐNð 2ó P€Mä�]Ô#Ü	ˆ-˜ØSõUä	ˆ-˜Ô)CÕDÜ˜mÔ,à%×0Ñ0°Ð>TÐ0ÓU€LÜ�\Ô"Ü	ˆ,˜Ð&VÕWà(×3Ñ3°IÐD]Ð3Ó^€OÜ�_Ô%Ü	ˆ/˜7ØOõQä	ˆ/˜9Ô+EÕFÜ˜oÔ.à'×2Ñ2°8ÐBWÐ2ÓX€NÜ	ˆ.˜(Ð)<Õ=Ü	ˆ.˜$ ØHõJä�^Ô$Ü˜nÔ-ð )×3Ñ3ØÐQð 4ó S€Oä	ˆ/˜9Øiõkä	ˆ/˜:ØGõIà× Ñ  °}ØBð !ô Dä	ˆ/˜=¨{ÀDØEõGà× Ñ Ð!1¸ÈMØ@ð !ô Bä	ˆ/Ð-Ð4DÈdØFõHà× Ñ Ð!6Ð=MÐVcØ?ð !ô Aä	ˆ/˜>°ØEõGä	ˆ/Ð.Ð5FØUõWä	ˆ/Ð/Ð6HÌx×O`ÑO`Õaà*×5Ñ5°kÐHcÐ5ÓdÐÜÐ&Ô'à×!Ñ! &Ð/[Ð!Ô\à×!Ñ! 'Ð0OÐ!ÔPà/×:Ñ:ØÐ\ð6ð ;ó 7Ðô 
Ð
  +°IØ:õ<ä	Ð
  $¨°eÐB`Õaà(×3Ñ3ØÐVðLð 4ó M€Oô 
ˆ/˜=¨{ÐAoÕpÜ	ˆ/˜;¨YÐ=tÕuÜ	ˆ/˜4 ¨uÐ;WÕXð (×2Ñ2°8Ø[ðZð 3ó [€Nð ×Ñ 	°4ðRð  ô Sð ×ÑÐ 1¸ÐQUð2ð  ô 3ð ×Ñ °\È4ð)ð  ô *ð ×Ñ °:Àtð%ð  ô &ð ×ÑÐ%7ÐÔ8ð ×(Ñ(ØÐHð.ð )ó /€Lð $×2Ñ2¸Ð2ÓHÐà"×-Ñ-¨gÐ<]Ð-Ó^€KØ×Ñ˜\°6Ø\ð ô ^à×Ñ˜X¨tØOð ô Qà×Ñ˜X¬C¸ÐD_ÐÔ`à×Ñ Ð/UÐÔVØ×Ñ Ð2[ÐÔ\Ø×Ñ 9ÐÔ-Ø×Ñ [ÐÖ1r   )Ú__doc__Ú
__future__r   r   Útypingr   Úhermes_cli.subcommands._sharedr   rO   r   r   r$   rb   r   r   r   Ú<module>rg      s7   ðÙ Aå "ã Ý å @ðFð ò
FõOõT÷x2r   