Compare commits
No commits in common. "c5e7030dd199bdcdef95f61b5352f18a80df74d4" and "13e48411c1d29538b30141aa332b163ace2a899b" have entirely different histories.
c5e7030dd1
...
13e48411c1
@ -1,17 +0,0 @@
|
|||||||
diff --git a/src/csv-loader.js b/src/csv-loader.js
|
|
||||||
index b53938d5e763b9f31e928492966bac5ef2c2e9a6..ddd469865d68bc420fd14e5097ed77f350c448a7 100644
|
|
||||||
--- a/src/csv-loader.js
|
|
||||||
+++ b/src/csv-loader.js
|
|
||||||
@@ -23,8 +23,11 @@ export class CsvLoader extends BaseLoader {
|
|
||||||
const parser = parse(buffer, this.csvParseOptions);
|
|
||||||
this.debug('CSV parsing started...');
|
|
||||||
for await (const record of parser) {
|
|
||||||
+ const stringified = Object.entries(record)
|
|
||||||
+ .map(([key, value]) => `${key}: ${value}`)
|
|
||||||
+ .join("\n");
|
|
||||||
yield {
|
|
||||||
- pageContent: cleanString(record.join(',')),
|
|
||||||
+ pageContent: cleanString(stringified),
|
|
||||||
metadata: {
|
|
||||||
type: 'CsvLoader',
|
|
||||||
source: this.filePathOrUrl,
|
|
||||||
@ -117,8 +117,7 @@ For more detailed guidelines, please refer to our [Contributing Guide](./CONTRIB
|
|||||||
Thank you for your support and contributions!
|
Thank you for your support and contributions!
|
||||||
|
|
||||||
## Related Projects
|
## Related Projects
|
||||||
|
* [one-api](https://github.com/songquanpeng/one-api):LLM API management and distribution system, supporting mainstream models like OpenAI, Azure, and Anthropic. Features unified API interface, suitable for key management and secondary distribution.
|
||||||
- [one-api](https://github.com/songquanpeng/one-api):LLM API management and distribution system, supporting mainstream models like OpenAI, Azure, and Anthropic. Features unified API interface, suitable for key management and secondary distribution.
|
|
||||||
|
|
||||||
# 🚀 Contributors
|
# 🚀 Contributors
|
||||||
|
|
||||||
|
|||||||
@ -118,8 +118,7 @@ Cherry Studioへの貢献を歓迎します!以下の方法で貢献できま
|
|||||||
ご支援と貢献に感謝します!
|
ご支援と貢献に感謝します!
|
||||||
|
|
||||||
## 関連頁版
|
## 関連頁版
|
||||||
|
* [one-api](https://github.com/songquanpeng/one-api):LLM APIの管理・配信システム。OpenAI、Azure、Anthropicなどの主要モデルに対応し、統一APIインターフェースを提供。APIキー管理と再配布に利用可能。
|
||||||
- [one-api](https://github.com/songquanpeng/one-api):LLM APIの管理・配信システム。OpenAI、Azure、Anthropicなどの主要モデルに対応し、統一APIインターフェースを提供。APIキー管理と再配布に利用可能。
|
|
||||||
|
|
||||||
# 🚀 コントリビューター
|
# 🚀 コントリビューター
|
||||||
|
|
||||||
|
|||||||
@ -118,8 +118,7 @@ $ yarn build:linux
|
|||||||
感谢您的支持和贡献!
|
感谢您的支持和贡献!
|
||||||
|
|
||||||
## 相关项目
|
## 相关项目
|
||||||
|
* [one-api](https://github.com/songquanpeng/one-api):LLM API管理及分发系统,支持OpenAI、Azure、Anthropic等主流模型,统一API接口,可用于密钥管理与二次分发。
|
||||||
- [one-api](https://github.com/songquanpeng/one-api):LLM API管理及分发系统,支持OpenAI、Azure、Anthropic等主流模型,统一API接口,可用于密钥管理与二次分发。
|
|
||||||
|
|
||||||
# 🚀 贡献者
|
# 🚀 贡献者
|
||||||
|
|
||||||
|
|||||||
@ -20,8 +20,7 @@ export default defineConfig({
|
|||||||
'@llm-tools/embedjs-loader-xml',
|
'@llm-tools/embedjs-loader-xml',
|
||||||
'@llm-tools/embedjs-loader-pdf',
|
'@llm-tools/embedjs-loader-pdf',
|
||||||
'@llm-tools/embedjs-loader-sitemap',
|
'@llm-tools/embedjs-loader-sitemap',
|
||||||
'@llm-tools/embedjs-libsql',
|
'@llm-tools/embedjs-libsql'
|
||||||
'@llm-tools/embedjs-loader-image'
|
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
...visualizerPlugin('main')
|
...visualizerPlugin('main')
|
||||||
|
|||||||
@ -53,8 +53,7 @@
|
|||||||
"@google/generative-ai": "^0.21.0",
|
"@google/generative-ai": "^0.21.0",
|
||||||
"@llm-tools/embedjs": "patch:@llm-tools/embedjs@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-npm-0.1.28-8e4393fa2d.patch",
|
"@llm-tools/embedjs": "patch:@llm-tools/embedjs@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-npm-0.1.28-8e4393fa2d.patch",
|
||||||
"@llm-tools/embedjs-libsql": "^0.1.28",
|
"@llm-tools/embedjs-libsql": "^0.1.28",
|
||||||
"@llm-tools/embedjs-loader-csv": "patch:@llm-tools/embedjs-loader-csv@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-loader-csv-npm-0.1.28-a5dac8addd.patch",
|
"@llm-tools/embedjs-loader-csv": "^0.1.28",
|
||||||
"@llm-tools/embedjs-loader-image": "^0.1.28",
|
|
||||||
"@llm-tools/embedjs-loader-markdown": "patch:@llm-tools/embedjs-loader-markdown@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-loader-markdown-npm-0.1.28-81647ffac6.patch",
|
"@llm-tools/embedjs-loader-markdown": "patch:@llm-tools/embedjs-loader-markdown@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-loader-markdown-npm-0.1.28-81647ffac6.patch",
|
||||||
"@llm-tools/embedjs-loader-msoffice": "^0.1.28",
|
"@llm-tools/embedjs-loader-msoffice": "^0.1.28",
|
||||||
"@llm-tools/embedjs-loader-pdf": "^0.1.28",
|
"@llm-tools/embedjs-loader-pdf": "^0.1.28",
|
||||||
|
|||||||
@ -1,111 +1,118 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="zh-CN">
|
<html lang="zh-CN">
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>CherryStudio 许可协议-ZH/EN</title>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="bg-gray-100 p-8">
|
<head>
|
||||||
<div class="container mx-auto bg-white p-6 rounded shadow-lg">
|
<meta charset="UTF-8" />
|
||||||
<h1 class="text-3xl font-bold mb-6 text-center">Cherry Studio 许可协议</h1>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<div class="mb-8">
|
<title>CherryStudio 许可协议-ZH/EN</title>
|
||||||
<h2 class="text-2xl font-semibold mb-4">许可协议</h2>
|
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet" />
|
||||||
<p class="mb-4">
|
</head>
|
||||||
本软件采用 <strong>Apache License 2.0</strong> 许可。除 Apache License 2.0 规定的条款外,您在使用 Cherry
|
|
||||||
Studio 时还应遵守以下附加条款:
|
<body class="bg-gray-100 p-8">
|
||||||
</p>
|
<div class="container mx-auto bg-white p-6 rounded shadow-lg">
|
||||||
<h3 class="text-xl font-semibold mb-2">一. 商用许可</h3>
|
<h1 class="text-3xl font-bold mb-6 text-center">Cherry Studio 许可协议</h1>
|
||||||
<ol class="list-decimal list-inside mb-4">
|
<div class="mb-8">
|
||||||
<li><strong>免费商用</strong>:用户在不修改代码的情况下,可以免费用于商业目的。</li>
|
<h2 class="text-2xl font-semibold mb-4">许可协议</h2>
|
||||||
<li>
|
<p class="mb-4">
|
||||||
<strong>商业授权</strong>:如果您满足以下任意条件之一,需取得商业授权:
|
本软件采用 <strong>Apache License 2.0</strong> 许可。除 Apache License 2.0 规定的条款外,您在使用 Cherry
|
||||||
<ol class="list-decimal list-inside ml-4">
|
Studio 时还应遵守以下附加条款:
|
||||||
<li>对本软件进行二次修改、开发(包括但不限于修改应用名称、logo、代码以及功能)。</li>
|
</p>
|
||||||
<li>为企业客户提供多租户服务,且该服务支持 10 人或以上的使用。</li>
|
<h3 class="text-xl font-semibold mb-2">一. 商用许可</h3>
|
||||||
<li>预装或集成到硬件设备或产品中进行捆绑销售。</li>
|
<ol class="list-decimal list-inside mb-4">
|
||||||
<li>政府或教育机构的大规模采购项目,特别是涉及安全、数据隐私等敏感需求时。</li>
|
<li><strong>免费商用</strong>:用户在不修改代码的情况下,可以免费用于商业目的。</li>
|
||||||
</ol>
|
<li>
|
||||||
</li>
|
<strong>商业授权</strong>:如果您满足以下任意条件之一,需取得商业授权:
|
||||||
</ol>
|
<ol class="list-decimal list-inside ml-4">
|
||||||
<h3 class="text-xl font-semibold mb-2">二. 贡献者协议</h3>
|
<li>对本软件进行二次修改、开发(包括但不限于修改应用名称、logo、代码以及功能)。</li>
|
||||||
<ol class="list-decimal list-inside mb-4">
|
<li>为企业客户提供多租户服务,且该服务支持 10 人或以上的使用。</li>
|
||||||
<li><strong>许可调整</strong>:生产者有权根据需要对开源协议进行调整,使其更加严格或宽松。</li>
|
<li>预装或集成到硬件设备或产品中进行捆绑销售。</li>
|
||||||
<li><strong>商业用途</strong>:您贡献的代码可能会被用于商业用途,包括但不限于云业务运营。</li>
|
<li>政府或教育机构的大规模采购项目,特别是涉及安全、数据隐私等敏感需求时。</li>
|
||||||
</ol>
|
</ol>
|
||||||
<h3 class="text-xl font-semibold mb-2">三. 其他条款</h3>
|
</li>
|
||||||
<ol class="list-decimal list-inside mb-4">
|
</ol>
|
||||||
<li>本协议条款的解释权归 Cherry Studio 开发者所有。</li>
|
<h3 class="text-xl font-semibold mb-2">二. 贡献者协议</h3>
|
||||||
<li>本协议可能根据实际情况进行更新,更新时将通过本软件通知用户。</li>
|
<ol class="list-decimal list-inside mb-4">
|
||||||
</ol>
|
<li><strong>许可调整</strong>:生产者有权根据需要对开源协议进行调整,使其更加严格或宽松。</li>
|
||||||
<p class="mb-4">如有任何问题或需申请商业授权,请联系 Cherry Studio 开发团队。</p>
|
<li><strong>商业用途</strong>:您贡献的代码可能会被用于商业用途,包括但不限于云业务运营。</li>
|
||||||
<p>
|
</ol>
|
||||||
除上述特定条件外,其他所有权利和限制均遵循 Apache License 2.0。有关 Apache License 2.0 的详细信息,请访问
|
<h3 class="text-xl font-semibold mb-2">三. 其他条款</h3>
|
||||||
<a href="http://www.apache.org/licenses/LICENSE-2.0" class="text-blue-500 underline"
|
<ol class="list-decimal list-inside mb-4">
|
||||||
>http://www.apache.org/licenses/LICENSE-2.0</a
|
<li>本协议条款的解释权归 Cherry Studio 开发者所有。</li>
|
||||||
>
|
<li>本协议可能根据实际情况进行更新,更新时将通过本软件通知用户。</li>
|
||||||
</p>
|
</ol>
|
||||||
</div>
|
<p class="mb-4">如有任何问题或需申请商业授权,请联系 Cherry Studio 开发团队。</p>
|
||||||
<h1 class="text-3xl font-bold mb-6 text-center">Cherry Studio License</h1>
|
<p>
|
||||||
<div class="mb-8">
|
除上述特定条件外,其他所有权利和限制均遵循 Apache License 2.0。有关 Apache License 2.0 的详细信息,请访问
|
||||||
<h2 class="text-2xl font-semibold mb-4">License Agreement</h2>
|
<a href="http://www.apache.org/licenses/LICENSE-2.0"
|
||||||
<p class="mb-4">
|
class="text-blue-500 underline">http://www.apache.org/licenses/LICENSE-2.0</a>
|
||||||
This software is licensed under the <strong>Apache License 2.0</strong>. In addition to the terms of the
|
</p>
|
||||||
Apache License 2.0, the following additional terms apply to the use of Cherry Studio:
|
|
||||||
</p>
|
|
||||||
<h3 class="text-xl font-semibold mb-2">I. Commercial Use License</h3>
|
|
||||||
<ol class="list-decimal list-inside mb-4">
|
|
||||||
<li>
|
|
||||||
<strong>Free Commercial Use</strong>: Users can use the software for commercial purposes without modifying
|
|
||||||
the code.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<strong>Commercial License Required</strong>: A commercial license is required if any of the following
|
|
||||||
conditions are met:
|
|
||||||
<ol class="list-decimal list-inside ml-4">
|
|
||||||
<li>
|
|
||||||
You modify, develop, or alter the software, including but not limited to changes to the application
|
|
||||||
name, logo, code, or functionality.
|
|
||||||
</li>
|
|
||||||
<li>You provide multi-tenant services to enterprise customers with 10 or more users.</li>
|
|
||||||
<li>
|
|
||||||
You pre-install or integrate the software into hardware devices or products and bundle it for sale.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
You are engaging in large-scale procurement for government or educational institutions, especially
|
|
||||||
involving security, data privacy, or other sensitive requirements.
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
<h3 class="text-xl font-semibold mb-2">II. Contributor Agreement</h3>
|
|
||||||
<ol class="list-decimal list-inside mb-4">
|
|
||||||
<li>
|
|
||||||
<strong>License Adjustment</strong>: The producer reserves the right to adjust the open-source license as
|
|
||||||
needed, making it stricter or more lenient.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<strong>Commercial Use</strong>: Any code you contribute may be used for commercial purposes, including but
|
|
||||||
not limited to cloud business operations.
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
<h3 class="text-xl font-semibold mb-2">III. Other Terms</h3>
|
|
||||||
<ol class="list-decimal list-inside mb-4">
|
|
||||||
<li>The interpretation of these terms is subject to the discretion of Cherry Studio developers.</li>
|
|
||||||
<li>These terms may be updated, and users will be notified through the software when changes occur.</li>
|
|
||||||
</ol>
|
|
||||||
<p class="mb-4">
|
|
||||||
For any questions or to request a commercial license, please contact the Cherry Studio development team.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Apart from the specific conditions mentioned above, all other rights and restrictions follow the Apache
|
|
||||||
License 2.0. Detailed information about the Apache License 2.0 can be found at
|
|
||||||
<a href="http://www.apache.org/licenses/LICENSE-2.0" class="text-blue-500 underline"
|
|
||||||
>http://www.apache.org/licenses/LICENSE-2.0</a
|
|
||||||
>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
<h1 class="text-3xl font-bold mb-6 text-center">Cherry Studio License</h1>
|
||||||
</html>
|
<div class="mb-8">
|
||||||
|
<h2 class="text-2xl font-semibold mb-4">License Agreement</h2>
|
||||||
|
<p class="mb-4">
|
||||||
|
This software is licensed under the <strong>Apache License 2.0</strong>. In addition to the terms of the
|
||||||
|
Apache License 2.0, the following additional terms apply to the use of Cherry Studio:
|
||||||
|
</p>
|
||||||
|
<h3 class="text-xl font-semibold mb-2">I. Commercial Use License</h3>
|
||||||
|
<ol class="list-decimal list-inside mb-4">
|
||||||
|
<li>
|
||||||
|
<strong>Free Commercial Use</strong>: Users can use the software for commercial purposes without
|
||||||
|
modifying
|
||||||
|
the code.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Commercial License Required</strong>: A commercial license is required if any of the
|
||||||
|
following
|
||||||
|
conditions are met:
|
||||||
|
<ol class="list-decimal list-inside ml-4">
|
||||||
|
<li>
|
||||||
|
You modify, develop, or alter the software, including but not limited to changes to the
|
||||||
|
application
|
||||||
|
name, logo, code, or functionality.
|
||||||
|
</li>
|
||||||
|
<li>You provide multi-tenant services to enterprise customers with 10 or more users.</li>
|
||||||
|
<li>
|
||||||
|
You pre-install or integrate the software into hardware devices or products and bundle it
|
||||||
|
for sale.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
You are engaging in large-scale procurement for government or educational institutions,
|
||||||
|
especially
|
||||||
|
involving security, data privacy, or other sensitive requirements.
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
<h3 class="text-xl font-semibold mb-2">II. Contributor Agreement</h3>
|
||||||
|
<ol class="list-decimal list-inside mb-4">
|
||||||
|
<li>
|
||||||
|
<strong>License Adjustment</strong>: The producer reserves the right to adjust the open-source
|
||||||
|
license as
|
||||||
|
needed, making it stricter or more lenient.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Commercial Use</strong>: Any code you contribute may be used for commercial purposes,
|
||||||
|
including but
|
||||||
|
not limited to cloud business operations.
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
<h3 class="text-xl font-semibold mb-2">III. Other Terms</h3>
|
||||||
|
<ol class="list-decimal list-inside mb-4">
|
||||||
|
<li>The interpretation of these terms is subject to the discretion of Cherry Studio developers.</li>
|
||||||
|
<li>These terms may be updated, and users will be notified through the software when changes occur.</li>
|
||||||
|
</ol>
|
||||||
|
<p class="mb-4">
|
||||||
|
For any questions or to request a commercial license, please contact the Cherry Studio development team.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Apart from the specific conditions mentioned above, all other rights and restrictions follow the Apache
|
||||||
|
License 2.0. Detailed information about the Apache License 2.0 can be found at
|
||||||
|
<a href="http://www.apache.org/licenses/LICENSE-2.0"
|
||||||
|
class="text-blue-500 underline">http://www.apache.org/licenses/LICENSE-2.0</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@ -1,6 +1,7 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<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>Github Releases Timeline</title>
|
<title>Github Releases Timeline</title>
|
||||||
@ -8,201 +9,194 @@
|
|||||||
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
|
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/markdown-it@13.0.1/dist/markdown-it.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/markdown-it@13.0.1/dist/markdown-it.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/typography@0.5.10/dist/typography.min.css"></script>
|
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/typography@0.5.10/dist/typography.min.css"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="app">
|
<body id="app">
|
||||||
<div :class="isDark ? 'dark-bg' : 'bg'" class="min-h-screen">
|
<div :class="isDark ? 'dark-bg' : 'bg'" class="min-h-screen">
|
||||||
<div class="max-w-3xl mx-auto py-12 px-4">
|
<div class="max-w-3xl mx-auto py-12 px-4">
|
||||||
<h1 class="text-3xl font-bold mb-8" :class="isDark ? 'text-white' : 'text-gray-900'">Release Timeline</h1>
|
<h1 class="text-3xl font-bold mb-8" :class="isDark ? 'text-white' : 'text-gray-900'">Release Timeline</h1>
|
||||||
|
|
||||||
<!-- Loading状态 -->
|
<!-- Loading状态 -->
|
||||||
<div v-if="loading" class="text-center py-8">
|
<div v-if="loading" class="text-center py-8">
|
||||||
<div
|
<div class="inline-block animate-spin rounded-full h-8 w-8 border-4"
|
||||||
class="inline-block animate-spin rounded-full h-8 w-8 border-4"
|
:class="isDark ? 'border-gray-700 border-t-blue-500' : 'border-gray-300 border-t-blue-500'"></div>
|
||||||
:class="isDark ? 'border-gray-700 border-t-blue-500' : 'border-gray-300 border-t-blue-500'"></div>
|
</div>
|
||||||
</div>
|
|
||||||
|
<!-- Error 状态 -->
|
||||||
<!-- Error 状态 -->
|
<div v-else-if="error" class="text-red-500 text-center py-8">{{ error }}</div>
|
||||||
<div v-else-if="error" class="text-red-500 text-center py-8">{{ error }}</div>
|
|
||||||
|
<!-- Release 列表 -->
|
||||||
<!-- Release 列表 -->
|
<div v-else class="space-y-8">
|
||||||
<div v-else class="space-y-8">
|
<div v-for="release in releases" :key="release.id" class="relative pl-8"
|
||||||
<div
|
:class="isDark ? 'border-l-2 border-gray-700' : 'border-l-2 border-gray-200'">
|
||||||
v-for="release in releases"
|
<div class="absolute -left-2 top-0 w-4 h-4 rounded-full bg-green-500"></div>
|
||||||
:key="release.id"
|
<div class="rounded-lg shadow-sm p-6 transition-shadow"
|
||||||
class="relative pl-8"
|
:class="isDark ? 'bg-black hover:shadow-md hover:shadow-black' : 'bg-white hover:shadow-md'">
|
||||||
:class="isDark ? 'border-l-2 border-gray-700' : 'border-l-2 border-gray-200'">
|
<div class="flex items-start justify-between mb-4">
|
||||||
<div class="absolute -left-2 top-0 w-4 h-4 rounded-full bg-green-500"></div>
|
<div>
|
||||||
<div
|
<h2 class="text-xl font-semibold" :class="isDark ? 'text-white' : 'text-gray-900'">
|
||||||
class="rounded-lg shadow-sm p-6 transition-shadow"
|
{{ release.name || release.tag_name }}
|
||||||
:class="isDark ? 'bg-black hover:shadow-md hover:shadow-black' : 'bg-white hover:shadow-md'">
|
</h2>
|
||||||
<div class="flex items-start justify-between mb-4">
|
<p class="text-sm mt-1" :class="isDark ? 'text-gray-400' : 'text-gray-500'">
|
||||||
<div>
|
{{ formatDate(release.published_at) }}
|
||||||
<h2 class="text-xl font-semibold" :class="isDark ? 'text-white' : 'text-gray-900'">
|
</p>
|
||||||
{{ release.name || release.tag_name }}
|
</div>
|
||||||
</h2>
|
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium"
|
||||||
<p class="text-sm mt-1" :class="isDark ? 'text-gray-400' : 'text-gray-500'">
|
:class="isDark ? 'bg-green-900 text-green-200' : 'bg-green-100 text-green-800'">
|
||||||
{{ formatDate(release.published_at) }}
|
{{ release.tag_name }}
|
||||||
</p>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<span
|
<div class="prose" :class="isDark ? 'text-gray-300 dark-prose' : 'text-gray-600'"
|
||||||
class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium"
|
v-html="renderMarkdown(release.body)"></div>
|
||||||
:class="isDark ? 'bg-green-900 text-green-200' : 'bg-green-100 text-green-800'">
|
</div>
|
||||||
{{ release.tag_name }}
|
</div>
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="prose"
|
|
||||||
:class="isDark ? 'text-gray-300 dark-prose' : 'text-gray-600'"
|
|
||||||
v-html="renderMarkdown(release.body)"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const md = window.markdownit({
|
const md = window.markdownit({
|
||||||
breaks: true,
|
breaks: true,
|
||||||
linkify: true
|
linkify: true
|
||||||
})
|
})
|
||||||
|
|
||||||
const { createApp } = Vue
|
const { createApp } = Vue
|
||||||
|
|
||||||
createApp({
|
createApp({
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
releases: [],
|
releases: [],
|
||||||
loading: true,
|
loading: true,
|
||||||
error: null,
|
error: null,
|
||||||
isDark: false
|
isDark: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async fetchReleases() {
|
async fetchReleases() {
|
||||||
try {
|
try {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.error = null
|
this.error = null
|
||||||
const response = await fetch('https://api.github.com/repos/kangfenmao/cherry-studio/releases')
|
const response = await fetch('https://api.github.com/repos/kangfenmao/cherry-studio/releases')
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error('Failed to fetch releases')
|
throw new Error('Failed to fetch releases')
|
||||||
}
|
}
|
||||||
this.releases = await response.json()
|
this.releases = await response.json()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.error = 'Error loading releases: ' + err.message
|
this.error = 'Error loading releases: ' + err.message
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
formatDate(dateString) {
|
||||||
|
return new Date(dateString).toLocaleDateString('en-US', {
|
||||||
|
year: 'numeric',
|
||||||
|
month: 'long',
|
||||||
|
day: 'numeric'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
renderMarkdown(content) {
|
||||||
|
if (!content) return ''
|
||||||
|
return md.render(content)
|
||||||
|
},
|
||||||
|
initTheme() {
|
||||||
|
// 从 URL 参数获取主题设置
|
||||||
|
const url = new URL(window.location.href)
|
||||||
|
const theme = url.searchParams.get('theme')
|
||||||
|
this.isDark = theme === 'dark'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initTheme()
|
||||||
|
this.fetchReleases()
|
||||||
}
|
}
|
||||||
},
|
}).mount('#app')
|
||||||
formatDate(dateString) {
|
|
||||||
return new Date(dateString).toLocaleDateString('en-US', {
|
|
||||||
year: 'numeric',
|
|
||||||
month: 'long',
|
|
||||||
day: 'numeric'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
renderMarkdown(content) {
|
|
||||||
if (!content) return ''
|
|
||||||
return md.render(content)
|
|
||||||
},
|
|
||||||
initTheme() {
|
|
||||||
// 从 URL 参数获取主题设置
|
|
||||||
const url = new URL(window.location.href)
|
|
||||||
const theme = url.searchParams.get('theme')
|
|
||||||
this.isDark = theme === 'dark'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.initTheme()
|
|
||||||
this.fetchReleases()
|
|
||||||
}
|
|
||||||
}).mount('#app')
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/* 基础的 Markdown 样式 */
|
/* 基础的 Markdown 样式 */
|
||||||
.prose {
|
.prose {
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose h1 {
|
.prose h1 {
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose h2 {
|
.prose h2 {
|
||||||
font-size: 1.3em;
|
font-size: 1.3em;
|
||||||
margin: 0.8em 0;
|
margin: 0.8em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose h3 {
|
.prose h3 {
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
margin: 0.6em 0;
|
margin: 0.6em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose ul {
|
.prose ul {
|
||||||
list-style-type: disc;
|
list-style-type: disc;
|
||||||
margin-left: 1.5em;
|
margin-left: 1.5em;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose ol {
|
.prose ol {
|
||||||
list-style-type: decimal;
|
list-style-type: decimal;
|
||||||
margin-left: 1.5em;
|
margin-left: 1.5em;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose code {
|
.prose code {
|
||||||
padding: 0.2em 0.4em;
|
padding: 0.2em 0.4em;
|
||||||
border-radius: 0.2em;
|
border-radius: 0.2em;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark .prose code {
|
.dark .prose code {
|
||||||
background-color: #1f2937;
|
background-color: #1f2937;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose code {
|
.prose code {
|
||||||
background-color: #f3f4f6;
|
background-color: #f3f4f6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose pre code {
|
.prose pre code {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose a {
|
.prose a {
|
||||||
color: #3b82f6;
|
color: #3b82f6;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark .prose a {
|
.dark .prose a {
|
||||||
color: #60a5fa;
|
color: #60a5fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose blockquote {
|
.prose blockquote {
|
||||||
border-left: 4px solid #e5e7eb;
|
border-left: 4px solid #e5e7eb;
|
||||||
padding-left: 1em;
|
padding-left: 1em;
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark .prose blockquote {
|
.dark .prose blockquote {
|
||||||
border-left-color: #374151;
|
border-left-color: #374151;
|
||||||
color: #9ca3af;
|
color: #9ca3af;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark .prose {
|
.dark .prose {
|
||||||
color: #e5e7eb;
|
color: #e5e7eb;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark-bg {
|
.dark-bg {
|
||||||
background-color: #151515;
|
background-color: #151515;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg {
|
.bg {
|
||||||
background-color: #f2f2f2;
|
background-color: #f2f2f2;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
|
||||||
|
</html>
|
||||||
@ -120,7 +120,6 @@ class KnowledgeService {
|
|||||||
|
|
||||||
if (item.type === 'file') {
|
if (item.type === 'file') {
|
||||||
const file = item.content as FileType
|
const file = item.content as FileType
|
||||||
console.log(file)
|
|
||||||
|
|
||||||
if (file.ext === '.pdf') {
|
if (file.ext === '.pdf') {
|
||||||
return await ragApplication.addLoader(
|
return await ragApplication.addLoader(
|
||||||
@ -166,27 +165,6 @@ class KnowledgeService {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file.ext === '.csv') {
|
|
||||||
try {
|
|
||||||
const module = await import('@llm-tools/embedjs-loader-csv/src/index.js')
|
|
||||||
// 使用module中的功能
|
|
||||||
console.log(module.CsvLoader) // 假设模块导出了一个默认值
|
|
||||||
return await ragApplication.addLoader(
|
|
||||||
new module.CsvLoader({
|
|
||||||
filePathOrUrl: file.path,
|
|
||||||
chunkSize: base.chunkSize,
|
|
||||||
chunkOverlap: base.chunkOverlap,
|
|
||||||
csvParseOptions: {
|
|
||||||
columns: true
|
|
||||||
}
|
|
||||||
}) as any,
|
|
||||||
forceReload
|
|
||||||
)
|
|
||||||
} catch (error) {
|
|
||||||
console.error('加载模块时出错:', error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (['.md'].includes(file.ext)) {
|
if (['.md'].includes(file.ext)) {
|
||||||
return await ragApplication.addLoader(
|
return await ragApplication.addLoader(
|
||||||
new MarkdownLoader({
|
new MarkdownLoader({
|
||||||
|
|||||||
@ -1,41 +1,42 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="zh-CN">
|
<html lang="zh-CN">
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta name="viewport" content="initial-scale=1, width=device-width" />
|
|
||||||
<meta
|
|
||||||
http-equiv="Content-Security-Policy"
|
|
||||||
content="default-src 'self'; connect-src blob: *; script-src 'self' 'unsafe-eval' *; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' *; font-src 'self' data: *; img-src 'self' data: file: * blob:; frame-src * file:" />
|
|
||||||
|
|
||||||
<style>
|
<head>
|
||||||
html,
|
<meta charset="UTF-8" />
|
||||||
body {
|
<meta name="viewport" content="initial-scale=1, width=device-width" />
|
||||||
margin: 0;
|
<meta http-equiv="Content-Security-Policy"
|
||||||
}
|
content="default-src 'self'; connect-src blob: *; script-src 'self' 'unsafe-eval' *; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' *; font-src 'self' data: *; img-src 'self' data: file: * blob:; frame-src * file:" />
|
||||||
|
|
||||||
#spinner {
|
<style>
|
||||||
position: fixed;
|
html,
|
||||||
width: 100vw;
|
body {
|
||||||
height: 100vh;
|
margin: 0;
|
||||||
flex-direction: row;
|
}
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#spinner img {
|
#spinner {
|
||||||
width: 100px;
|
position: fixed;
|
||||||
border-radius: 50px;
|
width: 100vw;
|
||||||
}
|
height: 100vh;
|
||||||
</style>
|
flex-direction: row;
|
||||||
</head>
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
<body>
|
#spinner img {
|
||||||
<div id="root"></div>
|
width: 100px;
|
||||||
<div id="spinner">
|
border-radius: 50px;
|
||||||
<img src="/src/assets/images/logo.png" />
|
}
|
||||||
</div>
|
</style>
|
||||||
<script type="module" src="/src/init.ts"></script>
|
</head>
|
||||||
<script type="module" src="/src/main.tsx"></script>
|
|
||||||
</body>
|
<body>
|
||||||
</html>
|
<div id="root"></div>
|
||||||
|
<div id="spinner">
|
||||||
|
<img src="/src/assets/images/logo.png" />
|
||||||
|
</div>
|
||||||
|
<script type="module" src="/src/init.ts"></script>
|
||||||
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@ -95,14 +95,14 @@ export const Box = styled.div<BoxProps>`
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: ${(props) => props?.border || 'none'};
|
border: ${(props) => props?.border || 'none'};
|
||||||
gap: ${(p) => (p.gap ? getElementValue(p.gap) : 0)};
|
gap: ${(p) => (p.gap ? getElementValue(p.gap) : 0)};
|
||||||
margin: ${(props) => (props.m || props.margin ? (props.m ?? props.margin) : 'none')};
|
margin: ${(props) => (props.m || props.margin ? props.m ?? props.margin : 'none')};
|
||||||
margin-top: ${(props) => (props.mt || props.marginTop ? getElementValue(props.mt || props.marginTop) : 'default')};
|
margin-top: ${(props) => (props.mt || props.marginTop ? getElementValue(props.mt || props.marginTop) : 'default')};
|
||||||
margin-bottom: ${(props) =>
|
margin-bottom: ${(props) =>
|
||||||
props.mb || props.marginBottom ? getElementValue(props.mb ?? props.marginBottom) : 'default'};
|
props.mb || props.marginBottom ? getElementValue(props.mb ?? props.marginBottom) : 'default'};
|
||||||
margin-left: ${(props) => (props.ml || props.marginLeft ? getElementValue(props.ml ?? props.marginLeft) : 'default')};
|
margin-left: ${(props) => (props.ml || props.marginLeft ? getElementValue(props.ml ?? props.marginLeft) : 'default')};
|
||||||
margin-right: ${(props) =>
|
margin-right: ${(props) =>
|
||||||
props.mr || props.marginRight ? getElementValue(props.mr ?? props.marginRight) : 'default'};
|
props.mr || props.marginRight ? getElementValue(props.mr ?? props.marginRight) : 'default'};
|
||||||
padding: ${(props) => (props.p || props.padding ? (props.p ?? props.padding) : 'none')};
|
padding: ${(props) => (props.p || props.padding ? props.p ?? props.padding : 'none')};
|
||||||
padding-top: ${(props) => (props.pt || props.paddingTop ? getElementValue(props.pt ?? props.paddingTop) : 'auto')};
|
padding-top: ${(props) => (props.pt || props.paddingTop ? getElementValue(props.pt ?? props.paddingTop) : 'auto')};
|
||||||
padding-bottom: ${(props) =>
|
padding-bottom: ${(props) =>
|
||||||
props.pb || props.paddingBottom ? getElementValue(props.pb ?? props.paddingBottom) : 'auto'};
|
props.pb || props.paddingBottom ? getElementValue(props.pb ?? props.paddingBottom) : 'auto'};
|
||||||
|
|||||||
@ -222,10 +222,6 @@ export const EMBEDDING_MODELS = [
|
|||||||
{
|
{
|
||||||
id: 'embed-multilingual-v2.0',
|
id: 'embed-multilingual-v2.0',
|
||||||
max_context: 256
|
max_context: 256
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'text-embedding-004',
|
|
||||||
max_context: 2048
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -1191,12 +1191,7 @@ export function isWebSearchModel(model: Model): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (provider.id === 'aihubmix') {
|
if (provider.id === 'aihubmix') {
|
||||||
const models = [
|
return model?.id === 'gemini-2.0-flash-exp-search'
|
||||||
'gemini-2.0-flash-search',
|
|
||||||
'gemini-2.0-flash-exp-search',
|
|
||||||
'gemini-2.0-pro-exp-02-05-search'
|
|
||||||
]
|
|
||||||
return models.includes(model?.id)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (provider.id === 'zhipu') {
|
if (provider.id === 'zhipu') {
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
"title": "智能體"
|
"title": "智能體"
|
||||||
},
|
},
|
||||||
"assistants": {
|
"assistants": {
|
||||||
"abbr": "助手",
|
"abbr": "助",
|
||||||
"clear.content": "清空話題會刪除助手下所有主題和文件,確定要繼續嗎?",
|
"clear.content": "清空話題會刪除助手下所有主題和文件,確定要繼續嗎?",
|
||||||
"clear.title": "清空話題",
|
"clear.title": "清空話題",
|
||||||
"copy.title": "複製助手",
|
"copy.title": "複製助手",
|
||||||
@ -107,7 +107,7 @@
|
|||||||
"settings.set_as_default": "設為預設助手",
|
"settings.set_as_default": "設為預設助手",
|
||||||
"settings.show_line_numbers": "代码顯示行號",
|
"settings.show_line_numbers": "代码顯示行號",
|
||||||
"settings.temperature": "溫度",
|
"settings.temperature": "溫度",
|
||||||
"settings.temperature.tip": "模型產生文字的隨機程度。數值越高,回應內容越具多樣性、創意性及隨機性;設定為 0 則會依據事實回答。一般聊天建議設定為 0.7",
|
"settings.temperature.tip": "較低的值使模型更具創造性和不可預測性,較高的值則使其更具確定性和精確性。",
|
||||||
"settings.top_p": "Top-P",
|
"settings.top_p": "Top-P",
|
||||||
"settings.top_p.tip": "模型生成文本的隨機程度。值越小,AI 生成的內容越單調,也越容易理解;值越大,AI 回覆的詞彙範圍越大,越多樣化",
|
"settings.top_p.tip": "模型生成文本的隨機程度。值越小,AI 生成的內容越單調,也越容易理解;值越大,AI 回覆的詞彙範圍越大,越多樣化",
|
||||||
"suggestions.title": "建議的問題",
|
"suggestions.title": "建議的問題",
|
||||||
|
|||||||
@ -33,7 +33,7 @@ interface KnowledgeContentProps {
|
|||||||
selectedBase: KnowledgeBase
|
selectedBase: KnowledgeBase
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileTypes = ['.pdf', '.docx', '.pptx', '.xlsx', '.txt', '.md', '.html', '.csv']
|
const fileTypes = ['.pdf', '.docx', '.pptx', '.xlsx', '.txt', '.md', '.html']
|
||||||
|
|
||||||
const KnowledgeContent: FC<KnowledgeContentProps> = ({ selectedBase }) => {
|
const KnowledgeContent: FC<KnowledgeContentProps> = ({ selectedBase }) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|||||||
@ -1,144 +1,146 @@
|
|||||||
<!doctype html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
<head>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta charset="UTF-8">
|
||||||
<title>Selection Menu</title>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<style>
|
<title>Selection Menu</title>
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--bg-color: rgba(255, 255, 255, 0.95);
|
||||||
|
--button-bg: #f5f5f5;
|
||||||
|
--button-hover: #e8e8e8;
|
||||||
|
--text-color: #333;
|
||||||
|
--border-color: rgba(0, 0, 0, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
:root {
|
:root {
|
||||||
--bg-color: rgba(255, 255, 255, 0.95);
|
--bg-color: rgba(80, 80, 80, 0.95);
|
||||||
--button-bg: #f5f5f5;
|
--button-bg: #2c2c2c;
|
||||||
--button-hover: #e8e8e8;
|
--button-hover: #383838;
|
||||||
--text-color: #333;
|
--text-color: #e0e0e0;
|
||||||
--border-color: rgba(0, 0, 0, 0.06);
|
--border-color: rgba(255, 255, 255, 0.08);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
* {
|
||||||
:root {
|
margin: 0;
|
||||||
--bg-color: rgba(80, 80, 80, 0.95);
|
padding: 0;
|
||||||
--button-bg: #2c2c2c;
|
box-sizing: border-box;
|
||||||
--button-hover: #383838;
|
user-select: none;
|
||||||
--text-color: #e0e0e0;
|
}
|
||||||
--border-color: rgba(255, 255, 255, 0.08);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
* {
|
body {
|
||||||
margin: 0;
|
width: 280px;
|
||||||
padding: 0;
|
height: 40px;
|
||||||
box-sizing: border-box;
|
background: var(--bg-color);
|
||||||
user-select: none;
|
overflow: hidden;
|
||||||
}
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
.drag-handle {
|
||||||
width: 280px;
|
width: 20px;
|
||||||
height: 40px;
|
height: 100%;
|
||||||
background: var(--bg-color);
|
display: flex;
|
||||||
overflow: hidden;
|
align-items: center;
|
||||||
display: flex;
|
justify-content: center;
|
||||||
align-items: center;
|
gap: 2px;
|
||||||
}
|
-webkit-app-region: drag;
|
||||||
|
}
|
||||||
|
|
||||||
.drag-handle {
|
.drag-handle::before,
|
||||||
width: 20px;
|
.drag-handle::after {
|
||||||
height: 100%;
|
content: '';
|
||||||
display: flex;
|
width: 2px;
|
||||||
align-items: center;
|
height: 16px;
|
||||||
justify-content: center;
|
background-color: var(--border-color);
|
||||||
gap: 2px;
|
border-radius: 1px;
|
||||||
-webkit-app-region: drag;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.drag-handle::before,
|
menu {
|
||||||
.drag-handle::after {
|
display: flex;
|
||||||
content: '';
|
align-items: center;
|
||||||
width: 2px;
|
height: 40px;
|
||||||
height: 16px;
|
flex: 1;
|
||||||
background-color: var(--border-color);
|
margin-right: 10px;
|
||||||
border-radius: 1px;
|
gap: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
menu {
|
button {
|
||||||
display: flex;
|
flex: 1;
|
||||||
align-items: center;
|
min-width: 0;
|
||||||
height: 40px;
|
height: 32px;
|
||||||
flex: 1;
|
border: none;
|
||||||
margin-right: 10px;
|
background: transparent;
|
||||||
gap: 5px;
|
border-radius: 6px;
|
||||||
}
|
cursor: pointer;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--text-color);
|
||||||
|
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 4px;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
button {
|
button:hover {
|
||||||
flex: 1;
|
background: var(--button-hover);
|
||||||
min-width: 0;
|
}
|
||||||
height: 32px;
|
|
||||||
border: none;
|
|
||||||
background: transparent;
|
|
||||||
border-radius: 6px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--text-color);
|
|
||||||
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 4px;
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
button:hover {
|
button:active {
|
||||||
background: var(--button-hover);
|
transform: scale(0.95);
|
||||||
}
|
}
|
||||||
|
|
||||||
button:active {
|
svg {
|
||||||
transform: scale(0.95);
|
width: 16px;
|
||||||
}
|
height: 16px;
|
||||||
|
fill: currentColor;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
svg {
|
<body>
|
||||||
width: 16px;
|
<div class="drag-handle"></div>
|
||||||
height: 16px;
|
<menu>
|
||||||
fill: currentColor;
|
<button data-action="chat">
|
||||||
}
|
<svg viewBox="0 0 24 24">
|
||||||
</style>
|
<path d="M20,2H4C2.9,2,2,2.9,2,4v18l4-4h14c1.1,0,2-0.9,2-2V4C22,2.9,21.1,2,20,2z M20,16H6l-2,2V4h16V16z" />
|
||||||
</head>
|
</svg>
|
||||||
|
提问
|
||||||
|
</button>
|
||||||
|
<button data-action="explanation">
|
||||||
|
<svg viewBox="0 0 24 24">
|
||||||
|
<path
|
||||||
|
d="M12,2C6.48,2,2,6.48,2,12s4.48,10,10,10s10-4.48,10-10S17.52,2,12,2z M13,17h-2v-6h2V17z M13,9h-2V7h2V9z" />
|
||||||
|
</svg>
|
||||||
|
释义
|
||||||
|
</button>
|
||||||
|
<button data-action="translate">
|
||||||
|
<svg viewBox="0 0 24 24">
|
||||||
|
<path d="M6 4h12v2H6zM6 10h12v2H6zM6 16h8v2H6z" />
|
||||||
|
</svg>
|
||||||
|
翻译
|
||||||
|
</button>
|
||||||
|
<button data-action="summary">
|
||||||
|
<svg viewBox="0 0 24 24">
|
||||||
|
<path d="M14,17H4v2h10V17z M20,9H4v2h16V9z M4,15h16v-2H4V15z M4,5v2h16V5H4z" />
|
||||||
|
</svg>
|
||||||
|
总结
|
||||||
|
</button>
|
||||||
|
</menu>
|
||||||
|
|
||||||
<body>
|
<script>
|
||||||
<div class="drag-handle"></div>
|
document.querySelectorAll('button').forEach(button => {
|
||||||
<menu>
|
button.addEventListener('click', () => {
|
||||||
<button data-action="chat">
|
const action = button.getAttribute('data-action')
|
||||||
<svg viewBox="0 0 24 24">
|
window.api.selectionMenu.action(action)
|
||||||
<path d="M20,2H4C2.9,2,2,2.9,2,4v18l4-4h14c1.1,0,2-0.9,2-2V4C22,2.9,21.1,2,20,2z M20,16H6l-2,2V4h16V16z" />
|
|
||||||
</svg>
|
|
||||||
提问
|
|
||||||
</button>
|
|
||||||
<button data-action="explanation">
|
|
||||||
<svg viewBox="0 0 24 24">
|
|
||||||
<path
|
|
||||||
d="M12,2C6.48,2,2,6.48,2,12s4.48,10,10,10s10-4.48,10-10S17.52,2,12,2z M13,17h-2v-6h2V17z M13,9h-2V7h2V9z" />
|
|
||||||
</svg>
|
|
||||||
释义
|
|
||||||
</button>
|
|
||||||
<button data-action="translate">
|
|
||||||
<svg viewBox="0 0 24 24">
|
|
||||||
<path d="M6 4h12v2H6zM6 10h12v2H6zM6 16h8v2H6z" />
|
|
||||||
</svg>
|
|
||||||
翻译
|
|
||||||
</button>
|
|
||||||
<button data-action="summary">
|
|
||||||
<svg viewBox="0 0 24 24">
|
|
||||||
<path d="M14,17H4v2h10V17z M20,9H4v2h16V9z M4,15h16v-2H4V15z M4,5v2h16V5H4z" />
|
|
||||||
</svg>
|
|
||||||
总结
|
|
||||||
</button>
|
|
||||||
</menu>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
document.querySelectorAll('button').forEach((button) => {
|
|
||||||
button.addEventListener('click', () => {
|
|
||||||
const action = button.getAttribute('data-action')
|
|
||||||
window.api.selectionMenu.action(action)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
</script>
|
})
|
||||||
</body>
|
</script>
|
||||||
</html>
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
41
yarn.lock
41
yarn.lock
@ -1518,7 +1518,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@llm-tools/embedjs-loader-csv@npm:0.1.28":
|
"@llm-tools/embedjs-loader-csv@npm:^0.1.28":
|
||||||
version: 0.1.28
|
version: 0.1.28
|
||||||
resolution: "@llm-tools/embedjs-loader-csv@npm:0.1.28"
|
resolution: "@llm-tools/embedjs-loader-csv@npm:0.1.28"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -1531,35 +1531,6 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@llm-tools/embedjs-loader-csv@patch:@llm-tools/embedjs-loader-csv@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-loader-csv-npm-0.1.28-a5dac8addd.patch":
|
|
||||||
version: 0.1.28
|
|
||||||
resolution: "@llm-tools/embedjs-loader-csv@patch:@llm-tools/embedjs-loader-csv@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-loader-csv-npm-0.1.28-a5dac8addd.patch::version=0.1.28&hash=c89b03"
|
|
||||||
dependencies:
|
|
||||||
"@llm-tools/embedjs-interfaces": "npm:0.1.28"
|
|
||||||
"@llm-tools/embedjs-utils": "npm:0.1.28"
|
|
||||||
csv-parse: "npm:^5.6.0"
|
|
||||||
debug: "npm:^4.4.0"
|
|
||||||
md5: "npm:^2.3.0"
|
|
||||||
checksum: 10c0/ed1e6f498293bfaa33e9fa7d1ad9cf916c39fc84e2cf29597be4e134913968e4a75017b081baaea6c550cf5910ea57ff5db3dccde5afe2b1c05b3bba741d384e
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"@llm-tools/embedjs-loader-image@npm:^0.1.28":
|
|
||||||
version: 0.1.28
|
|
||||||
resolution: "@llm-tools/embedjs-loader-image@npm:0.1.28"
|
|
||||||
dependencies:
|
|
||||||
"@langchain/core": "npm:^0.3.26"
|
|
||||||
"@llm-tools/embedjs-interfaces": "npm:0.1.28"
|
|
||||||
"@llm-tools/embedjs-utils": "npm:0.1.28"
|
|
||||||
debug: "npm:^4.4.0"
|
|
||||||
exifremove: "npm:^1.0.1"
|
|
||||||
md5: "npm:^2.3.0"
|
|
||||||
mime: "npm:^4.0.6"
|
|
||||||
stream-mime-type: "npm:^2.0.0"
|
|
||||||
checksum: 10c0/e9414dde0d10afe1541bfe464b80f5cb61ec523f28dce62ab931a3f4ffde93c5589fde8e7a7f5751e7dc20d68fe2d28883925ba65e2542ee9d43002591568af1
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"@llm-tools/embedjs-loader-markdown@npm:0.1.28":
|
"@llm-tools/embedjs-loader-markdown@npm:0.1.28":
|
||||||
version: 0.1.28
|
version: 0.1.28
|
||||||
resolution: "@llm-tools/embedjs-loader-markdown@npm:0.1.28"
|
resolution: "@llm-tools/embedjs-loader-markdown@npm:0.1.28"
|
||||||
@ -3000,8 +2971,7 @@ __metadata:
|
|||||||
"@kangfenmao/keyv-storage": "npm:^0.1.0"
|
"@kangfenmao/keyv-storage": "npm:^0.1.0"
|
||||||
"@llm-tools/embedjs": "patch:@llm-tools/embedjs@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-npm-0.1.28-8e4393fa2d.patch"
|
"@llm-tools/embedjs": "patch:@llm-tools/embedjs@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-npm-0.1.28-8e4393fa2d.patch"
|
||||||
"@llm-tools/embedjs-libsql": "npm:^0.1.28"
|
"@llm-tools/embedjs-libsql": "npm:^0.1.28"
|
||||||
"@llm-tools/embedjs-loader-csv": "patch:@llm-tools/embedjs-loader-csv@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-loader-csv-npm-0.1.28-a5dac8addd.patch"
|
"@llm-tools/embedjs-loader-csv": "npm:^0.1.28"
|
||||||
"@llm-tools/embedjs-loader-image": "npm:^0.1.28"
|
|
||||||
"@llm-tools/embedjs-loader-markdown": "patch:@llm-tools/embedjs-loader-markdown@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-loader-markdown-npm-0.1.28-81647ffac6.patch"
|
"@llm-tools/embedjs-loader-markdown": "patch:@llm-tools/embedjs-loader-markdown@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-loader-markdown-npm-0.1.28-81647ffac6.patch"
|
||||||
"@llm-tools/embedjs-loader-msoffice": "npm:^0.1.28"
|
"@llm-tools/embedjs-loader-msoffice": "npm:^0.1.28"
|
||||||
"@llm-tools/embedjs-loader-pdf": "npm:^0.1.28"
|
"@llm-tools/embedjs-loader-pdf": "npm:^0.1.28"
|
||||||
@ -5975,13 +5945,6 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"exifremove@npm:^1.0.1":
|
|
||||||
version: 1.0.1
|
|
||||||
resolution: "exifremove@npm:1.0.1"
|
|
||||||
checksum: 10c0/df5a30087b262a35f2932e4d8b567206ec5f39518740c1552361e9a6eee0a38819359bd8ab2bd5df391647c4dea8d572995852f355cf8fc504df6b1685d82921
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"expand-template@npm:^2.0.3":
|
"expand-template@npm:^2.0.3":
|
||||||
version: 2.0.3
|
version: 2.0.3
|
||||||
resolution: "expand-template@npm:2.0.3"
|
resolution: "expand-template@npm:2.0.3"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user