§
    oq'jñ"  ã                  ó>   — d Z ddlmZ ddlZddlmZ ddlmZ dd„ZdS )a-  ``hermes gateway`` and ``hermes proxy`` subcommand parsers.

Extracted verbatim from ``hermes_cli/main.py:main()`` (god-file Phase 2).
Both parsers are built together because they shared one inline block (the
``gateway`` section also defined ``proxy``). Handlers injected to avoid
importing ``main``.
é    )ÚannotationsN)ÚCallable)Úadd_accept_hooks_flagÚcmd_gatewayr   Ú	cmd_proxyÚreturnÚNonec               óF	  — |                       ddd¬¦  «        }|                     d¬¦  «        }|                      dd¬	¦  «        }|                     d
dddd¬¦  «         |                     dddd¬¦  «         |                     ddd¬¦  «         |                     ddd¬¦  «         t          |¦  «         t          |¦  «         |                      dd¬	¦  «        }|                     ddd¬¦  «         |                     ddd¬¦  «         |                      dd ¬	¦  «        }|                     ddd¬¦  «         |                     ddd!¬¦  «         |                      d"d#¬	¦  «        }|                     ddd¬¦  «         |                     ddd$¬¦  «         |                      d%d&¬	¦  «        }	|	                     d'dd(¬¦  «         |	                     d)d*dd+¬¦  «         |	                     ddd¬¦  «         |                      d,d-¬	¦  «        }
|
                     d.dd/¬¦  «         |
                     ddd0¬¦  «         |
                     d1d2d3¬4¦  «         |
                     d5d6dd7t          j        ¬8¦  «         |
                     d9d6d:t          j        ¬;¦  «         |
                     d<d=dd7t          j        ¬8¦  «         |
                     d>d=d:t          j        ¬;¦  «         |
                     d?d@dt          j        ¬;¦  «         |                      dAdB¬	¦  «        }|                     ddd¬¦  «         |                      dCdD¬	¦  «         |                      dEdF¬	¦  «         |                      dGdHdI¬¦  «        }|                     dJdKddL¬;¦  «         |                     dMdNdOddP¬;¦  «         |                       dQdRdS¬¦  «        }|                     dT¬¦  «        }|                      ddU¬	¦  «        }|                     dVdWdX¬Y¦  «         |                     dZd7d[¬Y¦  «         |                     d\t          d7d]¬^¦  «         |                      d%d_¬	¦  «         |                      d`da¬	¦  «         |                     |¬b¦  «         |                     |¬b¦  «         d7S )czCAttach the ``gateway`` and ``proxy`` subcommands to ``subparsers``.ÚgatewayzMessaging gateway managementzLManage the messaging gateway (Telegram, Discord, WhatsApp, Weixin, and more))ÚhelpÚdescriptionÚgateway_command)ÚdestÚrunz?Run gateway in foreground (recommended for WSL, Docker, Termux))r   z-vz	--verboseÚcountr   z2Increase stderr log verbosity (-v=INFO, -vv=DEBUG))ÚactionÚdefaultr   z-qz--quietÚ
store_truezSuppress all stderr log output)r   r   z	--replacez:Replace any existing gateway instance (useful for systemd)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.Ústartz6Start the installed systemd/launchd background servicez--systemz-Target the Linux system-level gateway 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 servicez--forcezForce reinstallz8Install as a Linux system-level service (starts at boot)z--run-as-userÚrun_as_userz3User account the Linux system service should run as)r   r   z--start-nowÚ	start_nowN)r   r   r   r   z--no-start-nowÚstore_false)r   r   r   z--start-on-loginÚstart_on_loginz--no-start-on-loginz--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Ú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`.)r   r   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)Úfunc)Ú
add_parserÚadd_subparsersÚadd_argumentr   ÚargparseÚSUPPRESSÚintÚset_defaults)Ú
subparsersr   r   Úgateway_parserÚgateway_subparsersÚgateway_runÚgateway_startÚgateway_stopÚgateway_restartÚgateway_statusÚgateway_installÚgateway_uninstallÚgateway_migrate_legacyÚproxy_parserÚproxy_subparsersÚproxy_starts                   úC/home/ubuntu/.hermes/hermes-agent/hermes_cli/subcommands/gateway.pyÚbuild_gateway_parserr@      sÙ  € ð
  ×*Ò*ØØ+Øbð +ñ ô €Nð
 (×6Ò6Ð<MÐ6ÑNÔNÐð %×/Ò/ØÐUð 0ñ ô €Kð ×ÒØØØØØAð ñ ô ð ð ×ÒØˆi Ð3Sð ñ ô ð ð ×ÒØØØIð ñ ô ð ð
 ×ÒØØðFð	 ñ ô ð õ ˜+Ñ&Ô&Ð&Ý˜.Ñ)Ô)Ð)ð '×1Ò1ØÐNð 2ñ ô €Mð ×ÒØØØ<ð ñ ô ð ð
 ×ÒØØØSð ñ ô ð ð &×0Ò0°Ð>TÐ0ÑUÔU€LØ×ÒØØØ<ð ñ ô ð ð
 ×ÒØØØ=ð ñ ô ð ð )×3Ò3ØÐ1ð 4ñ ô €Oð × Ò ØØØ<ð !ñ ô ð ð
 × Ò ØØØOð !ñ ô ð ð (×2Ò2°8ÐBWÐ2ÑXÔX€NØ×Ò °ÐDWÐÑXÔXÐXØ×ÒØØØØHð	  ñ ô ð ð ×ÒØØØ<ð  ñ ô ð ð )×3Ò3ØÐQð 4ñ ô €Oð × Ò  °<ÐFWÐ ÑXÔXÐXØ× Ò ØØØGð !ñ ô ð ð
 × Ò ØØØBð !ñ ô ð ð
 × Ò ØØØØÝÔð !ñ ô ð ð × Ò ØØØÝÔð	 !ñ ô ð ð × Ò ØØØØÝÔð !ñ ô ð ð × Ò ØØØÝÔð	 !ñ ô ð ð × Ò ØØØÝÔð	 !ñ ô ð ð +×5Ò5ØÐ5ð 6ñ ô Ðð ×"Ò"ØØØ<ð #ñ ô ð ð ×!Ò! &Ð/[Ð!Ñ\Ô\Ð\ð ×!Ò! 'Ð0OÐ!ÑPÔPÐPð 0×:Ò:ØØJð6ð	 ;ñ 	ô 	Ðð ×'Ò'ØØØØ:ð	 (ñ ô ð ð ×'Ò'ØØØØØ+ð (ñ ô ð ð ×(Ò(ØØ?ð.ð	 )ñ 	ô 	€Lð $×2Ò2¸Ð2ÑHÔHÐà"×-Ò-ØÐ7ð .ñ ô €Kð ×ÒØØØ\ð ñ ô ð ð
 ×ÒØØØOð ñ ô ð ð
 ×ÒØÝØØ(ð	 ñ ô ð ð ×ÒØÐ=ð  ñ ô ð ð ×ÒØÐCð  ñ ô ð ð ×Ò 9ÐÑ-Ô-Ð-Ø×Ò [ÐÑ1Ô1Ð1Ð1Ð1ó    )r   r   r   r   r   r	   )	Ú__doc__Ú
__future__r   r-   Útypingr   Úhermes_cli.subcommands._sharedr   r@   © rA   r?   ú<module>rG      st   ððð ð #Ð "Ð "Ð "Ð "Ð "à €€€Ø Ð Ð Ð Ð Ð à @Ð @Ð @Ð @Ð @Ð @ðo2ð o2ð o2ð o2ð o2ð o2rA   