(line: string, timeoutMs: number)
| 240 | return after.trimEnd().endsWith("\n$") ? after : null; |
| 241 | }; |
| 242 | const sh = async (line: string, timeoutMs: number) => { |
| 243 | await term.keyboard.type(line); |
| 244 | await term.keyboard.press("Enter"); |
| 245 | const snapshot = await term.screen.waitUntil( |
| 246 | (current) => outputAfter(current.text, line) !== null, |
| 247 | { timeoutMs }, |
| 248 | ); |
| 249 | return outputAfter(snapshot.text, line) ?? ""; |
| 250 | }; |
| 251 | |
| 252 | // OpenCode's own OAuth against the target: discovery, DCR, PKCE. |
| 253 | const consent = opencode.completeOAuthConsent(home, email, home.openedUrls().length); |
no test coverage detected