(directory, sessionID, job, client)
| 758 | return context; |
| 759 | } |
| 760 | function deleteSessionExecutionContext(sessionID) { |
| 761 | sessionExecutionContexts.delete(sessionID); |
| 762 | } |
| 763 | |
| 764 | // src/source/opencode/host.js |
| 765 | var SERVICE = "opencode-loop"; |
| 766 | function fireSdk(client, label, method, ...argsList) { |
| 767 | const pending = Promise.resolve().then(() => sdkCall(method, ...argsList)); |
| 768 | pending.catch((error) => { |
| 769 | log(client, "warn", `${label} failed`, { error: sdkErrorMessage(error) }).catch(() => {}); |
| 770 | }); |
| 771 | return pending; |
| 772 | } |
| 773 | async function executeTuiCommand(client, command) { |
| 774 | if (!client?.tui?.executeCommand) |
| 775 | throw new Error("client.tui.executeCommand is not available"); |
| 776 | return await sdkCall(client.tui.executeCommand.bind(client.tui), { body: { command } }, { command }); |
| 777 | } |
| 778 | function compactTuiCommandName(command = "compact") { |
| 779 | const normalized = String(command || "compact").replace(/^\/+/, "").trim().toLowerCase(); |
| 780 | if (normalized === "compact" || normalized === "summarize") |
| 781 | return "session_compact"; |
| 782 | return; |
no test coverage detected