├── .husky └── pre-commit ├── docs ├── 1.guide │ ├── _dir.yml │ ├── 2.installation.md │ └── 1.index.md ├── .gitignore ├── 2.community │ ├── _dir.yml │ ├── 1.getting-help.md │ └── 2.contribution.md ├── package.json ├── .docs │ └── public │ │ └── icon.svg └── .config │ └── docs.yaml ├── src ├── template │ ├── .python-version │ ├── .env │ ├── README.md │ ├── pyproject.toml │ └── src │ │ └── plugins │ │ └── echo.py ├── renderer │ ├── components │ │ ├── ui │ │ │ ├── modal │ │ │ │ ├── index.ts │ │ │ │ └── Modal.vue │ │ │ ├── button │ │ │ │ ├── index.ts │ │ │ │ └── Button.vue │ │ │ ├── skeleton │ │ │ │ ├── index.ts │ │ │ │ └── Skeleton.vue │ │ │ ├── scroll-area │ │ │ │ ├── index.ts │ │ │ │ ├── ScrollArea.vue │ │ │ │ └── ScrollBar.vue │ │ │ ├── hover-card │ │ │ │ ├── index.ts │ │ │ │ ├── HoverCardTrigger.vue │ │ │ │ ├── HoverCard.vue │ │ │ │ └── HoverCardContent.vue │ │ │ ├── tabs │ │ │ │ ├── index.ts │ │ │ │ ├── Tabs.vue │ │ │ │ ├── TabsList.vue │ │ │ │ ├── TabsContent.vue │ │ │ │ └── TabsTrigger.vue │ │ │ ├── avatar │ │ │ │ ├── AvatarImage.vue │ │ │ │ ├── AvatarFallback.vue │ │ │ │ ├── Avatar.vue │ │ │ │ └── index.ts │ │ │ ├── dropdown-menu │ │ │ │ ├── DropdownMenuGroup.vue │ │ │ │ ├── DropdownMenuShortcut.vue │ │ │ │ ├── DropdownMenuTrigger.vue │ │ │ │ ├── DropdownMenuSub.vue │ │ │ │ ├── DropdownMenu.vue │ │ │ │ ├── DropdownMenuRadioGroup.vue │ │ │ │ ├── DropdownMenuSeparator.vue │ │ │ │ ├── DropdownMenuLabel.vue │ │ │ │ ├── DropdownMenuItem.vue │ │ │ │ ├── DropdownMenuSubTrigger.vue │ │ │ │ ├── index.ts │ │ │ │ ├── DropdownMenuSubContent.vue │ │ │ │ ├── DropdownMenuContent.vue │ │ │ │ ├── DropdownMenuCheckboxItem.vue │ │ │ │ └── DropdownMenuRadioItem.vue │ │ │ └── pagination │ │ │ │ ├── index.ts │ │ │ │ ├── PaginationEllipsis.vue │ │ │ │ ├── PaginationNext.vue │ │ │ │ ├── PaginationPrev.vue │ │ │ │ ├── PaginationLast.vue │ │ │ │ └── PaginationFirst.vue │ │ ├── store │ │ │ ├── index.ts │ │ │ ├── Plugin.vue │ │ │ ├── Driver.vue │ │ │ ├── Adapter.vue │ │ │ ├── Modal.vue │ │ │ └── Card.vue │ │ ├── icons │ │ │ ├── index.ts │ │ │ ├── CircleCheckFilled.vue │ │ │ ├── Github.vue │ │ │ ├── CircleXFilled.vue │ │ │ └── GithubFilled.vue │ │ ├── Mark.vue │ │ ├── Toaster.vue │ │ └── LogView.vue │ ├── index.css │ ├── App.vue │ ├── lib │ │ └── utils.ts │ ├── index.html │ ├── index.ts │ ├── router │ │ └── index.ts │ └── views │ │ ├── StoreView.vue │ │ ├── BotView.vue │ │ └── SettingView.vue ├── types │ ├── tag.ts │ ├── driver.ts │ ├── adapter.ts │ ├── plugin.ts │ └── config.ts ├── lib │ ├── log.ts │ ├── index.ts │ ├── process │ │ ├── index.ts │ │ ├── utils.ts │ │ ├── schemas.ts │ │ ├── impl.ts │ │ ├── log.ts │ │ └── process.ts │ └── fs.ts ├── public │ ├── icon.svg │ └── thumb.svg ├── main │ ├── index.ts │ ├── config.ts │ ├── uv.ts │ └── handlers.ts ├── global.d.ts └── preload │ └── index.ts ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.yml │ └── bug_report.yml ├── CONTRIBUTING.md ├── workflows │ └── build.yml └── CODE_OF_CONDUCT.md ├── .vscode ├── settings.json ├── extensions.json └── tailwind.json ├── postcss.config.js ├── .editorconfig ├── tsconfig.json ├── tsconfig.web.json ├── tailwind.config.js ├── .prettierrc.json ├── .gitignore ├── README.md ├── tsconfig.node.json ├── manifest.json ├── .eslintrc.json ├── package.json ├── electron.vite.config.ts └── LICENSE /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | npx lint-staged -------------------------------------------------------------------------------- /docs/1.guide/_dir.yml: -------------------------------------------------------------------------------- 1 | title: '指南' -------------------------------------------------------------------------------- /src/template/.python-version: -------------------------------------------------------------------------------- 1 | {{ pyVersion }} 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ["https://afdian.com/@komoridev"] -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .nuxt 3 | .output 4 | dist 5 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ../docs/2.community/2.contribution.md 2 | -------------------------------------------------------------------------------- /docs/2.community/_dir.yml: -------------------------------------------------------------------------------- 1 | title: '社区' 2 | icon: i-ph-chats-teardrop -------------------------------------------------------------------------------- /src/template/.env: -------------------------------------------------------------------------------- 1 | DRIVER=~fastapi 2 | NICKNAME=["{{ name }}"] 3 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "css.customData": [".vscode/tailwind.json"] 3 | } 4 | -------------------------------------------------------------------------------- /src/renderer/components/ui/modal/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Modal } from './Modal.vue'; 2 | -------------------------------------------------------------------------------- /src/renderer/index.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /src/renderer/components/ui/button/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Button } from './Button.vue'; 2 | -------------------------------------------------------------------------------- /src/types/tag.ts: -------------------------------------------------------------------------------- 1 | export type Tag = { 2 | label: string; 3 | color: `#${string}`; 4 | }; 5 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["Vue.volar", "bradlc.vscode-tailwindcss"] 3 | } 4 | -------------------------------------------------------------------------------- /src/renderer/components/ui/skeleton/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Skeleton } from './Skeleton.vue'; 2 | -------------------------------------------------------------------------------- /docs/1.guide/2.installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | icon: i-ph-play 3 | --- 4 | 5 | # 安装 6 | 7 | ::note 8 | **存根** 9 | :: 10 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /src/lib/log.ts: -------------------------------------------------------------------------------- 1 | export function log(...content: string[]) { 2 | console.log('\x1b[32m%s\x1b[0m', 'LiteLoader NoneBot:', ...content); 3 | } 4 | -------------------------------------------------------------------------------- /docs/2.community/1.getting-help.md: -------------------------------------------------------------------------------- 1 | --- 2 | navigation.icon: i-ph-lifebuoy 3 | --- 4 | 5 | # 获取帮助 6 | 7 | > 依意试,吾亦侍。 8 | 9 | ::note 10 | **存根** 11 | :: 12 | -------------------------------------------------------------------------------- /src/renderer/components/ui/scroll-area/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ScrollArea } from './ScrollArea.vue'; 2 | export { default as ScrollBar } from './ScrollBar.vue'; 3 | -------------------------------------------------------------------------------- /src/renderer/components/store/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Plugin } from './Plugin.vue'; 2 | export { default as Driver } from './Driver.vue'; 3 | export { default as Adapter } from './Adapter.vue'; 4 | -------------------------------------------------------------------------------- /src/template/README.md: -------------------------------------------------------------------------------- 1 | # {{ name }} 2 | 3 | > A bot project generated by [LiteLoaderQQNT-NoneBot](https://github.com/KomoriDev/LiteLoaderQQNT-NoneBot) 4 | 5 | ## Document 6 | 7 | see [Docs](https://nonebot.dev/) 8 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "docs", 4 | "scripts": { 5 | "dev": "undocs dev", 6 | "build": "undocs build" 7 | }, 8 | "devDependencies": { 9 | "undocs": "latest" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/renderer/App.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | -------------------------------------------------------------------------------- /src/renderer/components/ui/hover-card/index.ts: -------------------------------------------------------------------------------- 1 | export { default as HoverCard } from './HoverCard.vue'; 2 | export { default as HoverCardContent } from './HoverCardContent.vue'; 3 | export { default as HoverCardTrigger } from './HoverCardTrigger.vue'; 4 | -------------------------------------------------------------------------------- /src/public/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/public/thumb.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/renderer/components/ui/tabs/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Tabs } from './Tabs.vue'; 2 | export { default as TabsContent } from './TabsContent.vue'; 3 | export { default as TabsList } from './TabsList.vue'; 4 | export { default as TabsTrigger } from './TabsTrigger.vue'; 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | insert_final_newline = false 14 | -------------------------------------------------------------------------------- /src/renderer/components/icons/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Github } from './Github.vue'; 2 | export { default as GithubFilled } from './GithubFilled.vue'; 3 | export { default as CircleXFilled } from './CircleXFilled.vue'; 4 | export { default as CircleCheckFilled } from './CircleCheckFilled.vue'; 5 | -------------------------------------------------------------------------------- /docs/.docs/public/icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2021", 4 | "types": ["vite/client"], 5 | "declaration": true, 6 | "declarationDir": "./src" 7 | }, 8 | "include": ["src/**/*.d.ts"], 9 | "references": [{ "path": "./tsconfig.node.json" }, { "path": "./tsconfig.web.json" }] 10 | } 11 | -------------------------------------------------------------------------------- /src/renderer/components/ui/avatar/AvatarImage.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | -------------------------------------------------------------------------------- /src/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from './fs'; 2 | export * from './log'; 3 | 4 | export function localFetch(path: string, plugin = 'liteloader_nonebot') { 5 | return fetch( 6 | `local:///${LiteLoader.plugins[plugin].path.plugin.replace(':\\', '://').replaceAll('\\', '/')}/${path.startsWith('/') ? path.slice(1) : path}` 7 | ); 8 | } 9 | -------------------------------------------------------------------------------- /tsconfig.web.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@electron-toolkit/tsconfig/tsconfig.web.json", 3 | "include": ["src/**/*.ts", "src/global.d.ts"], 4 | "compilerOptions": { 5 | "composite": true, 6 | "baseUrl": ".", 7 | "paths": { 8 | "@/*": ["src/*"], 9 | "@@/*": ["src/renderer/*"] 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/renderer/components/ui/avatar/AvatarFallback.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /src/lib/process/index.ts: -------------------------------------------------------------------------------- 1 | export { Processor, ProcessManager } from './process'; 2 | export { LogStorage, LogStorageFather } from './log'; 3 | export { ProcessLog } from './schemas'; 4 | export type { LogLevel, CustomLog, ProcessPerformance, ProcessInfo } from './schemas'; 5 | export { logForward } from './utils'; 6 | export { runSubprocess } from './impl'; 7 | -------------------------------------------------------------------------------- /src/renderer/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { clsx } from 'clsx'; 2 | import { twMerge } from 'tailwind-merge'; 3 | 4 | import type { ClassValue } from 'clsx'; 5 | 6 | export function cn(...inputs: ClassValue[]) { 7 | return twMerge(clsx(inputs)); 8 | } 9 | 10 | export function openExternal(url: string) { 11 | LiteLoader.api.openExternal(url); 12 | } 13 | -------------------------------------------------------------------------------- /src/renderer/components/ui/hover-card/HoverCardTrigger.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/DropdownMenuGroup.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: ['./src/renderer/index.html', './src/renderer/**/*.{vue,js,ts,jsx,tsx}'], 4 | theme: { 5 | extend: { 6 | colors: {}, 7 | borderColor: { 8 | standard: 'rgb(229, 231, 235)', 9 | }, 10 | }, 11 | }, 12 | plugins: [require('tailwindcss-animate')], 13 | }; 14 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "tabWidth": 2, 4 | "useTabs": false, 5 | "semi": true, 6 | "singleQuote": true, 7 | "quoteProps": "preserve", 8 | "jsxSingleQuote": false, 9 | "trailingComma": "es5", 10 | "bracketSpacing": true, 11 | "arrowParens": "always", 12 | "htmlWhitespaceSensitivity": "css", 13 | "vueIndentScriptAndStyle": false, 14 | "endOfLine": "auto" 15 | } 16 | -------------------------------------------------------------------------------- /src/lib/process/utils.ts: -------------------------------------------------------------------------------- 1 | import { BrowserWindow } from 'electron'; 2 | import { ProcessLog } from './schemas'; 3 | 4 | export const logCache: Map = new Map(); 5 | 6 | export function logForward(key: string, log: ProcessLog) { 7 | BrowserWindow.getAllWindows().forEach((win) => { 8 | win.webContents.send('LiteLoader.liteloader_nonebot.logListener', key, log); 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /src/types/driver.ts: -------------------------------------------------------------------------------- 1 | import type { Tag } from './tag'; 2 | 3 | type BaseDriver = { 4 | module_name: string; 5 | project_link: string; 6 | name: string; 7 | desc: string; 8 | author: string; 9 | homepage: string; 10 | tags: Tag[]; 11 | is_official: boolean; 12 | }; 13 | 14 | export type Driver = { resourceType: 'driver' } & BaseDriver; 15 | 16 | export type DriversResponse = BaseDriver[]; 17 | -------------------------------------------------------------------------------- /src/types/adapter.ts: -------------------------------------------------------------------------------- 1 | import type { Tag } from './tag'; 2 | 3 | type BaseAdapter = { 4 | module_name: string; 5 | project_link: string; 6 | name: string; 7 | desc: string; 8 | author: string; 9 | homepage: string; 10 | tags: Tag[]; 11 | is_official: boolean; 12 | }; 13 | 14 | export type Adapter = { resourceType: 'adapter' } & BaseAdapter; 15 | 16 | export type AdaptersResponse = BaseAdapter[]; 17 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/DropdownMenuShortcut.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /src/renderer/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | LiteLoaderQQNT NoneBot 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | .DS_Store 12 | dist 13 | dist-ssr 14 | coverage 15 | *.local 16 | 17 | /cypress/videos/ 18 | /cypress/screenshots/ 19 | 20 | # Editor directories and files 21 | .idea 22 | *.suo 23 | *.ntvs* 24 | *.njsproj 25 | *.sln 26 | *.sw? 27 | 28 | *.tsbuildinfo 29 | 30 | *.zip 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |

3 | 4 | nonebot 5 | 6 |

7 | 8 |
9 | 10 | # LiteLoaderQQNT NoneBot 11 | 12 | _✨ 在 QQ 上管理你的 NoneBot 应用 ✨_ 13 | 14 |
15 | 16 | > [!Note] 17 | > 该项目正在开发中,尚未准备好用于生产。欢迎为该项目做出贡献。 18 | -------------------------------------------------------------------------------- /src/renderer/components/ui/skeleton/Skeleton.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 15 | -------------------------------------------------------------------------------- /src/renderer/index.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue'; 2 | import { createPinia } from 'pinia'; 3 | 4 | import { router } from './router'; 5 | import App from './App.vue'; 6 | 7 | import './index.css'; 8 | 9 | export const onSettingWindowCreated = async (view: HTMLElement) => { 10 | const pinia = createPinia(); 11 | const app = createApp(App); 12 | 13 | app.use(pinia); 14 | app.use(router); 15 | app.mount(view); 16 | }; 17 | -------------------------------------------------------------------------------- /docs/1.guide/1.index.md: -------------------------------------------------------------------------------- 1 | # 介绍 2 | 3 | 🩹 无痛安装,易于使用,萌新上手也无压力。 4 | 5 | ## 🚀 弹射起步 6 | 7 | ::note 8 | **存根** 9 | :: 10 | 11 | ## ✨ 闪光点 12 | 13 | - 🎁 开箱即用 14 | 无门槛一键安装,无需复杂配置,小白也能轻松上手。 15 | 16 | - 🎛️ 插件管理 17 | 内置插件管理系统,更易于管理。 18 | 19 | ## 🧐 帮助改进 20 | 21 | 如果你发现文档存在问题,或者有改进文档或项目的建议,欢迎向我们[提出议题](https://github.com/KomoriDev/LiteLoaderQQNT-NoneBot/issues/new/choose)。 22 | 23 | 如果你有兴趣做出更多贡献,请参阅我们的[贡献文档](../2.community/2.contribution.md)了解更多信息。 24 | -------------------------------------------------------------------------------- /tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@electron-toolkit/tsconfig/tsconfig.node.json", 3 | "include": ["electron.vite.config.*", "src/**/*", "src/global.d.ts"], 4 | "compilerOptions": { 5 | "composite": true, 6 | "baseUrl": ".", 7 | "paths": { 8 | "@/*": ["src/*"], 9 | "@@/*": ["src/renderer/*"], 10 | "vite": ["node_modules/vite"] 11 | }, 12 | "types": ["vite/client", "electron-vite/node"] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/DropdownMenuTrigger.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | -------------------------------------------------------------------------------- /src/renderer/components/ui/tabs/Tabs.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 16 | -------------------------------------------------------------------------------- /src/renderer/components/ui/pagination/index.ts: -------------------------------------------------------------------------------- 1 | export { default as PaginationEllipsis } from './PaginationEllipsis.vue'; 2 | export { default as PaginationFirst } from './PaginationFirst.vue'; 3 | export { default as PaginationLast } from './PaginationLast.vue'; 4 | export { default as PaginationNext } from './PaginationNext.vue'; 5 | export { default as PaginationPrev } from './PaginationPrev.vue'; 6 | export { PaginationList, PaginationListItem, PaginationRoot as Pagination } from 'radix-vue'; 7 | -------------------------------------------------------------------------------- /src/renderer/components/ui/hover-card/HoverCard.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/DropdownMenuSub.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /src/renderer/router/index.ts: -------------------------------------------------------------------------------- 1 | import { createMemoryHistory, createRouter } from 'vue-router'; 2 | 3 | import BotView from '@@/views/BotView.vue'; 4 | import SettingView from '@@/views/SettingView.vue'; 5 | import StoreView from '@@/views/StoreView.vue'; 6 | 7 | const routes = [ 8 | { path: '/', name: 'home', component: SettingView }, 9 | { path: '/bot/:id', component: BotView }, 10 | { path: '/store/:id', component: StoreView }, 11 | ]; 12 | 13 | export const router = createRouter({ 14 | history: createMemoryHistory(), 15 | routes, 16 | }); 17 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/DropdownMenu.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 20 | -------------------------------------------------------------------------------- /src/types/plugin.ts: -------------------------------------------------------------------------------- 1 | import type { Tag } from './tag'; 2 | 3 | export type BasePlugin = { 4 | author: string; 5 | name: string; 6 | desc: string; 7 | homepage: string; 8 | is_official: boolean; 9 | module_name: string; 10 | project_link: string; 11 | skip_test: boolean; 12 | supported_adapters: string[] | null; 13 | tags: Array; 14 | time: string; 15 | type: string; 16 | valid: boolean; 17 | version: string; 18 | }; 19 | 20 | export type Plugin = { resourceType: 'plugin' } & BasePlugin; 21 | 22 | export type PluginsResponse = BasePlugin[]; 23 | -------------------------------------------------------------------------------- /docs/.config/docs.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://unpkg.com/undocs/schema/config.json 2 | 3 | name: 'LLNoneBot' 4 | shortDescription: 'Bot, made easy.' 5 | description: '在 QQ 上管理你的 NoneBot 应用 / Manage your NoneBot App on QQ' 6 | github: 'KomoriDev/LiteLoaderQQNT-NoneBot' 7 | url: 'https://github.com/KomoriDev/LiteLoaderQQNT-NoneBot' 8 | themeColor: '#f43f5e' 9 | landing: 10 | # contributors: true 11 | features: 12 | - title: '开箱即用' 13 | icon: '⚡' 14 | description: '简单易用,无需复杂配置,初次接触也可轻松上手。' 15 | - title: '插件管理' 16 | icon: '📦' 17 | description: '内置插件管理系统,更易于管理。' 18 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 20 | -------------------------------------------------------------------------------- /src/template/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "{{ name }}" 3 | version = "0.1.0" 4 | description = "{{ name }}" 5 | readme = "README.md" 6 | requires-python = ">={{ pyVersion }}" 7 | dependencies = [ 8 | "nonebot2[fastapi]>=2.3.3", 9 | ] 10 | 11 | [project.optional-dependencies] 12 | adapters = [ 13 | "nonebot-adapter-onebot>=2.4.4", 14 | ] 15 | 16 | [tool.uv] 17 | dev-dependencies = [ 18 | "nb-cli>=1.4.2", 19 | ] 20 | 21 | [tool.nonebot] 22 | adapters = [ 23 | { name = "OneBot V11", module_name = "nonebot.adapters.onebot.v11" } 24 | ] 25 | plugins = [] 26 | plugin_dirs = ["src/plugins"] 27 | 28 | -------------------------------------------------------------------------------- /src/main/index.ts: -------------------------------------------------------------------------------- 1 | import fs from 'fs'; 2 | import path from 'path'; 3 | import { log } from '@/lib/log'; 4 | 5 | import './uv'; 6 | import './handlers'; 7 | 8 | const dataPath = LiteLoader.plugins.liteloader_nonebot.path.data; 9 | const botsPath = path.join(dataPath, 'bots.json'); 10 | 11 | if (!fs.existsSync(dataPath)) { 12 | log('Plugin data path not found, creating a new plugin data path'); 13 | fs.mkdirSync(dataPath, { recursive: true }); 14 | } 15 | if (!fs.existsSync(botsPath)) { 16 | log('bots.json file not found, creating a new file'); 17 | fs.writeFileSync(botsPath, JSON.stringify([], null, 2)); 18 | } 19 | -------------------------------------------------------------------------------- /src/renderer/components/ui/avatar/Avatar.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 26 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/DropdownMenuSeparator.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 25 | -------------------------------------------------------------------------------- /src/template/src/plugins/echo.py: -------------------------------------------------------------------------------- 1 | from nonebot import on_command 2 | from nonebot.rule import to_me 3 | from nonebot.adapters import Message 4 | from nonebot.params import CommandArg 5 | from nonebot.plugin import PluginMetadata 6 | 7 | __plugin_meta__ = PluginMetadata( 8 | name="echo", 9 | description="重复你说的话", 10 | usage="/echo [text]", 11 | type="application", 12 | homepage="https://github.com/nonebot/nonebot2/blob/master/nonebot/plugins/echo.py", 13 | config=None, 14 | supported_adapters=None, 15 | ) 16 | 17 | echo = on_command("echo", rule=to_me()) 18 | 19 | 20 | @echo.handle() 21 | async def handle_echo(message: Message = CommandArg()): 22 | if any((not seg.is_text()) or str(seg) for seg in message): 23 | await echo.send(message) -------------------------------------------------------------------------------- /src/renderer/components/ui/tabs/TabsList.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 29 | -------------------------------------------------------------------------------- /src/renderer/components/ui/pagination/PaginationEllipsis.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 23 | -------------------------------------------------------------------------------- /src/renderer/components/ui/tabs/TabsContent.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 29 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/DropdownMenuLabel.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 25 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 4, 3 | "type": "extension", 4 | "name": "NoneBot", 5 | "slug": "liteloader_nonebot", 6 | "description": "在 QQ 上管理你的 NoneBot 应用 / Manage your NoneBot App on QQ", 7 | "version": "0.1.0", 8 | "icon": "public/icon.svg", 9 | "thumb": "public/thumb.svg", 10 | "authors": [ 11 | { 12 | "name": "KomoriDev", 13 | "link": "https://github.com/KomoriDev" 14 | } 15 | ], 16 | "platform": ["win32", "linux", "darwin"], 17 | "injects": { 18 | "main": "./main/index.js", 19 | "preload": "./preload/index.js", 20 | "renderer": "./renderer/index.js" 21 | }, 22 | "repository": { 23 | "repo": "KomoriDev/LiteLoaderQQNT-NoneBot", 24 | "branch": "master", 25 | "release": { 26 | "tag": "0.1.0", 27 | "file": "liteloader_nonebot.zip" 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/renderer/components/icons/CircleCheckFilled.vue: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | workflow_dispatch: 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - name: Checkout code 18 | uses: actions/checkout@v4 19 | 20 | - name: Setup Node.js 21 | uses: actions/setup-node@v4 22 | with: 23 | node-version: '20' 24 | 25 | - name: Install pnpm 26 | run: npm install -g pnpm 27 | 28 | - name: Install dependencies 29 | run: pnpm install 30 | 31 | - name: Build project 32 | run: pnpm build 33 | 34 | - name: Upload Artifact 35 | uses: actions/upload-artifact@v4 36 | with: 37 | name: liteloader_nonebot.zip 38 | path: liteloader_nonebot.zip 39 | -------------------------------------------------------------------------------- /src/renderer/components/Mark.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 35 | -------------------------------------------------------------------------------- /src/renderer/components/ui/avatar/index.ts: -------------------------------------------------------------------------------- 1 | import { cva, type VariantProps } from 'class-variance-authority'; 2 | 3 | export { default as Avatar } from './Avatar.vue'; 4 | export { default as AvatarFallback } from './AvatarFallback.vue'; 5 | export { default as AvatarImage } from './AvatarImage.vue'; 6 | 7 | export const avatarVariant = cva( 8 | 'inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden', 9 | { 10 | variants: { 11 | size: { 12 | xs: 'h-5 w-5 text-xs', 13 | sm: 'h-10 w-10 text-xs', 14 | base: 'h-16 w-16 text-2xl', 15 | lg: 'h-32 w-32 text-5xl', 16 | }, 17 | shape: { 18 | circle: 'rounded-full', 19 | square: 'rounded-md', 20 | }, 21 | }, 22 | } 23 | ); 24 | 25 | export type AvatarVariants = VariantProps; 26 | -------------------------------------------------------------------------------- /src/renderer/components/icons/Github.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /src/lib/process/schemas.ts: -------------------------------------------------------------------------------- 1 | export enum LogLevel { 2 | STDOUT = 'STDOUT', 3 | INFO = 'INFO', 4 | WARNING = 'WARNING', 5 | ERROR = 'ERROR', 6 | DEBUG = 'DEBUG', 7 | } 8 | 9 | export interface CustomLog { 10 | time: string | Date; 11 | level: T; 12 | message: string; 13 | } 14 | 15 | export class ProcessLog implements CustomLog { 16 | time: string | Date; 17 | level: LogLevel; 18 | message: string; 19 | 20 | constructor(message: string, level: LogLevel = LogLevel.STDOUT) { 21 | this.time = new Date().toISOString(); 22 | this.level = level; 23 | this.message = message; 24 | } 25 | } 26 | 27 | export interface ProcessPerformance { 28 | cpu: number; 29 | mem: number; 30 | } 31 | 32 | export interface ProcessInfo { 33 | statusCode?: number; 34 | totalLog: number; 35 | isRunning: boolean; 36 | performance?: ProcessPerformance; 37 | } 38 | -------------------------------------------------------------------------------- /src/renderer/components/ui/scroll-area/ScrollArea.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 25 | -------------------------------------------------------------------------------- /src/renderer/components/ui/pagination/PaginationNext.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 29 | -------------------------------------------------------------------------------- /src/renderer/components/ui/pagination/PaginationPrev.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 29 | -------------------------------------------------------------------------------- /src/renderer/components/ui/pagination/PaginationLast.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 29 | -------------------------------------------------------------------------------- /src/renderer/components/ui/pagination/PaginationFirst.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 29 | -------------------------------------------------------------------------------- /src/types/config.ts: -------------------------------------------------------------------------------- 1 | export interface Python { 2 | version: string; 3 | path: string; 4 | } 5 | 6 | export interface BotConfig { 7 | /** Bot 名称 */ 8 | name: string; 9 | /** Bot 目录 */ 10 | path: string; 11 | /** pid */ 12 | pid: number; 13 | /** 是否自启动 */ 14 | autoStart: boolean; 15 | /** Python 信息 */ 16 | python: Python; 17 | } 18 | 19 | export interface NontBotConfig { 20 | /** NoneBot 运行所使用的驱动器 */ 21 | driver?: string[]; 22 | /** 当 NoneBot 作为服务端时,监听的 IP / 主机名 */ 23 | host?: string; 24 | /** 当 NoneBot 作为服务端时,监听的端口 */ 25 | port?: number; 26 | /** NoneBot 日志输出等级 */ 27 | logLevel?: 'TRACE' | 'DEBUG' | 'INFO'; 28 | /** 调用平台接口的超时时间,单位为秒 */ 29 | apiTimeout?: number; 30 | /** 机器人超级用户,可以使用权限 `SUPERUSER` */ 31 | superUsers?: string[]; 32 | /** 机器人昵称 */ 33 | nickname?: string[]; 34 | /** 命令消息的起始符 */ 35 | commandStart?: string[]; 36 | /** 命令消息的分割符 */ 37 | commandSep?: string[]; 38 | /** 用户会话超时时间 */ 39 | sessionExpireTimeout?: number; 40 | } 41 | -------------------------------------------------------------------------------- /src/renderer/components/icons/CircleXFilled.vue: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/DropdownMenuItem.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 31 | -------------------------------------------------------------------------------- /src/renderer/components/ui/scroll-area/ScrollBar.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 32 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 32 | -------------------------------------------------------------------------------- /src/main/config.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { readJsonFile, writeJsonFile } from '@/lib'; 3 | import { BotConfig } from '@/types/config'; 4 | 5 | const dataPath = LiteLoader.plugins.liteloader_nonebot.path.data; 6 | 7 | export async function getBotConfig(id: string | number): Promise { 8 | const config = await readJsonFile(path.join(dataPath, 'bots.json')); 9 | return config[Number(id)]; 10 | } 11 | 12 | export async function updateBotConfig(id: number, key: string, value: any): Promise { 13 | const filePath = path.join(dataPath, 'bots.json'); 14 | const data = await readJsonFile(filePath); 15 | const oldValue = data[id][key]; 16 | 17 | if (id < 0 || id >= data.length) { 18 | throw new Error(`Invalid id: ${id}. It should be between 0 and ${data.length - 1}.`); 19 | } 20 | 21 | if (!(key in data[id])) { 22 | throw new Error(`Invalid key: ${key}. It does not exist in the BotConfig.`); 23 | } 24 | 25 | (data[id] as any)[key] = value; 26 | 27 | await writeJsonFile(filePath, data, 'overwrite'); 28 | 29 | console.log(`修改 ${id} 配置 ${key}:${oldValue} -> ${value}`); 30 | } 31 | -------------------------------------------------------------------------------- /src/renderer/components/Toaster.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | 11 | 49 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/index.ts: -------------------------------------------------------------------------------- 1 | export { DropdownMenuPortal } from 'radix-vue'; 2 | 3 | export { default as DropdownMenu } from './DropdownMenu.vue'; 4 | export { default as DropdownMenuTrigger } from './DropdownMenuTrigger.vue'; 5 | export { default as DropdownMenuContent } from './DropdownMenuContent.vue'; 6 | export { default as DropdownMenuGroup } from './DropdownMenuGroup.vue'; 7 | export { default as DropdownMenuRadioGroup } from './DropdownMenuRadioGroup.vue'; 8 | export { default as DropdownMenuItem } from './DropdownMenuItem.vue'; 9 | export { default as DropdownMenuCheckboxItem } from './DropdownMenuCheckboxItem.vue'; 10 | export { default as DropdownMenuRadioItem } from './DropdownMenuRadioItem.vue'; 11 | export { default as DropdownMenuShortcut } from './DropdownMenuShortcut.vue'; 12 | export { default as DropdownMenuSeparator } from './DropdownMenuSeparator.vue'; 13 | export { default as DropdownMenuLabel } from './DropdownMenuLabel.vue'; 14 | export { default as DropdownMenuSub } from './DropdownMenuSub.vue'; 15 | export { default as DropdownMenuSubTrigger } from './DropdownMenuSubTrigger.vue'; 16 | export { default as DropdownMenuSubContent } from './DropdownMenuSubContent.vue'; 17 | -------------------------------------------------------------------------------- /src/renderer/components/ui/tabs/TabsTrigger.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 33 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es2021": true, 5 | "node": true 6 | }, 7 | "extends": [ 8 | "eslint-config-prettier", 9 | "eslint:recommended", 10 | "plugin:vue/vue3-recommended", 11 | "plugin:import/typescript", 12 | "plugin:@typescript-eslint/recommended", 13 | "plugin:prettier/recommended" 14 | ], 15 | "overrides": [ 16 | { 17 | "env": { 18 | "node": true 19 | }, 20 | "files": [".eslintrc.{js,cjs}"], 21 | "parserOptions": { 22 | "sourceType": "script" 23 | } 24 | } 25 | ], 26 | "ignorePatterns": ["node_modules/**/*", "dist/**/*", "src/template/**/*", "*.html", "*.css", "*.svg"], 27 | "parser": "vue-eslint-parser", 28 | "parserOptions": { 29 | "parser": "@typescript-eslint/parser", 30 | "ecmaVersion": "latest", 31 | "sourceType": "module" 32 | }, 33 | "plugins": ["vue", "@typescript-eslint"], 34 | "rules": { 35 | "linebreak-style": ["error", "unix"], 36 | "indent": ["error", 2], 37 | "quotes": ["error", "single"], 38 | "semi": ["error", "always"], 39 | "no-undef": "off", 40 | "vue/multi-word-component-names": "off", 41 | "vue/require-default-prop": "off", 42 | "@typescript-eslint/no-unused-vars": "off", 43 | "@typescript-eslint/no-explicit-any": "off" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/renderer/components/ui/hover-card/HoverCardContent.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 35 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/DropdownMenuSubContent.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 36 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/DropdownMenuContent.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 41 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 43 | -------------------------------------------------------------------------------- /src/renderer/components/ui/dropdown-menu/DropdownMenuRadioItem.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 44 | -------------------------------------------------------------------------------- /src/renderer/components/ui/button/Button.vue: -------------------------------------------------------------------------------- 1 | 40 | 41 | 46 | -------------------------------------------------------------------------------- /docs/2.community/2.contribution.md: -------------------------------------------------------------------------------- 1 | --- 2 | navigation.icon: i-ph-git-pull-request 3 | --- 4 | 5 | # 贡献 6 | 7 | ::tip 8 | 如果你喜欢这个项目,可以为本项目点亮⭐️,这是对我们最大的鼓励。 9 | :: 10 | 11 | 首先,感谢你愿意为 LLNoneBot 做出贡献! 12 | 13 | 本章旨在引导你更规范地向 LLNoneBot 提交贡献,请务必认真阅读。 14 | 15 | **我们欢迎一切贡献!并对每个愿意贡献的人表示衷心的感谢!** 💖 16 | 17 | ## 提交 Issue 18 | 19 | 在提交 Issue 前,我们建议你先查看[已有的 Issues](https://github.com/KomoriDev/LiteLoaderQQNT-NoneBot/issues),以防重复提交。 20 | 21 | ### 报告问题、故障与漏洞 22 | 23 | 如果你在使用过程中发现问题并确信是由 LLNoneBot 引起的,欢迎提交 Issue。 24 | 25 | ### 建议功能 26 | 27 | 为了让开发者更好地理解你的意图,请认真描述你所需要的特性,可能的话可以提出你认为可行的解决方案。 28 | 29 | ## Pull Request 30 | 31 | LLNoneBot 使用 pnpm 管理项目依赖 32 | 33 | 下面的命令能在已安装 pnpm 的情况下帮你快速配置开发环境。 34 | 35 | ```bash 36 | pnpm install 37 | ``` 38 | 39 | ### 使用 GitHub Codespaces(Dev Container) 40 | 41 | [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/KomoriDev/LiteLoaderQQNT-NoneBot) 42 | 43 | ### 使用 GitPod 44 | 45 | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#/https://github.com/KomoriDev/LiteLoaderQQNT-NoneBot) 46 | 47 | ### Commit 规范 48 | 49 | 请确保你的每一个 commit 都能清晰地描述其意图,一个 commit 尽量只有一个意图。 50 | 51 | LLNoneBot 的 commit message 格式遵循 [gitmoji](https://gitmoji.dev/) 规范,在创建 commit 时请牢记这一点。 52 | 53 | ### 撰写文档 54 | 55 | LLNoneBot 的文档使用 [UnDocs](https://undocs.pages.dev/),它有一些 [组件](https://undocs.pages.dev/guide/components) 可能会帮助到你。 56 | 57 | 如果你需要在本地预览修改后的文档,可以使用 pnpm 安装文档依赖后启动 dev server,如下所示: 58 | 59 | :pm-install{script="install"} 60 | 61 | :pm-run{script="dev"} 62 | 63 | LLNoneBot 文档并没有具体的行文风格规范,但我们建议你尽量写得简单易懂。 64 | 65 | ~~好像压根没啥要写的~~ 66 | 67 | ## 版权声明 68 | 69 | 在为此项目做贡献时,请确保你的贡献内容不会侵犯他人的知识产权,否则你的贡献将被视为无效。 70 | 71 | 通过贡献你的代码、问题或建议,即表示你同意将你的贡献内容以开源的形式提供,并遵守项目所采用的开源许可证。 72 | -------------------------------------------------------------------------------- /src/lib/process/impl.ts: -------------------------------------------------------------------------------- 1 | import { spawn } from 'child_process'; 2 | import { Readable } from 'stream'; 3 | import { LogStorage } from './log'; 4 | import { ProcessLog } from './schemas'; 5 | 6 | type RunSubprocessOptions = { 7 | cwd?: string; 8 | stdin?: NodeJS.ReadStream | null; 9 | logStorage?: LogStorage; 10 | }; 11 | 12 | type SubprocessResult = { 13 | process: ReturnType; 14 | logStorage?: LogStorage; 15 | }; 16 | 17 | export async function runSubprocess( 18 | args: Array, 19 | options: RunSubprocessOptions = {} 20 | ): Promise { 21 | const { cwd, stdin, logStorage } = options; 22 | 23 | const stringArgs = args.map((arg) => arg.toString()); 24 | 25 | const childProcess = spawn(stringArgs[0], stringArgs.slice(1), { 26 | cwd, 27 | stdio: ['pipe', 'pipe', 'pipe'], 28 | detached: globalThis.process.platform === 'win32', // Windows equivalent of CREATE_NEW_PROCESS_GROUP 29 | }); 30 | 31 | const readStream = async (stream: Readable | null, logStorage: LogStorage) => { 32 | if (stream) { 33 | for await (const chunk of stream) { 34 | const decodeLine = chunk.toString('utf-8').replace(/\r?\n$/, ''); 35 | const logModel = new ProcessLog(decodeLine); 36 | await logStorage.add(logModel); 37 | } 38 | } 39 | }; 40 | 41 | if (stdin) { 42 | stdin.pipe(childProcess.stdin!); 43 | } 44 | 45 | if (logStorage) { 46 | if (childProcess.stdout) { 47 | readStream(childProcess.stdout, logStorage); 48 | } 49 | if (childProcess.stderr) { 50 | readStream(childProcess.stderr, logStorage); 51 | } 52 | } 53 | 54 | return { process: childProcess, logStorage }; 55 | } 56 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: ✨ 功能需求 2 | title: "Feature: " 3 | description: 为项目提出一个新的想法或建议 4 | labels: ["enhancement"] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | ## 注意事项 10 | [GitHub Issues](../issues) 专门用于错误报告和功能需求,这意味着我们不接受使用问题。如果你打开的问题不符合要求,它将会被无条件关闭。 11 | 12 | 有关使用问题,请通过以下途径: 13 | - 阅读文档以解决 14 | - 在社区内寻求他人解答 15 | - 在网络中搜索是否有人遇到过类似的问题 16 | 17 | 最后,请记得遵守我们的社区准则,友好交流。 18 | 19 | - type: checkboxes 20 | id: terms 21 | attributes: 22 | label: 确认事项 23 | description: 请确认你已遵守所有必选项。 24 | options: 25 | - label: 我已仔细阅读并了解上述注意事项。 26 | required: true 27 | - label: 我已使用最新版本测试过,确认功能并未实现。 28 | required: true 29 | - label: 我确定在 [GitHub Issues](../issues) 中没有相同或相似的需求。 30 | required: true 31 | 32 | - type: textarea 33 | id: problem 34 | attributes: 35 | label: 你希望能解决什么样的问题? 36 | description: 请简要地说明是什么问题导致你想要一个新功能。也许我们可以提出一种现有的解决办法。 37 | validations: 38 | required: true 39 | 40 | - type: textarea 41 | id: solution 42 | attributes: 43 | label: 你想要的解决方案 44 | description: 请说明你希望使用什么样的方法解决上述问题。 45 | validations: 46 | required: true 47 | 48 | - type: textarea 49 | id: alternatives 50 | attributes: 51 | label: 你考虑过的替代方案 52 | description: 除了上述方法以外,你还考虑过哪些其他的实现方式? 53 | 54 | - type: textarea 55 | id: usecase 56 | attributes: 57 | label: 实现的功能是什么样的? 58 | description: | 59 | 提供功能在实现后如何使用的代码示例。请注意,你可以使用 Markdown 来设置代码块的格式。 60 | 尽可能多地提供细节。你希望它如何使用的示例代码会有所帮助。 61 | 62 | - type: textarea 63 | id: context 64 | attributes: 65 | label: 还有什么要补充的吗? 66 | description: 在此处添加相关的任何其他上下文或截图,或者你觉得有帮助的信息。 67 | 68 | - type: checkboxes 69 | id: contribute 70 | attributes: 71 | label: 参与贡献 72 | description: 欢迎加入我们的贡献者行列! 73 | options: 74 | - label: 我有足够的时间和能力,愿意为此提交 PR 来实现功能。 -------------------------------------------------------------------------------- /src/lib/fs.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import fs from 'fs-extra'; 3 | 4 | export async function readJsonFile(filePath: string): Promise { 5 | const fullPath = path.resolve(__dirname, filePath); 6 | const fileContent = await fs.readFile(fullPath, 'utf-8'); 7 | return JSON.parse(fileContent) as T; 8 | } 9 | 10 | export async function writeJsonFile( 11 | filePath: string, 12 | data: T[], 13 | mode: 'append' | 'overwrite' = 'append' 14 | ): Promise { 15 | let jsonData: T[] = []; 16 | const fullPath = path.resolve(__dirname, filePath); 17 | 18 | if (mode === 'append') { 19 | const fileContent = await fs.readFile(fullPath, 'utf-8'); 20 | jsonData = JSON.parse(fileContent); 21 | } 22 | 23 | if (mode === 'append') { 24 | jsonData.push(...data); 25 | } else if (mode === 'overwrite') { 26 | jsonData = [...data]; 27 | } 28 | 29 | return fs.writeFile(fullPath, JSON.stringify(jsonData, null, 2), 'utf-8'); 30 | } 31 | 32 | export function replacePlaceholders(content: string, replacements: Record) { 33 | let result = content; 34 | for (const key in replacements) { 35 | const placeholder = `{{ ${key} }}`; 36 | result = result.replace(new RegExp(placeholder, 'g'), replacements[key]); 37 | } 38 | return result; 39 | } 40 | 41 | export async function processTemplate( 42 | templateDir: string, 43 | targetDir: string, 44 | replacements: Record 45 | ): Promise { 46 | const files = await fs.readdir(templateDir); 47 | 48 | for (const file of files) { 49 | const templateFilePath = path.join(templateDir, file); 50 | const targetFilePath = path.join(targetDir, file); 51 | const stat = await fs.stat(templateFilePath); 52 | 53 | if (stat.isDirectory()) { 54 | await fs.ensureDir(targetFilePath); 55 | await processTemplate(templateFilePath, targetFilePath, replacements); 56 | } else { 57 | await fs.ensureDir(path.dirname(targetFilePath)); 58 | 59 | const content = await fs.readFile(templateFilePath, 'utf8'); 60 | const replacedContent = replacePlaceholders(content, replacements); 61 | 62 | await fs.writeFile(targetFilePath, replacedContent); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/global.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { IpcRenderer } from 'electron'; 4 | import type { ContextBridgeApi, ipcRendererBridgeApi } from './preload'; 5 | 6 | declare namespace LiteLoader { 7 | interface ILiteLoaderPath { 8 | root: string; 9 | profile: string; 10 | data: string; 11 | plugins: string; 12 | } 13 | 14 | interface ILiteLoaderVersion { 15 | qqnt: string; 16 | liteloader: string; 17 | node: string; 18 | chrome: string; 19 | electron: string; 20 | } 21 | 22 | interface ILiteLoaderOS { 23 | platform: 'win32' | 'linux' | 'darwin'; 24 | } 25 | 26 | interface ILiteLoaderPackage { 27 | liteloader: object; 28 | qqnt: object; 29 | } 30 | 31 | interface ILiteLoaderPlugin { 32 | manifest: object; 33 | incompatible: boolean; 34 | disabled: boolean; 35 | path: ILiteLoaderPluginPath; 36 | } 37 | 38 | interface ILiteLoaderPluginPath { 39 | plugin: string; 40 | data: string; 41 | injects: ILiteLoaderPluginPathInject; 42 | } 43 | 44 | interface ILiteLoaderPluginPathInject { 45 | main: string; 46 | renderer: string; 47 | preload: string; 48 | } 49 | 50 | interface ILiteLoaderAPI { 51 | openPath: (path: string) => void; 52 | openExternal: (url: string) => void; 53 | disablePlugin: (slug: string) => void; 54 | config: ILiteLoaderAPIConfig; 55 | } 56 | 57 | interface ILiteLoaderAPIConfig { 58 | set: (slug: string, new_config: IConfig) => unknown; 59 | get: (slug: string, default_config?: IConfig) => IConfig; 60 | } 61 | } 62 | 63 | declare interface LiteLoader { 64 | path: LiteLoader.ILiteLoaderPath; 65 | versions: LiteLoader.ILiteLoaderVersion; 66 | os: LiteLoader.ILiteLoaderOS; 67 | package: LiteLoader.ILiteLoaderPackage; 68 | config: { 69 | LiteLoader: { 70 | disabled_plugins: string[]; 71 | }; 72 | }; 73 | plugins: Record; 74 | api: LiteLoader.ILiteLoaderAPI; 75 | } 76 | 77 | declare global { 78 | const LiteLoader: LiteLoader; 79 | 80 | interface Window { 81 | ipcRenderer: IpcRenderer; 82 | liteloader_nonebot: ContextBridgeApi; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: 🐛 错误报告 2 | title: "Bug: 出现异常" 3 | description: 提交 Bug 反馈以帮助我们改进代码 4 | labels: ["bug"] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | ## 注意事项 10 | [GitHub Issues](../issues) 专门用于错误报告和功能需求,这意味着我们不接受使用问题。如果你打开的问题不符合要求,它将会被无条件关闭。 11 | 12 | 有关使用问题,请通过以下途径: 13 | - 阅读文档以解决 14 | - 在社区内寻求他人解答 15 | - 在网络中搜索是否有人遇到过类似的问题 16 | 17 | 如果你不知道如何有效、精准地提出一个问题,我们建议你先阅读[《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md)。 18 | 19 | 最后,请记得遵守我们的社区准则,友好交流。 20 | 21 | - type: checkboxes 22 | id: terms 23 | attributes: 24 | label: 确认事项 25 | description: 请确认你已遵守所有必选项。 26 | options: 27 | - label: 我已仔细阅读并了解上述注意事项。 28 | required: true 29 | - label: 我已使用最新版本测试过,确认问题依旧存在。 30 | required: true 31 | - label: 我确定在 [GitHub Issues](../issues) 中没有相同或相似的问题。 32 | required: true 33 | 34 | - type: input 35 | id: env-liteloader-ver 36 | attributes: 37 | label: LiteLoader 版本 38 | description: 填写 LiteLoader 版本 39 | placeholder: e.g. 1.2.0 40 | validations: 41 | required: true 42 | 43 | - type: input 44 | id: env-liteloader-nb-ver 45 | attributes: 46 | label: LiteLoader NoneBot 版本或 Commit ID 47 | description: 填写 LiteLoader NoneBot 版本或 Commit ID 48 | placeholder: e.g. 0.1.0 49 | validations: 50 | required: true 51 | 52 | - type: textarea 53 | id: describe 54 | attributes: 55 | label: 描述问题 56 | description: 清晰简洁地说明问题是什么 57 | validations: 58 | required: true 59 | 60 | - type: textarea 61 | id: reproduction 62 | attributes: 63 | label: 复现步骤 64 | description: 提供能复现此问题的详细操作步骤 65 | placeholder: | 66 | 1. 首先…… 67 | 2. 然后…… 68 | 3. 发生…… 69 | validations: 70 | required: true 71 | 72 | - type: textarea 73 | id: expected 74 | attributes: 75 | label: 期望的结果 76 | description: 清晰简洁地描述你期望发生的事情 77 | 78 | - type: textarea 79 | id: logs 80 | attributes: 81 | label: 截图或日志 82 | description: 提供有助于诊断问题的任何日志和截图 83 | 84 | - type: checkboxes 85 | id: contribute 86 | attributes: 87 | label: 参与贡献 88 | description: 欢迎加入我们的贡献者行列! 89 | options: 90 | - label: 我有足够的时间和能力,愿意为此提交 PR 来修复问题。 -------------------------------------------------------------------------------- /.vscode/tailwind.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1.1, 3 | "atDirectives": [ 4 | { 5 | "name": "@tailwind", 6 | "description": "Use the `@tailwind` directive to insert Tailwind's `base`, `components`, `utilities` and `screens` styles into your CSS.", 7 | "references": [ 8 | { 9 | "name": "Tailwind Documentation", 10 | "url": "https://tailwindcss.com/docs/functions-and-directives#tailwind" 11 | } 12 | ] 13 | }, 14 | { 15 | "name": "@apply", 16 | "description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.", 17 | "references": [ 18 | { 19 | "name": "Tailwind Documentation", 20 | "url": "https://tailwindcss.com/docs/functions-and-directives#apply" 21 | } 22 | ] 23 | }, 24 | { 25 | "name": "@responsive", 26 | "description": "You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive:\n```css\n@responsive {\n .alert {\n background-color: #E53E3E;\n }\n}\n```\n", 27 | "references": [ 28 | { 29 | "name": "Tailwind Documentation", 30 | "url": "https://tailwindcss.com/docs/functions-and-directives#responsive" 31 | } 32 | ] 33 | }, 34 | { 35 | "name": "@screen", 36 | "description": "The `@screen` directive allows you to create media queries that reference your breakpoints by **name** instead of duplicating their values in your own CSS:\n```css\n@screen sm {\n /* ... */\n}\n```\n…gets transformed into this:\n```css\n@media (min-width: 640px) {\n /* ... */\n}\n```\n", 37 | "references": [ 38 | { 39 | "name": "Tailwind Documentation", 40 | "url": "https://tailwindcss.com/docs/functions-and-directives#screen" 41 | } 42 | ] 43 | }, 44 | { 45 | "name": "@variants", 46 | "description": "Generate `hover`, `focus`, `active` and other **variants** of your own utilities by wrapping their definitions in the `@variants` directive:\n```css\n@variants hover, focus {\n .btn-brand {\n background-color: #3182CE;\n }\n}\n```\n", 47 | "references": [ 48 | { 49 | "name": "Tailwind Documentation", 50 | "url": "https://tailwindcss.com/docs/functions-and-directives#variants" 51 | } 52 | ] 53 | } 54 | ] 55 | } 56 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "liteloader_nonebot", 3 | "version": "0.1.0", 4 | "description": "在 QQ 上管理你的 NoneBot 应用 / Manage your NoneBot App on QQ", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "electron-vite build", 8 | "lint": "eslint . --ext .vue,.js,.ts --ignore-path .gitignore", 9 | "format": "prettier --write ./**/*.{html,vue,js,ts,jsx,tsx,json,md} --ignore-path .gitignore", 10 | "prepare": "husky" 11 | }, 12 | "author": "KomoriDev", 13 | "license": "AGPL-3.0-only", 14 | "dependencies": { 15 | "class-variance-authority": "^0.7.0", 16 | "clsx": "^2.1.1", 17 | "lucide-vue-next": "^0.447.0", 18 | "pinia": "^2.1.7", 19 | "ps-list": "^8.1.1", 20 | "radix-vue": "^1.9.6", 21 | "tailwind-merge": "^2.5.2", 22 | "tree-kill": "^1.2.2", 23 | "vue": "^3.4.29", 24 | "vue-router": "4", 25 | "vue-sonner": "^1.2.1" 26 | }, 27 | "devDependencies": { 28 | "@electron-toolkit/eslint-config-ts": "^1.0.1", 29 | "@electron-toolkit/tsconfig": "^1.0.1", 30 | "@tsconfig/node22": "^22.0.0", 31 | "@types/fs-extra": "^11.0.4", 32 | "@types/node": "^22.5.5", 33 | "@typescript-eslint/eslint-plugin": "^7.2.0", 34 | "@typescript-eslint/parser": "^7.2.0", 35 | "@vitejs/plugin-vue": "^5.0.5", 36 | "@vitejs/plugin-vue-jsx": "^4.0.0", 37 | "@vue/tsconfig": "^0.5.1", 38 | "autoprefixer": "^10.4.20", 39 | "electron": "^29.1.4", 40 | "electron-vite": "^2.1.0", 41 | "eslint": "^8.57.0", 42 | "eslint-config-prettier": "^9.1.0", 43 | "eslint-plugin-import": "^2.30.0", 44 | "eslint-plugin-prettier": "^5.2.1", 45 | "eslint-plugin-vue": "^9.28.0", 46 | "fs-extra": "^11.2.0", 47 | "husky": "^9.1.6", 48 | "lint-staged": "^15.2.10", 49 | "postcss": "^8.4.47", 50 | "prettier": "3.3.3", 51 | "tailwindcss": "^3.4.13", 52 | "tailwindcss-animate": "^1.0.7", 53 | "typescript": "^5.5.4", 54 | "unplugin-zip-pack": "^1.0.1", 55 | "vite": "^5.4.5", 56 | "vite-plugin-checker": "^0.6.4", 57 | "vite-plugin-cp": "^4.0.8", 58 | "vite-plugin-css-injected-by-js": "^3.5.2", 59 | "vite-plugin-vue-devtools": "^7.3.1", 60 | "vue-eslint-parser": "^9.4.3", 61 | "vue-tsc": "^2.0.21" 62 | }, 63 | "husky": { 64 | "hooks": { 65 | "pre-commit": "lint-staged" 66 | } 67 | }, 68 | "lint-staged": { 69 | "*.{vue,js,ts,jsx,tsx}": [ 70 | "eslint --fix" 71 | ], 72 | "*.{html,vue,js,ts,json,md}": "prettier --write --ignore-unknown" 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/renderer/views/StoreView.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | 72 | 73 | 85 | -------------------------------------------------------------------------------- /src/renderer/components/store/Plugin.vue: -------------------------------------------------------------------------------- 1 | 54 | 55 | 96 | -------------------------------------------------------------------------------- /src/renderer/components/store/Driver.vue: -------------------------------------------------------------------------------- 1 | 54 | 55 | 96 | -------------------------------------------------------------------------------- /src/renderer/components/store/Adapter.vue: -------------------------------------------------------------------------------- 1 | 54 | 55 | 96 | -------------------------------------------------------------------------------- /electron.vite.config.ts: -------------------------------------------------------------------------------- 1 | import { resolve } from 'path'; 2 | import { defineConfig } from 'electron-vite'; 3 | import { defineConfig as defineViteConfig } from 'vite'; 4 | 5 | import vue from '@vitejs/plugin-vue'; 6 | import viteCp from 'vite-plugin-cp'; 7 | import viteChecker from 'vite-plugin-checker'; 8 | import viteZipPack from 'unplugin-zip-pack/vite'; 9 | import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'; 10 | 11 | import PluginManifest from './manifest.json'; 12 | 13 | const SRC_DIR = resolve(__dirname, './src'); 14 | const RENDER_DIR = resolve(__dirname, './src/renderer'); 15 | const OUTPUT_DIR = resolve(__dirname, './dist'); 16 | 17 | const BaseConfig = defineViteConfig({ 18 | root: __dirname, 19 | resolve: { 20 | alias: { 21 | '@': SRC_DIR, 22 | '@@': RENDER_DIR, 23 | }, 24 | }, 25 | }); 26 | 27 | const ConfigBuilder = (type: 'main' | 'preload') => 28 | defineViteConfig({ 29 | ...BaseConfig, 30 | 31 | plugins: [ 32 | viteChecker({ 33 | typescript: true, 34 | eslint: { 35 | lintCommand: 'eslint . --ext .vue,.js,.ts --ignore-path .gitignore', 36 | }, 37 | }), 38 | ], 39 | build: { 40 | minify: true, 41 | outDir: resolve(OUTPUT_DIR, `./${type}`), 42 | lib: { 43 | entry: resolve(SRC_DIR, `./${type}/index.ts`), 44 | formats: ['cjs'], 45 | fileName: () => 'index.js', 46 | }, 47 | }, 48 | }); 49 | 50 | export default defineConfig({ 51 | main: ConfigBuilder('main'), 52 | preload: ConfigBuilder('preload'), 53 | renderer: defineViteConfig({ 54 | ...BaseConfig, 55 | 56 | plugins: [ 57 | vue({ 58 | template: { 59 | compilerOptions: { 60 | isCustomElement: (tag) => 61 | [ 62 | 'setting-panel', 63 | 'setting-section', 64 | 'setting-modal', 65 | 'setting-text', 66 | 'setting-item', 67 | 'setting-list', 68 | 'data-orientation', 69 | ].includes(tag), 70 | }, 71 | }, 72 | }), 73 | viteChecker({ 74 | typescript: true, 75 | eslint: { 76 | lintCommand: 'eslint . --ext .vue,.js,.ts --ignore-path .gitignore', 77 | }, 78 | }), 79 | viteCp({ 80 | targets: [ 81 | { src: './manifest.json', dest: 'dist' }, 82 | { src: './src/public', dest: 'dist/public' }, 83 | { src: './src/template', dest: 'dist/template', flatten: false }, 84 | { src: './src/template/.python-version', dest: 'dist/template' }, 85 | { src: './node_modules/ps-list/vendor', dest: 'dist/main/vendor' }, 86 | ], 87 | }), 88 | viteZipPack({ 89 | in: OUTPUT_DIR, 90 | out: resolve(__dirname, `./${PluginManifest.slug}.zip`), 91 | }), 92 | cssInjectedByJsPlugin(), 93 | ], 94 | build: { 95 | minify: 'esbuild', 96 | cssCodeSplit: true, 97 | outDir: resolve(OUTPUT_DIR, './renderer'), 98 | lib: { 99 | entry: resolve(SRC_DIR, './renderer/index.ts'), 100 | formats: ['es'], 101 | fileName: () => 'index.js', 102 | }, 103 | rollupOptions: { 104 | input: resolve(SRC_DIR, './renderer/index.ts'), 105 | }, 106 | }, 107 | define: { 108 | 'process.env': {}, 109 | }, 110 | }), 111 | }); 112 | -------------------------------------------------------------------------------- /src/renderer/components/store/Modal.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 93 | -------------------------------------------------------------------------------- /src/renderer/components/ui/modal/Modal.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 46 | 47 | 144 | -------------------------------------------------------------------------------- /src/lib/process/log.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 修改自 cli-plugin-webui 3 | * @src https://github.com/nonebot/cli-plugin-webui/blob/master/nb_cli_plugin_webui/app/handlers/process/log.py 4 | */ 5 | 6 | /** 7 | * MIT License 8 | * 9 | * Copyright (c) 2023 Kyomotoi 10 | 11 | * Permission is hereby granted, free of charge, to any person obtaining a copy 12 | * of this software and associated documentation files (the "Software"), to deal 13 | * in the Software without restriction, including without limitation the rights 14 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | * copies of the Software, and to permit persons to whom the Software is 16 | * furnished to do so, subject to the following conditions: 17 | * 18 | * The above copyright notice and this permission notice shall be included in all 19 | * copies or substantial portions of the Software. 20 | * 21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 27 | * SOFTWARE. 28 | * 29 | * @author Kyomotoi 30 | * @website https://github.com/nonebot/cli-plugin-webui 31 | */ 32 | 33 | type LogListener = (log: T) => Promise; 34 | 35 | export class LogStorage { 36 | private count: number = 0; 37 | private logs: Map = new Map(); 38 | public listeners: Map> = new Map(); 39 | private rotation: number; 40 | private maxLogs?: number; 41 | 42 | constructor(rotation: number = 5 * 60 * 1000, maxLogs?: number) { 43 | this.rotation = rotation; 44 | this.maxLogs = maxLogs; 45 | } 46 | 47 | async add(log: T): Promise { 48 | if (this.maxLogs && this.logs.size >= this.maxLogs) { 49 | this.removeOldest(); 50 | } 51 | 52 | const seq = ++this.count; 53 | this.logs.set(seq, log); 54 | 55 | setTimeout(() => this.remove(seq), this.rotation); 56 | 57 | await Promise.all( 58 | Array.from(this.listeners.values()).map((listener) => 59 | listener(log).catch((err) => { 60 | console.error('Error in listener:', err); 61 | }) 62 | ) 63 | ); 64 | 65 | return seq; 66 | } 67 | 68 | private remove(seq: number): void { 69 | this.logs.delete(seq); 70 | } 71 | 72 | private removeOldest(): void { 73 | const oldestSeq = Math.min(...this.logs.keys()); 74 | this.remove(oldestSeq); 75 | } 76 | 77 | list(reverse: boolean = false): T[] { 78 | const entries = Array.from(this.logs.entries()); 79 | const sortedEntries = reverse ? entries.reverse() : entries; 80 | return sortedEntries.map(([_, log]) => log); 81 | } 82 | 83 | getCount(): number { 84 | return this.count; 85 | } 86 | 87 | addListener(id: string, listener: LogListener): void { 88 | if (this.listeners.has(id)) return; 89 | this.listeners.set(id, listener); 90 | } 91 | 92 | removeListener(id: string): void { 93 | this.listeners.delete(id); 94 | } 95 | } 96 | 97 | export class LogStorageFather { 98 | private static storages: Map> = new Map(); 99 | 100 | static getStorage(key: string): LogStorage | undefined { 101 | return this.storages.get(key); 102 | } 103 | 104 | static addStorage(storage: LogStorage, key: string): void { 105 | if (this.storages.has(key)) { 106 | throw new Error('LogStorageAlreadyExists'); 107 | } 108 | this.storages.set(key, storage); 109 | } 110 | 111 | static removeStorage(key: string): void { 112 | this.storages.delete(key); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /src/main/uv.ts: -------------------------------------------------------------------------------- 1 | import { exec } from 'child_process'; 2 | import { log } from '@/lib'; 3 | import { BotConfig, Python } from '@/types/config'; 4 | 5 | const os = LiteLoader.os.platform; 6 | 7 | function checkUVInstalled(): Promise { 8 | return new Promise((resolve) => { 9 | exec('uv -V', (error, _, stderr) => { 10 | if (error || stderr) { 11 | resolve(false); 12 | } else { 13 | resolve(true); 14 | } 15 | }); 16 | }); 17 | } 18 | 19 | function installUV(): Promise { 20 | return new Promise((resolve, reject) => { 21 | const installCommand = 22 | os === 'win32' 23 | ? 'powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"' 24 | : os === 'linux' 25 | ? 'curl -LsSf https://astral.sh/uv/install.sh | sh' 26 | : os === 'darwin' 27 | ? 'curl -LsSf https://astral.sh/uv/install.sh | sh' 28 | : 'curl -LsSf https://astral.sh/uv/install.sh | sh'; 29 | exec(installCommand, (error, _, stderr) => { 30 | if (error) { 31 | reject(`安装 uv 失败: ${stderr}`); 32 | } else { 33 | resolve(); 34 | } 35 | }); 36 | }); 37 | } 38 | 39 | function checkPythonInstalled(): Promise { 40 | return new Promise((resolve) => { 41 | exec('uv python list --only-installed', (error, _, stderr) => { 42 | if (error || stderr) { 43 | resolve(false); 44 | } else { 45 | resolve(true); 46 | } 47 | }); 48 | }); 49 | } 50 | 51 | function installPython(version: string = '3.12'): Promise { 52 | return new Promise((resolve, reject) => { 53 | exec(`uv python install ${version}`, (error, _, stderr) => { 54 | if (error) { 55 | reject(`安装 Python 失败: ${stderr}`); 56 | } else { 57 | resolve(); 58 | } 59 | }); 60 | }); 61 | } 62 | 63 | export function getInstalledPython(): Promise { 64 | return new Promise((resolve, reject) => { 65 | const python: Python[] = []; 66 | 67 | exec('uv python list --only-installed', (error, stdout) => { 68 | if (error) { 69 | return reject(error); 70 | } 71 | 72 | const lines = stdout.split('\n'); 73 | lines.forEach((line) => { 74 | // line: cpython-3.12.6-windows-x86_64-none C:\Users\Administrator\AppData\Roaming\uv\python\cpython-3.12.6-windows-x86_64-none\python.exe 75 | 76 | if (line.startsWith('cpython')) { 77 | const version = line.split(' ')[0].split('-')[1]; 78 | const path = line.match(/ ([A-Z]:\\.*)/i)![1]; 79 | python.push({ version, path }); 80 | } 81 | }); 82 | 83 | resolve(python); 84 | }); 85 | }); 86 | } 87 | 88 | export function syncBotDependencies(bot: BotConfig): Promise { 89 | log(`正在同步 ${bot.name} 的依赖,目录:${bot.path}`); 90 | return new Promise((resolve, reject) => { 91 | exec('uv sync --all-extras', { 'cwd': bot.path }, (error, _, stderr) => { 92 | if (error) { 93 | reject(`安装依赖失败: ${stderr}`); 94 | } else { 95 | resolve(); 96 | } 97 | }); 98 | }); 99 | } 100 | 101 | checkUVInstalled() 102 | .then((isInstalled) => { 103 | if (isInstalled) { 104 | log('uv 已安装'); 105 | return Promise.resolve(); 106 | } else { 107 | log('uv 未安装,正在安装...'); 108 | return installUV(); 109 | } 110 | }) 111 | .then(() => { 112 | log('uv 安装完成'); 113 | }) 114 | .catch((error) => { 115 | error('操作失败:', error); 116 | }); 117 | 118 | checkPythonInstalled() 119 | .then((isInstalled) => { 120 | if (isInstalled) { 121 | log('Python 已安装'); 122 | return Promise.resolve(); 123 | } else { 124 | log('Python 未安装,正在安装...'); 125 | return installPython(); 126 | } 127 | }) 128 | .then(() => { 129 | log('Python 安装完成'); 130 | }) 131 | .catch((error) => { 132 | error('操作失败:', error); 133 | }); 134 | -------------------------------------------------------------------------------- /src/preload/index.ts: -------------------------------------------------------------------------------- 1 | import { contextBridge, ipcRenderer, OpenDialogOptions, OpenDialogReturnValue } from 'electron'; 2 | import { ProcessLog } from '@/lib/process/schemas'; 3 | 4 | import type { BotConfig, NontBotConfig, Python } from '@/types/config'; 5 | import type { Adapter, AdaptersResponse } from '@/types/adapter'; 6 | import type { Driver, DriversResponse } from '@/types/driver'; 7 | import type { Plugin, PluginsResponse } from '@/types/plugin'; 8 | 9 | export type RegistryDataResponseTypes = { 10 | adapter: AdaptersResponse; 11 | driver: DriversResponse; 12 | plugin: PluginsResponse; 13 | }; 14 | export type RegistryDataType = keyof RegistryDataResponseTypes; 15 | 16 | export type ResourceTypes = { 17 | adapter: Adapter; 18 | driver: Driver; 19 | plugin: Plugin; 20 | }; 21 | 22 | export type Resource = Adapter | Driver | Plugin; 23 | 24 | export type ContextBridgeApi = { 25 | getBots: () => Promise; 26 | getConfig: () => null; 27 | getBotConfig: () => NontBotConfig; 28 | getInstalledPython: () => Promise; 29 | setBot: (config: BotConfig) => Promise; 30 | setConfig: (config: object) => void; 31 | setBotConfig: (config: object) => void; 32 | deleteBot: (id: string, path: string) => Promise; 33 | showOpenDialog: (data: OpenDialogOptions) => Promise; 34 | createProject: (output: string, replacements: Record) => Promise; 35 | syncBotDependencies: (bot: BotConfig) => Promise; 36 | runBot: (id: string) => Promise; 37 | stopBot: (id: string) => Promise; 38 | getLogHistory: (key: string) => Promise; 39 | logListener: (callback: (key: string, log: ProcessLog) => void) => void; 40 | fetchRegistryData: (dataType: T) => Promise; 41 | fetchGithubUser: (username: string) => Promise; 42 | }; 43 | 44 | const exposedApi: ContextBridgeApi = { 45 | // 获取 Bot 46 | getBots: () => ipcRenderer.invoke('LiteLoader.liteloader_nonebot.getBots'), 47 | // 获取 Liteloader 插件配置文件 48 | getConfig: () => ipcRenderer.sendSync('LiteLoader.liteloader_nonebot.getConfig'), 49 | // 获取 Bot 配置文件 50 | getBotConfig: () => ipcRenderer.sendSync('LiteLoader.liteloader_nonebot.getBotConfig'), 51 | // 获取系统 Python 信息 52 | getInstalledPython: () => ipcRenderer.invoke('LiteLoader.liteloader_nonebot.getInstalledPython'), 53 | // 添加 Bot 54 | setBot: (config) => ipcRenderer.invoke('LiteLoader.liteloader_nonebot.setBot', config), 55 | // 更新 Liteloader 插件配置文件 56 | setConfig: (config) => ipcRenderer.send('LiteLoader.liteloader_nonebot.setConfig', config), 57 | // 更新 Bot 配置文件 58 | setBotConfig: (config) => ipcRenderer.send('LiteLoader.liteloader_nonebot.setBotConfig', config), 59 | // 删除 Bot 60 | deleteBot: (id, path) => ipcRenderer.invoke('LiteLoader.liteloader_nonebot.deleteBot', id, path), 61 | // 通用文件选择窗口 62 | showOpenDialog: (data) => ipcRenderer.invoke('LiteLoader.liteloader_nonebot.showOpenDialog', data), 63 | // 创建 Bot 项目 64 | createProject: (output, replacements) => 65 | ipcRenderer.invoke('LiteLoader.liteloader_nonebot.createProject', output, replacements), 66 | // 同步 Bot 依赖 67 | syncBotDependencies: (bot) => ipcRenderer.invoke('LiteLoader.liteloader_nonebot.syncBotDependencies', bot), 68 | // 运行 Bot 69 | runBot: (id) => ipcRenderer.invoke('LiteLoader.liteloader_nonebot.runBot', id), 70 | // 关闭 Bot 71 | stopBot: (id) => ipcRenderer.invoke('LiteLoader.liteloader_nonebot.stopBot', id), 72 | // 历史日志 73 | getLogHistory: (key) => ipcRenderer.invoke('LiteLoader.liteloader_nonebot.getLogHistory', key), 74 | // 进程日志 75 | logListener: (callback: (key: string, log: ProcessLog) => void) => 76 | ipcRenderer.on('LiteLoader.liteloader_nonebot.logListener', (_, key, log) => callback(key, log)), 77 | // 获取测试数据 78 | fetchRegistryData: (dataType) => ipcRenderer.invoke('LiteLoader.liteloader_nonebot.fetchRegistryData', dataType), 79 | // 获取 Github 账户信息 80 | fetchGithubUser: (username) => ipcRenderer.invoke('LiteLoader.liteloader_nonebot.fetchGithubUser', username), 81 | }; 82 | 83 | contextBridge.exposeInMainWorld('liteloader_nonebot', exposedApi); 84 | -------------------------------------------------------------------------------- /src/renderer/components/LogView.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 81 | -------------------------------------------------------------------------------- /src/renderer/components/icons/GithubFilled.vue: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /src/main/handlers.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import treeKill from 'tree-kill'; 3 | import fs, { rm } from 'fs/promises'; 4 | import { ipcMain, dialog, OpenDialogOptions } from 'electron'; 5 | 6 | import type { BotConfig } from '@/types/config'; 7 | import type { RegistryDataResponseTypes, RegistryDataType, ResourceTypes } from '@/preload'; 8 | 9 | import { getBotConfig, updateBotConfig } from './config'; 10 | import { getInstalledPython, syncBotDependencies } from './uv'; 11 | import { readJsonFile, writeJsonFile, processTemplate } from '@/lib'; 12 | import { Processor, ProcessManager, LogStorageFather, logForward, ProcessLog } from '@/lib/process'; 13 | 14 | const dataPath = LiteLoader.plugins.liteloader_nonebot.path.data; 15 | const pluginPath = LiteLoader.plugins.liteloader_nonebot.path.plugin; 16 | 17 | ipcMain.handle('LiteLoader.liteloader_nonebot.getBots', async () => { 18 | return await readJsonFile(path.join(dataPath, 'bots.json')); 19 | }); 20 | 21 | ipcMain.handle('LiteLoader.liteloader_nonebot.showOpenDialog', async (_, data: OpenDialogOptions) => { 22 | return await dialog.showOpenDialog(data); 23 | }); 24 | 25 | ipcMain.handle('LiteLoader.liteloader_nonebot.setBot', async (_, config: BotConfig) => { 26 | return await writeJsonFile(path.join(dataPath, 'bots.json'), [config]); 27 | }); 28 | 29 | ipcMain.handle('LiteLoader.liteloader_nonebot.deleteBot', async (_, id: string, folderPath: string) => { 30 | const jsonPath = path.join(dataPath, 'bots.json'); 31 | const jsonData = await readJsonFile(jsonPath); 32 | 33 | jsonData.splice(Number(id), 1); 34 | 35 | await fs.writeFile(jsonPath, JSON.stringify(jsonData, null, 2), 'utf-8'); 36 | await rm(folderPath, { recursive: true, force: true }); 37 | }); 38 | 39 | ipcMain.handle( 40 | 'LiteLoader.liteloader_nonebot.createProject', 41 | async (_, output: string, replacements: Record) => { 42 | const templatePath = `${pluginPath.replace(/\\/g, '/')}/template`; 43 | 44 | await fs.mkdir(output, { recursive: true }); 45 | return await processTemplate(templatePath, output, replacements); 46 | } 47 | ); 48 | 49 | ipcMain.handle('LiteLoader.liteloader_nonebot.getInstalledPython', async () => { 50 | return await getInstalledPython(); 51 | }); 52 | 53 | ipcMain.handle('LiteLoader.liteloader_nonebot.syncBotDependencies', async (_, bot: BotConfig) => { 54 | return await syncBotDependencies(bot); 55 | }); 56 | 57 | ipcMain.handle('LiteLoader.liteloader_nonebot.runBot', async (_, id: string) => { 58 | const config = await getBotConfig(id); 59 | let process = ProcessManager.getProcess(id); 60 | 61 | if (process) { 62 | if (process.processIsRunning) { 63 | throw new Error(`Bot ${config.name} is already running`); 64 | } else { 65 | await process.start(); 66 | } 67 | } else { 68 | process = new Processor(['nb', 'run'], config.path, undefined, 300); 69 | } 70 | 71 | process.logStorage.addListener('run-log', async (log: ProcessLog) => logForward(`run-bot-${id}`, log)); 72 | 73 | LogStorageFather.addStorage(process.logStorage, `run-bot-${id}`); 74 | ProcessManager.addProcess(process, id); 75 | 76 | await process.start(); 77 | await updateBotConfig(Number(id), 'pid', process.process?.pid); 78 | }); 79 | 80 | ipcMain.handle('LiteLoader.liteloader_nonebot.stopBot', async (_, id: string) => { 81 | const process = ProcessManager.getProcess(id); 82 | 83 | if (process) { 84 | if (!process.processIsRunning) return; 85 | process.stop(); 86 | await updateBotConfig(Number(id), 'pid', 0); 87 | } else { 88 | const config = await getBotConfig(id); 89 | treeKill(config.pid); 90 | await updateBotConfig(Number(id), 'pid', 0); 91 | } 92 | LogStorageFather.removeStorage(`run-bot-${id}`); 93 | }); 94 | 95 | ipcMain.handle('LiteLoader.liteloader_nonebot.getLogHistory', (_, key: string) => { 96 | const logStorage = LogStorageFather.getStorage(key); 97 | return logStorage?.list(); 98 | }); 99 | 100 | ipcMain.handle( 101 | 'LiteLoader.liteloader_nonebot.fetchRegistryData', 102 | async (_, dataType: T): Promise => { 103 | const resp = await fetch(`https://registry.nonebot.dev/${dataType}s.json`, { method: 'GET' }); 104 | const data = (await resp.json()) as RegistryDataResponseTypes[T]; 105 | return data.map((resource) => ({ ...resource, resourceType: dataType }) as ResourceTypes[T]); 106 | } 107 | ); 108 | 109 | ipcMain.handle('LiteLoader.liteloader_nonebot.fetchGithubUser', async (_, username: string) => { 110 | const response = await fetch(`https://api.github.com/users/${username}`, { method: 'GET' }); 111 | const data = await response.json(); 112 | return data; 113 | }); 114 | -------------------------------------------------------------------------------- /src/lib/process/process.ts: -------------------------------------------------------------------------------- 1 | import { spawn, ChildProcessWithoutNullStreams } from 'child_process'; 2 | import path from 'path'; 3 | import fs from 'fs'; 4 | import psList from 'ps-list'; 5 | import treeKill from 'tree-kill'; 6 | import { LogStorage } from './log'; 7 | 8 | import { ProcessLog, ProcessInfo } from './schemas'; 9 | 10 | export class Processor { 11 | public process: ChildProcessWithoutNullStreams | null = null; 12 | public processIsRunning: boolean = false; 13 | public args: string[]; 14 | public cwd: string; 15 | public env: NodeJS.ProcessEnv | undefined; 16 | public logStorage: LogStorage; 17 | 18 | constructor(args: string[], cwd: string, env: NodeJS.ProcessEnv | undefined, logDestroySeconds: number) { 19 | this.args = args; 20 | this.cwd = cwd; 21 | this.env = env; 22 | this.logStorage = new LogStorage(logDestroySeconds); 23 | } 24 | 25 | private async findDuplicateProcess(): Promise { 26 | const duplicatePIDs: number[] = []; 27 | const processes = await psList(); 28 | 29 | for (const proc of processes) { 30 | try { 31 | const processCwd = fs.readlinkSync(`/proc/${proc.pid}/cwd`); 32 | if (path.resolve(processCwd) === path.resolve(this.cwd)) { 33 | treeKill(proc.pid, 'SIGTERM'); 34 | duplicatePIDs.push(proc.pid); 35 | } 36 | } catch (error) { 37 | continue; 38 | } 39 | } 40 | 41 | return duplicatePIDs; 42 | } 43 | 44 | private async processExecutor(): Promise { 45 | return new Promise((resolve, reject) => { 46 | this.process = spawn(this.args[0], this.args.slice(1), { 47 | cwd: this.cwd, 48 | env: this.env, 49 | detached: true, 50 | windowsHide: true, 51 | stdio: ['pipe', 'pipe', 'pipe'], 52 | }); 53 | 54 | if (!this.process) { 55 | return reject(new Error('Failed to start process.')); 56 | } 57 | 58 | this.process.stdout?.on('data', (data) => { 59 | const output = data.toString(); 60 | this.logStorage.add(new ProcessLog(output)); 61 | }); 62 | 63 | this.process.on('spawn', () => { 64 | this.processIsRunning = true; 65 | resolve(); 66 | }); 67 | 68 | this.process.on('close', (code) => { 69 | this.processIsRunning = false; 70 | this.logStorage.add(new ProcessLog(`Process finished with code: ${code}`)); 71 | resolve(); 72 | }); 73 | }); 74 | } 75 | 76 | public getStatus(): ProcessInfo { 77 | if (!this.process || this.process.killed) { 78 | return { 79 | statusCode: this.process?.exitCode || undefined, 80 | totalLog: this.logStorage.getCount(), 81 | isRunning: this.processIsRunning, 82 | performance: undefined, 83 | }; 84 | } 85 | 86 | return { 87 | statusCode: this.process.exitCode || undefined, 88 | totalLog: this.logStorage.getCount(), 89 | isRunning: this.processIsRunning, 90 | performance: { 91 | cpu: Math.random() * 100, 92 | mem: Math.random() * 100, 93 | }, 94 | }; 95 | } 96 | 97 | public async start(): Promise { 98 | if (this.processIsRunning) return; 99 | 100 | const duplicatePIDs = await this.findDuplicateProcess(); 101 | if (duplicatePIDs.length > 0) { 102 | console.warn(`Possible duplicate processes found: ${duplicatePIDs.join(', ')}`); 103 | } 104 | 105 | await this.processExecutor(); 106 | } 107 | 108 | public stop(): void { 109 | if (this.process) { 110 | const pid = this.process.pid; 111 | console.log(`stop pid ${pid}`); 112 | 113 | if (!pid) return; 114 | 115 | treeKill(pid, 'SIGTERM', (err) => { 116 | if (!err) { 117 | console.info(`Process ${pid} terminated.`); 118 | this.processIsRunning = false; 119 | } 120 | }); 121 | } 122 | } 123 | 124 | public writeStdin(data: Buffer): Promise { 125 | return new Promise((resolve, reject) => { 126 | if (this.process && this.process.stdin) { 127 | this.process.stdin.write(data, (err) => { 128 | if (err) reject(err); 129 | else resolve(data.length); 130 | }); 131 | } else { 132 | reject(new Error('Process is not running.')); 133 | } 134 | }); 135 | } 136 | } 137 | 138 | export class ProcessManager { 139 | private static processes: Map = new Map(); 140 | 141 | static getProcess(key: string): Processor | undefined { 142 | return this.processes.get(key); 143 | } 144 | 145 | static addProcess(process: Processor, key: string): void { 146 | if (key in this.processes) { 147 | throw new Error('ProcessAlreadyExists'); 148 | } 149 | this.processes.set(key, process); 150 | } 151 | 152 | static removeProcess(key: string): void { 153 | const process = this.processes.get(key); 154 | if (!process) return; 155 | 156 | process.logStorage.listeners.clear(); 157 | this.processes.delete(key); 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /src/renderer/views/BotView.vue: -------------------------------------------------------------------------------- 1 | 66 | 67 | 153 | 154 | 166 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | - Demonstrating empathy and kindness toward other people 21 | - Being respectful of differing opinions, viewpoints, and experiences 22 | - Giving and gracefully accepting constructive feedback 23 | - Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | - Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | - The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | - Trolling, insulting or derogatory comments, and personal or political attacks 33 | - Public or private harassment 34 | - Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | - Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | mute231010@gmail.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /src/renderer/components/store/Card.vue: -------------------------------------------------------------------------------- 1 | 40 | 41 | 144 | -------------------------------------------------------------------------------- /src/renderer/views/SettingView.vue: -------------------------------------------------------------------------------- 1 | 113 | 114 | 269 | 270 | 298 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | --------------------------------------------------------------------------------