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

Function sh

e2e/selfhost/mcp-opencode-consent.test.ts:79–87  ·  view source on GitHub ↗
(line: string, timeoutMs: number)

Source from the content-addressed store, hash-verified

77 return after.trimEnd().endsWith("\n$") ? after : null;
78 };
79 const sh = async (line: string, timeoutMs: number) => {
80 await term.keyboard.type(line);
81 await term.keyboard.press("Enter");
82 const snapshot = await term.screen.waitUntil(
83 (current) => outputAfter(current.text, line) !== null,
84 { timeoutMs },
85 );
86 return outputAfter(snapshot.text, line) ?? "";
87 };
88
89 // Blocks until the browser fiber completes consent → OpenCode's
90 // callback receives the code → OpenCode stores the grant.

Callers 1

Calls 2

outputAfterFunction · 0.70
waitUntilMethod · 0.65

Tested by

no test coverage detected