MCPcopy
hub / github.com/HKUDS/OpenHarness / _make_command_context

Function _make_command_context

scripts/local_system_scenarios.py:41–65  ·  view source on GitHub ↗
(cwd: Path)

Source from the content-addressed store, hash-verified

39
40
41def _make_command_context(cwd: Path) -> CommandContext:
42 tool_registry = create_default_tool_registry()
43 engine = QueryEngine(
44 api_client=FakeApiClient(),
45 tool_registry=tool_registry,
46 permission_checker=PermissionChecker(load_settings().permission),
47 cwd=cwd,
48 model="claude-test",
49 system_prompt="system",
50 )
51 engine.load_messages(
52 [
53 ConversationMessage(role="user", content=[TextBlock(text="one")]),
54 ConversationMessage(role="assistant", content=[TextBlock(text="two")]),
55 ConversationMessage(role="user", content=[TextBlock(text="three")]),
56 ]
57 )
58 return CommandContext(
59 engine=engine,
60 cwd=str(cwd),
61 tool_registry=tool_registry,
62 app_state=AppStateStore(
63 AppState(model="claude-test", permission_mode="default", theme="default", keybindings={})
64 ),
65 )
66
67
68def _write_plugin(source_root: Path) -> Path:

Callers 2

_run_plugin_command_flowFunction · 0.85
_run_command_flowFunction · 0.85

Calls 11

load_messagesMethod · 0.95
QueryEngineClass · 0.90
PermissionCheckerClass · 0.90
load_settingsFunction · 0.90
ConversationMessageClass · 0.90
TextBlockClass · 0.90
CommandContextClass · 0.90
AppStateStoreClass · 0.90
AppStateClass · 0.90
FakeApiClientClass · 0.70

Tested by

no test coverage detected