-- "Верни первый/второй/третий буфер" — copy to clipboard. local phrase = (jarvis.context.phrase or ""):lower() local idx = 0 -- "первый" = 0 (most recent) if phrase:find("втор") then idx = 1 elseif phrase:find("трет") then idx = 2 elseif phrase:find("четверт") then idx = 3 elseif phrase:find("пят") then idx = 4 end -- Allow explicit number "вставь буфер 3" local n = phrase:match("(%d+)") if n then idx = tonumber(n) - 1 end -- 1-based → 0-based local content = jarvis.memory.recall("clip." .. idx) if not content then return jarvis.cmd.not_found("В истории нет такой записи.") end jarvis.system.clipboard.set(content) local preview = content:sub(1, 30):gsub("\r?\n", " ") return jarvis.cmd.ok("Восстановил: " .. preview .. ".")