feat(agent): add Grok Build TUI adapter, runtime dispatch, and skill support

This commit is contained in:
2026-08-26 10:49:34 +09:00
parent 926ca5452b
commit ad8201d706
27 changed files with 414 additions and 40 deletions
+42
View File
@@ -946,6 +946,48 @@ def test_layout_single_workspace_54x23_compact_tiling_tier1():
assert d4.reason == "column_width_overflow"
# ==============================================================================
# FEATURE: Grok Build TUI Agent Integration
# ==============================================================================
def test_grok_adapter_contract_in_tier1():
"""Verify GrokAgentAdapter registration and properties in Tier 1 suite."""
from lib_py.agents.registry import get_adapter
adapter = get_adapter('grok')
assert adapter is not None
assert adapter.name == 'grok'
assert adapter.own_key == 'grok_session_id_own'
assert adapter.delegate_agent_key == 'grok-build'
assert adapter.exit_key == '/exit'
assert adapter.ready_tokens == 'Grok|xAI|Assistant||>>>'
def test_grok_shell_and_scripts_integration(mam_sandbox):
"""Verify lib.sh, create_session.sh, stop_session.sh, and workspace_uuid contain grok."""
# 1. lib.sh kind mapping & binaries
lib_path = mam_sandbox / "skills" / "lib.sh"
lib_content = lib_path.read_text()
assert '*-creator-grok|*-planner-grok|*-reviewer-grok) kind="grok"' in lib_content
assert "'claude', 'agy', 'hermes', 'cline', 'grok'" in lib_content
assert '[[ "$sess" =~ "grok" ]]' in lib_content
# 2. create_session.sh validation
create_path = mam_sandbox / "skills" / "multi-agent-mux-create" / "scripts" / "create_session.sh"
create_content = create_path.read_text()
assert 'claude|agy|hermes|cline|grok)' in create_content
# 3. stop_session.sh validation & state capture
stop_path = mam_sandbox / "skills" / "multi-agent-mux-stop" / "scripts" / "stop_session.sh"
stop_content = stop_path.read_text()
assert 'claude|agy|hermes|cline|grok)' in stop_content
assert "target['grok_session_id_own'] = captured" in stop_content
# 4. workspace_uuid OWN_KEY
from lib_py.workspace_uuid import OWN_KEY
assert OWN_KEY.get('grok') == 'grok_session_id_own'