-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(ChatLLM Teams): add activity #10594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
00272a2
dd78c42
142f83e
0d88300
e2faf84
1849833
ebcbc10
c5ae04c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| { | ||
| "$schema": "https://schemas.premid.app/metadata/1.16", | ||
| "apiVersion": 1, | ||
| "author": { | ||
| "id": "621775934382669894", | ||
| "name": "Clover Y5 Network" | ||
| }, | ||
| "service": "ChatLLM Teams", | ||
| "altnames": ["Abacus AI", "ChatLLM"], | ||
| "description": { | ||
| "en": "ChatLLM Teams by Abacus.AI - An AI super assistant powered by large language models with access to multiple AI models including GPT-4, Claude, Gemini and more.", | ||
| "es": "ChatLLM Teams de Abacus.AI - Un super asistente de IA con acceso a multiples modelos de lenguaje como GPT-4, Claude, Gemini y mas." | ||
| }, | ||
| "url": "apps.abacus.ai", | ||
| "regExp": "^https?[:][/][/]apps[.]abacus[.]ai[/]chatllm.*", | ||
| "version": "1.0.0", | ||
| "logo": "https://play-lh.googleusercontent.com/O35u7LcmgKHsRpEQvHmT9ACfvDvP5S6HRIVmz-x-spUhojXIcnk0wbMEqaBSWPUJYQ", | ||
Check failureCode scanning / ESLint validate object with JSON Schema. Error
"logo" must match pattern "^https?://.+.(png|jpe?g|gif|webp)$".
|
||
CloverY5 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "thumbnail": "https://www.hrkatha.com/wp-content/uploads/2022/01/Abacus.png", | ||
| "color": "#4F46E5", | ||
| "category": "other", | ||
| "tags": [ | ||
| "ai", | ||
| "chat", | ||
| "assistant", | ||
| "llm", | ||
| "abacus", | ||
| "productivity" | ||
| ], | ||
| "settings": [ | ||
| { | ||
| "id": "title", | ||
| "title": "Show Chat Title", | ||
| "icon": "fad fa-user-secret", | ||
| "value": true | ||
| }, | ||
| { | ||
| "id": "timestamp", | ||
| "title": "Show Timestamp", | ||
| "icon": "fad fa-stopwatch", | ||
| "value": true | ||
| } | ||
| ] | ||
| } | ||
Check failureCode scanning / ESLint Require or disallow newline at the end of files Error
Newline required at end of file but not found.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| import { ActivityType, Assets } from "premid"; | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
|
|
||
| const presence = new Presence({clientId: "1485675381863219241",}) | ||
Check failureCode scanning / ESLint Enforce consistent spacing inside braces Error
A space is required after '{'.
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Require or disallow trailing commas Error
Unexpected trailing comma.
Check failureCode scanning / ESLint Enforce consistent spacing inside braces Error
A space is required before '}'.
|
||
|
|
||
| const browsingTimestamp = Math.floor(Date.now() / 1000) | ||
|
|
||
| // Variable to store the last known title when the sidebar is hidden | ||
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| let lastKnownTitle = ""; | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
|
|
||
| enum ActivityAssets { | ||
| Logo = 'https://cdn.abacus.ai/chatllm/favicon.ico', | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 2 spaces but found 4.
|
||
CloverY5 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| presence.on("UpdateData", async () => { | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
|
||
| const [title, timestamp] = await Promise.all([ | ||
| presence.getSetting<boolean>('title'), | ||
| presence.getSetting<boolean>('timestamp'), | ||
| ]) | ||
|
|
||
| const { href, search } = document.location; | ||
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| if (!href.includes("apps.abacus.ai/chatllm")) { | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| presence.clearActivity(); | ||
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| return; | ||
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| } | ||
| const params = new URLSearchParams(search); | ||
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| const projectId = params.get("projectId"); | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| const convoId = params.get("convoId"); | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
|
|
||
| const presenceData: PresenceData = { | ||
| largeImageKey: ActivityAssets.Logo, | ||
| type: ActivityType.Playing | ||
| }; | ||
Check failureCode scanning / ESLint Require or disallow trailing commas Error
Missing trailing comma.
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
|
|
||
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| const getTitleFromUI = () => { | ||
| const activeChatElement = document.querySelector("div[class*='bg-bwleftblue/25'] span[data-state], div[class*='dark:bg-bwleftblue/40'] span[data-state]"); | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| if (activeChatElement?.textContent) { | ||
| lastKnownTitle = activeChatElement.textContent.trim(); | ||
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| return lastKnownTitle; | ||
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| } | ||
| const headerTitle = document.querySelector("h1, .text-xl, .font-bold")?.textContent; | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| if (headerTitle && !headerTitle.includes("ChatLLM")) return headerTitle.trim(); | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Newline after if Error
Expect newline after if
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| return document.title.replace(` - ${lastKnownTitle}`, "").trim(); | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| }; | ||
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
|
|
||
| if (timestamp) { | ||
| presenceData.startTimestamp = browsingTimestamp | ||
| } | ||
|
|
||
| if (convoId && projectId) { | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 2 spaces but found 1.
|
||
| presenceData.details = "Chatting in a project"; | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| presenceData.smallImageKey = Assets.Writing; | ||
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| if (title) presenceData.state = `Project Chat: ${getTitleFromUI()}`; | ||
Check failureCode scanning / ESLint Newline after if Error
Expect newline after if
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| } | ||
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| else if (convoId && !projectId) { | ||
| presenceData.details = "In a conversation"; | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| presenceData.smallImageKey = Assets.Writing; | ||
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| if (title) presenceData.state = `Chat: ${getTitleFromUI()}`; | ||
Check failureCode scanning / ESLint Newline after if Error
Expect newline after if
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| } | ||
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| else if (projectId && !convoId) { | ||
| presenceData.details = "Viewing a project"; | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| presenceData.smallImageKey = Assets.Reading; | ||
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| if (title) presenceData.state = `Project: ${getTitleFromUI()}`; | ||
Check failureCode scanning / ESLint Newline after if Error
Expect newline after if
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| } | ||
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| else { | ||
| presenceData.details = "On the home screen"; | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| presenceData.state = "Exploring ChatLLM Teams"; | ||
Check failureCode scanning / ESLint Enforce the consistent use of either backticks, double, or single quotes Error
Strings must use singlequote.
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| presenceData.smallImageKey = Assets.Search; | ||
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| } | ||
|
|
||
| presence.setActivity(presenceData); | ||
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
| }); | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 0 spaces but found 2.
Check failureCode scanning / ESLint Require or disallow semicolons instead of ASI Error
Extra semicolon.
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.