MCPcopy Create free account
hub / github.com/ByBrawe/opencode-loop / uninstallTask

Function uninstallTask

scripts/loopd.mjs:155–163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

153}
154
155async function resolveLatestSessionID(opencodeBin, project, preferredTitle) {
156 const result = await run(opencodeBin, ["session", "list", "--format", "json", "-n", "20"], project, { capture: true, timeoutMs: 15_000 })
157 if (result.code !== 0 || result.timedOut) return undefined
158 let parsed
159 try { parsed = JSON.parse(result.stdout || "[]") } catch { return undefined }
160 const sessions = Array.isArray(parsed) ? parsed : Array.isArray(parsed?.data) ? parsed.data : []
161 const match = preferredTitle ? sessions.find((item) => item?.title === preferredTitle) : sessions[0]
162 return typeof match?.id === "string" && match.id ? match.id : undefined
163}
164
165function runSync(command, commandArgs) {
166 const options = { shell: false, stdio: "inherit", windowsHide: true }

Callers 1

loopd.mjsFile · 0.85

Calls 1

argFunction · 0.85

Tested by

no test coverage detected