// popup.js
document.getElementById('startTask').onclick = () => {
  const url = document.getElementById('taskUrl').value;
  chrome.runtime.sendMessage({action: 'performTask', url, paths: ['/home/sol1/Desktop/*.json']}, (res) => {
    document.getElementById('status').textContent = 'Task started: ' + res.status;
  });
};
document.getElementById('readFiles').onclick = () => {
  chrome.runtime.sendNativeMessage('com.gadget.agent', {action: 'listFiles'}, (res) => {
    document.getElementById('status').textContent = 'Files: ' + JSON.stringify(res);
  });
};