Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
fix(agent): read reply commands as publication intent
Emre Sokullu7b63a68e7884
diff --git a/src/chrome/src/agent/agent.js b/src/chrome/src/agent/agent.jsindex 0931f20e5..17e750605 100644--- a/src/chrome/src/agent/agent.js+++ b/src/chrome/src/agent/agent.js@@ -227,8 +227,8 @@ const DEFAULT_OUTPUT_COST_PER_MILLION_USD = 15;// them honest.const SOCIAL_WORD_EDGE = '\\p{L}\\p{N}_';const SOCIAL_PUBLISH_VERBS = new RegExp(- `(?<![${SOCIAL_WORD_EDGE}])(?:post|posts|posted|posting|publish|publishes|published|publishing|tweet|tweets|tweeted|tweeting|skeet|skeets|share|shares|shared|sharing|publica|public\u00e1|publ\u00edcalo|publ\u00edcala|publicalo|publicala|publicar|publicas|publican|publique|publiquen|publiquem|publicando|posta|postar|comparte|compartir|compartilhe|compartilhar|publie|publier|publiez|publions|publi\u00e9e|publi\u00e9e|publi\u00e9|partage|partager|partagez|pubblica|pubblicare|pubblicate|condividi|condividere|ver\u00f6ffentliche|ver\u00f6ffentlichen|ver\u00f6ffentlicht|poste|posten|teile|teilen|yay\u0131nla|yay\u0131nlay\u0131n|yay\u0131mla|payla\u015f|payla\u015f\u0131n|\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0439|\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0439\u0442\u0435|\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c|\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0439|\u043f\u043e\u0434\u0435\u043b\u0438\u0441\u044c|\u0437\u0430\u043f\u043e\u0441\u0442\u044c)(?![${SOCIAL_WORD_EDGE}])`- + '|\u6295\u7a3f\u3059\u308b|\u6295\u7a3f\u3057\u3066|\u6295\u7a3f\u3057|\u6295\u7a3f|\u30c4\u30a4\u30fc\u30c8\u3057\u3066|\u30c4\u30a4\u30fc\u30c8\u3057|\u30dd\u30b9\u30c8\u3057\u3066|\u30dd\u30b9\u30c8\u3057|\u53d1\u5e03|\u767c\u5e03|\u53d1\u5e16|\u767c\u5e16|\u53d1\u63a8|\u767c\u63a8|\u53d1\u9001\u63a8\u6587|\uac8c\uc2dc|\uc62c\ub824|\uc62c\ub9ac|\u0627\u0646\u0634\u0631|\u0646\u0634\u0631',+ `(?<![${SOCIAL_WORD_EDGE}])(?:post|posts|posted|posting|publish|publishes|published|publishing|tweet|tweets|tweeted|tweeting|skeet|skeets|share|shares|shared|sharing|publica|public\u00e1|publ\u00edcalo|publ\u00edcala|publicalo|publicala|publicar|publicas|publican|publique|publiquen|publiquem|publicando|posta|postar|comparte|compartir|compartilhe|compartilhar|publie|publier|publiez|publions|publi\u00e9e|publi\u00e9e|publi\u00e9|partage|partager|partagez|pubblica|pubblicare|pubblicate|condividi|condividere|ver\u00f6ffentliche|ver\u00f6ffentlichen|ver\u00f6ffentlicht|poste|posten|teile|teilen|yay\u0131nla|yay\u0131nlay\u0131n|yay\u0131mla|payla\u015f|payla\u015f\u0131n|\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0439|\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0439\u0442\u0435|\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c|\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0439|\u043f\u043e\u0434\u0435\u043b\u0438\u0441\u044c|\u0437\u0430\u043f\u043e\u0441\u0442\u044c|reply|replies|replied|replying|respond|responds|responded|responding|responde|responder|respondan|contesta|contestar|responda|r\u00e9ponds|r\u00e9pondre|r\u00e9pondez|rispondi|rispondere|antworte|antworten|yan\u0131tla|yan\u0131tlay\u0131n|cevapla|cevaplay\u0131n|\u043e\u0442\u0432\u0435\u0442\u044c|\u043e\u0442\u0432\u0435\u0442\u044c\u0442\u0435|\u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c)(?![${SOCIAL_WORD_EDGE}])`+ + '|\u6295\u7a3f\u3059\u308b|\u6295\u7a3f\u3057\u3066|\u6295\u7a3f\u3057|\u6295\u7a3f|\u30c4\u30a4\u30fc\u30c8\u3057\u3066|\u30c4\u30a4\u30fc\u30c8\u3057|\u30dd\u30b9\u30c8\u3057\u3066|\u30dd\u30b9\u30c8\u3057|\u53d1\u5e03|\u767c\u5e03|\u53d1\u5e16|\u767c\u5e16|\u53d1\u63a8|\u767c\u63a8|\u53d1\u9001\u63a8\u6587|\uac8c\uc2dc|\uc62c\ub824|\uc62c\ub9ac|\u0627\u0646\u0634\u0631|\u0646\u0634\u0631|\u8fd4\u4fe1\u3057\u3066|\u8fd4\u4fe1\u3057|\u8fd4\u4fe1|\u56de\u590d|\u56de\u8986|\u56de\u5e16|\ub2f5\uae00|\ub2f5\uc7a5|\ub2f5\ubcc0|\u0631\u062f','iu',);@@ -242,7 +242,7 @@ const SOCIAL_READ_VERBS = new RegExp('iu',);const SOCIAL_NOUN_LIKE_PUBLISH = new RegExp(- '^(?:posts?|tweets?|skeets?|shares?|publica[c\u00e7][i\u00ed]?[o\u00f3]n(?:es)?|publica[c\u00e7][a\u00e3]o|publica[c\u00e7][o\u00f5]es|publication|publications|\u6295\u7a3f|\u63a8\u6587)$',+ '^(?:posts?|tweets?|skeets?|shares?|repl(?:y|ies)|responses?|respuestas?|r\u00e9ponses?|rispost[ae]|respostas?|antworten|\u8fd4\u4fe1|\u56de\u590d|\u56de\u8986|\ub2f5\uae00|publica[c\u00e7][i\u00ed]?[o\u00f3]n(?:es)?|publica[c\u00e7][a\u00e3]o|publica[c\u00e7][o\u00f5]es|publication|publications|\u6295\u7a3f|\u63a8\u6587)$','iu',);const SOCIAL_NEGATION = new RegExp(diff --git a/src/firefox/src/agent/agent.js b/src/firefox/src/agent/agent.jsindex 3c6e07c5d..2824ed2db 100644--- a/src/firefox/src/agent/agent.js+++ b/src/firefox/src/agent/agent.js@@ -160,8 +160,8 @@ const STAGED_SCREENSHOT_REDACTION_MAX_REGIONS = 400;// them honest.const SOCIAL_WORD_EDGE = '\\p{L}\\p{N}_';const SOCIAL_PUBLISH_VERBS = new RegExp(- `(?<![${SOCIAL_WORD_EDGE}])(?:post|posts|posted|posting|publish|publishes|published|publishing|tweet|tweets|tweeted|tweeting|skeet|skeets|share|shares|shared|sharing|publica|public\u00e1|publ\u00edcalo|publ\u00edcala|publicalo|publicala|publicar|publicas|publican|publique|publiquen|publiquem|publicando|posta|postar|comparte|compartir|compartilhe|compartilhar|publie|publier|publiez|publions|publi\u00e9e|publi\u00e9e|publi\u00e9|partage|partager|partagez|pubblica|pubblicare|pubblicate|condividi|condividere|ver\u00f6ffentliche|ver\u00f6ffentlichen|ver\u00f6ffentlicht|poste|posten|teile|teilen|yay\u0131nla|yay\u0131nlay\u0131n|yay\u0131mla|payla\u015f|payla\u015f\u0131n|\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0439|\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0439\u0442\u0435|\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c|\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0439|\u043f\u043e\u0434\u0435\u043b\u0438\u0441\u044c|\u0437\u0430\u043f\u043e\u0441\u0442\u044c)(?![${SOCIAL_WORD_EDGE}])`- + '|\u6295\u7a3f\u3059\u308b|\u6295\u7a3f\u3057\u3066|\u6295\u7a3f\u3057|\u6295\u7a3f|\u30c4\u30a4\u30fc\u30c8\u3057\u3066|\u30c4\u30a4\u30fc\u30c8\u3057|\u30dd\u30b9\u30c8\u3057\u3066|\u30dd\u30b9\u30c8\u3057|\u53d1\u5e03|\u767c\u5e03|\u53d1\u5e16|\u767c\u5e16|\u53d1\u63a8|\u767c\u63a8|\u53d1\u9001\u63a8\u6587|\uac8c\uc2dc|\uc62c\ub824|\uc62c\ub9ac|\u0627\u0646\u0634\u0631|\u0646\u0634\u0631',+ `(?<![${SOCIAL_WORD_EDGE}])(?:post|posts|posted|posting|publish|publishes|published|publishing|tweet|tweets|tweeted|tweeting|skeet|skeets|share|shares|shared|sharing|publica|public\u00e1|publ\u00edcalo|publ\u00edcala|publicalo|publicala|publicar|publicas|publican|publique|publiquen|publiquem|publicando|posta|postar|comparte|compartir|compartilhe|compartilhar|publie|publier|publiez|publions|publi\u00e9e|publi\u00e9e|publi\u00e9|partage|partager|partagez|pubblica|pubblicare|pubblicate|condividi|condividere|ver\u00f6ffentliche|ver\u00f6ffentlichen|ver\u00f6ffentlicht|poste|posten|teile|teilen|yay\u0131nla|yay\u0131nlay\u0131n|yay\u0131mla|payla\u015f|payla\u015f\u0131n|\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0439|\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0439\u0442\u0435|\u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c|\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0439|\u043f\u043e\u0434\u0435\u043b\u0438\u0441\u044c|\u0437\u0430\u043f\u043e\u0441\u0442\u044c|reply|replies|replied|replying|respond|responds|responded|responding|responde|responder|respondan|contesta|contestar|responda|r\u00e9ponds|r\u00e9pondre|r\u00e9pondez|rispondi|rispondere|antworte|antworten|yan\u0131tla|yan\u0131tlay\u0131n|cevapla|cevaplay\u0131n|\u043e\u0442\u0432\u0435\u0442\u044c|\u043e\u0442\u0432\u0435\u0442\u044c\u0442\u0435|\u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c)(?![${SOCIAL_WORD_EDGE}])`+ + '|\u6295\u7a3f\u3059\u308b|\u6295\u7a3f\u3057\u3066|\u6295\u7a3f\u3057|\u6295\u7a3f|\u30c4\u30a4\u30fc\u30c8\u3057\u3066|\u30c4\u30a4\u30fc\u30c8\u3057|\u30dd\u30b9\u30c8\u3057\u3066|\u30dd\u30b9\u30c8\u3057|\u53d1\u5e03|\u767c\u5e03|\u53d1\u5e16|\u767c\u5e16|\u53d1\u63a8|\u767c\u63a8|\u53d1\u9001\u63a8\u6587|\uac8c\uc2dc|\uc62c\ub824|\uc62c\ub9ac|\u0627\u0646\u0634\u0631|\u0646\u0634\u0631|\u8fd4\u4fe1\u3057\u3066|\u8fd4\u4fe1\u3057|\u8fd4\u4fe1|\u56de\u590d|\u56de\u8986|\u56de\u5e16|\ub2f5\uae00|\ub2f5\uc7a5|\ub2f5\ubcc0|\u0631\u062f','iu',);@@ -175,7 +175,7 @@ const SOCIAL_READ_VERBS = new RegExp('iu',);const SOCIAL_NOUN_LIKE_PUBLISH = new RegExp(- '^(?:posts?|tweets?|skeets?|shares?|publica[c\u00e7][i\u00ed]?[o\u00f3]n(?:es)?|publica[c\u00e7][a\u00e3]o|publica[c\u00e7][o\u00f5]es|publication|publications|\u6295\u7a3f|\u63a8\u6587)$',+ '^(?:posts?|tweets?|skeets?|shares?|repl(?:y|ies)|responses?|respuestas?|r\u00e9ponses?|rispost[ae]|respostas?|antworten|\u8fd4\u4fe1|\u56de\u590d|\u56de\u8986|\ub2f5\uae00|publica[c\u00e7][i\u00ed]?[o\u00f3]n(?:es)?|publica[c\u00e7][a\u00e3]o|publica[c\u00e7][o\u00f5]es|publication|publications|\u6295\u7a3f|\u63a8\u6587)$','iu',);const SOCIAL_NEGATION = new RegExp(diff --git a/test/run.js b/test/run.jsindex 199364f4b..bfb3db9e3 100644--- a/test/run.js+++ b/test/run.js@@ -87231,6 +87231,32 @@ test('social publication workflow follows the live X or Bluesky destination and'a Spanish bare Bluesky destination was missed'],['Publiez ceci sur Bluesky', ['bluesky'],'a French bare platform destination was missed'],+ // A reply is a publication: it composes and submits a post.+ ['Reply "Thanks" on X', ['twitter'],+ 'an English reply command was not read as publication intent'],+ ['Respond on Bluesky', ['bluesky'],+ 'an English respond command was not read as publication intent'],+ ['Responde en X con "gracias"', ['twitter'],+ 'a Spanish reply command was not read as publication intent'],+ ['Répondez sur Bluesky', ['bluesky'],+ 'a French reply command was not read as publication intent'],+ ['Antworte auf X', ['twitter'],+ 'a German reply command was not read as publication intent'],+ ['Ответь в X', ['twitter'],+ 'a Russian reply command was not read as publication intent'],+ ['Xで返信して', ['twitter'],+ 'a Japanese reply command was not read as publication intent'],+ ['在X上回复', ['twitter'],+ 'a Chinese reply command was not read as publication intent'],+ // Reading replies is not writing one.+ ['Read the replies on X', [],+ 'reading replies was read as publication intent'],+ ['Summarize responses on Bluesky', [],+ 'summarizing responses was read as publication intent'],+ ['Collect all replies on X', [],+ 'collecting replies was read as publication intent'],+ ['Do not reply on X', [],+ 'a negated reply command was read as publication intent'],['发布到X', ['twitter'],'an unspaced Chinese bare X destination was missed'],['发布至X', ['twitter'],