Merge branch 'main' into 3.6.1_issue_469
This commit is contained in:
commit
c17b3187b2
13 changed files with 92 additions and 29 deletions
|
|
@ -7,9 +7,12 @@
|
|||
<h2>Version 3.6.1 - ??/??/2025</h2>
|
||||
<ul>
|
||||
<li><i>[OpenAI Comp API]</i> Perplexity configuration fixed [<a href="https://github.com/micz/ThunderAI/issues/461">#461</a>].</li>
|
||||
<li><i>[OpenAI Comp API]</i> Added a button to clear the models list [<a href="https://github.com/micz/ThunderAI/issues/472">#472</a>].</li>
|
||||
<li><i>[ChatGPT Web]</i> Fix: Any <br> tag in the response is now replaced with a line break [<a href="https://github.com/micz/ThunderAI/issues/462">#462</a>].</li>
|
||||
<li><i>[ChatGPT Web]</i> Models list updated. [<a href="https://github.com/micz/ThunderAI/issues/464">#464</a>].</li>
|
||||
<li><i>[All APIs]</i> Fix: If the incoming email has no text only part, the html part is used [<a href="https://github.com/micz/ThunderAI/issues/470">#470</a>].</li>
|
||||
<li><i>[All APIs]</i> Fix: Improved the extraction of the plain text from html emails [<a href="https://github.com/micz/ThunderAI/issues/469">#469</a>].</li>
|
||||
<li><i>[All APIs]</i> If the option to use only existing tags is enabled, this now works also when adding tags manually using the ThunderAI menu [<a href="https://github.com/micz/ThunderAI/issues/475">#475</a>].</li>
|
||||
<li>...</li>
|
||||
</ul>
|
||||
<h2>Version 3.6.0 - 30/07/2025</h2>
|
||||
|
|
|
|||
|
|
@ -838,10 +838,10 @@
|
|||
"message": "ThunderAI Sparks nicht installiert!"
|
||||
},
|
||||
"prefs_OptionText_add_tags_auto_force_existing_Info": {
|
||||
"message": "Wenn ausgewählt, wird die KI nur vorhandene Tags zu neu empfangenen E-Mails hinzufügen und keine neuen Tags erstellen."
|
||||
"message": "Wenn aktiviert, fügt die KI nur vorhandene Tags hinzu und erstellt keine neuen Tags."
|
||||
},
|
||||
"prefs_OptionText_add_tags_auto_force_existing": {
|
||||
"message": "Vorhandene Tags beim automatischen Taggen oder bei der Verwendung des Kontextmenüs erzwingen"
|
||||
"message": "Vorhandene Tags erzwingen"
|
||||
},
|
||||
"spamfilter_no_reports": {
|
||||
"message": "Es wurden noch keine Nachrichten auf Spam überprüft. Hier finden Sie eine Liste der letzten 100 Spam-Berichte nur für die aktuelle Sitzung."
|
||||
|
|
@ -1251,5 +1251,11 @@
|
|||
},
|
||||
"prefs_OptionText_chatgpt_web_br_replace_info": {
|
||||
"message": "Bitte beachten Sie, dass alle <br>-Tags in der Antwort der KI durch Zeilenumbrüche ersetzt werden."
|
||||
},
|
||||
"OpenAIComp_ClearModelsList_Confirm": {
|
||||
"message": "Möchten Sie die Modellliste wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden."
|
||||
},
|
||||
"prefs_OpenAIComp_ClearModelsList": {
|
||||
"message": "Modellliste löschen"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1120,11 +1120,11 @@
|
|||
"description": ""
|
||||
},
|
||||
"prefs_OptionText_add_tags_auto_force_existing": {
|
||||
"message": "Force existing tags when autotagging or using the context menu",
|
||||
"message": "Force existing tags",
|
||||
"description": ""
|
||||
},
|
||||
"prefs_OptionText_add_tags_auto_force_existing_Info": {
|
||||
"message": "If checked, the AI will add only existing tags to newly received emails, and won't create new tags.",
|
||||
"message": "If checked, the AI will add only existing tags and won't create new tags.",
|
||||
"description": ""
|
||||
},
|
||||
"prefs_OptionText_add_tags_auto_only_inbox": {
|
||||
|
|
@ -1620,5 +1620,13 @@
|
|||
"prefs_OptionText_chatgpt_web_br_replace_info": {
|
||||
"message": "Please note that any <br> tags in the AI's response will be replaced with line breaks.",
|
||||
"description": ""
|
||||
},
|
||||
"prefs_OpenAIComp_ClearModelsList": {
|
||||
"message": "Clear Models List",
|
||||
"description": ""
|
||||
},
|
||||
"OpenAIComp_ClearModelsList_Confirm": {
|
||||
"message": "Are you sure you want to clear the Models List? This action cannot be undone.",
|
||||
"description": ""
|
||||
}
|
||||
}
|
||||
|
|
@ -838,10 +838,10 @@
|
|||
"message": "Ici, vous pouvez également insérer l'adresse d'un serveur distant."
|
||||
},
|
||||
"prefs_OptionText_add_tags_auto_force_existing": {
|
||||
"message": "Forcer les balises existantes lors de l’auto-étiquetage ou de l’utilisation du menu contextuel"
|
||||
"message": "Forcer les balises existantes"
|
||||
},
|
||||
"prefs_OptionText_add_tags_auto_force_existing_Info": {
|
||||
"message": "Si coché, l'IA ajoutera uniquement les tags existants aux e-mails nouvellement reçus et ne créera pas de nouveaux tags."
|
||||
"message": "Si coché, l'IA ajoutera uniquement les tags existants et ne créera pas de nouveaux tags."
|
||||
},
|
||||
"prefs_OptionText_spamfilter_Info": {
|
||||
"message": "Si coché, ThunderAI déplacera automatiquement les e-mails indésirables dans le dossier spam."
|
||||
|
|
@ -1251,5 +1251,11 @@
|
|||
},
|
||||
"prefs_OptionText_chatgpt_web_br_replace_info": {
|
||||
"message": "Veuillez noter que toutes les balises <br> dans la réponse de l'IA seront remplacées par des sauts de ligne."
|
||||
},
|
||||
"prefs_OpenAIComp_ClearModelsList": {
|
||||
"message": "Effacer la liste des modèles"
|
||||
},
|
||||
"OpenAIComp_ClearModelsList_Confirm": {
|
||||
"message": "Êtes-vous sûr de vouloir effacer la liste des modèles ? Cette action est irréversible."
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -778,7 +778,7 @@
|
|||
"message": "Aggiungi tag automaticamente"
|
||||
},
|
||||
"prefs_OptionText_add_tags_auto_force_existing": {
|
||||
"message": "Forza i tag esistenti durante l'autotagging o quando usi il menu di contesto"
|
||||
"message": "Forza i tag esistenti"
|
||||
},
|
||||
"prefs_OptionText_add_tags_auto_only_inbox": {
|
||||
"message": "Aggiungi tag solo alle email nella posta in arrivo"
|
||||
|
|
@ -847,7 +847,7 @@
|
|||
"message": "Analizza la seguente email e determina se si tratta di spam o meno. Considera fattori come parole chiave sospette, linguaggio promozionale eccessivo, linee oggetto fuorvianti, richieste di informazioni personali e indirizzi del mittente insoliti.\nFornisci un valore da 0 (non spam) a 100 (spam) e una spiegazione di non più di 10 parole.\nIn caso di dati del messaggio mancanti, imposta il valore a 0 (non spam) e fornisci la motivazione.\nGenera una risposta esclusivamente in formato JSON. Non includere alcun testo o spiegazione aggiuntiva; fornisci solo il JSON. Ecco il formato da utilizzare:\n{\n\"spamValue\": <intero da 0 a 100>,\n\"explanation\": \"Breve spiegazione del tuo ragionamento\"\n}\nQui ci sono le informazioni sull'email:\nMittente: \"{%author%}\"\nOggetto: \"{%mail_subject%}\"\nCorpo HTML: \"{%mail_html_body%}\""
|
||||
},
|
||||
"prefs_OptionText_add_tags_auto_force_existing_Info": {
|
||||
"message": "Se selezionato, l'IA aggiungerà solo i tag esistenti alle email appena ricevute e non creerà nuovi tag."
|
||||
"message": "Se selezionato, l'IA aggiungerà solo i tag esistenti e non creerà nuovi tag."
|
||||
},
|
||||
"spamfilter_threshold_too_low": {
|
||||
"message": "La soglia di spam è troppo bassa! Probabilmente considererai troppe email come spam!"
|
||||
|
|
@ -1254,5 +1254,11 @@
|
|||
},
|
||||
"prefs_OptionText_chatgpt_web_br_replace_info": {
|
||||
"message": "Ricorda che eventuali tag <br> nella risposta dell'IA verranno sostituiti con interruzioni di riga."
|
||||
},
|
||||
"prefs_OpenAIComp_ClearModelsList": {
|
||||
"message": "Svuota l'elenco dei modelli"
|
||||
},
|
||||
"OpenAIComp_ClearModelsList_Confirm": {
|
||||
"message": "Sei sicuro di voler cancellare l’elenco dei modelli? Questa azione non può essere annullata."
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -834,10 +834,10 @@
|
|||
"message": "Выберите, для какой учетной записи активировать эту функцию, в нижней части этой страницы."
|
||||
},
|
||||
"prefs_OptionText_add_tags_auto_force_existing": {
|
||||
"message": "Принудительное использование существующих тегов при авто тегировании или использовании контекстного меню"
|
||||
"message": "Принудительное использование существующих тегов"
|
||||
},
|
||||
"prefs_OptionText_add_tags_auto_force_existing_Info": {
|
||||
"message": "Если флажок установлен, ИИ будет добавлять только существующие теги к вновь полученным сообщениям эл. почты и не будет создавать новые теги."
|
||||
"message": "Если флажок установлен, ИИ будет добавлять только существующие теги и не будет создавать новые теги."
|
||||
},
|
||||
"prefs_OptionText_add_tags_auto_only_inbox": {
|
||||
"message": "Добавляйте теги только к входящим сообщениям эл. почты"
|
||||
|
|
@ -1147,7 +1147,7 @@
|
|||
"message": "Если флажок установлен, ваши чаты будут сохраняться OpenAI."
|
||||
},
|
||||
"prefs_ollama_think": {
|
||||
"message": "Позволяет мыслить"
|
||||
"message": "Включить режим размышления"
|
||||
},
|
||||
"prefs_ollama_think_Info": {
|
||||
"message": "Если флажок установлен, Модель будет думать перед ответом. Эта опция работает только с моделями, поддерживающими функцию \"думать\"."
|
||||
|
|
@ -1214,5 +1214,14 @@
|
|||
},
|
||||
"prompt_reply_custom_command_full_text": {
|
||||
"message": "Ответьте на следующее письмо \"{%mail_text_body%}\". {%additional_text%}. Отвечайте только на нужный текст, без лишних комментариев или другого текста."
|
||||
},
|
||||
"prefs_OptionText_chatgpt_web_br_replace_info": {
|
||||
"message": "Обратите внимание, что любые теги <br> в ответе ИИ будут заменены переносами строк."
|
||||
},
|
||||
"prefs_OpenAIComp_ClearModelsList": {
|
||||
"message": "Очистить список моделей"
|
||||
},
|
||||
"OpenAIComp_ClearModelsList_Confirm": {
|
||||
"message": "Вы уверены, что хотите очистить список моделей? Это действие не может быть отменено."
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
// Some original methods are derived from https://github.com/ali-raheem/Aify/blob/cfadf52f576b7be3720b5b73af7c8d3129c054da/plugin/html/actions.js
|
||||
|
||||
import { getPrompts } from './mzta-prompts.js';
|
||||
import { getLanguageDisplayName, getMenuContextCompose, getMenuContextDisplay, i18nConditionalGet, getMailSubject, getTagsList, extractJsonObject, convertNewlinesToBr, cleanupNewlines } from './mzta-utils.js'
|
||||
import { getLanguageDisplayName, getMenuContextCompose, getMenuContextDisplay, i18nConditionalGet, getMailSubject, getTagsList, extractJsonObject, convertNewlinesToBr, cleanupNewlines, checkIfTagLabelExists } from './mzta-utils.js'
|
||||
import { taPromptUtils } from './mzta-utils-prompt.js';
|
||||
import { taLogger } from './mzta-logger.js';
|
||||
import { placeholdersUtils } from './mzta-placeholders.js';
|
||||
|
|
@ -169,7 +169,8 @@ export class mzta_Menus {
|
|||
switch(curr_prompt.id){
|
||||
case 'prompt_add_tags': { // Add tags to the email
|
||||
let tags_current_email = [];
|
||||
let prefs_at = await browser.storage.sync.get({add_tags_maxnum: 3, connection_type: '', add_tags_force_lang: true, default_chatgpt_lang: '', do_debug: false});
|
||||
let tags_current_email_final = [];
|
||||
let prefs_at = await browser.storage.sync.get({add_tags_maxnum: 3, connection_type: '', add_tags_force_lang: true, add_tags_auto_force_existing: false, default_chatgpt_lang: '', do_debug: false});
|
||||
if((prefs_at.connection_type === '')||(prefs_at.connection_type === null)||(prefs_at.connection_type === undefined)||(prefs_at.connection_type === 'chatgpt_web')){
|
||||
console.error("[ThunderAI | AddTags] Invalid connection type: " + prefs_at.connection_type);
|
||||
taWorkingStatus.stopWorking();
|
||||
|
|
@ -177,6 +178,8 @@ export class mzta_Menus {
|
|||
}
|
||||
fullPrompt = taPromptUtils.finalizePrompt_add_tags(fullPrompt, prefs_at.add_tags_maxnum, prefs_at.add_tags_force_lang, prefs_at.default_chatgpt_lang);
|
||||
this.logger.log("fullPrompt: " + fullPrompt);
|
||||
let create_new_tags = !prefs_at.add_tags_auto_force_existing;
|
||||
let all_tags_list = tags_full_list[1];
|
||||
// TODO: use the current API, abort if using chatgpt web
|
||||
// COMMENTED TO DO TESTS
|
||||
// tags_current_email = "recipients, TEST, home, work, CAR, light";
|
||||
|
|
@ -184,6 +187,17 @@ export class mzta_Menus {
|
|||
await cmd_addTags.initWorker();
|
||||
try{
|
||||
tags_current_email = taPromptUtils.getTagsFromResponse(await cmd_addTags.sendPrompt());
|
||||
if(!create_new_tags){
|
||||
this.logger.log("Not creating new tags, only showing existing ones...");
|
||||
}
|
||||
for (const tag of tags_current_email) {
|
||||
// console.log(">>>>>>>>>>>>>>> tag: " + JSON.stringify(tag));
|
||||
if (!create_new_tags && !checkIfTagLabelExists(tag, all_tags_list)) {
|
||||
this.logger.log("Removing tag from the list: " + tag);
|
||||
}else{
|
||||
tags_current_email_final.push(tag);
|
||||
}
|
||||
}
|
||||
// console.log(">>>>>>>>>>> tags_current_email: " + tags_current_email);
|
||||
}catch(err){
|
||||
console.error("[ThunderAI] Error getting tags: ", err);
|
||||
|
|
@ -191,9 +205,9 @@ export class mzta_Menus {
|
|||
taWorkingStatus.stopWorking();
|
||||
return {ok:'0'};
|
||||
}
|
||||
this.logger.log("tags_current_email: " + JSON.stringify(tags_current_email));
|
||||
this.logger.log("tags_current_email_final: " + JSON.stringify(tags_current_email_final));
|
||||
this.logger.log("tags_full_list: " + JSON.stringify(tags_full_list));
|
||||
browser.tabs.sendMessage(tabs[0].id, {command: "getTags", tags: tags_current_email, messageId: curr_message.id});
|
||||
browser.tabs.sendMessage(tabs[0].id, {command: "getTags", tags: tags_current_email_final, messageId: curr_message.id});
|
||||
taWorkingStatus.stopWorking();
|
||||
return {ok:'1'};
|
||||
break; // Add tags to the email - END
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
*/
|
||||
|
||||
const sparks_min = '1.2.0'; // Minimum version of ThunderAI-Sparks required for the add-on to work
|
||||
export const ChatGPTWeb_models = ['gpt-5','gpt-5-thinking','gpt-4o']; // List of models available in ChatGPT Web
|
||||
export const ChatGPTWeb_models = ['gpt-5','gpt-5-instant','gpt-5-t-mini','gpt-5-thinking']; // List of models available in ChatGPT Web
|
||||
|
||||
export const getMenuContextCompose = () => 'compose_action_menu';
|
||||
export const getMenuContextDisplay = () => 'message_display_action_menu';
|
||||
|
|
@ -246,12 +246,12 @@ export function getGPTWebModelString(model) {
|
|||
switch (model) {
|
||||
case 'gpt-5':
|
||||
return '5';
|
||||
case 'gpt-5-instant':
|
||||
return '5 Fast';
|
||||
case 'gpt-5-t-mini':
|
||||
return '5 Thinking mini';
|
||||
case 'gpt-5-thinking':
|
||||
return '5 Thinking';
|
||||
case 'gpt-4o':
|
||||
return '4o';
|
||||
case 'gpt-4o-mini':
|
||||
return '4o mini';
|
||||
return '5 Thinking';
|
||||
default:
|
||||
return model;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"manifest_version": 2,
|
||||
"name": "ThunderAI",
|
||||
"description": "__MSG_extensionDescription__",
|
||||
"version": "3.6.1_issue_469",
|
||||
"version": "3.6.1",
|
||||
"author": "Mic (m@micz.it)",
|
||||
"homepage_url": "https://micz.it/thunderbird-addon-thunderai/",
|
||||
"browser_specific_settings": {
|
||||
|
|
|
|||
|
|
@ -976,11 +976,6 @@ async function processEmails(messages, addTagsAuto, spamFilter) {
|
|||
if (addTagsAuto || spamFilter) {
|
||||
curr_fullMessage = await browser.messages.getFull(message.id);
|
||||
msg_text = getMailBody(curr_fullMessage);
|
||||
// body_text = msg_text.text.replace(/\s+/g, ' ').trim();
|
||||
// if( body_text.length == 0 ){
|
||||
// taLog.log("No text found in the message body, trying to convert HTML to plain text...");
|
||||
// body_text = htmlBodyToPlainText(msg_text.html);
|
||||
// }
|
||||
taLog.log("Startin from the HTML body if present and converting to plain text...");
|
||||
body_text = htmlBodyToPlainText(msg_text.html);
|
||||
if( body_text.length == 0 ){
|
||||
|
|
|
|||
|
|
@ -410,7 +410,8 @@
|
|||
<td>
|
||||
<label>
|
||||
<span class="opt_title">__MSG_OpenAIComp_Models__</span>
|
||||
<br><button id="btnOpenAICompForceModel" class="btn_small">__MSG_prefs_OpenAIComp_ForceModel__</button></td>
|
||||
<br><button id="btnOpenAICompForceModel" class="btn_small">__MSG_prefs_OpenAIComp_ForceModel__</button>
|
||||
<br><button id="btnOpenAICompClearModelsList" class="btn_small">__MSG_prefs_OpenAIComp_ClearModelsList__</button></td>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -511,10 +511,22 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
option.text = modelName;
|
||||
select_openai_comp_model.appendChild(option);
|
||||
select_openai_comp_model.value = modelName;
|
||||
select_openai_comp_model.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
select_openai_comp_model.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('btnOpenAICompClearModelsList').addEventListener('click', () => {
|
||||
if (!confirm(browser.i18n.getMessage('OpenAIComp_ClearModelsList_Confirm'))) {
|
||||
return;
|
||||
}
|
||||
let select_openai_comp_model = document.getElementById('openai_comp_model');
|
||||
while (select_openai_comp_model.options.length > 0) {
|
||||
select_openai_comp_model.remove(0);
|
||||
}
|
||||
select_openai_comp_model.value = '';
|
||||
select_openai_comp_model.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
});
|
||||
|
||||
document.getElementById('btnGiveAllUrlsPermission_ollama_api').addEventListener('click', async () => {
|
||||
permission_all_urls = await messenger.permissions.request({ origins: ["<all_urls>"] });
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,9 +10,12 @@
|
|||
<h2>Version 3.6.1 - ??/??/2025</h2>
|
||||
<ul>
|
||||
<li><i>[OpenAI Comp API]</i> Perplexity configuration fixed [<a href="https://github.com/micz/ThunderAI/issues/461">#461</a>].</li>
|
||||
<li><i>[OpenAI Comp API]</i> Added a button to clear the models list [<a href="https://github.com/micz/ThunderAI/issues/472">#472</a>].</li>
|
||||
<li><i>[ChatGPT Web]</i> Fix: Any <br> tag in the response is now replaced with a line break [<a href="https://github.com/micz/ThunderAI/issues/462">#462</a>].</li>
|
||||
<li><i>[ChatGPT Web]</i> Models list updated. [<a href="https://github.com/micz/ThunderAI/issues/464">#464</a>].</li>
|
||||
<li><i>[All APIs]</i> Fix: If the incoming email has no text only part, the html part is used [<a href="https://github.com/micz/ThunderAI/issues/470">#470</a>].</li>
|
||||
<li><i>[All APIs]</i> Fix: Improved the extraction of the plain text from html emails [<a href="https://github.com/micz/ThunderAI/issues/469">#469</a>].</li>
|
||||
<li><i>[All APIs]</i> If the option to use only existing tags is enabled, this now works also when adding tags manually using the ThunderAI menu [<a href="https://github.com/micz/ThunderAI/issues/475">#475</a>].</li>
|
||||
<li>...</li>
|
||||
</ul>
|
||||
<h2>Version 3.6.0 - 30/07/2025</h2>
|
||||
|
|
|
|||
Loading…
Reference in a new issue