
    7j%                    Z    d Z ddlmZ ddlmZ ddlmZ ddlmZ  ed      Z	d
dZ
dddZy	)u   Quick discovery: a small, fast, read-only snapshot.

Runs during install/registration so the panel has baseline facts immediately.
Intentionally cheap — no subprocess-heavy scans here.
    )annotations)Any)system)
get_loggerzdiscovery.quickc                    t        j                         t        j                         t        j                         t        j                         t        j
                         t        j                         t        j                         t        j                         t        j                         t        j                         d
S )z)Return the minimal baseline server facts.)
hostnameoskernelarchitecture	cpu_countmemory_total
disk_total	public_ipprivate_ipsuptime)r   r   os_infor
   r   r   memory_total_bytesdisk_total_bytesr   r   uptime_seconds     I/var/www/downloads.wolfpanel.net/public_html/agent/src/discovery/quick.pycollectr      s     OO%nn--/++-%%'113--/%%'))+'') r   c                    t               }|rddlm} 	  || |dd|gi       |S |S # t        $ r!}t        j                  d|       Y d}~|S d}~ww xY w)zCollect baseline facts and upload them as an instant server_facts scan.

    The quick scan gives the panel non-empty server_facts immediately after the
    first connection, ahead of the slower full inventory. Upload is best-effort.
    r   )upload_inventoryquickserver_factszquick scan upload failed: %sN)r   discovery.uploadr   	Exceptionlogwarning)config
api_clientuploadsnapshotr   excs         r   runr'   !   s_     yH5	=VZ>H::VW O8O  	=KK6<<O	=s   & 	AAAN)returndict[str, Any])T)r$   boolr(   r)   )__doc__
__future__r   typingr   	discoveryr   loggerr   r    r   r'   r   r   r   <module>r0      s-    #   "# r   