MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / _SlashCommandLexer

Class _SlashCommandLexer

src/harness/agentic_loop/loop.py:38–52  ·  view source on GitHub ↗

Highlights /command at the start of input in yellow.

Source from the content-addressed store, hash-verified

36
37
38class _SlashCommandLexer(Lexer):
39 """Highlights /command at the start of input in yellow."""
40
41 def lex_document(self, document):
42 def get_line(lineno):
43 line = document.lines[lineno]
44 if line.startswith("/"):
45 parts = line.split(" ", 1)
46 tokens = [("class:slash-cmd", parts[0])]
47 if len(parts) > 1:
48 tokens.append(("", " " + parts[1]))
49 return tokens
50 return [("", line)]
51
52 return get_line
53
54
55def _serialize_tool_calls(tool_calls) -> list[dict]:

Callers 1

run_interactiveMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected