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

Function sh

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 2

outputAfterFunction · 0.70
waitUntilMethod · 0.65

Tested by

no test coverage detected