MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / _execute_local

Method _execute_local

src/command_system/engine.py:168–201  ·  view source on GitHub ↗

Execute a local command.

(
        self,
        command: LocalCommand,
        args: str,
    )

Source from the content-addressed store, hash-verified

166 return result
167
168 async def _execute_local(
169 self,
170 command: LocalCommand,
171 args: str,
172 ) -> CommandResult:
173 """Execute a local command."""
174 try:
175 local_result = await command.call(args, self.context)
176
177 if local_result.type == "skip":
178 return CommandResult.skip(command.name)
179
180 display_text = local_result.display_text or local_result.value
181 if local_result.type == "compact":
182 # C3b: preserve the compact result type so UI surfaces can
183 # render a boundary row (TS CompactBoundaryMessage) instead
184 # of a plain system line. text still carries the
185 # user_display_message for surfaces that don't special-case.
186 return CommandResult(
187 success=True,
188 command_name=command.name,
189 result_type="compact",
190 text=display_text,
191 display="system",
192 )
193 return CommandResult.success_text(
194 command.name,
195 display_text,
196 )
197 except Exception as e:
198 return CommandResult.error(
199 command.name,
200 str(e),
201 )
202
203 async def _execute_prompt(
204 self,

Callers 1

executeMethod · 0.95

Calls 5

CommandResultClass · 0.85
success_textMethod · 0.80
errorMethod · 0.80
callMethod · 0.45
skipMethod · 0.45

Tested by

no test coverage detected