From 226b36bbe39774f72c691b8780e2473343670b98 Mon Sep 17 00:00:00 2001 From: lencx Date: Wed, 5 Feb 2025 18:31:16 +0800 Subject: [PATCH] extensions: github copilot (noi-ask) --- README.md | 4 +++- configs/noi.mode.cn.json | 8 +++++++- configs/noi.mode.json | 8 +++++++- extensions/README.md | 2 +- extensions/noi-ask/main.js | 21 +++++++++++++++++++++ extensions/noi-ask/manifest.json | 5 +++-- extensions/noi.extensions.json | 2 +- 7 files changed, 43 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index fc41d37..d5e24f9 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ Introducing Noi: an AI-enhanced, customizable browser designed to streamline your digital experience: +**AI Support: [ChatGPT](https://chatgpt.com), [Claude](https://claude.ai), [Gemini](https://gemini.google.com), [DeepSeek](https://chat.deepseek.com), [GitHub Copilot](https://github.com/copilot), [HuggingChat](https://huggingface.co/chat), ..., etc.** + - **Browser**: Noi not only includes curated AI websites but also allows the addition of any URL, providing a tailored browsing experience ([Noi Configs](./configs)). - **Prompts Management**: Offers robust customization options including the addition, synchronization, batch tagging, and removal of prompts. - **Noi Ask**: Enables sending batch messages to multiple AI chats, streamlining the process of interacting with various AI services simultaneously ([Noi Extensions](./extensions)). Entries made via Noi Ask are stored locally, ensuring easy access for future review or bookmarking. @@ -108,7 +110,7 @@ Learn more: [electronjs/doc](https://www.electronjs.org/docs/latest/api/extensio | Name | Version | Description | | --- | --- | --- | -| [@noi/ask](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.15 | The best assistant for batch asking and quick typing of prompts. | +| [@noi/ask](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.16 | The best assistant for batch asking and quick typing of prompts. | | [@noi/ask-custom](https://github.com/lencx/Noi/tree/main/extensions/noi-ask-custom) | 0.1.0 | The best assistant for batch asking and quick typing of prompts. | | [@noi/export-chatgpt](https://github.com/lencx/Noi/tree/main/extensions/noi-export-chatgpt) | 0.1.1 | ChatGPT chat history export, supports PDF, Image, and Markdown formats. | | [@noi/reset](https://github.com/lencx/Noi/tree/main/extensions/noi-reset) | 0.1.3 | Reset certain website styles to enhance compatibility with Noi. | diff --git a/configs/noi.mode.cn.json b/configs/noi.mode.cn.json index 9c38821..37099d0 100644 --- a/configs/noi.mode.cn.json +++ b/configs/noi.mode.cn.json @@ -1,6 +1,6 @@ { "name": "Noi Mode", - "version": "0.1.9", + "version": "0.1.10", "sync": "https://github.com/lencx/noi/blob/main/configs/noi.mode.cn.json", "modes": [ { @@ -57,6 +57,12 @@ "text": "DeepSeek", "url": "https://chat.deepseek.com" }, + { + "id": "noi:githubcopilot", + "parent": "noi@ai", + "text": "GitHub Copilot", + "url": "https://github.com/copilot" + }, { "id": "noi:sora", "parent": "noi@ai", diff --git a/configs/noi.mode.json b/configs/noi.mode.json index f0c9034..4963163 100644 --- a/configs/noi.mode.json +++ b/configs/noi.mode.json @@ -1,6 +1,6 @@ { "name": "Noi Mode", - "version": "0.1.12", + "version": "0.1.13", "sync": "https://github.com/lencx/noi/blob/main/configs/noi.mode.json", "modes": [ { @@ -63,6 +63,12 @@ "text": "DeepSeek", "url": "https://chat.deepseek.com" }, + { + "id": "noi:githubcopilot", + "parent": "noi@ai", + "text": "GitHub Copilot", + "url": "https://github.com/copilot" + }, { "id": "noi:sora", "parent": "noi@ai", diff --git a/extensions/README.md b/extensions/README.md index 0e4711c..ceffd2a 100644 --- a/extensions/README.md +++ b/extensions/README.md @@ -9,7 +9,7 @@ Learn more: [electronjs/doc](https://www.electronjs.org/docs/latest/api/extensio | Name | Version | Description | | --- | --- | --- | -| [@noi/ask](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.15 | The best assistant for batch asking and quick typing of prompts. | +| [@noi/ask](https://github.com/lencx/Noi/tree/main/extensions/noi-ask) | 0.1.16 | The best assistant for batch asking and quick typing of prompts. | | [@noi/ask-custom](https://github.com/lencx/Noi/tree/main/extensions/noi-ask-custom) | 0.1.0 | The best assistant for batch asking and quick typing of prompts. | | [@noi/export-chatgpt](https://github.com/lencx/Noi/tree/main/extensions/noi-export-chatgpt) | 0.1.1 | ChatGPT chat history export, supports PDF, Image, and Markdown formats. | | [@noi/reset](https://github.com/lencx/Noi/tree/main/extensions/noi-reset) | 0.1.3 | Reset certain website styles to enhance compatibility with Noi. | diff --git a/extensions/noi-ask/main.js b/extensions/noi-ask/main.js index ac2e2c7..b240be7 100644 --- a/extensions/noi-ask/main.js +++ b/extensions/noi-ask/main.js @@ -401,6 +401,26 @@ class JimengAsk extends NoiAsk { } } +class GitHubCopilotAsk extends NoiAsk { + static name = 'GitHub'; + static url = 'https://github.com/copilot'; + + static sync(message) { + const inputElement = document.querySelector('form #copilot-chat-textarea'); + if (inputElement) { + inputElement.focus(); + document.execCommand('undo'); + document.execCommand('insertText', false, message); + } + } + + static submit() { + const btns = document.querySelectorAll('form button'); + const btn = btns[btns.length - 1]; + if (btn) this.autoClick(btn); + } +} + window.NoiAsk = { OpenAIAsk, SoraAsk, @@ -422,4 +442,5 @@ window.NoiAsk = { NotebooklmAsk, JimengAsk, DeepSeekAsk, + GitHubCopilotAsk, }; diff --git a/extensions/noi-ask/manifest.json b/extensions/noi-ask/manifest.json index 33bf79d..74323fd 100644 --- a/extensions/noi-ask/manifest.json +++ b/extensions/noi-ask/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "@noi/ask", - "version": "0.1.15", + "version": "0.1.16", "homepage": "https://github.com/lencx/Noi/tree/main/extensions/noi-ask", "description": "The best assistant for batch asking and quick typing of prompts.", "content_scripts": [ @@ -26,7 +26,8 @@ "https://suno.com/*", "https://notebooklm.google.com/*", "https://jimeng.jianying.com/*", - "https://chat.deepseek.com/*" + "https://chat.deepseek.com/*", + "https://github.com/copilot/*" ], "js": ["main.js"], "run_at": "document_end", diff --git a/extensions/noi.extensions.json b/extensions/noi.extensions.json index 1579f97..271408f 100644 --- a/extensions/noi.extensions.json +++ b/extensions/noi.extensions.json @@ -5,7 +5,7 @@ { "name": "@noi/ask", "description": "The best assistant for batch asking and quick typing of prompts.", - "version": "0.1.15", + "version": "0.1.16", "url": "https://github.com/lencx/Noi/tree/main/extensions/noi-ask", "dirname": "noi-ask", "disabled": false