local repo = jarvis.memory.recall("github.repo") if not repo or repo == "" then return jarvis.cmd.not_found("Сначала укажите репозиторий: текущий репо owner/repo.") end local res = jarvis.system.exec(string.format( 'gh issue list --repo "%s" --state open --json number,title,labels --limit 10', repo )) if not res or not res.success then return jarvis.cmd.error("gh CLI не отвечает.") end local stdout = res.stdout or "" if stdout:gsub("%s", "") == "" or stdout:gsub("%s", "") == "[]" then return jarvis.cmd.ok("Открытых issues нет.") end local _, count = stdout:gsub('"number"%s*:', "") if count == 0 then return jarvis.cmd.ok("Открытых issues нет.") end local titles = {} for title in stdout:gmatch('"title"%s*:%s*"([^"]+)"') do table.insert(titles, title) if #titles >= 3 then break end end local line = string.format("%d открытых issues. ", count) if #titles > 0 then line = line .. "Первые: " .. table.concat(titles, ". ") .. "." end return jarvis.cmd.ok(line)