
    iS                        d Z ddlmZ ddlZddlZddlmZ ddlmZ ddl	Z
ddZddZddZdd	Zed
k(  r e e             y)z{Human-friendly wrapper for demo validation checks.

Use this script instead of demo_test_ladder.py for clearer mode names.
    )annotationsN)SimpleNamespace)Iterablec                6   t        | j                  | j                  | j                  | j                  | j
                  | j                  | j                  | j                  | j                  | j                  | j                  | j                  | j                        S )N)orchestrator_healthedge_healthrosbridge_urltimeout_secskip_preflightpytest_argswith_live_llmlive_llm_endpointlive_llm_modellive_llm_intentlive_llm_timeout_seclive_llm_use_openai_sdklive_llm_no_response_format)r   orchestrator_health_urledge_health_urlrosbridge_ws_urlr
   r   r   r   llm_endpoint	llm_model
llm_intentllm_timeout_secllm_use_openai_sdkllm_no_response_format)argss    tools/run_demo_checks.py_namespace_for_corer      s     88((++$$**$$((++~~!11 $ 7 7$($?$?     c                    | D ]a  }|dk(  rt        j                  |      }n;|dk(  rt        j                  |      }n t        j                  ||j                        }|dk7  s_|c S  y)N	preflightlive-llmr   )corerun_preflightrun_live_llm_smoke	run_layerr   )modes	core_argsmodercs       r   _run_modes_in_orderr,   #   sh     ;##I.BZ((3Bi&;&;<B7I r    c            
        t        j                  d      } | j                  dddd       | j                  dt        j                  d	d
             | j                  dt        j                  dd             | j                  dt        j                  dd             | j                  dt
        d       | j                  ddd       | j                  ddd       | j                  dt        j                  dt        j                  dd                   | j                  dt        j                  d t        j                  d!d"                   | j                  d#d$       | j                  d%t        d&       | j                  d'd(       | j                  d)d(       | j                  d*t         j                  d+,       | j                         S )-Nz)Run demo validation checks (simple modes))descriptionz--mode)r"   quickintegrationscenariollmfullr/   zpreflight=connectivity only, quick=unit+component, integration=mock integration tests, scenario=3-scene flow test, llm=real orchestrator planner call, full=all checks in order)choicesdefaulthelpz--orchestrator-health-urlORCHESTRATOR_HEALTH_URLzhttp://127.0.0.1:8000/health)r5   z--edge-health-urlEDGE_PROXY_HEALTH_URLzhttp://127.0.0.1:8080/healthz--rosbridge-ws-urlROSBRIDGE_URLzwss://127.0.0.1:9090z--timeout-secg       @)typer5   z--skip-preflight
store_truez4Skip connectivity checks for local/offline test runs)actionr6   z--with-live-llmz<In full mode, include real planner call against LLM endpointz--llm-endpointLIVE_LLM_ENDPOINTORCHESTRATOR_LLM_ENDPOINTz.https://modelapi.klass.dev/v1/chat/completionsz--llm-modelLIVE_LLM_MODELORCHESTRATOR_LLM_MODELzQwen3-Next-80B-A3B-FP8z--llm-intentz?Navigate to office_scene, scan area, verify chemical container.z--llm-timeout-sec-   z--llm-use-openai-sdk)r<   z--llm-no-response-formatr   z/Extra args forwarded to pytest (prefix with --))nargsr6   )	argparseArgumentParseradd_argumentosgetenvfloatint	REMAINDER
parse_args)parsers    r   rK   rK   0   s   $$1\]F
P'   #		35ST   		13QR   		/+AB   eSA
C  
 K  
 		II13cd
   		*BII6NPh,ij   Q   +#rB
.|D
2<H
  >  
 r    c                    t               } t        |       }| j                  dk(  rt        j                  |      S | j                  dk(  r4| j
                  st        j                  |      }|dk7  r|S t        d|      S | j                  dk(  r t        j                  d|j                        S | j                  dk(  rH| j
                  st        j                  |      }|dk7  r|S t        j                  d|j                        S | j                  dk(  rt        j                  |      S | j
                  st        j                  |      }|dk7  r|S g d	}| j                  r|j                  d
d       t        ||      S )Nr"   r/   r   )unit	componentr0   integration-mockr1   r2   )rN   rO   rP   r1      r#   )rK   r   r*   r$   r%   r   r,   r'   r   r&   r   insert)r   r)   r+   ordered_modess       r   mainrT   p   sJ   <D#D)IyyK!!),,yyG""##I.BQw	"#8)DDyyM!~~0)2G2GHHyyJ""##I.BQw	~~j)*?*?@@yyE&&y11 	*7IIMQ
+}i88r    __main__)r   argparse.Namespacereturnr   )r(   zIterable[str]r)   r   rW   rI   )rW   rV   )rW   rI   )__doc__
__future__r   rC   rF   typesr   typingr   demo_test_ladderr$   r   r,   rK   rT   __name__
SystemExit r    r   <module>r`      sP   
 #  	 !  $
=@#9L z
TV
 r    