*** Settings ***
Library    Process
Library    String

*** Test Cases ***
TUI Commands Module Initialization
    [Tags]    tdd_issue    tdd_issue_1928
    ${script}=    Catenate    SEPARATOR=\n
    ...    from cleveragents.tui.commands import TuiCommandRouter
    ...    assert callable(TuiCommandRouter), "TuiCommandRouter should be a callable class"
    ...    print("command-handler-ok")
    ${result}=    Run Process    ${PYTHON}    -c    ${script}    shell=False
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    command-handler-ok

TUI Slash Catalog Initialization
    [Tags]    tdd_issue    tdd_issue_1928
    ${script}=    Catenate    SEPARATOR=\n
    ...    from cleveragents.tui.slash_catalog import SLASH_COMMAND_SPECS, slash_command_names
    ...    names = slash_command_names()
    ...    assert len(names) > 0, "Slash catalog should have commands"
    ...    assert len(SLASH_COMMAND_SPECS) > 0, "SLASH_COMMAND_SPECS should be non-empty"
    ...    print("slash-catalog-ok")
    ${result}=    Run Process    ${PYTHON}    -c    ${script}    shell=False
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    slash-catalog-ok

TUI First Run Module Initialization
    [Tags]    tdd_issue    tdd_issue_1928
    ${script}=    Catenate    SEPARATOR=\n
    ...    from cleveragents.tui.first_run import is_first_run, create_default_persona_for_actor
    ...    assert callable(is_first_run), "is_first_run should be callable"
    ...    assert callable(create_default_persona_for_actor), "create_default_persona_for_actor should be callable"
    ...    print("first-run-handler-ok")
    ${result}=    Run Process    ${PYTHON}    -c    ${script}    shell=False
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    first-run-handler-ok

TUI Quotes Module Initialization
    [Tags]    tdd_issue    tdd_issue_1928
    ${script}=    Catenate    SEPARATOR=\n
    ...    from cleveragents.tui.quotes import THROBBER_QUOTES
    ...    assert isinstance(THROBBER_QUOTES, tuple), "THROBBER_QUOTES should be a tuple"
    ...    assert len(THROBBER_QUOTES) > 0, "THROBBER_QUOTES should be non-empty"
    ...    print("quote-provider-ok")
    ${result}=    Run Process    ${PYTHON}    -c    ${script}    shell=False
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    quote-provider-ok
