(line: string, timeoutMs: number)
| 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"); |
| 66 | const snapshot = await term.screen.waitUntil( |
| 67 | (current) => outputAfter(current.text, line) !== null, |
| 68 | { timeoutMs }, |
| 69 | ); |
| 70 | return outputAfter(snapshot.text, line) ?? ""; |
| 71 | }; |
| 72 | |
| 73 | // OpenCode completes MCP OAuth for real: discovery, DCR, PKCE, |
| 74 | // its own scope request, its own token store. |
no test coverage detected