Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: AI Agent https://github.com/siyuan-note/siyuan/issues/17797

Daniela0f0d6872ba2
diff --git a/app/appearance/langs/ar_SA.json b/app/appearance/langs/ar_SA.json
index 605520c21e..11c6243744 100644
--- a/app/appearance/langs/ar_SA.json
+++ b/app/appearance/langs/ar_SA.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "الحد الأقصى لمحاولات إعادة طلب API عند الفشل",
"agentThinkingAnalyzing": "جاري تحليل طلبك...",
"agentThinkingProcessing": "جاري معالجة النتائج...",
+ "agentThinkingAnalyzed": "تم تحليل طلبك...",
+ "agentThinkingProcessed": "تم معالجة النتائج...",
"agentChat": "وكيل",
"agentQuestionSubmit": "إرسال",
"agentQuestionCustom": "اكتب إجابتك...",
diff --git a/app/appearance/langs/de_DE.json b/app/appearance/langs/de_DE.json
index a1f061dd5b..0f6b4442f5 100644
--- a/app/appearance/langs/de_DE.json
+++ b/app/appearance/langs/de_DE.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "Maximale API-Wiederholungsversuche bei Fehler",
"agentThinkingAnalyzing": "Anfrage wird analysiert...",
"agentThinkingProcessing": "Ergebnisse werden verarbeitet...",
+ "agentThinkingAnalyzed": "Anfrage analysiert...",
+ "agentThinkingProcessed": "Ergebnisse verarbeitet...",
"agentChat": "Agent",
"agentQuestionSubmit": "Senden",
"agentQuestionCustom": "Eigene Antwort eingeben...",
diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json
index a038f82e88..abebb3a8f3 100644
--- a/app/appearance/langs/en_US.json
+++ b/app/appearance/langs/en_US.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "Max API retry attempts on failure",
"agentThinkingAnalyzing": "Analyzing your request...",
"agentThinkingProcessing": "Processing results...",
+ "agentThinkingAnalyzed": "Analyzed your request...",
+ "agentThinkingProcessed": "Processed results...",
"agentChat": "Agent",
"agentQuestionSubmit": "Submit",
"agentQuestionCustom": "Type your own answer...",
diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json
index 382ec6c0c1..69e4d5d2a8 100644
--- a/app/appearance/langs/es_ES.json
+++ b/app/appearance/langs/es_ES.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "Reintentos máximos de la API en caso de error",
"agentThinkingAnalyzing": "Analizando tu solicitud...",
"agentThinkingProcessing": "Procesando resultados...",
+ "agentThinkingAnalyzed": "Solicitud analizada...",
+ "agentThinkingProcessed": "Resultados procesados...",
"agentChat": "Agente",
"agentQuestionSubmit": "Enviar",
"agentQuestionCustom": "Escribir respuesta...",
diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json
index 352667b4ac..967add590e 100644
--- a/app/appearance/langs/fr_FR.json
+++ b/app/appearance/langs/fr_FR.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "Nombre max. de tentatives API en cas d'échec",
"agentThinkingAnalyzing": "Analyse de votre demande...",
"agentThinkingProcessing": "Traitement des résultats...",
+ "agentThinkingAnalyzed": "Demande analysée...",
+ "agentThinkingProcessed": "Résultats traités...",
"agentChat": "Agent",
"agentQuestionSubmit": "Envoyer",
"agentQuestionCustom": "Saisir votre réponse...",
diff --git a/app/appearance/langs/he_IL.json b/app/appearance/langs/he_IL.json
index 33d074b823..e16e7fa0c6 100644
--- a/app/appearance/langs/he_IL.json
+++ b/app/appearance/langs/he_IL.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "מקסימום ניסיונות חוזרים של API בכשלון",
"agentThinkingAnalyzing": "מנתח את הבקשה שלך...",
"agentThinkingProcessing": "מעבד תוצאות...",
+ "agentThinkingAnalyzed": "הבקשה נותחה...",
+ "agentThinkingProcessed": "תוצאות עובדו...",
"agentChat": "סוכן",
"agentQuestionSubmit": "שלח",
"agentQuestionCustom": "הקלד תשובה...",
diff --git a/app/appearance/langs/hi_IN.json b/app/appearance/langs/hi_IN.json
index 7d3847901f..e0a3ab109c 100644
--- a/app/appearance/langs/hi_IN.json
+++ b/app/appearance/langs/hi_IN.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "विफलता पर API के अधिकतम पुनः प्रयास",
"agentThinkingAnalyzing": "आपके अनुरोध का विश्लेषण...",
"agentThinkingProcessing": "परिणाम संसाधित कर रहा है...",
+ "agentThinkingAnalyzed": "आपके अनुरोध का विश्लेषण पूर्ण...",
+ "agentThinkingProcessed": "परिणाम संसाधित...",
"agentChat": "एजेंट",
"agentQuestionSubmit": "जमा करें",
"agentQuestionCustom": "अपना उत्तर लिखें...",
diff --git a/app/appearance/langs/id_ID.json b/app/appearance/langs/id_ID.json
index 1c7f8a9b8e..1ad63696e9 100644
--- a/app/appearance/langs/id_ID.json
+++ b/app/appearance/langs/id_ID.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "Percobaan ulang API maksimum saat gagal",
"agentThinkingAnalyzing": "Menganalisis permintaan Anda...",
"agentThinkingProcessing": "Memproses hasil...",
+ "agentThinkingAnalyzed": "Permintaan Anda dianalisis...",
+ "agentThinkingProcessed": "Hasil diproses...",
"agentChat": "Agen",
"agentQuestionSubmit": "Kirim",
"agentQuestionCustom": "Ketik jawaban Anda...",
diff --git a/app/appearance/langs/it_IT.json b/app/appearance/langs/it_IT.json
index 51dac00059..8042a79669 100644
--- a/app/appearance/langs/it_IT.json
+++ b/app/appearance/langs/it_IT.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "Tentativi massimi API in caso di errore",
"agentThinkingAnalyzing": "Analisi della richiesta...",
"agentThinkingProcessing": "Elaborazione risultati...",
+ "agentThinkingAnalyzed": "Richiesta analizzata...",
+ "agentThinkingProcessed": "Risultati elaborati...",
"agentChat": "Agente",
"agentQuestionSubmit": "Invia",
"agentQuestionCustom": "Scrivi la tua risposta...",
diff --git a/app/appearance/langs/ja_JP.json b/app/appearance/langs/ja_JP.json
index 5f5c4d01a8..c1ddf495b6 100644
--- a/app/appearance/langs/ja_JP.json
+++ b/app/appearance/langs/ja_JP.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "API リクエスト失敗時の最大リトライ回数",
"agentThinkingAnalyzing": "リクエストを分析中...",
"agentThinkingProcessing": "結果を処理中...",
+ "agentThinkingAnalyzed": "リクエストを分析済み...",
+ "agentThinkingProcessed": "結果を処理済み...",
"agentChat": "エージェント",
"agentQuestionSubmit": "送信",
"agentQuestionCustom": "自由回答を入力...",
diff --git a/app/appearance/langs/ko_KR.json b/app/appearance/langs/ko_KR.json
index 0e0a604fbd..820e23156c 100644
--- a/app/appearance/langs/ko_KR.json
+++ b/app/appearance/langs/ko_KR.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "API 요청 실패 시 최대 재시도 횟수",
"agentThinkingAnalyzing": "요청 분석 중...",
"agentThinkingProcessing": "결과 처리 중...",
+ "agentThinkingAnalyzed": "요청 분석 완료...",
+ "agentThinkingProcessed": "결과 처리 완료...",
"agentChat": "에이전트",
"agentQuestionSubmit": "제출",
"agentQuestionCustom": "직접 입력...",
diff --git a/app/appearance/langs/nl_NL.json b/app/appearance/langs/nl_NL.json
index e5ff192052..2a62c27ea8 100644
--- a/app/appearance/langs/nl_NL.json
+++ b/app/appearance/langs/nl_NL.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "Max. API-herhalingspogingen bij fout",
"agentThinkingAnalyzing": "Verzoek analyseren...",
"agentThinkingProcessing": "Resultaten verwerken...",
+ "agentThinkingAnalyzed": "Verzoek geanalyseerd...",
+ "agentThinkingProcessed": "Resultaten verwerkt...",
"agentChat": "Agent",
"agentQuestionSubmit": "Verzenden",
"agentQuestionCustom": "Typ je antwoord...",
diff --git a/app/appearance/langs/pl_PL.json b/app/appearance/langs/pl_PL.json
index f654dd4c35..48eb7250c4 100644
--- a/app/appearance/langs/pl_PL.json
+++ b/app/appearance/langs/pl_PL.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "Maks. liczba ponownych prób API przy błędzie",
"agentThinkingAnalyzing": "Analizowanie żądania...",
"agentThinkingProcessing": "Przetwarzanie wyników...",
+ "agentThinkingAnalyzed": "Żądanie przeanalizowane...",
+ "agentThinkingProcessed": "Wyniki przetworzone...",
"agentChat": "Agent",
"agentQuestionSubmit": "Wyślij",
"agentQuestionCustom": "Wpisz odpowiedź...",
diff --git a/app/appearance/langs/pt_BR.json b/app/appearance/langs/pt_BR.json
index 0c8ef6ca38..6aa47e8499 100644
--- a/app/appearance/langs/pt_BR.json
+++ b/app/appearance/langs/pt_BR.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "Tentativas máximas da API em caso de falha",
"agentThinkingAnalyzing": "Analisando sua solicitação...",
"agentThinkingProcessing": "Processando resultados...",
+ "agentThinkingAnalyzed": "Solicitação analisada...",
+ "agentThinkingProcessed": "Resultados processados...",
"agentChat": "Agente",
"agentQuestionSubmit": "Enviar",
"agentQuestionCustom": "Digite sua resposta...",
diff --git a/app/appearance/langs/ru_RU.json b/app/appearance/langs/ru_RU.json
index 7ef24bb9be..18faa1746b 100644
--- a/app/appearance/langs/ru_RU.json
+++ b/app/appearance/langs/ru_RU.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "Макс. повторных попыток API при сбое",
"agentThinkingAnalyzing": "Анализ запроса...",
"agentThinkingProcessing": "Обработка результатов...",
+ "agentThinkingAnalyzed": "Запрос проанализирован...",
+ "agentThinkingProcessed": "Результаты обработаны...",
"agentChat": "Агент",
"agentQuestionSubmit": "Отправить",
"agentQuestionCustom": "Введите свой ответ...",
diff --git a/app/appearance/langs/sk_SK.json b/app/appearance/langs/sk_SK.json
index 97aacb0e88..74dfcd6d52 100644
--- a/app/appearance/langs/sk_SK.json
+++ b/app/appearance/langs/sk_SK.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "Max. počet opakovaných pokusov API pri chybe",
"agentThinkingAnalyzing": "Analyzovanie požiadavky...",
"agentThinkingProcessing": "Spracovanie výsledkov...",
+ "agentThinkingAnalyzed": "Požiadavka analyzovaná...",
+ "agentThinkingProcessed": "Výsledky spracované...",
"agentChat": "Agent",
"agentQuestionSubmit": "Odoslať",
"agentQuestionCustom": "Napíšte odpoveď...",
diff --git a/app/appearance/langs/th_TH.json b/app/appearance/langs/th_TH.json
index 2290a51e54..6bbb750fcc 100644
--- a/app/appearance/langs/th_TH.json
+++ b/app/appearance/langs/th_TH.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "จำนวนครั้งสูงสุดในการลอง API ใหม่เมื่อล้มเหลว",
"agentThinkingAnalyzing": "กำลังวิเคราะห์คำขอ...",
"agentThinkingProcessing": "กำลังประมวลผล...",
+ "agentThinkingAnalyzed": "วิเคราะห์คำขอแล้ว...",
+ "agentThinkingProcessed": "ประมวลผลแล้ว...",
"agentChat": "เอเจนต์",
"agentQuestionSubmit": "ส่ง",
"agentQuestionCustom": "พิมพ์คำตอบของคุณ...",
diff --git a/app/appearance/langs/tr_TR.json b/app/appearance/langs/tr_TR.json
index a32d857c43..9cf480d552 100644
--- a/app/appearance/langs/tr_TR.json
+++ b/app/appearance/langs/tr_TR.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "Hata durumunda maks. API yeniden deneme sayısı",
"agentThinkingAnalyzing": "İsteğiniz analiz ediliyor...",
"agentThinkingProcessing": "Sonuçlar işleniyor...",
+ "agentThinkingAnalyzed": "İsteğiniz analiz edildi...",
+ "agentThinkingProcessed": "Sonuçlar işlendi...",
"agentChat": "Ajan",
"agentQuestionSubmit": "Gönder",
"agentQuestionCustom": "Cevabınızı yazın...",
diff --git a/app/appearance/langs/uk_UA.json b/app/appearance/langs/uk_UA.json
index ca74835ae2..1c5f2c026e 100644
--- a/app/appearance/langs/uk_UA.json
+++ b/app/appearance/langs/uk_UA.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "Макс. повторних спроб API при збої",
"agentThinkingAnalyzing": "Аналіз запиту...",
"agentThinkingProcessing": "Обробка результатів...",
+ "agentThinkingAnalyzed": "Запит проаналізовано...",
+ "agentThinkingProcessed": "Результати оброблено...",
"agentChat": "Агент",
"agentQuestionSubmit": "Надіслати",
"agentQuestionCustom": "Введіть свою відповідь...",
diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json
index a4b5827ce5..ebc537d823 100644
--- a/app/appearance/langs/zh_CHT.json
+++ b/app/appearance/langs/zh_CHT.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "API 請求失敗時的最大重試次數",
"agentThinkingAnalyzing": "正在分析你的請求...",
"agentThinkingProcessing": "正在處理結果...",
+ "agentThinkingAnalyzed": "已分析你的請求...",
+ "agentThinkingProcessed": "已處理結果...",
"agentChat": "智能體",
"agentQuestionSubmit": "提交",
"agentQuestionCustom": "輸入自定義答案...",
diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json
index 2efb728c4a..0a4323ad62 100644
--- a/app/appearance/langs/zh_CN.json
+++ b/app/appearance/langs/zh_CN.json
@@ -18,6 +18,8 @@
"agentMaxRetriesTip": "API 请求失败时的最大重试次数",
"agentThinkingAnalyzing": "正在分析你的请求...",
"agentThinkingProcessing": "正在处理结果...",
+ "agentThinkingAnalyzed": "已分析你的请求...",
+ "agentThinkingProcessed": "已处理结果...",
"agentChat": "智能体",
"agentQuestionSubmit": "提交",
"agentQuestionCustom": "输入自定义答案...",
diff --git a/app/src/layout/dock/AgentChat.ts b/app/src/layout/dock/AgentChat.ts
index 7cd321aae0..ed16ae03bc 100644
--- a/app/src/layout/dock/AgentChat.ts
+++ b/app/src/layout/dock/AgentChat.ts
@@ -792,6 +792,7 @@ export class AgentChat extends Model {
private appendThinking(reasoning: string) {
if (this.currentThinkingText) {
+ this.finishActiveThinking();
const tc = this.currentToolCalls.map(function (t) { return {name: t.name, result: t.result}; });
this.entries.push({
type: "thinking",
@@ -801,7 +802,6 @@ export class AgentChat extends Model {
reasoningContent: this.currentThinkingReasoningContent,
});
}
- this.finishActiveThinking();
this.currentThinkingText = "";
this.currentThinkingReasoning = reasoning;
this.currentThinkingReasoningContent = "";
@@ -1365,17 +1365,28 @@ export class AgentChat extends Model {
}
private finishActiveThinking() {
- const items = this.messagesContainer.querySelectorAll(".agent-chat__msg--thinking");
+ const L = window.siyuan.languages;
+ let doneText = "";
+ if (this.currentThinkingReasoning === "analyzing") {
+ doneText = L.agentThinkingAnalyzed || "Analyzed your request...";
+ } else if (this.currentThinkingReasoning === "processing") {
+ doneText = L.agentThinkingProcessed || "Processed results...";
+ }
+ this.currentThinkingText = doneText || this.currentThinkingText;
+
+ const items = this.messagesContainer.querySelectorAll(
+ ".agent-chat__msg--thinking:not(.agent-chat__msg--thinking-done)"
+ );
for (let i = 0; i < items.length; i++) {
const el = items[i] as HTMLElement;
el.classList.add("agent-chat__msg--thinking-done");
const dot = el.querySelector(".agent-chat__thinking-dot");
if (dot) { dot.classList.add("fn__none"); }
- const textEl = el.querySelector(".agent-chat__thinking-text");
- if (textEl) {
- const raw = textEl.textContent || "";
- if (raw.indexOf("分析") >= 0) { textEl.textContent = raw.replace("正在分析", "已分析"); }
- else if (raw.indexOf("处理") >= 0) { textEl.textContent = raw.replace("正在处理", "已处理"); }
+ if (doneText) {
+ const textEl = el.querySelector(".agent-chat__thinking-text");
+ if (textEl) {
+ textEl.textContent = doneText;
+ }
}
}
}