(sdk: OpencodeClient)
| 576 | } |
| 577 | |
| 578 | async function current(sdk: OpencodeClient): Promise<string> { |
| 579 | if (!args.attach) { |
| 580 | return directory ?? root |
| 581 | } |
| 582 | |
| 583 | const next = await sdk.path |
| 584 | .get() |
| 585 | .then((x) => x.data?.directory) |
| 586 | .catch(() => undefined) |
| 587 | if (next) { |
| 588 | return next |
| 589 | } |
| 590 | |
| 591 | UI.error("Failed to resolve remote directory") |
| 592 | process.exit(1) |
| 593 | } |
| 594 | |
| 595 | async function localAgent() { |
| 596 | if (!args.agent) return undefined |
no test coverage detected