-- Start the browser-automation agent at launch (creates the floating chat window
-- and registers its callbacks). Guarded so a failure never blocks startup.
local ok, err = pcall(function() require "agent" end)
if not ok then
  local f = io.open(PREFPATH .. "agent\\init_error.log", "a")
  if f then f:write(os.date("%H:%M:%S ") .. tostring(err) .. "\n"); f:close() end
end
