// options.js - Config xAI key/models
const models = ['grok-4-1-fast','grok-3-fast','grok-4','grok-beta','grok-code-fast-1']; // Your xAI models
document.getElementById('saveKey').onclick = () => {
  const key = document.getElementById('apiKey').value;
  chrome.storage.sync.set({xaiKey: key, model: document.getElementById('modelSelect').value}, () => {
    alert('Saved! Key/models ready for autonomous tasks.');
  });
};
chrome.storage.sync.get(['xaiKey','model'], (data) => {
  if (data.xaiKey) document.getElementById('apiKey').value = data.xaiKey;
  document.getElementById('modelSelect').value = data.model || 'grok-4-1-fast';
});