Skip to content

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

:sparkles: Support text files and hidden paths in skill management https://github.com/siyuan-note/siyuan/issues/19227

Danielc18d00a0e356
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index a3753e0f1e..5465b07c28 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "يحتفظ خيار «نقل المستندات فقط» بقاعدة الفرز الحالية، التي تحدد مواضع المستندات.",
+ "agentSkillBinaryTip": "لا يمكن تحرير الملفات الثنائية كنص",
+ "agentSkillEncodingTip": "هذا الملف ليس بترميز UTF-8 ولا يمكن تحريره",
+ "agentSkillTooLargeTip": "يتجاوز حجم هذا الملف 8 MiB ولا يمكن تحريره",
+ "agentSkillOpenLocationTip": "افتح موقع الملف لتحريره في تطبيق آخر",
"fileTreeMoveKeepSort": "نقل المستندات فقط",
"accessibilitySupport": "دعم إمكانية الوصول",
"accessibilitySupportTip": "يدعم قارئات الشاشة والأدوات المساعدة الأخرى؛ معطّل افتراضيًا، وينطبق على جميع مساحات العمل على هذا الجهاز، ويتطلب إغلاق SiYuan بالكامل وإعادة تشغيله",
"accessibilitySupportError": "تعذّرت قراءة إعدادات إمكانية الوصول أو حفظها",
"accessibilitySupportOverrideTip": "تتحكم به معاملات بدء التشغيل؛ أزل معاملات إمكانية الوصول لاستخدام هذا الإعداد",
"agentWorkspaceSkills": "مهارات مساحة العمل",
- "agentWorkspaceSkillsTip": "إدارة المهارات وملفات Markdown في مساحة العمل الحالية",
+ "agentWorkspaceSkillsTip": "إدارة المهارات والملفات النصية في مساحة العمل الحالية",
"agentSkillManager": "إدارة المهارات",
"agentSkillNew": "مهارة جديدة",
- "agentSkillNewFile": "ملف Markdown جديد",
+ "agentSkillNewFile": "ملف نصي جديد",
"agentSkillNewFolder": "مجلد جديد",
"agentSkillSearch": "البحث في ملفات المهارات",
- "agentSkillSource": "مصدر Markdown",
+ "agentSkillSource": "مصدر النص",
"agentSkillDeleteTip": "سيُحذف الملف أو المجلد المحدد وكل محتوياته نهائيًا؛ لا يمكن التراجع عن هذا الإجراء",
"agentSkillNameTip": "أدخل اسمًا صالحًا للملف أو المجلد",
- "agentSkillResourceTip": "لا يمكن فتح موقع هذا الملف إلا في تطبيق سطح المكتب المحلي",
+ "agentSkillResourceTip": "لا يمكن تحرير هذا الملف هنا",
"agentStreamingMarkdown": "معاينة Markdown أثناء البث",
"agentStreamingMarkdownTip": "معاينة Markdown أثناء رد الوكيل؛ قد يؤثر ذلك في الأداء",
"taskStatus": "حالة المهمة",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index 44dad7b29c..64b4f4f91f 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "„Dokumente nur verschieben“ behält die aktuelle Sortierregel bei, die die Positionen der Dokumente bestimmt.",
+ "agentSkillBinaryTip": "Binärdateien können nicht als Text bearbeitet werden",
+ "agentSkillEncodingTip": "Diese Datei ist nicht UTF-8-kodiert und kann nicht bearbeitet werden",
+ "agentSkillTooLargeTip": "Diese Datei ist größer als 8 MiB und kann nicht bearbeitet werden",
+ "agentSkillOpenLocationTip": "Öffnen Sie den Speicherort, um die Datei in einer anderen Anwendung zu bearbeiten",
"fileTreeMoveKeepSort": "Dokumente nur verschieben",
"accessibilitySupport": "Unterstützung für Barrierefreiheit",
"accessibilitySupportTip": "Unterstützt Screenreader und andere Hilfsmittel; standardmäßig deaktiviert, gilt für alle Arbeitsbereiche auf diesem Gerät und wird nach vollständigem Beenden und Neustarten von SiYuan wirksam",
"accessibilitySupportError": "Einstellungen zur Barrierefreiheit konnten nicht gelesen oder gespeichert werden",
"accessibilitySupportOverrideTip": "Wird durch Startparameter gesteuert; entferne die Parameter zur Barrierefreiheit, um diese Einstellung zu verwenden",
"agentWorkspaceSkills": "Arbeitsbereich-Fähigkeiten",
- "agentWorkspaceSkillsTip": "Fähigkeiten und Markdown-Dateien im aktuellen Arbeitsbereich verwalten",
+ "agentWorkspaceSkillsTip": "Fähigkeiten und Textdateien im aktuellen Arbeitsbereich verwalten",
"agentSkillManager": "Fähigkeitenverwaltung",
"agentSkillNew": "Neue Fähigkeit",
- "agentSkillNewFile": "Neue Markdown-Datei",
+ "agentSkillNewFile": "Neue Textdatei",
"agentSkillNewFolder": "Neuer Ordner",
"agentSkillSearch": "Fähigkeitsdateien durchsuchen",
- "agentSkillSource": "Markdown-Quelltext",
+ "agentSkillSource": "Textquellcode",
"agentSkillDeleteTip": "Die ausgewählte Datei oder der Ordner samt Inhalt wird dauerhaft gelöscht; dies kann nicht rückgängig gemacht werden",
"agentSkillNameTip": "Gültigen Datei- oder Ordnernamen eingeben",
- "agentSkillResourceTip": "Der Speicherort dieser Datei kann nur im lokalen Desktop-Client geöffnet werden",
+ "agentSkillResourceTip": "Diese Datei kann hier nicht bearbeitet werden",
"agentStreamingMarkdown": "Markdown-Vorschau beim Streaming",
"agentStreamingMarkdownTip": "Markdown während der Agentenantwort anzeigen; kann die Leistung beeinträchtigen",
"taskStatus": "Aufgabenstatus",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index ee9e264e0d..e7c4247e8f 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "“Move documents only” keeps the current sort rule, which determines the documents’ positions.",
+ "agentSkillBinaryTip": "Binary files cannot be edited as text",
+ "agentSkillEncodingTip": "This file is not UTF-8 encoded and cannot be edited",
+ "agentSkillTooLargeTip": "This file exceeds 8 MiB and cannot be edited",
+ "agentSkillOpenLocationTip": "Open the file location to edit it in another application",
"fileTreeMoveKeepSort": "Move documents only",
"accessibilitySupport": "Accessibility support",
"accessibilitySupportTip": "Support screen readers and other assistive tools; off by default, applies to all workspaces on this device, and takes effect after fully quitting and restarting SiYuan",
"accessibilitySupportError": "Unable to read or save accessibility settings",
"accessibilitySupportOverrideTip": "Controlled by startup arguments; remove the accessibility arguments to use this setting",
"agentWorkspaceSkills": "Workspace skills",
- "agentWorkspaceSkillsTip": "Manage skills and Markdown files in the current workspace",
+ "agentWorkspaceSkillsTip": "Manage skills and text files in the current workspace",
"agentSkillManager": "Skill manager",
"agentSkillNew": "New skill",
- "agentSkillNewFile": "New Markdown file",
+ "agentSkillNewFile": "New text file",
"agentSkillNewFolder": "New folder",
"agentSkillSearch": "Search skill files",
- "agentSkillSource": "Markdown source",
+ "agentSkillSource": "Text source",
"agentSkillDeleteTip": "The selected file or folder and all its contents will be permanently deleted; this cannot be undone",
"agentSkillNameTip": "Enter a valid file or folder name",
- "agentSkillResourceTip": "This file's location can only be opened in the local desktop client",
+ "agentSkillResourceTip": "This file cannot be edited here",
"agentStreamingMarkdown": "Streaming Markdown preview",
"agentStreamingMarkdownTip": "Preview Markdown while the agent responds; may affect performance",
"taskStatus": "Task status",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index ecb4616e36..81ebf2c0fb 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "«Solo mover documentos» conserva la regla de ordenación actual, que determina la posición de los documentos.",
+ "agentSkillBinaryTip": "Los archivos binarios no se pueden editar como texto",
+ "agentSkillEncodingTip": "Este archivo no está codificado en UTF-8 y no se puede editar",
+ "agentSkillTooLargeTip": "Este archivo supera los 8 MiB y no se puede editar",
+ "agentSkillOpenLocationTip": "Abre la ubicación del archivo para editarlo en otra aplicación",
"fileTreeMoveKeepSort": "Solo mover documentos",
"accessibilitySupport": "Compatibilidad con accesibilidad",
"accessibilitySupportTip": "Permite usar lectores de pantalla y otras herramientas de asistencia; desactivada por defecto, se aplica a todos los espacios de trabajo de este dispositivo y requiere cerrar por completo y reiniciar SiYuan",
"accessibilitySupportError": "No se pudo leer o guardar la configuración de accesibilidad",
"accessibilitySupportOverrideTip": "Controlada por los parámetros de inicio; elimina los parámetros de accesibilidad para usar esta configuración",
"agentWorkspaceSkills": "Habilidades del espacio de trabajo",
- "agentWorkspaceSkillsTip": "Gestionar habilidades y archivos Markdown del espacio de trabajo actual",
+ "agentWorkspaceSkillsTip": "Administrar habilidades y archivos de texto del espacio de trabajo actual",
"agentSkillManager": "Gestor de habilidades",
"agentSkillNew": "Nueva habilidad",
- "agentSkillNewFile": "Nuevo archivo Markdown",
+ "agentSkillNewFile": "Nuevo archivo de texto",
"agentSkillNewFolder": "Nueva carpeta",
"agentSkillSearch": "Buscar archivos de habilidades",
- "agentSkillSource": "Código fuente Markdown",
+ "agentSkillSource": "Texto fuente",
"agentSkillDeleteTip": "El archivo o la carpeta seleccionados y todo su contenido se eliminarán permanentemente; esta acción no se puede deshacer",
"agentSkillNameTip": "Introduce un nombre válido de archivo o carpeta",
- "agentSkillResourceTip": "La ubicación de este archivo solo se puede abrir en el cliente de escritorio local",
+ "agentSkillResourceTip": "Este archivo no se puede editar aquí",
"agentStreamingMarkdown": "Vista previa de Markdown en streaming",
"agentStreamingMarkdownTip": "Previsualizar Markdown durante la respuesta del agente; puede afectar al rendimiento",
"taskStatus": "Estado de la tarea",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index 464a53bdf6..30b71d56e3 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "« Déplacer uniquement les documents » conserve la règle de tri actuelle, qui détermine la position des documents.",
+ "agentSkillBinaryTip": "Les fichiers binaires ne peuvent pas être modifiés comme du texte",
+ "agentSkillEncodingTip": "Ce fichier n’est pas encodé en UTF-8 et ne peut pas être modifié",
+ "agentSkillTooLargeTip": "Ce fichier dépasse 8 MiB et ne peut pas être modifié",
+ "agentSkillOpenLocationTip": "Ouvrez l’emplacement du fichier pour le modifier dans une autre application",
"fileTreeMoveKeepSort": "Déplacer uniquement les documents",
"accessibilitySupport": "Prise en charge de l’accessibilité",
"accessibilitySupportTip": "Permet l’utilisation de lecteurs d’écran et d’autres outils d’assistance ; désactivée par défaut, s’applique à tous les espaces de travail de cet appareil et nécessite de quitter complètement puis de redémarrer SiYuan",
"accessibilitySupportError": "Impossible de lire ou d’enregistrer les paramètres d’accessibilité",
"accessibilitySupportOverrideTip": "Contrôlée par les paramètres de démarrage ; retirez les paramètres d’accessibilité pour utiliser ce réglage",
"agentWorkspaceSkills": "Compétences de l’espace de travail",
- "agentWorkspaceSkillsTip": "Gérer les compétences et les fichiers Markdown de l’espace de travail actuel",
+ "agentWorkspaceSkillsTip": "Gérer les compétences et les fichiers texte de l’espace de travail actuel",
"agentSkillManager": "Gestion des compétences",
"agentSkillNew": "Nouvelle compétence",
- "agentSkillNewFile": "Nouveau fichier Markdown",
+ "agentSkillNewFile": "Nouveau fichier texte",
"agentSkillNewFolder": "Nouveau dossier",
"agentSkillSearch": "Rechercher des fichiers de compétences",
- "agentSkillSource": "Source Markdown",
+ "agentSkillSource": "Texte source",
"agentSkillDeleteTip": "Le fichier ou dossier sélectionné et tout son contenu seront supprimés définitivement ; cette action est irréversible",
"agentSkillNameTip": "Saisissez un nom de fichier ou de dossier valide",
- "agentSkillResourceTip": "L’emplacement de ce fichier ne peut être ouvert que dans le client de bureau local",
+ "agentSkillResourceTip": "Ce fichier ne peut pas être modifié ici",
"agentStreamingMarkdown": "Aperçu Markdown en continu",
"agentStreamingMarkdownTip": "Prévisualiser le Markdown pendant la réponse de l’agent ; peut affecter les performances",
"taskStatus": "État de la tâche",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index 539f4d634a..21770b4c58 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "האפשרות „העברת מסמכים בלבד” שומרת על כלל המיון הנוכחי, הקובע את מיקומי המסמכים.",
+ "agentSkillBinaryTip": "לא ניתן לערוך קבצים בינאריים כטקסט",
+ "agentSkillEncodingTip": "הקובץ אינו מקודד ב-UTF-8 ולא ניתן לערוך אותו",
+ "agentSkillTooLargeTip": "גודל הקובץ עולה על 8 MiB ולא ניתן לערוך אותו",
+ "agentSkillOpenLocationTip": "יש לפתוח את מיקום הקובץ כדי לערוך אותו ביישום אחר",
"fileTreeMoveKeepSort": "העברת מסמכים בלבד",
"accessibilitySupport": "תמיכה בנגישות",
"accessibilitySupportTip": "תמיכה בקוראי מסך ובכלי עזר אחרים; כבויה כברירת מחדל, חלה על כל סביבות העבודה במכשיר זה ונכנסת לתוקף לאחר סגירה מלאה והפעלה מחדש של SiYuan",
"accessibilitySupportError": "לא ניתן לקרוא או לשמור את הגדרות הנגישות",
"accessibilitySupportOverrideTip": "נשלטת באמצעות פרמטרי ההפעלה; יש להסיר את פרמטרי הנגישות כדי להשתמש בהגדרה זו",
"agentWorkspaceSkills": "מיומנויות סביבת העבודה",
- "agentWorkspaceSkillsTip": "ניהול מיומנויות וקובצי Markdown בסביבת העבודה הנוכחית",
+ "agentWorkspaceSkillsTip": "ניהול מיומנויות וקובצי טקסט בסביבת העבודה הנוכחית",
"agentSkillManager": "מנהל המיומנויות",
"agentSkillNew": "מיומנות חדשה",
- "agentSkillNewFile": "קובץ Markdown חדש",
+ "agentSkillNewFile": "קובץ טקסט חדש",
"agentSkillNewFolder": "תיקייה חדשה",
"agentSkillSearch": "חיפוש בקובצי מיומנויות",
- "agentSkillSource": "קוד מקור Markdown",
+ "agentSkillSource": "טקסט המקור",
"agentSkillDeleteTip": "הקובץ או התיקייה שנבחרו וכל תוכנם יימחקו לצמיתות; לא ניתן לבטל פעולה זו",
"agentSkillNameTip": "יש להזין שם תקין לקובץ או לתיקייה",
- "agentSkillResourceTip": "ניתן לפתוח את מיקום הקובץ רק ביישום שולחן העבודה המקומי",
+ "agentSkillResourceTip": "לא ניתן לערוך את הקובץ כאן",
"agentStreamingMarkdown": "תצוגה מקדימה של Markdown בזמן הזרמה",
"agentStreamingMarkdownTip": "תצוגה מקדימה של Markdown בזמן תגובת הסוכן; עשויה להשפיע על הביצועים",
"taskStatus": "מצב משימה",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index a74bfb6d5e..e65da87846 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "“केवल दस्तावेज़ स्थानांतरित करें” वर्तमान क्रमबद्ध करने का नियम बनाए रखता है, जो दस्तावेज़ों की स्थिति निर्धारित करता है।",
+ "agentSkillBinaryTip": "बाइनरी फ़ाइलों को टेक्स्ट के रूप में संपादित नहीं किया जा सकता",
+ "agentSkillEncodingTip": "यह फ़ाइल UTF-8 में एन्कोड नहीं है और इसे संपादित नहीं किया जा सकता",
+ "agentSkillTooLargeTip": "यह फ़ाइल 8 MiB से बड़ी है और इसे संपादित नहीं किया जा सकता",
+ "agentSkillOpenLocationTip": "किसी अन्य ऐप में संपादित करने के लिए फ़ाइल का स्थान खोलें",
"fileTreeMoveKeepSort": "केवल दस्तावेज़ स्थानांतरित करें",
"accessibilitySupport": "सुलभता समर्थन",
"accessibilitySupportTip": "स्क्रीन रीडर और अन्य सहायक उपकरणों का समर्थन करता है; डिफ़ॉल्ट रूप से बंद है, इस डिवाइस के सभी कार्यक्षेत्रों पर लागू होता है और SiYuan को पूरी तरह बंद करके फिर से शुरू करने पर प्रभावी होता है",
"accessibilitySupportError": "सुलभता सेटिंग पढ़ी या सहेजी नहीं जा सकीं",
"accessibilitySupportOverrideTip": "स्टार्टअप पैरामीटर द्वारा नियंत्रित; इस सेटिंग का उपयोग करने के लिए सुलभता से संबंधित स्टार्टअप पैरामीटर हटाएँ",
"agentWorkspaceSkills": "कार्यक्षेत्र कौशल",
- "agentWorkspaceSkillsTip": "वर्तमान कार्यक्षेत्र में कौशल और Markdown फ़ाइलें प्रबंधित करें",
+ "agentWorkspaceSkillsTip": "वर्तमान कार्यक्षेत्र में कौशल और टेक्स्ट फ़ाइलें प्रबंधित करें",
"agentSkillManager": "कौशल प्रबंधक",
"agentSkillNew": "नया कौशल",
- "agentSkillNewFile": "नई Markdown फ़ाइल",
+ "agentSkillNewFile": "नई टेक्स्ट फ़ाइल",
"agentSkillNewFolder": "नया फ़ोल्डर",
"agentSkillSearch": "कौशल फ़ाइलें खोजें",
- "agentSkillSource": "Markdown स्रोत",
+ "agentSkillSource": "मूल टेक्स्ट",
"agentSkillDeleteTip": "चुनी गई फ़ाइल या फ़ोल्डर और उसकी सारी सामग्री स्थायी रूप से हटा दी जाएगी; इस कार्रवाई को पूर्ववत नहीं किया जा सकता",
"agentSkillNameTip": "मान्य फ़ाइल या फ़ोल्डर का नाम दर्ज करें",
- "agentSkillResourceTip": "इस फ़ाइल का स्थान केवल स्थानीय डेस्कटॉप क्लाइंट में खोला जा सकता है",
+ "agentSkillResourceTip": "इस फ़ाइल को यहाँ संपादित नहीं किया जा सकता",
"agentStreamingMarkdown": "स्ट्रीमिंग Markdown पूर्वावलोकन",
"agentStreamingMarkdownTip": "एजेंट के उत्तर के दौरान Markdown का पूर्वावलोकन करें; प्रदर्शन प्रभावित हो सकता है",
"taskStatus": "कार्य की स्थिति",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index fd7e1f7a1f..41512e5254 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "“Hanya pindahkan dokumen” mempertahankan aturan pengurutan saat ini, yang menentukan posisi dokumen.",
+ "agentSkillBinaryTip": "Berkas biner tidak dapat diedit sebagai teks",
+ "agentSkillEncodingTip": "Berkas ini tidak menggunakan pengodean UTF-8 dan tidak dapat diedit",
+ "agentSkillTooLargeTip": "Berkas ini melebihi 8 MiB dan tidak dapat diedit",
+ "agentSkillOpenLocationTip": "Buka lokasi berkas untuk mengeditnya di aplikasi lain",
"fileTreeMoveKeepSort": "Hanya pindahkan dokumen",
"accessibilitySupport": "Dukungan aksesibilitas",
"accessibilitySupportTip": "Mendukung pembaca layar dan alat bantu lainnya; nonaktif secara bawaan, berlaku untuk semua ruang kerja di perangkat ini, dan memerlukan penutupan sepenuhnya serta mulai ulang SiYuan",
"accessibilitySupportError": "Tidak dapat membaca atau menyimpan pengaturan aksesibilitas",
"accessibilitySupportOverrideTip": "Dikendalikan oleh parameter peluncuran; hapus parameter aksesibilitas untuk menggunakan pengaturan ini",
"agentWorkspaceSkills": "Keterampilan ruang kerja",
- "agentWorkspaceSkillsTip": "Kelola keterampilan dan berkas Markdown di ruang kerja saat ini",
+ "agentWorkspaceSkillsTip": "Kelola keterampilan dan berkas teks di ruang kerja saat ini",
"agentSkillManager": "Pengelola keterampilan",
"agentSkillNew": "Keterampilan baru",
- "agentSkillNewFile": "Berkas Markdown baru",
+ "agentSkillNewFile": "Berkas teks baru",
"agentSkillNewFolder": "Folder baru",
"agentSkillSearch": "Cari berkas keterampilan",
- "agentSkillSource": "Sumber Markdown",
+ "agentSkillSource": "Teks sumber",
"agentSkillDeleteTip": "Berkas atau folder yang dipilih beserta seluruh isinya akan dihapus secara permanen; tindakan ini tidak dapat dibatalkan",
"agentSkillNameTip": "Masukkan nama berkas atau folder yang valid",
- "agentSkillResourceTip": "Lokasi berkas ini hanya dapat dibuka di klien desktop lokal",
+ "agentSkillResourceTip": "Berkas ini tidak dapat diedit di sini",
"agentStreamingMarkdown": "Pratinjau Markdown saat streaming",
"agentStreamingMarkdownTip": "Pratinjau Markdown saat agen merespons; dapat memengaruhi kinerja",
"taskStatus": "Status tugas",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index 8c5f00d753..a5ff4a1faa 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "«Sposta solo i documenti» mantiene la regola di ordinamento attuale, che determina la posizione dei documenti.",
+ "agentSkillBinaryTip": "I file binari non possono essere modificati come testo",
+ "agentSkillEncodingTip": "Questo file non è codificato in UTF-8 e non può essere modificato",
+ "agentSkillTooLargeTip": "Questo file supera 8 MiB e non può essere modificato",
+ "agentSkillOpenLocationTip": "Apri la posizione del file per modificarlo in un’altra applicazione",
"fileTreeMoveKeepSort": "Sposta solo i documenti",
"accessibilitySupport": "Supporto per l’accessibilità",
"accessibilitySupportTip": "Supporta lettori di schermo e altri strumenti assistivi; disattivato per impostazione predefinita, si applica a tutti gli spazi di lavoro su questo dispositivo e richiede di chiudere completamente e riavviare SiYuan",
"accessibilitySupportError": "Impossibile leggere o salvare le impostazioni di accessibilità",
"accessibilitySupportOverrideTip": "Controllato dai parametri di avvio; rimuovi i parametri di accessibilità per usare questa impostazione",
"agentWorkspaceSkills": "Competenze dell'area di lavoro",
- "agentWorkspaceSkillsTip": "Gestisci competenze e file Markdown nell'area di lavoro corrente",
+ "agentWorkspaceSkillsTip": "Gestisci le competenze e i file di testo nell’area di lavoro corrente",
"agentSkillManager": "Gestione competenze",
"agentSkillNew": "Nuova competenza",
- "agentSkillNewFile": "Nuovo file Markdown",
+ "agentSkillNewFile": "Nuovo file di testo",
"agentSkillNewFolder": "Nuova cartella",
"agentSkillSearch": "Cerca file delle competenze",
- "agentSkillSource": "Sorgente Markdown",
+ "agentSkillSource": "Testo sorgente",
"agentSkillDeleteTip": "Il file o la cartella selezionati e tutto il loro contenuto verranno eliminati definitivamente; l'operazione non può essere annullata",
"agentSkillNameTip": "Inserisci un nome valido per il file o la cartella",
- "agentSkillResourceTip": "La posizione di questo file può essere aperta solo nel client desktop locale",
+ "agentSkillResourceTip": "Questo file non può essere modificato qui",
"agentStreamingMarkdown": "Anteprima Markdown in streaming",
"agentStreamingMarkdownTip": "Mostra l’anteprima Markdown durante la risposta dell’agente; può influire sulle prestazioni",
"taskStatus": "Stato dell'attività",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index fd94d0a747..aea2d45c11 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "「ドキュメントの移動のみ」では現在の並び替えルールが維持され、ドキュメントの位置はそのルールによって決まります。",
+ "agentSkillBinaryTip": "バイナリファイルはテキストとして編集できません",
+ "agentSkillEncodingTip": "このファイルは UTF-8 形式ではないため編集できません",
+ "agentSkillTooLargeTip": "このファイルは 8 MiB を超えるため編集できません",
+ "agentSkillOpenLocationTip": "ファイルの場所を開き、他のアプリで編集できます",
"fileTreeMoveKeepSort": "ドキュメントの移動のみ",
"accessibilitySupport": "アクセシビリティ対応",
"accessibilitySupportTip": "スクリーンリーダーなどの支援ツールに対応します。初期設定はオフで、この端末のすべてのワークスペースに適用されます。変更後は思源を完全に終了して再起動してください",
"accessibilitySupportError": "アクセシビリティ設定を読み取りまたは保存できません",
"accessibilitySupportOverrideTip": "起動引数によって制御されています。この設定を使用するには、アクセシビリティ関連の起動引数を削除してください",
"agentWorkspaceSkills": "ワークスペースのスキル",
- "agentWorkspaceSkillsTip": "現在のワークスペースのスキルと Markdown ファイルを管理",
+ "agentWorkspaceSkillsTip": "現在のワークスペースのスキルとテキストファイルを管理",
"agentSkillManager": "スキル管理",
"agentSkillNew": "新しいスキル",
- "agentSkillNewFile": "新しい Markdown ファイル",
+ "agentSkillNewFile": "テキストファイルを新規作成",
"agentSkillNewFolder": "新しいフォルダー",
"agentSkillSearch": "スキルファイルを検索",
- "agentSkillSource": "Markdown ソース",
+ "agentSkillSource": "テキストソース",
"agentSkillDeleteTip": "選択したファイルまたはフォルダーとその内容をすべて完全に削除します。この操作は元に戻せません",
"agentSkillNameTip": "有効なファイル名またはフォルダー名を入力してください",
- "agentSkillResourceTip": "このファイルの保存場所はローカルのデスクトップクライアントでのみ開けます",
+ "agentSkillResourceTip": "このファイルはここでは編集できません",
"agentStreamingMarkdown": "ストリーミング Markdown プレビュー",
"agentStreamingMarkdownTip": "応答中に Markdown をプレビューします(パフォーマンスに影響する場合があります)",
"taskStatus": "タスクの状態",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index 0ccc0f39b0..058700c645 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "‘문서만 이동’을 선택하면 현재 정렬 규칙이 유지되며, 문서의 위치는 해당 규칙에 따라 결정됩니다.",
+ "agentSkillBinaryTip": "바이너리 파일은 텍스트로 편집할 수 없습니다",
+ "agentSkillEncodingTip": "이 파일은 UTF-8 인코딩이 아니므로 편집할 수 없습니다",
+ "agentSkillTooLargeTip": "이 파일은 8 MiB를 초과하여 편집할 수 없습니다",
+ "agentSkillOpenLocationTip": "파일 위치를 열어 다른 앱에서 편집할 수 있습니다",
"fileTreeMoveKeepSort": "문서만 이동",
"accessibilitySupport": "접근성 지원",
"accessibilitySupportTip": "화면 읽기 프로그램 및 기타 보조 도구를 지원합니다. 기본적으로 꺼져 있으며 이 기기의 모든 작업 공간에 적용됩니다. 변경 후 SiYuan을 완전히 종료하고 다시 시작해야 합니다",
"accessibilitySupportError": "접근성 설정을 읽거나 저장할 수 없습니다",
"accessibilitySupportOverrideTip": "시작 인수로 제어되고 있습니다. 이 설정을 사용하려면 접근성 관련 시작 인수를 제거하세요",
"agentWorkspaceSkills": "작업 공간 스킬",
- "agentWorkspaceSkillsTip": "현재 작업 공간의 스킬과 Markdown 파일 관리",
+ "agentWorkspaceSkillsTip": "현재 작업 공간의 스킬과 텍스트 파일 관리",
"agentSkillManager": "스킬 관리",
"agentSkillNew": "새 스킬",
- "agentSkillNewFile": "새 Markdown 파일",
+ "agentSkillNewFile": "새 텍스트 파일",
"agentSkillNewFolder": "새 폴더",
"agentSkillSearch": "스킬 파일 검색",
- "agentSkillSource": "Markdown 소스",
+ "agentSkillSource": "텍스트 원본",
"agentSkillDeleteTip": "선택한 파일 또는 폴더와 그 안의 모든 내용이 영구적으로 삭제되며, 이 작업은 되돌릴 수 없습니다",
"agentSkillNameTip": "올바른 파일 또는 폴더 이름을 입력하세요",
- "agentSkillResourceTip": "이 파일의 위치는 로컬 데스크톱 클라이언트에서만 열 수 있습니다",
+ "agentSkillResourceTip": "이 파일은 여기서 편집할 수 없습니다",
"agentStreamingMarkdown": "스트리밍 Markdown 미리보기",
"agentStreamingMarkdownTip": "에이전트 응답 중 Markdown을 미리 표시하며, 성능에 영향을 줄 수 있습니다",
"taskStatus": "작업 상태",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index 69955f0762..0bf26b0433 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "‘Alleen documenten verplaatsen’ behoudt de huidige sorteerregel, die de posities van de documenten bepaalt.",
+ "agentSkillBinaryTip": "Binaire bestanden kunnen niet als tekst worden bewerkt",
+ "agentSkillEncodingTip": "Dit bestand is niet UTF-8-gecodeerd en kan niet worden bewerkt",
+ "agentSkillTooLargeTip": "Dit bestand is groter dan 8 MiB en kan niet worden bewerkt",
+ "agentSkillOpenLocationTip": "Open de bestandslocatie om het bestand in een andere toepassing te bewerken",
"fileTreeMoveKeepSort": "Alleen documenten verplaatsen",
"accessibilitySupport": "Ondersteuning voor toegankelijkheid",
"accessibilitySupportTip": "Ondersteunt schermlezers en andere hulpmiddelen; standaard uitgeschakeld, geldt voor alle werkruimten op dit apparaat en wordt actief nadat SiYuan volledig is afgesloten en opnieuw is gestart",
"accessibilitySupportError": "Kan toegankelijkheidsinstellingen niet lezen of opslaan",
"accessibilitySupportOverrideTip": "Bepaald door opstartparameters; verwijder de toegankelijkheidsparameters om deze instelling te gebruiken",
"agentWorkspaceSkills": "Werkruimtevaardigheden",
- "agentWorkspaceSkillsTip": "Vaardigheden en Markdown-bestanden in de huidige werkruimte beheren",
+ "agentWorkspaceSkillsTip": "Vaardigheden en tekstbestanden in de huidige werkruimte beheren",
"agentSkillManager": "Vaardighedenbeheer",
"agentSkillNew": "Nieuwe vaardigheid",
- "agentSkillNewFile": "Nieuw Markdown-bestand",
+ "agentSkillNewFile": "Nieuw tekstbestand",
"agentSkillNewFolder": "Nieuwe map",
"agentSkillSearch": "Vaardigheidsbestanden zoeken",
- "agentSkillSource": "Markdown-broncode",
+ "agentSkillSource": "Brontekst",
"agentSkillDeleteTip": "Het geselecteerde bestand of de geselecteerde map en alle inhoud worden permanent verwijderd; dit kan niet ongedaan worden gemaakt",
"agentSkillNameTip": "Voer een geldige bestands- of mapnaam in",
- "agentSkillResourceTip": "De locatie van dit bestand kan alleen in de lokale desktopclient worden geopend",
+ "agentSkillResourceTip": "Dit bestand kan hier niet worden bewerkt",
"agentStreamingMarkdown": "Markdown-voorbeeld tijdens streaming",
"agentStreamingMarkdownTip": "Markdown tijdens het antwoord van de agent weergeven; kan de prestaties beïnvloeden",
"taskStatus": "Taakstatus",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index 0053bdac96..13c075565d 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "Opcja „Tylko przenieś dokumenty” zachowuje bieżącą regułę sortowania, która określa pozycje dokumentów.",
+ "agentSkillBinaryTip": "Plików binarnych nie można edytować jako tekstu",
+ "agentSkillEncodingTip": "Ten plik nie jest zakodowany w UTF-8 i nie można go edytować",
+ "agentSkillTooLargeTip": "Ten plik przekracza 8 MiB i nie można go edytować",
+ "agentSkillOpenLocationTip": "Otwórz lokalizację pliku, aby edytować go w innej aplikacji",
"fileTreeMoveKeepSort": "Tylko przenieś dokumenty",
"accessibilitySupport": "Obsługa ułatwień dostępu",
"accessibilitySupportTip": "Obsługuje czytniki ekranu i inne narzędzia wspomagające; domyślnie wyłączona, dotyczy wszystkich obszarów roboczych na tym urządzeniu i wymaga całkowitego zamknięcia oraz ponownego uruchomienia SiYuan",
"accessibilitySupportError": "Nie można odczytać lub zapisać ustawień ułatwień dostępu",
"accessibilitySupportOverrideTip": "Sterowanie za pomocą parametrów uruchamiania; usuń parametry ułatwień dostępu, aby użyć tego ustawienia",
"agentWorkspaceSkills": "Umiejętności przestrzeni roboczej",
- "agentWorkspaceSkillsTip": "Zarządzaj umiejętnościami i plikami Markdown w bieżącej przestrzeni roboczej",
+ "agentWorkspaceSkillsTip": "Zarządzaj umiejętnościami i plikami tekstowymi w bieżącym obszarze roboczym",
"agentSkillManager": "Menedżer umiejętności",
"agentSkillNew": "Nowa umiejętność",
- "agentSkillNewFile": "Nowy plik Markdown",
+ "agentSkillNewFile": "Nowy plik tekstowy",
"agentSkillNewFolder": "Nowy folder",
"agentSkillSearch": "Szukaj plików umiejętności",
- "agentSkillSource": "Źródło Markdown",
+ "agentSkillSource": "Tekst źródłowy",
"agentSkillDeleteTip": "Wybrany plik lub folder wraz z całą zawartością zostanie trwale usunięty; tej operacji nie można cofnąć",
"agentSkillNameTip": "Wprowadź prawidłową nazwę pliku lub folderu",
- "agentSkillResourceTip": "Lokalizację tego pliku można otworzyć tylko w lokalnym kliencie komputerowym",
+ "agentSkillResourceTip": "Tego pliku nie można tutaj edytować",
"agentStreamingMarkdown": "Podgląd Markdown podczas przesyłania",
"agentStreamingMarkdownTip": "Podgląd Markdown podczas odpowiedzi agenta; może wpływać na wydajność",
"taskStatus": "Stan zadania",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index 38fe7d9432..5e4680b265 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "“Apenas mover documentos” mantém a regra de ordenação atual, que determina a posição dos documentos.",
+ "agentSkillBinaryTip": "Arquivos binários não podem ser editados como texto",
+ "agentSkillEncodingTip": "Este arquivo não está codificado em UTF-8 e não pode ser editado",
+ "agentSkillTooLargeTip": "Este arquivo excede 8 MiB e não pode ser editado",
+ "agentSkillOpenLocationTip": "Abra o local do arquivo para editá-lo em outro aplicativo",
"fileTreeMoveKeepSort": "Apenas mover documentos",
"accessibilitySupport": "Suporte à acessibilidade",
"accessibilitySupportTip": "Oferece suporte a leitores de tela e outras ferramentas assistivas; desativado por padrão, aplica-se a todos os espaços de trabalho deste dispositivo e exige encerrar completamente e reiniciar o SiYuan",
"accessibilitySupportError": "Não foi possível ler ou salvar as configurações de acessibilidade",
"accessibilitySupportOverrideTip": "Controlado pelos parâmetros de inicialização; remova os parâmetros de acessibilidade para usar esta configuração",
"agentWorkspaceSkills": "Habilidades do espaço de trabalho",
- "agentWorkspaceSkillsTip": "Gerenciar habilidades e arquivos Markdown no espaço de trabalho atual",
+ "agentWorkspaceSkillsTip": "Gerenciar habilidades e arquivos de texto no espaço de trabalho atual",
"agentSkillManager": "Gerenciador de habilidades",
"agentSkillNew": "Nova habilidade",
- "agentSkillNewFile": "Novo arquivo Markdown",
+ "agentSkillNewFile": "Novo arquivo de texto",
"agentSkillNewFolder": "Nova pasta",
"agentSkillSearch": "Pesquisar arquivos de habilidades",
- "agentSkillSource": "Código-fonte Markdown",
+ "agentSkillSource": "Texto-fonte",
"agentSkillDeleteTip": "O arquivo ou a pasta selecionados e todo o seu conteúdo serão excluídos permanentemente; esta ação não pode ser desfeita",
"agentSkillNameTip": "Insira um nome válido de arquivo ou pasta",
- "agentSkillResourceTip": "O local deste arquivo só pode ser aberto no cliente de desktop local",
+ "agentSkillResourceTip": "Este arquivo não pode ser editado aqui",
"agentStreamingMarkdown": "Prévia de Markdown durante o streaming",
"agentStreamingMarkdownTip": "Pré-visualizar Markdown durante a resposta do agente; pode afetar o desempenho",
"taskStatus": "Status da tarefa",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index 4ae10399b6..76e1a46c54 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "«Только переместить документы» сохраняет текущее правило сортировки, которое определяет положение документов.",
+ "agentSkillBinaryTip": "Двоичные файлы нельзя редактировать как текст",
+ "agentSkillEncodingTip": "Этот файл имеет кодировку, отличную от UTF-8, и не может быть отредактирован",
+ "agentSkillTooLargeTip": "Размер этого файла превышает 8 MiB, редактирование недоступно",
+ "agentSkillOpenLocationTip": "Откройте расположение файла, чтобы отредактировать его в другом приложении",
"fileTreeMoveKeepSort": "Только переместить документы",
"accessibilitySupport": "Поддержка специальных возможностей",
"accessibilitySupportTip": "Поддержка программ чтения с экрана и других вспомогательных средств; по умолчанию отключена, применяется ко всем рабочим пространствам на этом устройстве и требует полного закрытия и повторного запуска SiYuan",
"accessibilitySupportError": "Не удалось прочитать или сохранить настройки специальных возможностей",
"accessibilitySupportOverrideTip": "Управляется параметрами запуска; удалите параметры специальных возможностей, чтобы использовать эту настройку",
"agentWorkspaceSkills": "Навыки рабочего пространства",
- "agentWorkspaceSkillsTip": "Управление навыками и файлами Markdown в текущем рабочем пространстве",
+ "agentWorkspaceSkillsTip": "Управление навыками и текстовыми файлами в текущем рабочем пространстве",
"agentSkillManager": "Управление навыками",
"agentSkillNew": "Новый навык",
- "agentSkillNewFile": "Новый файл Markdown",
+ "agentSkillNewFile": "Новый текстовый файл",
"agentSkillNewFolder": "Новая папка",
"agentSkillSearch": "Поиск файлов навыков",
- "agentSkillSource": "Исходный текст Markdown",
+ "agentSkillSource": "Исходный текст",
"agentSkillDeleteTip": "Выбранный файл или папка со всем содержимым будут удалены безвозвратно; это действие нельзя отменить",
"agentSkillNameTip": "Введите допустимое имя файла или папки",
- "agentSkillResourceTip": "Расположение этого файла можно открыть только в локальном настольном клиенте",
+ "agentSkillResourceTip": "Этот файл нельзя редактировать здесь",
"agentStreamingMarkdown": "Предпросмотр Markdown при потоковом выводе",
"agentStreamingMarkdownTip": "Предпросмотр Markdown во время ответа агента; может влиять на производительность",
"taskStatus": "Статус задачи",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index 27c9f4807e..2bfae24760 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "Možnosť „Iba presunúť dokumenty“ zachová aktuálne pravidlo zoradenia, ktoré určuje pozície dokumentov.",
+ "agentSkillBinaryTip": "Binárne súbory nemožno upravovať ako text",
+ "agentSkillEncodingTip": "Tento súbor nemá kódovanie UTF-8 a nemožno ho upravovať",
+ "agentSkillTooLargeTip": "Tento súbor presahuje 8 MiB a nemožno ho upravovať",
+ "agentSkillOpenLocationTip": "Otvorte umiestnenie súboru a upravte ho v inej aplikácii",
"fileTreeMoveKeepSort": "Iba presunúť dokumenty",
"accessibilitySupport": "Podpora prístupnosti",
"accessibilitySupportTip": "Podporuje čítačky obrazovky a ďalšie asistenčné nástroje; predvolene vypnutá, platí pre všetky pracovné priestory na tomto zariadení a vyžaduje úplné ukončenie a opätovné spustenie SiYuan",
"accessibilitySupportError": "Nastavenia prístupnosti sa nepodarilo načítať alebo uložiť",
"accessibilitySupportOverrideTip": "Riadené parametrami spustenia; odstráňte parametre prístupnosti, aby ste mohli použiť toto nastavenie",
"agentWorkspaceSkills": "Zručnosti pracovného priestoru",
- "agentWorkspaceSkillsTip": "Správa zručností a súborov Markdown v aktuálnom pracovnom priestore",
+ "agentWorkspaceSkillsTip": "Spravovať zručnosti a textové súbory v aktuálnom pracovnom priestore",
"agentSkillManager": "Správca zručností",
"agentSkillNew": "Nová zručnosť",
- "agentSkillNewFile": "Nový súbor Markdown",
+ "agentSkillNewFile": "Nový textový súbor",
"agentSkillNewFolder": "Nový priečinok",
"agentSkillSearch": "Hľadať súbory zručností",
- "agentSkillSource": "Zdrojový text Markdown",
+ "agentSkillSource": "Zdrojový text",
"agentSkillDeleteTip": "Vybraný súbor alebo priečinok so všetkým obsahom sa natrvalo odstráni; túto akciu nemožno vrátiť späť",
"agentSkillNameTip": "Zadajte platný názov súboru alebo priečinka",
- "agentSkillResourceTip": "Umiestnenie tohto súboru možno otvoriť iba v lokálnom počítačovom klientovi",
+ "agentSkillResourceTip": "Tento súbor tu nemožno upravovať",
"agentStreamingMarkdown": "Náhľad Markdown počas streamovania",
"agentStreamingMarkdownTip": "Náhľad Markdown počas odpovede agenta; môže ovplyvniť výkon",
"taskStatus": "Stav úlohy",
diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.json
index aa387659a2..9f3161fd0b 100644
--- a/app/appearance/langs/sr.json
+++ b/app/appearance/langs/sr.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "Opcija „Samo premesti dokumente“ zadržava trenutno pravilo ređanja, koje određuje položaj dokumenata.",
+ "agentSkillBinaryTip": "Бинарне датотеке се не могу уређивати као текст",
+ "agentSkillEncodingTip": "Ова датотека није кодирана као UTF-8 и не може се уређивати",
+ "agentSkillTooLargeTip": "Ова датотека је већа од 8 MiB и не може се уређивати",
+ "agentSkillOpenLocationTip": "Отворите локацију датотеке да бисте је уредили у другој апликацији",
"fileTreeMoveKeepSort": "Samo premesti dokumente",
"accessibilitySupport": "Подршка за приступачност",
"accessibilitySupportTip": "Подржава читаче екрана и друге помоћне алате; подразумевано је искључена, важи за све радне просторе на овом уређају и захтева потпуно затварање и поновно покретање SiYuan-а",
"accessibilitySupportError": "Није могуће прочитати или сачувати подешавања приступачности",
"accessibilitySupportOverrideTip": "Контролишу је параметри покретања; уклоните параметре приступачности да бисте користили ово подешавање",
"agentWorkspaceSkills": "Вештине радног простора",
- "agentWorkspaceSkillsTip": "Управљајте вештинама и Markdown датотекама у тренутном радном простору",
+ "agentWorkspaceSkillsTip": "Управљајте вештинама и текстуалним датотекама у тренутном радном простору",
"agentSkillManager": "Управљање вештинама",
"agentSkillNew": "Нова вештина",
- "agentSkillNewFile": "Нова Markdown датотека",
+ "agentSkillNewFile": "Нова текстуална датотека",
"agentSkillNewFolder": "Нова фасцикла",
"agentSkillSearch": "Претражи датотеке вештина",
- "agentSkillSource": "Markdown извор",
+ "agentSkillSource": "Изворни текст",
"agentSkillDeleteTip": "Изабрана датотека или фасцикла и сав њен садржај биће трајно обрисани; ова радња се не може опозвати",
"agentSkillNameTip": "Унесите важеће име датотеке или фасцикле",
- "agentSkillResourceTip": "Локација ове датотеке може се отворити само у локалном десктоп клијенту",
+ "agentSkillResourceTip": "Ова датотека се овде не може уређивати",
"agentStreamingMarkdown": "Преглед Markdown-а током стримовања",
"agentStreamingMarkdownTip": "Преглед Markdown-а током одговора агента; може утицати на перформансе",
"taskStatus": "Статус задатка",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index 573072be36..ab00448133 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "“ย้ายเอกสารเท่านั้น” จะคงกฎการเรียงลำดับปัจจุบันไว้ โดยตำแหน่งของเอกสารจะเป็นไปตามกฎดังกล่าว",
+ "agentSkillBinaryTip": "ไม่สามารถแก้ไขไฟล์ไบนารีเป็นข้อความได้",
+ "agentSkillEncodingTip": "ไฟล์นี้ไม่ได้เข้ารหัสแบบ UTF-8 จึงไม่สามารถแก้ไขได้",
+ "agentSkillTooLargeTip": "ไฟล์นี้มีขนาดเกิน 8 MiB จึงไม่สามารถแก้ไขได้",
+ "agentSkillOpenLocationTip": "เปิดตำแหน่งไฟล์เพื่อแก้ไขในแอปอื่น",
"fileTreeMoveKeepSort": "ย้ายเอกสารเท่านั้น",
"accessibilitySupport": "การรองรับการช่วยการเข้าถึง",
"accessibilitySupportTip": "รองรับโปรแกรมอ่านหน้าจอและเครื่องมือช่วยเหลืออื่น ๆ โดยปิดไว้เป็นค่าเริ่มต้น มีผลกับพื้นที่ทำงานทั้งหมดบนอุปกรณ์นี้ และต้องปิด SiYuan ให้สมบูรณ์แล้วเปิดใหม่เพื่อให้การเปลี่ยนแปลงมีผล",
"accessibilitySupportError": "ไม่สามารถอ่านหรือบันทึกการตั้งค่าการช่วยการเข้าถึงได้",
"accessibilitySupportOverrideTip": "ควบคุมโดยพารามิเตอร์เริ่มต้นระบบ ให้นำพารามิเตอร์การช่วยการเข้าถึงออกเพื่อใช้การตั้งค่านี้",
"agentWorkspaceSkills": "ทักษะของพื้นที่ทำงาน",
- "agentWorkspaceSkillsTip": "จัดการทักษะและไฟล์ Markdown ในพื้นที่ทำงานปัจจุบัน",
+ "agentWorkspaceSkillsTip": "จัดการทักษะและไฟล์ข้อความในพื้นที่ทำงานปัจจุบัน",
"agentSkillManager": "ตัวจัดการทักษะ",
"agentSkillNew": "ทักษะใหม่",
- "agentSkillNewFile": "ไฟล์ Markdown ใหม่",
+ "agentSkillNewFile": "ไฟล์ข้อความใหม่",
"agentSkillNewFolder": "โฟลเดอร์ใหม่",
"agentSkillSearch": "ค้นหาไฟล์ทักษะ",
- "agentSkillSource": "ซอร์ส Markdown",
+ "agentSkillSource": "ข้อความต้นฉบับ",
"agentSkillDeleteTip": "ไฟล์หรือโฟลเดอร์ที่เลือกและเนื้อหาทั้งหมดจะถูกลบอย่างถาวร และไม่สามารถเลิกทำได้",
"agentSkillNameTip": "ป้อนชื่อไฟล์หรือโฟลเดอร์ที่ถูกต้อง",
- "agentSkillResourceTip": "เปิดตำแหน่งของไฟล์นี้ได้เฉพาะในไคลเอนต์เดสก์ท็อปบนเครื่องนี้เท่านั้น",
+ "agentSkillResourceTip": "ไม่สามารถแก้ไขไฟล์นี้ที่นี่ได้",
"agentStreamingMarkdown": "แสดงตัวอย่าง Markdown ระหว่างสตรีม",
"agentStreamingMarkdownTip": "แสดงตัวอย่าง Markdown ขณะเอเจนต์ตอบกลับ อาจส่งผลต่อประสิทธิภาพ",
"taskStatus": "สถานะงาน",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index caa00959a5..d1b688e330 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "“Yalnızca belgeleri taşı” geçerli sıralama kuralını korur; belgelerin konumlarını bu kural belirler.",
+ "agentSkillBinaryTip": "İkili dosyalar metin olarak düzenlenemez",
+ "agentSkillEncodingTip": "Bu dosya UTF-8 kodlamasında değil ve düzenlenemez",
+ "agentSkillTooLargeTip": "Bu dosya 8 MiB sınırını aşıyor ve düzenlenemez",
+ "agentSkillOpenLocationTip": "Başka bir uygulamada düzenlemek için dosya konumunu açın",
"fileTreeMoveKeepSort": "Yalnızca belgeleri taşı",
"accessibilitySupport": "Erişilebilirlik desteği",
"accessibilitySupportTip": "Ekran okuyucuları ve diğer yardımcı araçları destekler; varsayılan olarak kapalıdır, bu cihazdaki tüm çalışma alanlarına uygulanır ve SiYuan tamamen kapatılıp yeniden başlatıldığında etkinleşir",
"accessibilitySupportError": "Erişilebilirlik ayarları okunamadı veya kaydedilemedi",
"accessibilitySupportOverrideTip": "Başlangıç parametreleri tarafından kontrol ediliyor; bu ayarı kullanmak için erişilebilirlik parametrelerini kaldırın",
"agentWorkspaceSkills": "Çalışma alanı becerileri",
- "agentWorkspaceSkillsTip": "Geçerli çalışma alanındaki becerileri ve Markdown dosyalarını yönetin",
+ "agentWorkspaceSkillsTip": "Geçerli çalışma alanındaki becerileri ve metin dosyalarını yönetin",
"agentSkillManager": "Beceri yöneticisi",
"agentSkillNew": "Yeni beceri",
- "agentSkillNewFile": "Yeni Markdown dosyası",
+ "agentSkillNewFile": "Yeni metin dosyası",
"agentSkillNewFolder": "Yeni klasör",
"agentSkillSearch": "Beceri dosyalarını ara",
- "agentSkillSource": "Markdown kaynağı",
+ "agentSkillSource": "Kaynak metin",
"agentSkillDeleteTip": "Seçilen dosya veya klasör ve tüm içeriği kalıcı olarak silinecek; bu işlem geri alınamaz",
"agentSkillNameTip": "Geçerli bir dosya veya klasör adı girin",
- "agentSkillResourceTip": "Bu dosyanın konumu yalnızca yerel masaüstü istemcisinde açılabilir",
+ "agentSkillResourceTip": "Bu dosya burada düzenlenemez",
"agentStreamingMarkdown": "Akış sırasında Markdown önizlemesi",
"agentStreamingMarkdownTip": "Ajan yanıt verirken Markdown önizlemesi göster; performansı etkileyebilir",
"taskStatus": "Görev durumu",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index 39c19e446f..37b78dd888 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "«Лише перемістити документи» зберігає поточне правило сортування, яке визначає розташування документів.",
+ "agentSkillBinaryTip": "Двійкові файли не можна редагувати як текст",
+ "agentSkillEncodingTip": "Цей файл має кодування, відмінне від UTF-8, і його неможливо редагувати",
+ "agentSkillTooLargeTip": "Розмір цього файлу перевищує 8 MiB, редагування недоступне",
+ "agentSkillOpenLocationTip": "Відкрийте розташування файлу, щоб відредагувати його в іншій програмі",
"fileTreeMoveKeepSort": "Лише перемістити документи",
"accessibilitySupport": "Підтримка спеціальних можливостей",
"accessibilitySupportTip": "Підтримка програм читання з екрана та інших допоміжних засобів; типово вимкнена, застосовується до всіх робочих просторів на цьому пристрої та потребує повного закриття й повторного запуску SiYuan",
"accessibilitySupportError": "Не вдалося прочитати або зберегти налаштування спеціальних можливостей",
"accessibilitySupportOverrideTip": "Керується параметрами запуску; видаліть параметри спеціальних можливостей, щоб використовувати це налаштування",
"agentWorkspaceSkills": "Навички робочого простору",
- "agentWorkspaceSkillsTip": "Керування навичками та файлами Markdown у поточному робочому просторі",
+ "agentWorkspaceSkillsTip": "Керування навичками й текстовими файлами в поточному робочому просторі",
"agentSkillManager": "Керування навичками",
"agentSkillNew": "Нова навичка",
- "agentSkillNewFile": "Новий файл Markdown",
+ "agentSkillNewFile": "Новий текстовий файл",
"agentSkillNewFolder": "Нова тека",
"agentSkillSearch": "Пошук файлів навичок",
- "agentSkillSource": "Вихідний текст Markdown",
+ "agentSkillSource": "Вихідний текст",
"agentSkillDeleteTip": "Вибраний файл або теку з усім вмістом буде видалено назавжди; цю дію неможливо скасувати",
"agentSkillNameTip": "Введіть припустиму назву файлу або теки",
- "agentSkillResourceTip": "Розташування цього файлу можна відкрити лише в локальному настільному клієнті",
+ "agentSkillResourceTip": "Цей файл неможливо редагувати тут",
"agentStreamingMarkdown": "Попередній перегляд Markdown під час потокового виведення",
"agentStreamingMarkdownTip": "Попередній перегляд Markdown під час відповіді агента; може впливати на продуктивність",
"taskStatus": "Статус завдання",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index ecaed2fa5e..c09fb4f821 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "「仅移动文档」将保留当前排序规则,文档位置由排序规则决定。",
+ "agentSkillBinaryTip": "二进制文件不支持作为文本编辑",
+ "agentSkillEncodingTip": "此文件不是 UTF-8 编码,无法编辑",
+ "agentSkillTooLargeTip": "此文件超过 8 MiB,无法编辑",
+ "agentSkillOpenLocationTip": "可打开文件位置,使用其他应用编辑",
"fileTreeMoveKeepSort": "仅移动文档",
"accessibilitySupport": "辅助功能支持",
"accessibilitySupportTip": "支持读屏和其他辅助工具,默认关闭;适用于本机所有工作空间,修改后需完全退出并重新启动思源",
"accessibilitySupportError": "无法读取或保存辅助功能设置",
"accessibilitySupportOverrideTip": "当前由启动参数控制,移除辅助功能相关启动参数后才能使用此设置",
"agentWorkspaceSkills": "工作空间技能",
- "agentWorkspaceSkillsTip": "管理当前工作空间中的技能及 Markdown 文件",
+ "agentWorkspaceSkillsTip": "管理当前工作空间中的技能和文本文件",
"agentSkillManager": "技能管理",
"agentSkillNew": "新建技能",
- "agentSkillNewFile": "新建 Markdown 文件",
+ "agentSkillNewFile": "新建文本文件",
"agentSkillNewFolder": "新建文件夹",
"agentSkillSearch": "搜索技能文件",
- "agentSkillSource": "Markdown 源码",
+ "agentSkillSource": "文本源码",
"agentSkillDeleteTip": "将永久删除所选文件或文件夹及其全部内容,此操作无法撤销",
"agentSkillNameTip": "请输入有效的文件或文件夹名称",
- "agentSkillResourceTip": "此文件仅支持在本地桌面端打开文件位置",
+ "agentSkillResourceTip": "此文件无法在此处编辑",
"agentStreamingMarkdown": "流式 Markdown 预览",
"agentStreamingMarkdownTip": "在回复过程中预览 Markdown,可能影响性能",
"taskStatus": "任务状态",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index 3696a8db8b..f096fa4174 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -1,21 +1,25 @@
{
"fileTreeMoveKeepSortTip": "「僅移動文件」將保留目前排序規則,文件位置由排序規則決定。",
+ "agentSkillBinaryTip": "二進位檔案不支援以文字編輯",
+ "agentSkillEncodingTip": "此檔案不是 UTF-8 編碼,無法編輯",
+ "agentSkillTooLargeTip": "此檔案超過 8 MiB,無法編輯",
+ "agentSkillOpenLocationTip": "可開啟檔案位置,使用其他應用程式編輯",
"fileTreeMoveKeepSort": "僅移動文件",
"accessibilitySupport": "輔助功能支援",
"accessibilitySupportTip": "支援螢幕閱讀器和其他輔助工具,預設關閉;適用於本機所有工作空間,修改後需完全結束並重新啟動思源",
"accessibilitySupportError": "無法讀取或儲存輔助功能設定",
"accessibilitySupportOverrideTip": "目前由啟動參數控制,移除輔助功能相關啟動參數後才能使用此設定",
"agentWorkspaceSkills": "工作空間技能",
- "agentWorkspaceSkillsTip": "管理目前工作空間中的技能及 Markdown 檔案",
+ "agentWorkspaceSkillsTip": "管理目前工作空間中的技能和文字檔案",
"agentSkillManager": "技能管理",
"agentSkillNew": "新增技能",
- "agentSkillNewFile": "新增 Markdown 檔案",
+ "agentSkillNewFile": "新增文字檔案",
"agentSkillNewFolder": "新增資料夾",
"agentSkillSearch": "搜尋技能檔案",
- "agentSkillSource": "Markdown 原始碼",
+ "agentSkillSource": "文字原始碼",
"agentSkillDeleteTip": "將永久刪除所選檔案或資料夾及其全部內容,此操作無法復原",
"agentSkillNameTip": "請輸入有效的檔案或資料夾名稱",
- "agentSkillResourceTip": "此檔案僅支援在本機桌面端開啟檔案位置",
+ "agentSkillResourceTip": "此檔案無法在此處編輯",
"agentStreamingMarkdown": "串流 Markdown 預覽",
"agentStreamingMarkdownTip": "在回覆過程中預覽 Markdown,可能影響效能",
"taskStatus": "任務狀態",
diff --git a/app/src/ai/skills/manager.ts b/app/src/ai/skills/manager.ts
index 1bf6de7286..d48d034ad0 100644
--- a/app/src/ai/skills/manager.ts
+++ b/app/src/ai/skills/manager.ts
@@ -8,7 +8,7 @@ import {getHostCapabilities} from "../../util/hostCapabilities";
import {isBrowser, isMobile} from "../../util/functions";
import {canChangeSkillEntry, getSkillDirectory, SkillSourceState} from "./state";
import {createSkillManagerPage} from "./page";
-import type {AISkillFileEntry, AISkillFileRequestInput} from "../../types/api";
+import type {AISkillFileData, AISkillFileEntry, AISkillFileRequestInput} from "../../types/api";
/// #if !MOBILE
import {openBy} from "../../editor/util";
/// #endif
@@ -81,6 +81,7 @@ export const openSkillManager = (settingRoot?: HTMLElement) => {
let entries: AISkillFileEntry[] = [];
let selected: AISkillFileEntry;
let selectedRevision = "";
+ let readOnlyReason: AISkillFileData["readOnlyReason"];
let busy = false;
let closed = false;
let confirming = false;
@@ -141,7 +142,11 @@ ${mobile ? "" : `<div class="skill-manager__actions">${button("save", lang.save)
source.readOnly = busy;
source.classList.toggle("fn__none", !editable);
hint.classList.toggle("fn__none", editable);
- hint.textContent = selected && !selected.isDir ? lang.agentSkillResourceTip : lang.emptyContent;
+ const reasons = {binary: lang.agentSkillBinaryTip, encoding: lang.agentSkillEncodingTip,
+ tooLarge: lang.agentSkillTooLargeTip};
+ hint.textContent = selected && !selected.isDir ?
+ (reasons[readOnlyReason] || lang.agentSkillResourceTip) + (localFiles ? " " + lang.agentSkillOpenLocationTip : "") :
+ lang.emptyContent;
path.textContent = (state.path || selected?.path || "") + (state.dirty ? " *" : "");
if (mobile) {
const editing = root.classList.contains("skill-manager--editing");
@@ -235,7 +240,12 @@ ${mobile ? "" : `<div class="skill-manager__actions">${button("save", lang.save)
selected = entry;
selectedRevision = data?.revision || "";
if (!entry?.isDir) {
- state.load(entry?.editable ? entry.path : "", data?.content || "", selectedRevision);
+ readOnlyReason = data?.readOnlyReason;
+ // 读取结果优先于列表快照,外部程序可能已改变文件内容或编码。
+ if (entry) {
+ entry.editable = typeof data?.content === "string";
+ }
+ state.load(entry?.editable ? entry.path : "", data?.content ?? "", selectedRevision);
source.value = state.text;
source.scrollTop = 0;
if (entry && reveal) {
@@ -367,7 +377,7 @@ ${mobile ? "" : `<div class="skill-manager__actions">${button("save", lang.save)
const input = inputDialog.element.querySelector<HTMLInputElement>("input");
const name = value.trim();
const target = getFileRenameTarget(action === "rename" ? entry.path : "", name);
- if (target === undefined || (action === "rename" && !entry.isDir && !/\.md$/i.test(name))) {
+ if (target === undefined) {
input.setCustomValidity(lang.agentSkillNameTip);
input.reportValidity();
return;
@@ -386,7 +396,7 @@ ${mobile ? "" : `<div class="skill-manager__actions">${button("save", lang.save)
}
data = await api({action: "move", path: entry.path, target, revision: selectedRevision});
} else {
- next = directory + "/" + (action === "newFile" && !/\.md$/i.test(name) ? name + ".md" : name);
+ next = directory + "/" + name;
data = await api(action === "mkdir" ? {action: "mkdir", path: next} :
{action: "write", path: next, content: "", revision: ""});
}
diff --git a/app/src/ai/skills/state.test.ts b/app/src/ai/skills/state.test.ts
index 8db77e26d2..ac9f74345a 100644
--- a/app/src/ai/skills/state.test.ts
+++ b/app/src/ai/skills/state.test.ts
@@ -7,17 +7,32 @@ test("skill entry points and resources cannot be renamed or deleted separately",
assert.equal(canChangeSkillEntry({path: "review/skill.MD", isDir: false, editable: true}), false);
assert.equal(canChangeSkillEntry({path: "review/references/SKILL.md", isDir: false, editable: true}), true);
assert.equal(canChangeSkillEntry({path: "review/run.js", isDir: false, editable: false}), false);
+ assert.equal(canChangeSkillEntry({path: "review/run.js", isDir: false, editable: true}), true);
+ assert.equal(canChangeSkillEntry({path: "review/.claude/.config.json", isDir: false, editable: true}), true);
assert.equal(canChangeSkillEntry({path: "review", isDir: true, editable: false}), true);
assert.equal(canChangeSkillEntry(undefined), false);
});
-test("new Markdown files stay inside the selected skill directory", () => {
+test("new text files stay inside the selected skill directory", () => {
assert.equal(getSkillDirectory(), "");
assert.equal(getSkillDirectory({path: "review", isDir: true, editable: false}), "review");
assert.equal(getSkillDirectory({path: "review/references/info.md", isDir: false, editable: true}), "review/references");
assert.equal(getSkillDirectory({path: "loose.md", isDir: false, editable: false}), "");
});
+test("text editing preserves UTF-8 BOM and uniform line endings without evaluating scripts", () => {
+ for (const newline of ["\n", "\r\n", "\r"]) {
+ const state = new SkillSourceState();
+ const content = "\ufeffprint('text only')" + newline;
+ state.load("skill/.script.py", content, "original");
+ assert.equal(state.content, content);
+ state.text += "# edited\n";
+ assert.equal(state.content, content + "# edited" + newline);
+ state.acceptSave("new");
+ assert.equal(state.dirty, false);
+ }
+});
+
test("editing preserves Markdown front matter, Unicode, and CRLF", () => {
const state = new SkillSourceState();
const content = "---\r\nname: review\r\ndescription: \"检查\"\r\n---\r\n\r\n# Notes\r\n";
diff --git a/app/src/ai/skills/state.ts b/app/src/ai/skills/state.ts
index 0a5a77aaad..b94f61d051 100644
--- a/app/src/ai/skills/state.ts
+++ b/app/src/ai/skills/state.ts
@@ -15,13 +15,14 @@ export class SkillSourceState {
public text = "";
private saved = "";
private original = "";
- private crlf = false;
+ private newline = "\n";
public load(path: string, content: string, revision: string) {
this.path = path;
this.original = content;
this.revision = revision;
- this.crlf = content.includes("\r\n") && !content.replace(/\r\n/g, "").includes("\n");
+ const endings = content.match(/\r\n|\r|\n/g);
+ this.newline = endings?.length && endings.every(ending => ending === endings[0]) ? endings[0] : "\n";
this.text = content.replace(/\r\n?/g, "\n");
this.saved = this.text;
}
@@ -34,7 +35,7 @@ export class SkillSourceState {
if (!this.dirty) {
return this.original;
}
- return this.crlf ? this.text.replace(/\n/g, "\r\n") : this.text;
+ return this.text.replace(/\n/g, this.newline);
}
public acceptSave(revision: string) {
diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.ts
index 0b54b2f2d6..7c1a3d37b4 100644
--- a/app/src/types/api/index.d.ts
+++ b/app/src/types/api/index.d.ts
@@ -172,7 +172,7 @@ export type AISessionsRequestInput = { "keyword"?: string | null; "page"?: numbe
export type AISkillData = { "content": string; "name": string; };
-export type AISkillFileData = { "content"?: string; "entries"?: Array<AISkillFileEntry> | null; "revision"?: string; };
+export type AISkillFileData = { "content"?: string; "entries"?: Array<AISkillFileEntry> | null; "readOnlyReason"?: "binary" | "encoding" | "tooLarge"; "revision"?: string; };
export type AISkillFileEntry = { "editable": boolean; "isDir": boolean; "path": string; };
diff --git a/app/tests/skillManager.test.js b/app/tests/skillManager.test.js
index 488b988077..d5094a0998 100644
--- a/app/tests/skillManager.test.js
+++ b/app/tests/skillManager.test.js
@@ -40,12 +40,23 @@ const runCases = async (appDirectory, mode, capture) => {
let stored = original;
let conflict = false;
let id = 0;
+ const textFiles = new Map([
+ ["directory-id/.config.json", "\ufeff{\r\n \"enabled\": true\r\n}\r\n"],
+ ["directory-id/run.py", "print('text only')\n"],
+ ["directory-id/README", "No extension\n"],
+ ]);
+ const readOnlyFiles = new Map([
+ ["directory-id/image.png", "binary"],
+ ["directory-id/legacy.txt", "encoding"],
+ ["directory-id/large.txt", "tooLarge"],
+ ]);
const entries = [
{path: "directory-id", isDir: true, editable: false},
{path: "directory-id/SKILL.md", isDir: false, editable: true},
{path: "directory-id/resources", isDir: true, editable: false},
{path: "directory-id/resources/notes.md", isDir: false, editable: true},
- {path: "directory-id/image.png", isDir: false, editable: false},
+ ...Array.from(textFiles.keys(), path => ({path, isDir: false, editable: false})),
+ ...Array.from(readOnlyFiles.keys(), path => ({path, isDir: false, editable: true})),
...Array.from({length: 40}, (_, index) => ({path: `extra-${index}`, isDir: true, editable: false})),
];
window.siyuan = {
@@ -70,23 +81,46 @@ const runCases = async (appDirectory, mode, capture) => {
requests.push({...request});
await tick();
if (request.action === "list") {
- return {code: 0, data: {entries}};
+ return {code: 0, data: {entries: entries.map(entry => ({...entry}))}};
}
if (request.action === "read") {
const entry = entries.find(item => item.path === request.path);
assert.ok(entry, request.path);
+ if (readOnlyFiles.has(request.path)) {
+ return {code: 0, data: {revision: "revision-1", readOnlyReason: readOnlyFiles.get(request.path)}};
+ }
return {code: 0, data: {
revision: "revision-1",
- ...(entry.editable ? {content: request.path.endsWith("SKILL.md") ? stored : "Resource text"} : {}),
+ ...(textFiles.has(request.path) ? {content: textFiles.get(request.path)} :
+ entry.editable ? {content: request.path.endsWith("SKILL.md") ? stored : "Resource text"} : {}),
}};
}
if (request.action === "write") {
if (conflict) {
return {code: -1, msg: "File changed", data: null};
}
- stored = request.content;
+ if (request.path.endsWith("SKILL.md")) {
+ stored = request.content;
+ } else {
+ textFiles.set(request.path, request.content);
+ if (!entries.some(entry => entry.path === request.path)) {
+ entries.push({path: request.path, isDir: false, editable: true});
+ }
+ }
return {code: 0, data: {revision: "revision-2"}};
}
+ if (request.action === "move") {
+ const entry = entries.find(entry => entry.path === request.path);
+ entry.path = request.target;
+ textFiles.set(request.target, textFiles.get(request.path));
+ textFiles.delete(request.path);
+ return {code: 0, data: {}};
+ }
+ if (request.action === "remove") {
+ entries.splice(entries.findIndex(entry => entry.path === request.path), 1);
+ textFiles.delete(request.path);
+ return {code: 0, data: {}};
+ }
throw new Error(`Unexpected action: ${request.action}`);
}},
};
@@ -276,6 +310,7 @@ const runCases = async (appDirectory, mode, capture) => {
assert.equal(host.isConnected, false);
assert.equal(window.siyuan.dialogs.length, 0);
+ conflict = false;
openManager();
await tick();
await tick();
@@ -291,6 +326,9 @@ const runCases = async (appDirectory, mode, capture) => {
assert.equal(nextHost.querySelector('[data-action="save"]').disabled, true);
assert.equal(nextManager.querySelector('[data-action="rename"]').disabled, true);
assert.equal(nextManager.querySelector('[data-action="remove"]').disabled, true);
+ const lang = window.siyuan.languages;
+ assert.equal(nextManager.querySelector(".skill-manager__hint").textContent,
+ lang.agentSkillBinaryTip + (mode === "desktop" ? " " + lang.agentSkillOpenLocationTip : ""));
if (mode === "desktop") {
nextManager.querySelector('[data-action="open"]').click();
assert.equal(opened[0][0], "D:/workspace/data/storage/ai/agent/skills/directory-id/image.png");
@@ -306,6 +344,70 @@ const runCases = async (appDirectory, mode, capture) => {
assert.equal(prompt.element.classList.contains("mobile-bottom-sheet-dialog"), false);
prompt.element.querySelector("[data-input-cancel]").click();
await tick();
+ const nextButton = action => nextHost.querySelector(`[data-action="${action}"]`);
+ const returnToList = async () => {
+ if (mobile && nextManager.classList.contains("skill-manager--editing")) {
+ nextButton("back").click();
+ await tick();
+ }
+ };
+ const nextChoose = async file => {
+ await returnToList();
+ nextManager.querySelector(`[data-path="${file}"] .skill-manager__file`).click();
+ await tick();
+ await tick();
+ };
+ for (const [file, reason] of readOnlyFiles) {
+ await nextChoose(file);
+ const tip = {binary: lang.agentSkillBinaryTip, encoding: lang.agentSkillEncodingTip, tooLarge: lang.agentSkillTooLargeTip}[reason];
+ assert.ok(nextManager.querySelector(".skill-manager__hint").textContent.startsWith(tip));
+ assert.equal(nextButton("rename").disabled, true);
+ assert.equal(nextButton("remove").disabled, true);
+ assert.equal(nextManager.querySelector("textarea").disabled, true);
+ }
+ for (const [file, content] of textFiles) {
+ await nextChoose(file);
+ const editor = nextManager.querySelector("textarea");
+ assert.equal(editor.disabled, false, "read response supersedes stale list editability");
+ assert.equal(editor.value, content.replace(/\r\n/g, "\n"));
+ editor.value += "edited\n";
+ editor.dispatchEvent(new Event("input", {bubbles: true}));
+ nextButton("save").click();
+ await tick();
+ await tick();
+ const saved = requests.filter(request => request.action === "write").at(-1);
+ assert.equal(saved.path, file);
+ assert.equal(saved.content, content + (content.includes("\r\n") ? "edited\r\n" : "edited\n"));
+ assert.equal(nextButton("rename").disabled, false);
+ assert.equal(nextButton("remove").disabled, false);
+ }
+ const nameAction = async (action, name) => {
+ await returnToList();
+ nextButton(action).click();
+ await tick();
+ const inputDialog = window.siyuan.dialogs.at(-1);
+ inputDialog.element.querySelector("input").value = name;
+ inputDialog.element.querySelector("[data-input-confirm]").click();
+ for (let i = 0; i < 6; i++) {
+ await tick();
+ }
+ };
+ for (const name of ["settings.yaml", "LICENSE"]) {
+ await nameAction("newFile", name);
+ assert.ok(textFiles.has("directory-id/" + name), "new text files keep their chosen extension or lack of one");
+ assert.equal(nextManager.querySelector("textarea").disabled, false, "empty files are editable");
+ }
+ await nameAction("rename", ".env");
+ assert.ok(textFiles.has("directory-id/.env"));
+ assert.equal(textFiles.has("directory-id/LICENSE"), false);
+ await returnToList();
+ nextButton("remove").click();
+ await tick();
+ await acceptConfirm();
+ for (let i = 0; i < 4; i++) {
+ await tick();
+ }
+ assert.equal(textFiles.has("directory-id/.env"), false);
if (mobile) {
settingsRoot.remove();
} else {
diff --git a/docs/API-CONTRACTS.md b/docs/API-CONTRACTS.md
index cadd8f92b1..1b23c45d02 100644
--- a/docs/API-CONTRACTS.md
+++ b/docs/API-CONTRACTS.md
@@ -52,7 +52,7 @@ Attribute-view contracts declare table, gallery, and kanban results separately a
AI contracts retain provider configuration, model discovery and matching, confirmation decisions, session extensions, and numeric and omission semantics. Editor and agent streams declare their actual SSE events; disconnection closes upstream requests, and stream lifetimes remain within the request. OAuth pages retain their media types, HTTP statuses, and security headers. Session permission notifications use `WithAfterWrite` to preserve response-before-broadcast ordering. Arbitrary JSON remains limited to protocol extension fields and tool results.
-`/api/ai/agent/manageSkills` uses strict string fields and administrator/read-only admission for workspace skill files. Relative paths identify physical directories independently of frontmatter names. Markdown reads and writes preserve raw UTF-8 source; directory and resource reads return content-based revisions without source text. Existing mutations require the current revision, share a critical section with legacy skill mutations and installation, and notify synchronization after success. Path traversal, platform aliases, links, stale revisions, and individual renaming or deletion of non-Markdown resources or root `SKILL.md` are rejected. `TestAISkillManagementContract`, `TestAPIContractAISkillManagement`, and `TestSkillManagement` cover request types, actual HTTP responses, authorization, raw content, concurrent saves, and filesystem boundaries. Run `go test -tags "fts5 sqlcipher" ./apicontract/... ./api ./util -run 'Test(AISkillManagementContract|APIContractAISkillManagement|SkillManagement|RouteCoverage)' -count=1`; the full kernel CI suite below includes all of these regressions.
+`/api/ai/agent/manageSkills` uses strict string fields and administrator/read-only admission for workspace skill files. Relative paths identify physical directories independently of frontmatter names, including ordinary dot-prefixed names. Reads and writes support UTF-8 text up to 8 MiB regardless of extension and preserve source bytes. Directory and resource reads retain content-based revisions; non-editable contents omit `content` and add an optional `readOnlyReason` (`binary`, `encoding`, or `tooLarge`). The read response, rather than a stale list entry, determines editor availability. Existing mutations revalidate content and require the current revision, share a critical section with legacy skill mutations and installation, and notify synchronization after success. Path traversal, platform aliases, links, stale revisions, and individual modification of unsupported contents or renaming/deletion of root `SKILL.md` are rejected. `TestAISkillManagementContract`, `TestAPIContractAISkillManagement`, and `TestSkillManagement` cover request types, actual HTTP responses, authorization, raw content, text classification, hidden paths, concurrent saves, and filesystem boundaries. Run `go test -tags "fts5 sqlcipher" ./apicontract/... ./api ./util -run 'Test(AISkillManagementContract|APIContractAISkillManagement|SkillManagement|RouteCoverage)' -count=1`; the full kernel CI suite below includes all of these regressions.
Setting contracts retain partial configuration merging, existing defaults, case-insensitive struct fields, explicit null values, JSON number normalization, and parser error messages. Keyboard shortcuts and cloud authentication results declare their fixed fields while preserving their protocol-defined JSON extensions. Cloud-user admission still precedes body reads for non-administrators, and two-factor authentication keeps cloud error codes and extension fields. Frontend callers normalize persisted display settings at the same existing boundaries.
diff --git a/docs/API-CONTRACTS.zh-CN.md b/docs/API-CONTRACTS.zh-CN.md
index e259a53bc3..8deb173ba9 100644
--- a/docs/API-CONTRACTS.zh-CN.md
+++ b/docs/API-CONTRACTS.zh-CN.md
@@ -52,7 +52,7 @@
AI 契约保留供应商配置、模型发现与匹配、确认结果、会话扩展字段,以及数值和省略语义。编辑器和智能体流声明实际 SSE 事件,断开连接时关闭上游请求,流生命周期仍位于请求内部。OAuth 页面保留媒体类型、HTTP 状态和安全响应头。会话权限通知使用 `WithAfterWrite`,保留先响应再广播的顺序。任意 JSON 仅用于协议扩展字段和工具结果。
-`/api/ai/agent/manageSkills` 使用严格字符串字段,并通过管理员和只读检查管理工作空间技能文件。相对路径标识实际目录,与文件头中的技能名称无关。Markdown 读写保留 UTF-8 原文;目录和资源读取只返回基于内容的版本,不返回正文。修改已有文件必须提供当前版本,与旧技能修改接口和安装共享临界区,成功后通知同步。路径穿越、平台别名、链接、过期版本,以及单独重命名或删除非 Markdown 资源、根 `SKILL.md` 的请求均被拒绝。`TestAISkillManagementContract`、`TestAPIContractAISkillManagement` 和 `TestSkillManagement` 覆盖请求类型、实际 HTTP 响应、权限、原文、并发保存和文件系统边界。运行 `go test -tags "fts5 sqlcipher" ./apicontract/... ./api ./util -run 'Test(AISkillManagementContract|APIContractAISkillManagement|SkillManagement|RouteCoverage)' -count=1`;下方完整内核 CI 测试包含这些回归用例。
+`/api/ai/agent/manageSkills` 使用严格字符串字段,并通过管理员和只读检查管理工作空间技能文件。相对路径标识实际目录,与文件头中的技能名称无关,允许普通的点开头名称。读写支持不超过 8 MiB 的 UTF-8 文本,不依赖扩展名并保留原文字节。目录和资源读取保留基于内容的版本;不支持编辑的内容省略 `content`,并增加可选的 `readOnlyReason`(`binary`、`encoding` 或 `tooLarge`)。编辑器以读取结果判断可编辑性,不依赖可能过期的列表项。修改已有文件时重新校验内容并要求当前版本,与旧技能修改接口和安装共享临界区,成功后通知同步。路径穿越、平台别名、链接、过期版本,以及单独修改不支持的内容或重命名、删除根 `SKILL.md` 的请求均被拒绝。`TestAISkillManagementContract`、`TestAPIContractAISkillManagement` 和 `TestSkillManagement` 覆盖请求类型、实际 HTTP 响应、权限、原文、文本判定、隐藏路径、并发保存和文件系统边界。运行 `go test -tags "fts5 sqlcipher" ./apicontract/... ./api ./util -run 'Test(AISkillManagementContract|APIContractAISkillManagement|SkillManagement|RouteCoverage)' -count=1`;下方完整内核 CI 测试包含这些回归用例。
设置契约保留局部配置合并、既有默认值、结构字段大小写兼容、显式 null、JSON 数字归一化及解析错误消息。快捷键与云端认证结果声明固定字段,同时保留协议定义的 JSON 扩展。非管理员查询云用户时仍先执行准入判断再读取请求体;双因素认证保留云端错误码与扩展字段。前端继续在既有边界规范化持久化的显示设置。
diff --git a/docs/SKILL-MANAGER.md b/docs/SKILL-MANAGER.md
index ae76caabb1..ccbd8160b1 100644
--- a/docs/SKILL-MANAGER.md
+++ b/docs/SKILL-MANAGER.md
@@ -6,11 +6,11 @@ Open Workspace skills in the Skills group under Settings - Artificial Intelligen
## Managing files
-Search the file list and select `SKILL.md` or a bundled `.md` file to edit its Markdown source. Editable source files must be valid UTF-8 and at most 8 MiB. Save writes the source back to the selected path without converting it into a SiYuan document or regenerating its YAML frontmatter. Files with consistent CRLF line endings retain that format; editing a file with mixed line endings normalizes them to LF. Leaving a file unmodified or discarding changes preserves its original source. Unsaved changes require confirmation before they are discarded.
+Search the file list and select `SKILL.md` or any bundled text file, including JSON, YAML, scripts, and files without an extension. Editability is determined by content, not the extension: files must be valid UTF-8, at most 8 MiB, and contain no control characters other than tab, line feed, carriage return, and form feed. Scripts are edited as text and are never executed by the manager. Save writes the source back to the selected path without converting it into a SiYuan document or regenerating its YAML frontmatter. UTF-8 BOMs and consistent LF, CRLF, or CR line endings are preserved; editing mixed line endings normalizes them to LF. Leaving a file unmodified or discarding changes preserves its original source. Unsaved changes require confirmation before they are discarded. Replacing an existing file preserves its permission bits, including script execution permissions.
-Create a skill to add a directory containing `SKILL.md`. Inside a skill, create Markdown files and folders, rename files or folders within their current parent, and delete Markdown files or folders. A skill's root `SKILL.md` cannot be renamed or deleted on its own; delete the containing skill to remove it. Renaming a skill directory does not change the independent `name` field in its frontmatter.
+Create a skill to add a directory containing `SKILL.md`. Inside a skill, create text files and folders, rename editable files or folders within their current parent, and delete editable files or folders. New files keep the specified name without an automatically appended extension. Names such as `.config.json` and `.claude/` are supported. A skill's root `SKILL.md` cannot be renamed or deleted on its own; delete the containing skill to remove it. Renaming a skill directory does not change the independent `name` field in its frontmatter.
-Other resource files appear in the list but cannot be edited, renamed, or deleted individually in the manager. A local desktop client can open their file location for management with other applications. Deleting a folder also deletes every resource inside it, including files that the manager cannot edit, and cannot be undone through the manager.
+Binary files, files in unsupported encodings, and files larger than 8 MiB appear in the list but cannot be edited, renamed, or deleted individually in the manager. Selecting one displays the reason editing is unavailable. A local desktop client also offers opening its file location for management with other applications. Deleting a folder deletes every resource inside it, including files that the manager cannot edit, and cannot be undone through the manager.
On mobile, the manager opens as a full-screen settings subpage. Selecting a file opens an editor page with Back and Save at the top. Returning to the file list preserves its scroll position, and returning to settings preserves the existing settings page state. Unsaved-change confirmation and layout adaptation to the on-screen keyboard remain available; short confirmations and name entry use ordinary dialogs.
@@ -29,11 +29,11 @@ The management interface rejects paths through symbolic links, paths outside the
| Action | Behavior |
| --- | --- |
| `list` | Return the file tree as `entries`, with `path`, `isDir`, and `editable` for each entry |
-| `read` | Return the item's `revision`, plus original `content` for editable Markdown files |
+| `read` | Return the item's `revision`, plus original `content` for editable text files; unsupported contents omit `content` and include `readOnlyReason` (`binary`, `encoding`, or `tooLarge`) |
| `create` | Create a top-level skill directory and its `SKILL.md` |
| `mkdir` | Create a folder inside a skill |
-| `write` | Write a Markdown file inside a skill; an existing file requires its current `revision`, and a new file uses an empty revision |
+| `write` | Write a UTF-8 text file inside a skill; an existing file requires its current `revision`, and a new file uses an empty revision |
| `move` | Rename an item to `target` within the same parent, using its current `revision` |
| `remove` | Delete an item using its current `revision` |
-The root `SKILL.md`, non-Markdown files, symbolic links, and folder deletion follow the restrictions described above. A rejected revision or invalid operation returns an error instead of changing the item. Existing name-based skill APIs remain available for compatibility; management clients should use relative paths through this endpoint.
+The root `SKILL.md`, unsupported contents, symbolic links, and folder deletion follow the restrictions described above. Reads and mutations revalidate file contents instead of trusting list-time `editable` values. A rejected revision or invalid operation returns an error instead of changing the item. Existing name-based skill APIs remain available for compatibility; management clients should use relative paths through this endpoint.
diff --git a/docs/SKILL-MANAGER.zh-CN.md b/docs/SKILL-MANAGER.zh-CN.md
index 0cb1e3152e..3f75e01aec 100644
--- a/docs/SKILL-MANAGER.zh-CN.md
+++ b/docs/SKILL-MANAGER.zh-CN.md
@@ -6,11 +6,11 @@
## 管理文件
-搜索文件列表,选择 `SKILL.md` 或技能附带的 `.md` 文件,即可编辑 Markdown 源码。可编辑的源码文件必须采用有效的 UTF-8 编码,且不超过 8 MiB。保存时直接写回所选路径,不转换为思源文档,也不重新生成 YAML 前置元数据。编辑器保留统一的 CRLF 换行格式;编辑混合换行的文件后,换行符会统一为 LF。未修改文件或放弃更改时保留原文。放弃未保存的更改前需要确认。
+搜索文件列表,选择 `SKILL.md` 或技能附带的文本文件即可编辑,包括 JSON、YAML、脚本及无扩展名文件。是否可编辑根据内容判断,不依赖扩展名:文件必须采用有效的 UTF-8 编码,不超过 8 MiB,且不含制表、换行、回车、换页以外的控制字符。脚本仅作为文本编辑,管理器不会执行脚本。保存时直接写回所选路径,不转换为思源文档,也不重新生成 YAML 前置元数据。编辑器保留 UTF-8 BOM 和统一的 LF、CRLF 或 CR 换行格式;编辑混合换行的文件后,换行符会统一为 LF。未修改文件或放弃更改时保留原文。放弃未保存的更改前需要确认。替换已有文件时保留其权限位,包括脚本的执行权限。
-新建技能会创建包含 `SKILL.md` 的目录。在技能内部,可以新建 Markdown 文件和文件夹,在当前父目录内重命名文件或文件夹,以及删除 Markdown 文件或文件夹。技能根目录中的 `SKILL.md` 不能单独重命名或删除;如需移除技能,应删除整个技能目录。重命名技能目录不会修改前置元数据中独立的 `name` 字段。
+新建技能会创建包含 `SKILL.md` 的目录。在技能内部,可以新建文本文件和文件夹,在当前父目录内重命名可编辑的文件或文件夹,以及删除可编辑的文件或文件夹。新建文件使用输入的名称,不自动追加扩展名。支持 `.config.json`、`.claude/` 等合法名称。技能根目录中的 `SKILL.md` 不能单独重命名或删除;如需移除技能,应删除整个技能目录。重命名技能目录不会修改前置元数据中独立的 `name` 字段。
-其他资源文件会显示在列表中,但不能在管理界面内单独编辑、重命名或删除。本地桌面端可以打开文件位置,再使用其他应用管理这些资源。删除文件夹也会删除其中的全部资源,包括管理界面无法编辑的文件,且无法通过技能管理撤销。
+二进制文件、编码不支持的文件及超过 8 MiB 的文件会显示在列表中,但不能在管理界面内单独编辑、重命名或删除。选择文件后会说明无法编辑的原因,本地桌面端还可打开文件位置,使用其他应用管理。删除文件夹也会删除其中的全部资源,包括管理界面无法编辑的文件,且无法通过技能管理撤销。
移动端通过全屏设置子页面展示技能管理。选择文件后进入编辑页面,顶部提供返回和保存操作。返回文件列表时保留滚动位置,返回设置时保留原设置页面状态。未保存更改确认和屏幕键盘适配保持可用;简短确认和名称输入使用普通对话框。
@@ -29,11 +29,11 @@
| 操作 | 行为 |
| --- | --- |
| `list` | 通过 `entries` 返回文件树,每项包含 `path`、`isDir` 和 `editable` |
-| `read` | 返回项目的 `revision`,可编辑的 Markdown 文件另返回原始 `content` |
+| `read` | 返回项目的 `revision`,可编辑的文本文件另返回原始 `content`;内容不支持编辑时省略 `content`,并通过 `readOnlyReason` 返回 `binary`、`encoding` 或 `tooLarge` |
| `create` | 新建顶层技能目录及其 `SKILL.md` |
| `mkdir` | 在技能内部新建文件夹 |
-| `write` | 写入技能内部的 Markdown 文件;已有文件必须提供当前 `revision`,新文件使用空修订号 |
+| `write` | 写入技能内部的 UTF-8 文本文件;已有文件必须提供当前 `revision`,新文件使用空修订号 |
| `move` | 在同一父目录内将项目重命名为 `target`,并提供当前 `revision` |
| `remove` | 删除项目,并提供当前 `revision` |
-根目录中的 `SKILL.md`、非 Markdown 文件、符号链接以及文件夹删除遵循前述限制。修订号不匹配或操作无效时返回错误,不修改目标项目。现有按名称操作的技能 API 保留兼容,管理客户端应通过此接口使用相对路径。
+根目录中的 `SKILL.md`、不支持编辑的内容、符号链接以及文件夹删除遵循前述限制。读取和修改时会重新校验内容,不依赖列表中的 `editable` 快照。修订号不匹配或操作无效时返回错误,不修改目标项目。现有按名称操作的技能 API 保留兼容,管理客户端应通过此接口使用相对路径。
diff --git a/kernel/api/contract_skill_manage_test.go b/kernel/api/contract_skill_manage_test.go
index 33cd782c73..0623d666e4 100644
--- a/kernel/api/contract_skill_manage_test.go
+++ b/kernel/api/contract_skill_manage_test.go
@@ -65,6 +65,25 @@ func TestAPIContractAISkillManagement(t *testing.T) {
}
call(`{"action":"mkdir","path":"directory/references"}`, 0)
call(`{"action":"write","path":"directory/references/reference.md","content":"reference"}`, 0)
+ call(`{"action":"mkdir","path":"directory/.claude"}`, 0)
+ call(`{"action":"write","path":"directory/.claude/.config.json","content":"{\r\n\"enabled\":true\r\n}\r\n"}`, 0)
+ text := call(`{"action":"read","path":"directory/.claude/.config.json"}`, 0)
+ if text.Content == nil || *text.Content != "{\r\n\"enabled\":true\r\n}\r\n" || text.ReadOnlyReason != "" {
+ t.Fatalf("hidden JSON file is not editable: %+v", text)
+ }
+ for _, fixture := range []struct{ name, content, reason string }{
+ {"binary.json", "\x00\x01", "binary"},
+ {"encoding.txt", "\xff\xfea\x00", "encoding"},
+ {"large.txt", strings.Repeat("a", 8*1024*1024+1), "tooLarge"},
+ } {
+ if err = os.WriteFile(filepath.Join(util.SkillsDir(), "directory", fixture.name), []byte(fixture.content), 0644); err != nil {
+ t.Fatal(err)
+ }
+ response := call(`{"action":"read","path":"directory/`+fixture.name+`"}`, 0)
+ if response.Content != nil || response.ReadOnlyReason != fixture.reason || response.Revision == "" {
+ t.Fatalf("read-only reason missing from HTTP response: %+v", response)
+ }
+ }
resource := filepath.Join(util.SkillsDir(), "directory", "asset.bin")
if err = os.WriteFile(resource, []byte{0, 255}, 0644); err != nil {
t.Fatal(err)
diff --git a/kernel/api/skill_manage.go b/kernel/api/skill_manage.go
index 6868325d98..0e6aca50ce 100644
--- a/kernel/api/skill_manage.go
+++ b/kernel/api/skill_manage.go
@@ -1,6 +1,7 @@
package api
import (
+ "errors"
"path/filepath"
"github.com/gin-gonic/gin"
@@ -16,9 +17,24 @@ func manageSkillsContract(c *gin.Context, request apicontract.AISkillFileRequest
Action: request.Action, Path: request.Path, Target: request.Target, Content: request.Content, Revision: request.Revision,
})
if err != nil {
- return apicontract.Failure[apicontract.AISkillFileData](-1, util.EscapeHTML(err.Error()))
+ message := err.Error()
+ key := ""
+ switch {
+ case errors.Is(err, util.ErrSkillBinary):
+ key = "agentSkillBinaryTip"
+ case errors.Is(err, util.ErrSkillEncoding):
+ key = "agentSkillEncodingTip"
+ case errors.Is(err, util.ErrSkillTooLarge):
+ key = "agentSkillTooLargeTip"
+ }
+ if key != "" {
+ if translated := util.I18nTerm(model.Conf.Lang, key); translated != "" {
+ message = translated
+ }
+ }
+ return apicontract.Failure[apicontract.AISkillFileData](-1, util.EscapeHTML(message))
}
- ret := apicontract.AISkillFileData{Content: data.Content, Revision: data.Revision}
+ ret := apicontract.AISkillFileData{Content: data.Content, Revision: data.Revision, ReadOnlyReason: data.ReadOnlyReason}
if data.Entries != nil {
entries := make([]apicontract.AISkillFileEntry, 0, len(data.Entries))
for _, entry := range data.Entries {
diff --git a/kernel/apicontract/ai_skill_manage.go b/kernel/apicontract/ai_skill_manage.go
index 760c8cb333..d59746d523 100644
--- a/kernel/apicontract/ai_skill_manage.go
+++ b/kernel/apicontract/ai_skill_manage.go
@@ -1,6 +1,6 @@
package apicontract
-// AISkillFileRequest 使用工作空间技能目录内的相对路径,保留 Markdown 原文和版本。
+// AISkillFileRequest 使用工作空间技能目录内的相对路径,保留 UTF-8 文本原文和版本。
type AISkillFileRequest struct {
Action string `json:"action"`
Path string `json:"path" api:"optional"`
@@ -10,13 +10,16 @@ type AISkillFileRequest struct {
}
type AISkillFileEntry struct {
- Path string `json:"path"`
- IsDir bool `json:"isDir"`
- Editable bool `json:"editable"`
+ Path string `json:"path"`
+ IsDir bool `json:"isDir"`
+ // Editable 表示文件是技能内不超过 8 MiB 的 UTF-8 文本;读取时会重新检测。
+ Editable bool `json:"editable"`
}
type AISkillFileData struct {
Entries *[]AISkillFileEntry `json:"entries,omitempty"`
Content *string `json:"content,omitempty"`
Revision string `json:"revision,omitempty"`
+ // ReadOnlyReason 说明读取时不能编辑正文的原因;此时不返回 Content,仍保留 Revision。
+ ReadOnlyReason string `json:"readOnlyReason,omitempty" api:"enum=binary|encoding|tooLarge"`
}
diff --git a/kernel/apicontract/schema.json b/kernel/apicontract/schema.json
index 9636271161..b809e08849 100644
--- a/kernel/apicontract/schema.json
+++ b/kernel/apicontract/schema.json
@@ -5056,6 +5056,14 @@
}
]
},
+ "readOnlyReason": {
+ "type": "string",
+ "enum": [
+ "binary",
+ "encoding",
+ "tooLarge"
+ ]
+ },
"revision": {
"type": "string"
}
diff --git a/kernel/util/skill_manage.go b/kernel/util/skill_manage.go
index 86f8c186c4..a934199623 100644
--- a/kernel/util/skill_manage.go
+++ b/kernel/util/skill_manage.go
@@ -26,6 +26,12 @@ const maxManagedSkillSourceSize = 8 * 1024 * 1024
var skillManagementLock sync.Mutex
+var (
+ ErrSkillBinary = errors.New("binary files cannot be edited as text")
+ ErrSkillEncoding = errors.New("only UTF-8 text files can be edited")
+ ErrSkillTooLarge = errors.New("text files must be at most 8 MiB")
+)
+
type SkillFileRequest struct {
Action string
Path string
@@ -41,9 +47,10 @@ type SkillFileEntry struct {
}
type SkillFileData struct {
- Entries []SkillFileEntry
- Content *string
- Revision string
+ Entries []SkillFileEntry
+ Content *string
+ Revision string
+ ReadOnlyReason string
}
// 管理操作使用真实的相对路径,不使用技能正文中的名称作为文件标识。
@@ -52,7 +59,7 @@ func validateManagedSkillPath(p string) error {
return errors.New("invalid skill path")
}
for _, part := range strings.Split(p, "/") {
- if strings.HasPrefix(part, ".") || strings.TrimSpace(part) != part || strings.HasSuffix(part, ".") ||
+ if strings.TrimSpace(part) != part || strings.HasSuffix(part, ".") ||
strings.ContainsAny(part, "<>\"|?*~") || strings.ContainsFunc(part, unicode.IsControl) {
return errors.New("invalid skill path component")
}
@@ -112,10 +119,6 @@ func checkManagedSkillPath(root *os.Root, p string) error {
return nil
}
-func isManagedSkillMarkdown(p string) bool {
- return strings.Contains(p, "/") && strings.EqualFold(path.Ext(p), ".md")
-}
-
func isManagedSkillManifest(p string) bool {
return strings.Count(p, "/") == 1 && strings.EqualFold(path.Base(p), "SKILL.md")
}
@@ -161,6 +164,41 @@ func managedSkillRevision(root *os.Root, p string) (string, error) {
return fmt.Sprintf("%x", h.Sum(nil)), err
}
+// 编码标记不参与二进制判断;其余正文不允许文本空白以外的控制字符。
+func validateManagedSkillSource(content string) error {
+ if len(content) > maxManagedSkillSourceSize {
+ return ErrSkillTooLarge
+ }
+ if strings.HasPrefix(content, "\xff\xfe") || strings.HasPrefix(content, "\xfe\xff") ||
+ strings.HasPrefix(content, "\x00\x00\xfe\xff") {
+ return ErrSkillEncoding
+ }
+ if strings.ContainsRune(content, 0) {
+ return ErrSkillBinary
+ }
+ if !utf8.ValidString(content) {
+ return ErrSkillEncoding
+ }
+ for _, r := range content {
+ if unicode.IsControl(r) && r != '\t' && r != '\n' && r != '\r' && r != '\f' {
+ return ErrSkillBinary
+ }
+ }
+ return nil
+}
+
+func skillSourceReadOnlyReason(err error) string {
+ switch {
+ case errors.Is(err, ErrSkillBinary):
+ return "binary"
+ case errors.Is(err, ErrSkillEncoding):
+ return "encoding"
+ case errors.Is(err, ErrSkillTooLarge):
+ return "tooLarge"
+ }
+ return ""
+}
+
func readManagedSkillSource(root *os.Root, p string) (string, error) {
file, err := root.Open(p)
if err != nil {
@@ -171,26 +209,36 @@ func readManagedSkillSource(root *os.Root, p string) (string, error) {
if err != nil {
return "", err
}
- if !info.Mode().IsRegular() || info.Size() > maxManagedSkillSourceSize {
- return "", errors.New("invalid or oversized skill source")
+ if !info.Mode().IsRegular() {
+ return "", errors.New("skill source is not a regular file")
+ }
+ if info.Size() > maxManagedSkillSourceSize {
+ return "", ErrSkillTooLarge
}
content, err := io.ReadAll(io.LimitReader(file, maxManagedSkillSourceSize+1))
if err != nil {
return "", err
}
- if len(content) > maxManagedSkillSourceSize || !utf8.Valid(content) {
- return "", errors.New("skill source must be UTF-8 and at most 8 MiB")
+ // UTF-8 BOM 随正文保留;二进制内容不会返回给文本编辑器。
+ if err = validateManagedSkillSource(string(content)); err != nil {
+ return "", err
}
return string(content), nil
}
// 写入临时文件并同步后替换,发生写入错误时保留原文及其换行和元数据。
func writeManagedSkillSource(root *os.Root, p, content string, create bool, revision string) error {
- if len(content) > maxManagedSkillSourceSize || !utf8.ValidString(content) {
- return errors.New("skill source must be UTF-8 and at most 8 MiB")
+ if err := validateManagedSkillSource(content); err != nil {
+ return err
}
target := p
+ mode := os.FileMode(0644)
if !create {
+ info, err := root.Stat(p)
+ if err != nil {
+ return err
+ }
+ mode = info.Mode().Perm()
target = path.Join(path.Dir(p), ".skill-"+ast.NewNodeID())
}
file, err := root.OpenFile(target, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0644)
@@ -203,7 +251,13 @@ func writeManagedSkillSource(root *os.Root, p, content string, create bool, revi
root.Remove(target)
}
}()
- _, err = file.WriteString(content)
+ // 替换脚本文件时保留执行权限,不受当前进程 umask 影响。
+ if !create {
+ err = file.Chmod(mode)
+ }
+ if err == nil {
+ _, err = file.WriteString(content)
+ }
if err == nil {
err = file.Sync()
}
@@ -255,7 +309,13 @@ func ManageSkillFiles(request SkillFileRequest) (SkillFileData, error) {
return walkErr
}
// 未解析或被同名技能遮蔽的目录也保留在列表中,链接只展示而不跟随。
- editable := entry.Type().IsRegular() && isManagedSkillMarkdown(p) && validateManagedSkillPath(p) == nil
+ editable := false
+ if entry.Type().IsRegular() && strings.Contains(p, "/") && validateManagedSkillPath(p) == nil {
+ if err := checkManagedSkillPath(root, p); err == nil {
+ _, err = readManagedSkillSource(root, p)
+ editable = err == nil
+ }
+ }
ret.Entries = append(ret.Entries, SkillFileEntry{Path: p, IsDir: entry.IsDir(), Editable: editable})
return nil
})
@@ -301,20 +361,30 @@ func ManageSkillFiles(request SkillFileRequest) (SkillFileData, error) {
return ret, statErr
}
if request.Action == "read" {
- if !info.IsDir() && isManagedSkillMarkdown(request.Path) {
+ if !info.IsDir() && strings.Contains(request.Path, "/") {
content, readErr := readManagedSkillSource(root, request.Path)
- if readErr != nil {
+ if readErr == nil {
+ ret.Content = &content
+ ret.Revision = fmt.Sprintf("%x", sha256.Sum256([]byte(content)))
+ return ret, nil
+ }
+ ret.ReadOnlyReason = skillSourceReadOnlyReason(readErr)
+ if ret.ReadOnlyReason == "" {
return ret, readErr
}
- ret.Content = &content
- ret.Revision = fmt.Sprintf("%x", sha256.Sum256([]byte(content)))
- return ret, nil
}
ret.Revision, err = managedSkillRevision(root, request.Path)
return ret, err
}
- if (info == nil || !info.IsDir()) && !isManagedSkillMarkdown(request.Path) {
- return ret, errors.New("only Markdown files inside a skill can be edited")
+ if info == nil || !info.IsDir() {
+ if !strings.Contains(request.Path, "/") {
+ return ret, errors.New("only text files inside a skill can be edited")
+ }
+ if info != nil {
+ if _, err = readManagedSkillSource(root, request.Path); err != nil {
+ return ret, err
+ }
+ }
}
if (request.Action == "move" || request.Action == "remove") && isManagedSkillManifest(request.Path) {
return ret, errors.New("rename or delete the skill directory instead of SKILL.md")
@@ -342,8 +412,8 @@ func ManageSkillFiles(request SkillFileRequest) (SkillFileData, error) {
if err = checkManagedSkillPath(root, request.Target); err != nil {
return ret, err
}
- if path.Dir(request.Path) != path.Dir(request.Target) || (!info.IsDir() && !isManagedSkillMarkdown(request.Target)) {
- return ret, errors.New("skills and Markdown files can only be renamed in the same directory")
+ if path.Dir(request.Path) != path.Dir(request.Target) {
+ return ret, errors.New("skills and text files can only be renamed in the same directory")
}
if _, err = root.Lstat(request.Target); !errors.Is(err, os.ErrNotExist) {
return ret, errors.New("skill destination already exists or is inaccessible")
diff --git a/kernel/util/skill_manage_test.go b/kernel/util/skill_manage_test.go
index d2d61c65a3..b6af8ed849 100644
--- a/kernel/util/skill_manage_test.go
+++ b/kernel/util/skill_manage_test.go
@@ -153,7 +153,7 @@ func TestSkillManagementRevisionConflicts(t *testing.T) {
func TestSkillManagementPathBoundaries(t *testing.T) {
managedSkillTestWorkspace(t)
requireManagedSkill(t, SkillFileRequest{Action: "create", Path: "skill"})
- for _, p := range []string{"", ".", "..", "../escape", "/absolute", "C:/escape", "skill\\SKILL.md", "skill/../escape.md", "skill//a.md", "skill/a:stream.md", "skill/CON.md", "skill/COM¹.md", "skill/CONIN$", "skill/a. ", "skill/a.", "skill/.hidden.md", "skill/SKILL~1.MD", "skill/\x00.md"} {
+ for _, p := range []string{"", ".", "..", "../escape", "/absolute", "C:/escape", "skill\\SKILL.md", "skill/../escape.md", "skill/./file.txt", "skill//a.md", "skill/a:stream.md", "skill/CON.md", "skill/COM¹.md", "skill/CONIN$", "skill/a. ", "skill/a.", "skill/SKILL~1.MD", "skill/\x00.md"} {
if _, err := ManageSkillFiles(SkillFileRequest{Action: "write", Path: p, Content: "outside"}); err == nil {
t.Fatalf("accepted invalid path %q", p)
}
@@ -171,7 +171,7 @@ func TestSkillManagementPathBoundaries(t *testing.T) {
requireManagedSkill(t, SkillFileRequest{Action: "mkdir", Path: "skill/sub"})
requireManagedSkill(t, SkillFileRequest{Action: "write", Path: "skill/extra.md", Content: "original"})
read := requireManagedSkill(t, SkillFileRequest{Action: "read", Path: "skill/extra.md"})
- for _, target := range []string{"skill/sub/extra.md", "skill/file.txt", "../outside.md", "skill/SKILL.md"} {
+ for _, target := range []string{"skill/sub/extra.md", "../outside.md", "skill/SKILL.md"} {
if _, err := ManageSkillFiles(SkillFileRequest{Action: "move", Path: "skill/extra.md", Target: target, Revision: read.Revision}); err == nil {
t.Fatalf("accepted invalid move target %q", target)
}
diff --git a/kernel/util/skill_manage_text_test.go b/kernel/util/skill_manage_text_test.go
new file mode 100644
index 0000000000..0d5c7c090a
--- /dev/null
+++ b/kernel/util/skill_manage_text_test.go
@@ -0,0 +1,121 @@
+package util
+
+import (
+ "bytes"
+ "os"
+ "path/filepath"
+ "runtime"
+ "strings"
+ "testing"
+)
+
+func TestSkillManagementTextFiles(t *testing.T) {
+ managedSkillTestWorkspace(t)
+ requireManagedSkill(t, SkillFileRequest{Action: "create", Path: ".hidden-skill"})
+ requireManagedSkill(t, SkillFileRequest{Action: "mkdir", Path: ".hidden-skill/.claude"})
+ for _, name := range []string{".config.json", "config.yaml", "run.py", "README", "notes.bin", ".claude/settings.json"} {
+ t.Run(name, func(t *testing.T) {
+ p := ".hidden-skill/" + name
+ content := "\ufeff# 中文\r\ntext\r\n"
+ written := requireManagedSkill(t, SkillFileRequest{Action: "write", Path: p, Content: content})
+ read := requireManagedSkill(t, SkillFileRequest{Action: "read", Path: p})
+ if read.Content == nil || *read.Content != content || read.Revision != written.Revision || read.ReadOnlyReason != "" {
+ t.Fatalf("text or BOM/line endings lost: %+v", read)
+ }
+ found := false
+ for _, entry := range requireManagedSkill(t, SkillFileRequest{Action: "list"}).Entries {
+ if entry.Path == p {
+ found = entry.Editable
+ }
+ }
+ if !found {
+ t.Fatal("text file not listed as editable")
+ }
+ updated := requireManagedSkill(t, SkillFileRequest{Action: "write", Path: p, Content: content + "updated\r\n", Revision: read.Revision})
+ if _, err := ManageSkillFiles(SkillFileRequest{Action: "write", Path: p, Content: "stale", Revision: read.Revision}); err == nil {
+ t.Fatal("stale revision overwrote text")
+ }
+ target := p + ".renamed"
+ requireManagedSkill(t, SkillFileRequest{Action: "move", Path: p, Target: target, Revision: updated.Revision})
+ read = requireManagedSkill(t, SkillFileRequest{Action: "read", Path: target})
+ requireManagedSkill(t, SkillFileRequest{Action: "remove", Path: target, Revision: read.Revision})
+ if _, err := os.Stat(filepath.Join(SkillsDir(), filepath.FromSlash(target))); !os.IsNotExist(err) {
+ t.Fatalf("text file was not deleted: %v", err)
+ }
+ })
+ }
+ // 脚本只保存文本,替换时保留执行权限。
+ if runtime.GOOS != "windows" {
+ p := filepath.Join(SkillsDir(), ".hidden-skill", "run.sh")
+ if err := os.WriteFile(p, []byte("#!/bin/sh\nexit 0\n"), 0755); err != nil {
+ t.Fatal(err)
+ }
+ before, _ := os.Stat(p)
+ read := requireManagedSkill(t, SkillFileRequest{Action: "read", Path: ".hidden-skill/run.sh"})
+ requireManagedSkill(t, SkillFileRequest{Action: "write", Path: ".hidden-skill/run.sh", Content: "#!/bin/sh\nexit 1\n", Revision: read.Revision})
+ after, err := os.Stat(p)
+ if err != nil || before.Mode().Perm() != after.Mode().Perm() {
+ t.Fatalf("script permissions changed: %v", err)
+ }
+ }
+}
+
+func TestSkillManagementTextProtection(t *testing.T) {
+ managedSkillTestWorkspace(t)
+ requireManagedSkill(t, SkillFileRequest{Action: "create", Path: "skill"})
+ for _, test := range []struct {
+ name string
+ content []byte
+ reason string
+ }{
+ {"binary.json", []byte{'a', 0, 'b'}, "binary"},
+ {"control.md", []byte{'a', 1, 'b'}, "binary"},
+ {"encoding.txt", []byte{0xe9, 0x20}, "encoding"},
+ {"utf16.txt", []byte{0xff, 0xfe, 'a', 0}, "encoding"},
+ {"utf32.txt", []byte{0, 0, 0xfe, 0xff, 0, 0, 0, 'a'}, "encoding"},
+ {"large.txt", bytes.Repeat([]byte{'a'}, maxManagedSkillSourceSize+1), "tooLarge"},
+ } {
+ t.Run(test.name, func(t *testing.T) {
+ p := "skill/" + test.name
+ abs := filepath.Join(SkillsDir(), filepath.FromSlash(p))
+ if err := os.WriteFile(abs, test.content, 0644); err != nil {
+ t.Fatal(err)
+ }
+ read := requireManagedSkill(t, SkillFileRequest{Action: "read", Path: p})
+ if read.Content != nil || read.ReadOnlyReason != test.reason || read.Revision == "" {
+ t.Fatalf("incorrect read-only response: %+v", read)
+ }
+ for _, entry := range requireManagedSkill(t, SkillFileRequest{Action: "list"}).Entries {
+ if entry.Path == p && entry.Editable {
+ t.Fatal("non-text file marked editable")
+ }
+ }
+ for _, action := range []string{"write", "move", "remove"} {
+ if _, err := ManageSkillFiles(SkillFileRequest{Action: action, Path: p, Target: p + ".txt", Content: "replacement", Revision: read.Revision}); err == nil {
+ t.Fatalf("non-text file permits %s", action)
+ }
+ }
+ if _, err := ManageSkillFiles(SkillFileRequest{Action: "write", Path: "skill/new.txt", Content: string(test.content)}); err == nil {
+ t.Fatal("invalid text was written")
+ }
+ actual, err := os.ReadFile(abs)
+ if err != nil || !bytes.Equal(actual, test.content) {
+ t.Fatalf("protected bytes changed: %v", err)
+ }
+ })
+ }
+ content := strings.Repeat("a", maxManagedSkillSourceSize)
+ requireManagedSkill(t, SkillFileRequest{Action: "write", Path: "skill/boundary", Content: content})
+ read := requireManagedSkill(t, SkillFileRequest{Action: "read", Path: "skill/boundary"})
+ if read.Content == nil || *read.Content != content {
+ t.Fatal("exact size limit must remain editable")
+ }
+ // 外部修改即使提供最新修订号,也不能绕过文本类型校验。
+ if err := os.WriteFile(filepath.Join(SkillsDir(), "skill", "boundary"), []byte{0, 1}, 0644); err != nil {
+ t.Fatal(err)
+ }
+ read = requireManagedSkill(t, SkillFileRequest{Action: "read", Path: "skill/boundary"})
+ if _, err := ManageSkillFiles(SkillFileRequest{Action: "write", Path: "skill/boundary", Content: "overwrite", Revision: read.Revision}); err == nil {
+ t.Fatal("external binary content overwritten")
+ }
+}