ci: add format check to PR workflow and documentation (#9810)

This commit is contained in:
yyhhyyyyyy 2025-09-06 09:28:50 +08:00 committed by GitHub
parent fd83834fca
commit c506ff6872
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 275 additions and 195 deletions

View File

@ -45,6 +45,9 @@ jobs:
- name: Install Dependencies - name: Install Dependencies
run: yarn install run: yarn install
- name: Format Check
run: yarn format:check
- name: Lint Check - name: Lint Check
run: yarn test:lint run: yarn test:lint

View File

@ -8,4 +8,5 @@ CHANGELOG*.md
agents.json agents.json
src/renderer/src/integration/nutstore/sso/lib src/renderer/src/integration/nutstore/sso/lib
AGENT.md AGENT.md
src/main/integration/cherryin/index.js src/main/integration/
.yarn/releases/

View File

@ -66,6 +66,7 @@
"test:lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts", "test:lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts",
"test:scripts": "vitest scripts", "test:scripts": "vitest scripts",
"format": "prettier --write .", "format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix && yarn typecheck && yarn check:i18n", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix && yarn typecheck && yarn check:i18n",
"prepare": "git config blame.ignoreRevsFile .git-blame-ignore-revs && husky" "prepare": "git config blame.ignoreRevsFile .git-blame-ignore-revs && husky"
}, },

View File

@ -1,26 +1,33 @@
<!DOCTYPE html> <!doctype html>
<html lang="zh-CN"> <html lang="zh-CN">
<head>
<head> <meta charset="UTF-8" />
<meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>许可协议 | License Agreement</title> <title>许可协议 | License Agreement</title>
<script src="https://cdn.tailwindcss.com"></script> <script src="https://cdn.tailwindcss.com"></script>
</head> </head>
<body class="bg-gray-50"> <body class="bg-gray-50">
<div class="max-w-4xl mx-auto px-4 py-8"> <div class="max-w-4xl mx-auto px-4 py-8">
<!-- 中文版本 --> <!-- 中文版本 -->
<div class="mb-12"> <div class="mb-12">
<h1 class="text-3xl font-bold mb-8 text-gray-900">许可协议</h1> <h1 class="text-3xl font-bold mb-8 text-gray-900">许可协议</h1>
<p class="mb-6 text-gray-700">本项目采用<strong>区分用户的双重许可 (User-Segmented Dual Licensing)</strong> 模式。</p> <p class="mb-6 text-gray-700">
本项目采用<strong>区分用户的双重许可 (User-Segmented Dual Licensing)</strong> 模式。
</p>
<section class="mb-8"> <section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">核心原则</h2> <h2 class="text-xl font-semibold mb-4 text-gray-900">核心原则</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700"> <ul class="list-disc pl-6 space-y-2 text-gray-700">
<li><strong>个人用户 和 10人及以下企业/组织:</strong> 默认适用 <strong>GNU Affero 通用公共许可证 v3.0 (AGPLv3)</strong></li> <li>
<li><strong>超过10人的企业/组织:</strong> <strong>必须</strong> 获取 <strong>商业许可证 (Commercial License)</strong></li> <strong>个人用户 和 10人及以下企业/组织:</strong> 默认适用
<strong>GNU Affero 通用公共许可证 v3.0 (AGPLv3)</strong>
</li>
<li>
<strong>超过10人的企业/组织:</strong> <strong>必须</strong> 获取
<strong>商业许可证 (Commercial License)</strong>
</li>
</ul> </ul>
</section> </section>
@ -33,47 +40,80 @@
</section> </section>
<section class="mb-8"> <section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">1. 开源许可证 (Open Source License): AGPLv3 - 适用于个人及10人及以下组织 <h2 class="text-xl font-semibold mb-4 text-gray-900">
1. 开源许可证 (Open Source License): AGPLv3 - 适用于个人及10人及以下组织
</h2> </h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700"> <ul class="list-disc pl-6 space-y-2 text-gray-700">
<li>如果您是个人用户,或者您的组织满足上述"10人及以下"的定义,您可以在 <strong>AGPLv3</strong> 的条款下自由使用、修改和分发 Cherry Studio。AGPLv3 的完整文本可以访问 <li>
<a href="https://www.gnu.org/licenses/agpl-3.0.html" 如果您是个人用户,或者您的组织满足上述"10人及以下"的定义,您可以在
class="text-blue-600 hover:underline">https://www.gnu.org/licenses/agpl-3.0.html</a> 获取。 <strong>AGPLv3</strong> 的条款下自由使用、修改和分发 Cherry Studio。AGPLv3 的完整文本可以访问
<a href="https://www.gnu.org/licenses/agpl-3.0.html" class="text-blue-600 hover:underline"
>https://www.gnu.org/licenses/agpl-3.0.html</a
>
获取。
</li>
<li>
<strong>核心义务:</strong> AGPLv3 的一个关键要求是,如果您修改了 Cherry Studio
并通过网络提供服务,或者分发了修改后的版本,您必须以 AGPLv3
许可证向接收者提供相应的<strong>完整源代码</strong>。即使您符合"10人及以下"的标准,如果您希望避免此源代码公开义务,您也需要考虑获取商业许可证(见下文)。
</li> </li>
<li><strong>核心义务:</strong> AGPLv3 的一个关键要求是,如果您修改了 Cherry Studio 并通过网络提供服务,或者分发了修改后的版本,您必须以 AGPLv3
许可证向接收者提供相应的<strong>完整源代码</strong>。即使您符合"10人及以下"的标准,如果您希望避免此源代码公开义务,您也需要考虑获取商业许可证(见下文)。</li>
<li>使用前请务必仔细阅读并理解 AGPLv3 的所有条款。</li> <li>使用前请务必仔细阅读并理解 AGPLv3 的所有条款。</li>
</ul> </ul>
</section> </section>
<section class="mb-8"> <section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">2. 商业许可证 (Commercial License) - 适用于超过10人的组织或希望规避 AGPLv3 <h2 class="text-xl font-semibold mb-4 text-gray-900">
义务的用户</h2> 2. 商业许可证 (Commercial License) - 适用于超过10人的组织或希望规避 AGPLv3 义务的用户
</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700"> <ul class="list-disc pl-6 space-y-2 text-gray-700">
<li><strong>强制要求:</strong> <li>
<strong>强制要求:</strong>
如果您的组织<strong></strong>满足上述"10人及以下"的定义即有11人或更多人可以访问、使用或受益于本软件<strong>必须</strong>联系我们获取并签署一份商业许可证才能使用 如果您的组织<strong></strong>满足上述"10人及以下"的定义即有11人或更多人可以访问、使用或受益于本软件<strong>必须</strong>联系我们获取并签署一份商业许可证才能使用
Cherry Studio。</li> Cherry Studio。
<li><strong>自愿选择:</strong> 即使您的组织满足"10人及以下"的条件,但如果您的使用场景<strong>无法满足 AGPLv3 </li>
的条款要求</strong>(特别是关于<strong>源代码公开</strong>的义务),或者您需要 AGPLv3 <strong>未提供</strong>的特定商业条款(如保证、赔偿、无 Copyleft <li>
限制等),您也<strong>必须</strong>联系我们获取并签署一份商业许可证。</li> <strong>自愿选择:</strong> 即使您的组织满足"10人及以下"的条件,但如果您的使用场景<strong
<li><strong>需要商业许可证的常见情况包括(但不限于):</strong> >无法满足 AGPLv3 的条款要求</strong
>(特别是关于<strong>源代码公开</strong>的义务),或者您需要 AGPLv3
<strong>未提供</strong>的特定商业条款(如保证、赔偿、无 Copyleft
限制等),您也<strong>必须</strong>联系我们获取并签署一份商业许可证。
</li>
<li>
<strong>需要商业许可证的常见情况包括(但不限于):</strong>
<ul class="list-disc pl-6 mt-2 space-y-1"> <ul class="list-disc pl-6 mt-2 space-y-1">
<li>您的组织规模超过10人。</li> <li>您的组织规模超过10人。</li>
<li>(无论组织规模)您希望分发修改过的 Cherry Studio 版本,但<strong>不希望</strong>根据 AGPLv3 公开您修改部分的源代码。</li> <li>
<li>(无论组织规模)您希望基于修改过的 Cherry Studio 提供网络服务SaaS<strong>不希望</strong>根据 AGPLv3 向服务使用者提供修改后的源代码。</li> (无论组织规模)您希望分发修改过的 Cherry Studio 版本,但<strong>不希望</strong>根据 AGPLv3
<li>(无论组织规模)您的公司政策、客户合同或项目要求不允许使用 AGPLv3 许可的软件,或要求闭源分发及保密。</li> 公开您修改部分的源代码。
</li>
<li>
(无论组织规模)您希望基于修改过的 Cherry Studio 提供网络服务SaaS<strong>不希望</strong>根据
AGPLv3 向服务使用者提供修改后的源代码。
</li>
<li>
(无论组织规模)您的公司政策、客户合同或项目要求不允许使用 AGPLv3 许可的软件,或要求闭源分发及保密。
</li>
</ul> </ul>
</li> </li>
<li><strong>获取商业许可:</strong> 请通过邮箱 <a href="mailto:bd@cherry-ai.com" <li>
class="text-blue-600 hover:underline">bd@cherry-ai.com</a> 联系 Cherry Studio 开发团队洽谈商业授权事宜。</li> <strong>获取商业许可:</strong> 请通过邮箱
<a href="mailto:bd@cherry-ai.com" class="text-blue-600 hover:underline">bd@cherry-ai.com</a> 联系 Cherry
Studio 开发团队洽谈商业授权事宜。
</li>
</ul> </ul>
</section> </section>
<section class="mb-8"> <section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">3. 贡献 (Contributions)</h2> <h2 class="text-xl font-semibold mb-4 text-gray-900">3. 贡献 (Contributions)</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700"> <ul class="list-disc pl-6 space-y-2 text-gray-700">
<li>我们欢迎社区对 Cherry Studio 的贡献。所有向本项目提交的贡献都将被视为在 <strong>AGPLv3</strong> 许可证下提供。</li> <li>
<li>通过向本项目提交贡献(例如通过 Pull Request即表示您同意您的代码以 AGPLv3 许可证授权给本项目及所有后续使用者(无论这些使用者最终遵循 AGPLv3 还是商业许可)。</li> 我们欢迎社区对 Cherry Studio 的贡献。所有向本项目提交的贡献都将被视为在
<strong>AGPLv3</strong> 许可证下提供。
</li>
<li>
通过向本项目提交贡献(例如通过 Pull Request即表示您同意您的代码以 AGPLv3
许可证授权给本项目及所有后续使用者(无论这些使用者最终遵循 AGPLv3 还是商业许可)。
</li>
<li>您也理解并同意,您的贡献可能会被包含在根据商业许可证分发的 Cherry Studio 版本中。</li> <li>您也理解并同意,您的贡献可能会被包含在根据商业许可证分发的 Cherry Studio 版本中。</li>
</ul> </ul>
</section> </section>
@ -82,12 +122,14 @@
<h2 class="text-xl font-semibold mb-4 text-gray-900">4. 其他条款 (Other Terms)</h2> <h2 class="text-xl font-semibold mb-4 text-gray-900">4. 其他条款 (Other Terms)</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700"> <ul class="list-disc pl-6 space-y-2 text-gray-700">
<li>关于商业许可证的具体条款和条件,以双方签署的正式商业许可协议为准。</li> <li>关于商业许可证的具体条款和条件,以双方签署的正式商业许可协议为准。</li>
<li>项目维护者保留根据需要更新本许可政策(包括用户规模定义和阈值)的权利。相关更新将通过项目官方渠道(如代码仓库、官方网站)进行通知。</li> <li>
项目维护者保留根据需要更新本许可政策(包括用户规模定义和阈值)的权利。相关更新将通过项目官方渠道(如代码仓库、官方网站)进行通知。
</li>
</ul> </ul>
</section> </section>
</div> </div>
<hr class="my-12 border-gray-300"> <hr class="my-12 border-gray-300" />
<!-- English Version --> <!-- English Version -->
<div> <div>
@ -98,9 +140,12 @@
<section class="mb-8"> <section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">Core Principle</h2> <h2 class="text-xl font-semibold mb-4 text-gray-900">Core Principle</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700"> <ul class="list-disc pl-6 space-y-2 text-gray-700">
<li><strong>Individual Users and Organizations with 10 or Fewer Individuals:</strong> Governed by default <li>
under the <strong>GNU Affero General Public License v3.0 (AGPLv3)</strong>.</li> <strong>Individual Users and Organizations with 10 or Fewer Individuals:</strong> Governed by default
<li><strong>Organizations with More Than 10 Individuals:</strong> <strong>Must</strong> obtain a under the <strong>GNU Affero General Public License v3.0 (AGPLv3)</strong>.
</li>
<li>
<strong>Organizations with More Than 10 Individuals:</strong> <strong>Must</strong> obtain a
<strong>Commercial License</strong>. <strong>Commercial License</strong>.
</li> </li>
</ul> </ul>
@ -110,90 +155,120 @@
<h2 class="text-xl font-semibold mb-4 text-gray-900">Definition: "10 or Fewer Individuals"</h2> <h2 class="text-xl font-semibold mb-4 text-gray-900">Definition: "10 or Fewer Individuals"</h2>
<p class="text-gray-700"> <p class="text-gray-700">
Refers to any organization (including companies, non-profits, government agencies, educational institutions, Refers to any organization (including companies, non-profits, government agencies, educational institutions,
etc.) where the total number of individuals who can access, use, or in any way directly or indirectly benefit etc.) where the total number of individuals who can access, use, or in any way directly or indirectly
from the functionality of this software (Cherry Studio) does not exceed 10. This includes, but is not limited benefit from the functionality of this software (Cherry Studio) does not exceed 10. This includes, but is
to, developers, testers, operations staff, end-users, and indirect users via integrated systems. not limited to, developers, testers, operations staff, end-users, and indirect users via integrated systems.
</p> </p>
</section> </section>
<section class="mb-8"> <section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">1. Open Source License: AGPLv3 - For Individuals and <h2 class="text-xl font-semibold mb-4 text-gray-900">
Organizations of 10 or Fewer</h2> 1. Open Source License: AGPLv3 - For Individuals and Organizations of 10 or Fewer
</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700"> <ul class="list-disc pl-6 space-y-2 text-gray-700">
<li>If you are an individual user, or if your organization meets the "10 or Fewer Individuals" definition <li>
If you are an individual user, or if your organization meets the "10 or Fewer Individuals" definition
above, you are free to use, modify, and distribute Cherry Studio under the terms of the above, you are free to use, modify, and distribute Cherry Studio under the terms of the
<strong>AGPLv3</strong>. The full text of the AGPLv3 can be found at <a <strong>AGPLv3</strong>. The full text of the AGPLv3 can be found at
href="https://www.gnu.org/licenses/agpl-3.0.html" <a href="https://www.gnu.org/licenses/agpl-3.0.html" class="text-blue-600 hover:underline"
class="text-blue-600 hover:underline">https://www.gnu.org/licenses/agpl-3.0.html</a>. >https://www.gnu.org/licenses/agpl-3.0.html</a
>.
</li>
<li>
<strong>Core Obligation:</strong> A key requirement of the AGPLv3 is that if you modify Cherry Studio and
make it available over a network, or distribute the modified version, you must provide the
<strong>complete corresponding source code</strong> under the AGPLv3 license to the recipients. Even if
you qualify under the "10 or Fewer Individuals" rule, if you wish to avoid this source code disclosure
obligation, you will need to obtain a Commercial License (see below).
</li> </li>
<li><strong>Core Obligation:</strong> A key requirement of the AGPLv3 is that if you modify Cherry Studio and
make it available over a network, or distribute the modified version, you must provide the <strong>complete
corresponding source code</strong> under the AGPLv3 license to the recipients. Even if you qualify under
the "10 or Fewer Individuals" rule, if you wish to avoid this source code disclosure obligation, you will
need to obtain a Commercial License (see below).</li>
<li>Please read and understand the full terms of the AGPLv3 carefully before use.</li> <li>Please read and understand the full terms of the AGPLv3 carefully before use.</li>
</ul> </ul>
</section> </section>
<section class="mb-8"> <section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">2. Commercial License - For Organizations with More Than 10 <h2 class="text-xl font-semibold mb-4 text-gray-900">
Individuals, or Users Needing to Avoid AGPLv3 Obligations</h2> 2. Commercial License - For Organizations with More Than 10 Individuals, or Users Needing to Avoid AGPLv3
Obligations
</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700"> <ul class="list-disc pl-6 space-y-2 text-gray-700">
<li><strong>Mandatory Requirement:</strong> If your organization does <strong>not</strong> meet the "10 or <li>
<strong>Mandatory Requirement:</strong> If your organization does <strong>not</strong> meet the "10 or
Fewer Individuals" definition above (i.e., 11 or more individuals can access, use, or benefit from the Fewer Individuals" definition above (i.e., 11 or more individuals can access, use, or benefit from the
software), you <strong>must</strong> contact us to obtain and execute a Commercial License to use Cherry software), you <strong>must</strong> contact us to obtain and execute a Commercial License to use Cherry
Studio.</li> Studio.
<li><strong>Voluntary Option:</strong> Even if your organization meets the "10 or Fewer Individuals" </li>
condition, if your intended use case <strong>cannot comply with the terms of the AGPLv3</strong> <li>
(particularly the obligations regarding <strong>source code disclosure</strong>), or if you require specific <strong>Voluntary Option:</strong> Even if your organization meets the "10 or Fewer Individuals"
commercial terms <strong>not offered</strong> by the AGPLv3 (such as warranties, indemnities, or freedom condition, if your intended use case
from copyleft restrictions), you also <strong>must</strong> contact us to obtain and execute a Commercial <strong>cannot comply with the terms of the AGPLv3</strong> (particularly the obligations regarding
License.</li> <strong>source code disclosure</strong>), or if you require specific commercial terms
<li><strong>Common scenarios requiring a Commercial License include (but are not limited to):</strong> <strong>not offered</strong> by the AGPLv3 (such as warranties, indemnities, or freedom from copyleft
restrictions), you also <strong>must</strong> contact us to obtain and execute a Commercial License.
</li>
<li>
<strong>Common scenarios requiring a Commercial License include (but are not limited to):</strong>
<ul class="list-disc pl-6 mt-2 space-y-1"> <ul class="list-disc pl-6 mt-2 space-y-1">
<li>Your organization has more than 10 individuals who can access, use, or benefit from the software.</li> <li>
<li>(Regardless of organization size) You wish to distribute a modified version of Cherry Studio but Your organization has more than 10 individuals who can access, use, or benefit from the software.
</li>
<li>
(Regardless of organization size) You wish to distribute a modified version of Cherry Studio but
<strong>do not want</strong> to disclose the source code of your modifications under AGPLv3. <strong>do not want</strong> to disclose the source code of your modifications under AGPLv3.
</li> </li>
<li>(Regardless of organization size) You wish to provide a network service (SaaS) based on a modified <li>
(Regardless of organization size) You wish to provide a network service (SaaS) based on a modified
version of Cherry Studio but <strong>do not want</strong> to provide the modified source code to users version of Cherry Studio but <strong>do not want</strong> to provide the modified source code to users
of the service under AGPLv3.</li> of the service under AGPLv3.
<li>(Regardless of organization size) Your corporate policies, client contracts, or project requirements </li>
prohibit the use of AGPLv3-licensed software or mandate closed-source distribution and confidentiality. <li>
(Regardless of organization size) Your corporate policies, client contracts, or project requirements
prohibit the use of AGPLv3-licensed software or mandate closed-source distribution and
confidentiality.
</li> </li>
</ul> </ul>
</li> </li>
<li><strong>Obtaining a Commercial License:</strong> Please contact the Cherry Studio development team via <li>
<strong>Obtaining a Commercial License:</strong> Please contact the Cherry Studio development team via
email at <a href="mailto:bd@cherry-ai.com" class="text-blue-600 hover:underline">bd@cherry-ai.com</a> to email at <a href="mailto:bd@cherry-ai.com" class="text-blue-600 hover:underline">bd@cherry-ai.com</a> to
discuss commercial licensing options.</li> discuss commercial licensing options.
</li>
</ul> </ul>
</section> </section>
<section class="mb-8"> <section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">3. Contributions</h2> <h2 class="text-xl font-semibold mb-4 text-gray-900">3. Contributions</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700"> <ul class="list-disc pl-6 space-y-2 text-gray-700">
<li>We welcome community contributions to Cherry Studio. All contributions submitted to this project are <li>
considered to be offered under the <strong>AGPLv3</strong> license.</li> We welcome community contributions to Cherry Studio. All contributions submitted to this project are
<li>By submitting a contribution to this project (e.g., via a Pull Request), you agree to license your code considered to be offered under the <strong>AGPLv3</strong> license.
</li>
<li>
By submitting a contribution to this project (e.g., via a Pull Request), you agree to license your code
under the AGPLv3 to the project and all its downstream users (regardless of whether those users ultimately under the AGPLv3 to the project and all its downstream users (regardless of whether those users ultimately
operate under AGPLv3 or a Commercial License).</li> operate under AGPLv3 or a Commercial License).
<li>You also understand and agree that your contribution may be included in distributions of Cherry Studio </li>
offered under our commercial license.</li> <li>
You also understand and agree that your contribution may be included in distributions of Cherry Studio
offered under our commercial license.
</li>
</ul> </ul>
</section> </section>
<section class="mb-8"> <section class="mb-8">
<h2 class="text-xl font-semibold mb-4 text-gray-900">4. Other Terms</h2> <h2 class="text-xl font-semibold mb-4 text-gray-900">4. Other Terms</h2>
<ul class="list-disc pl-6 space-y-2 text-gray-700"> <ul class="list-disc pl-6 space-y-2 text-gray-700">
<li>The specific terms and conditions of the Commercial License are governed by the formal commercial license <li>
agreement signed by both parties.</li> The specific terms and conditions of the Commercial License are governed by the formal commercial license
<li>The project maintainers reserve the right to update this licensing policy (including the definition and agreement signed by both parties.
</li>
<li>
The project maintainers reserve the right to update this licensing policy (including the definition and
threshold for user count) as needed. Updates will be communicated through official project channels (e.g., threshold for user count) as needed. Updates will be communicated through official project channels (e.g.,
code repository, official website).</li> code repository, official website).
</li>
</ul> </ul>
</section> </section>
</div> </div>
</div> </div>
</body> </body>
</html> </html>