MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / outputAfter

Function outputAfter

e2e/scenarios/mcp-opencode-real.test.ts:57–62  ·  view source on GitHub ↗
(text: string, line: string)

Source from the content-addressed store, hash-verified

55 // only what THIS command produced, so earlier output can't
56 // satisfy a later assertion and the scrollback stays natural.
57 const outputAfter = (text: string, line: string): string | null => {
58 const echoed = text.lastIndexOf(line);
59 if (echoed === -1) return null;
60 const after = text.slice(echoed + line.length);
61 return after.trimEnd().endsWith("\n$") ? after : null;
62 };
63 const sh = async (line: string, timeoutMs: number) => {
64 await term.keyboard.type(line);
65 await term.keyboard.press("Enter");

Callers 1

shFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected