diff --git a/dist/main.js b/dist/main.js index 35c9070..10e64b6 100644 --- a/dist/main.js +++ b/dist/main.js @@ -11,7 +11,7 @@ var DEFAULT_SETTINGS = { show_full_path: false, expanded_view: true, group_nearest_by_file: false, - language: "en", + language: "zh", log_render: false, log_render_files: false, recently_sent_retry_notice: false, @@ -23,33 +23,6 @@ var DEFAULT_SETTINGS = { var MAX_EMBED_STRING_LENGTH = 25e3; var VERSION; var SUPPORTED_FILE_TYPES = ["md", "canvas"]; -var SMART_TRANSLATION = { - "en": { - "pronous": ["my", "I", "me", "mine", "our", "ours", "us", "we"], - "prompt": "Based on your notes", - "initial_message": "Hi, I'm ChatGPT with access to your notes via Smart Connections. Ask me a question about your notes and I'll try to answer it." - }, - "es": { - "pronous": ["mi", "yo", "m\xED", "t\xFA"], - "prompt": "Bas\xE1ndose en sus notas", - "initial_message": "Hola, soy ChatGPT con acceso a tus apuntes a trav\xE9s de Smart Connections. Hazme una pregunta sobre tus apuntes e intentar\xE9 responderte." - }, - "fr": { - "pronous": ["me", "mon", "ma", "mes", "moi", "nous", "notre", "nos", "je", "j'", "m'"], - "prompt": "D'apr\xE8s vos notes", - "initial_message": "Bonjour, je suis ChatGPT et j'ai acc\xE8s \xE0 vos notes via Smart Connections. Posez-moi une question sur vos notes et j'essaierai d'y r\xE9pondre." - }, - "de": { - "pronous": ["mein", "meine", "meinen", "meiner", "meines", "mir", "uns", "unser", "unseren", "unserer", "unseres"], - "prompt": "Basierend auf Ihren Notizen", - "initial_message": "Hallo, ich bin ChatGPT und habe \xFCber Smart Connections Zugang zu Ihren Notizen. Stellen Sie mir eine Frage zu Ihren Notizen und ich werde versuchen, sie zu beantworten." - }, - "it": { - "pronous": ["mio", "mia", "miei", "mie", "noi", "nostro", "nostri", "nostra", "nostre"], - "prompt": "Sulla base degli appunti", - "initial_message": "Ciao, sono ChatGPT e ho accesso ai tuoi appunti tramite Smart Connections. Fatemi una domanda sui vostri appunti e cercher\xF2 di rispondervi." - } -}; var VecLite = class { constructor(config) { this.config = { @@ -412,6 +385,13 @@ var VecLite = class { await this.init_embeddings_file(); } }; +var SMART_TRANSLATION = { + "zh": { + "pronous": ["\u6211", "\u6211\u7684", "\u4FFA", "\u6211\u4EEC", "\u6211\u4EEC\u7684"], + "prompt": "\u57FA\u4E8E\u6211\u7684\u7B14\u8BB0", + "initial_message": `\u4F60\u597D\uFF0C\u6211\u662F\u80FD\u901A\u8FC7 Smart Connections \u8BBF\u95EE\u4F60\u7684\u7B14\u8BB0\u7684 ChatGPT\u3002\u4F60\u53EF\u4EE5\u95EE\u6211\u5173\u4E8E\u4F60\u7B14\u8BB0\u7684\u95EE\u9898\uFF0C\u6211\u4F1A\u9605\u8BFB\u5E76\u7406\u89E3\u4F60\u7684\u7B14\u8BB0\uFF0C\u5E76\u5C3D\u529B\u56DE\u7B54\u4F60\u7684\u95EE\u9898\u3002` + } +}; var crypto = require("crypto"); function md5(str) { return crypto.createHash("md5").update(str).digest("hex"); @@ -440,7 +420,6 @@ var SmartConnectionsPlugin = class extends Obsidian.Plugin { this.retry_notice_timeout = null; this.save_timeout = null; this.sc_branding = {}; - this.self_ref_kw_regex = null; this.update_available = false; } async onload() { @@ -449,10 +428,9 @@ var SmartConnectionsPlugin = class extends Obsidian.Plugin { onunload() { this.output_render_log(); console.log("unloading plugin"); - this.app.workspace.detachLeavesOfType(SMART_CONNECTIONS_VIEW_TYPE); - this.app.workspace.detachLeavesOfType(SMART_CONNECTIONS_CHAT_VIEW_TYPE); } async initialize() { + console.log("testtest"); console.log("Loading Smart Connections plugin"); VERSION = this.manifest.version; await this.loadSettings(); @@ -507,6 +485,7 @@ var SmartConnectionsPlugin = class extends Obsidian.Plugin { this.open_chat(); } if (this.settings.version !== VERSION) { + this.settings.best_new_plugin = false; this.settings.version = VERSION; await this.saveSettings(); this.open_view(); @@ -528,6 +507,21 @@ var SmartConnectionsPlugin = class extends Obsidian.Plugin { this.embeddings_loaded = await this.smart_vec_lite.load(); return this.embeddings_loaded; } + async upgrade() { + const v2 = await Obsidian.requestUrl({ + url: "https://sc.corn.li/download/newest.json", + method: "GET", + headers: { + "Content-Type": "application/json" + } + }); + if (v2.status !== 200) + throw new Error(`Error downloading version 2: Status ${v2.status}`); + await this.app.vault.adapter.write(".obsidian/plugins/smart-connections/main.js", v2.json.main); + await this.app.vault.adapter.write(".obsidian/plugins/smart-connections/manifest.json", v2.json.manifest); + await this.app.vault.adapter.write(".obsidian/plugins/smart-connections/styles.css", v2.json.styles); + console.log("upgrade complete"); + } async loadSettings() { this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); if (this.settings.file_exclusions && this.settings.file_exclusions.length > 0) { @@ -556,7 +550,6 @@ var SmartConnectionsPlugin = class extends Obsidian.Plugin { return path.trim(); }); } - this.self_ref_kw_regex = new RegExp(`\\b(${SMART_TRANSLATION[this.settings.language].pronous.join("|")})\\b`, "gi"); await this.load_failed_files(); } async saveSettings(rerender = false) { @@ -820,11 +813,11 @@ var SmartConnectionsPlugin = class extends Obsidian.Plugin { } // force refresh embeddings file but first rename existing embeddings file to .smart-connections/embeddings-YYYY-MM-DD.json async force_refresh_embeddings_file() { - new Obsidian.Notice("Smart Connections: embeddings file Force Refreshed, making new connections..."); + new Obsidian.Notice("Smart Connections: \u94FE\u63A5\u6587\u4EF6\u5DF2\u5F3A\u5236\u5237\u65B0\uFF0C\u6B63\u5728\u521B\u5EFA\u65B0\u7684\u94FE\u63A5..."); await this.smart_vec_lite.force_refresh(); await this.get_all_embeddings(); this.output_render_log(); - new Obsidian.Notice("Smart Connections: embeddings file Force Refreshed, new connections made."); + new Obsidian.Notice("Smart Connections: \u94FE\u63A5\u6587\u4EF6\u5F3A\u5236\u5237\u65B0\uFF0C\u65B0\u7684\u94FE\u63A5\u5DF2\u5EFA\u7ACB\u3002"); } // get embeddings for embed_input async get_file_embeddings(curr_file, save = true) { @@ -1092,7 +1085,7 @@ var SmartConnectionsPlugin = class extends Obsidian.Plugin { for (let j = 0; j < this.file_exclusions.length; j++) { if (current_note.path.indexOf(this.file_exclusions[j]) > -1) { this.log_exclusion(this.file_exclusions[j]); - return "excluded"; + return "\u5F53\u524D\u7B14\u8BB0\u5DF2\u88AB\u6392\u9664"; } } setTimeout(() => { @@ -1104,7 +1097,7 @@ var SmartConnectionsPlugin = class extends Obsidian.Plugin { } const vec = this.smart_vec_lite.get_vec(curr_key); if (!vec) { - return "Error getting embeddings for: " + current_note.path; + return "\u83B7\u53D6\u5D4C\u5165\u5185\u5BB9\u65F6\u51FA\u9519\uFF1A " + current_note.path; } nearest = this.smart_vec_lite.nearest(vec, { skip_key: curr_key, @@ -1907,10 +1900,10 @@ var SmartConnectionsView = class extends Obsidian.ItemView { this.app.workspace.onLayoutReady(this.initialize.bind(this)); } async initialize() { - this.set_message("Loading embeddings file..."); + this.set_message("\u6B63\u5728\u52A0\u8F7D\u5D4C\u5165\u6587\u4EF6..."); const vecs_intiated = await this.plugin.init_vecs(); if (vecs_intiated) { - this.set_message("Embeddings file loaded."); + this.set_message("\u5D4C\u5165\u6587\u4EF6\u52A0\u8F7D\u5B8C\u6210"); await this.render_connections(); } else { this.render_embeddings_buttons(); @@ -1926,18 +1919,18 @@ var SmartConnectionsView = class extends Obsidian.ItemView { async render_connections(context = null) { console.log("rendering connections"); if (!this.plugin.settings.api_key) { - this.set_message("An OpenAI API key is required to make Smart Connections"); + this.set_message("\u6B63\u786E\u914D\u7F6E OpenAI API \u4FE1\u606F\u540E\u65B9\u53EF\u4F7F\u7528 Smart Connections"); return; } if (!this.plugin.embeddings_loaded) { await this.plugin.init_vecs(); } if (!this.plugin.embeddings_loaded) { - console.log("embeddings files still not loaded or yet to be created"); + console.log("\u5D4C\u5165\u6587\u4EF6\u5C1A\u672A\u52A0\u8F7D\u6216\u5C1A\u672A\u521B\u5EFA"); this.render_embeddings_buttons(); return; } - this.set_message("Making Smart Connections..."); + this.set_message("\u6B63\u5728\u521B\u5EFA\u667A\u80FD\u8FDE\u63A5..."); if (typeof context === "string") { const highlighted_text = context; await this.search(highlighted_text); @@ -1960,7 +1953,7 @@ var SmartConnectionsView = class extends Obsidian.ItemView { this.file = this.app.workspace.getActiveFile(); if (!this.file && this.count > 1) { clearInterval(this.interval); - this.set_message("No active file"); + this.set_message("\u65E0\u6D3B\u52A8\u6587\u4EF6"); return; } } @@ -1979,7 +1972,7 @@ var SmartConnectionsView = class extends Obsidian.ItemView { return; } else { this.interval_count++; - this.set_message("Making Smart Connections..." + this.interval_count); + this.set_message("\u6B63\u5728\u521B\u5EFA\u667A\u80FD\u8FDE\u63A5..." + this.interval_count); } } }, 10); @@ -2044,33 +2037,15 @@ var SmartConnectionsSettingsTab = class extends Obsidian.PluginSettingTab { containerEl } = this; containerEl.empty(); - containerEl.createEl("h2", { - text: "Supporter Settings" - }); - containerEl.createEl("p", { - text: 'As a Smart Connections "Supporter", fast-track your PKM journey with priority perks and pioneering innovations.' - }); - const supporter_benefits_list = containerEl.createEl("ul"); - supporter_benefits_list.createEl("li", { - text: "Enjoy swift, top-priority support." - }); - supporter_benefits_list.createEl("li", { - text: "Gain early access to experimental features like the ChatGPT plugin." - }); - supporter_benefits_list.createEl("li", { - text: "Stay informed and engaged with exclusive supporter-only communications." - }); - new Obsidian.Setting(containerEl).setName("Supporter License Key").setDesc("Note: this is not required to use Smart Connections.").addText((text) => text.setPlaceholder("Enter your license_key").setValue(this.plugin.settings.license_key).onChange(async (value) => { - this.plugin.settings.license_key = value.trim(); - await this.plugin.saveSettings(true); + new Obsidian.Setting(containerEl).setName("\u7248\u672C\u66F4\u65B0").setDesc("\u66F4\u65B0\u5230\u6700\u65B0\u7248\u672C\uFF0C\u4EE5\u83B7\u53D6\u66F4\u591A\u529F\u80FD").addButton((button) => button.setButtonText("\u66F4\u65B0").onClick(async () => { + await this.plugin.upgrade(); })); - new Obsidian.Setting(containerEl).setName("Sync Notes").setDesc("Make notes available via the Smart Connections ChatGPT Plugin. Respects exclusion settings configured below.").addButton((button) => button.setButtonText("Sync Notes").onClick(async () => { + new Obsidian.Setting(containerEl).setName("\u540C\u6B65\u7B14\u8BB0").setDesc("\u901A\u8FC7 Smart Connections \u670D\u52A1\u5668\u540C\u6B65\u7B14\u8BB0\u3002\u652F\u6301\u4E0B\u9762\u914D\u7F6E\u7684\u6392\u9664\u8BBE\u7F6E\u3002").addButton((button) => button.setButtonText("\u540C\u6B65\u7B14\u8BB0").onClick(async () => { await this.plugin.sync_notes(); })); - new Obsidian.Setting(containerEl).setName("Become a Supporter").setDesc("Become a Supporter").addButton((button) => button.setButtonText("Become a Supporter").onClick(async () => { + new Obsidian.Setting(containerEl).setName("\u652F\u6301 Smart Connections \u4E2D\u6587\u7248").setDesc("\u652F\u6301\u4E00\u4E0B\u5427").addButton((button) => button.setButtonText("\u652F\u6301(\u5FAE\u4FE1\u6536\u6B3E\u7801)").onClick(async () => { const payment_pages = [ - "https://buy.stripe.com/9AQ5kO5QnbAWgGAbIY", - "https://buy.stripe.com/9AQ7sWemT48u1LGcN4" + "https://mir.ug0.ltd/static/image/wechatpay.png" ]; if (!this.plugin.payment_page_index) { this.plugin.payment_page_index = Math.round(Math.random()); @@ -2078,27 +2053,27 @@ var SmartConnectionsSettingsTab = class extends Obsidian.PluginSettingTab { window.open(payment_pages[this.plugin.payment_page_index]); })); containerEl.createEl("h2", { - text: "OpenAI Settings" + text: "\u6A21\u578B\u8BBE\u7F6E" }); - new Obsidian.Setting(containerEl).setName("OpenAI API Key").setDesc("Required: an OpenAI API key is currently required to use Smart Connections.").addText((text) => text.setPlaceholder("Enter your api_key").setValue(this.plugin.settings.api_key).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("\u8BBE\u7F6E OpenAI API \u5BC6\u94A5").setDesc("\u5FC5\u586B: \u4F7F\u7528\u672C\u63D2\u4EF6\u5FC5\u987B\u586B\u5199\u6B64\u5B57\u6BB5").addText((text) => text.setPlaceholder("\u8F93\u5165 OpenAI API key").setValue(this.plugin.settings.api_key).onChange(async (value) => { this.plugin.settings.api_key = value.trim(); await this.plugin.saveSettings(true); })); - new Obsidian.Setting(containerEl).setName("OpenAI API Endpoint").setDesc("Optional: an OpenAI API endpoint is used to use Smart Connections.").addText((text) => text.setPlaceholder("Enter your api_endpoint").setValue(this.plugin.settings.api_endpoint).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("\u8BBE\u7F6E OpenAI API \u63A5\u5165\u5730\u5740").setDesc("\u53EF\u9009\uFF1A\u5982\u679C OpenAI API \u53EF\u7528\u6027\u6D4B\u8BD5\u5931\u8D25\uFF0C\u5EFA\u8BAE\u66F4\u6362\u5176\u4ED6\u63A5\u5165\u5730\u5740").addText((text) => text.setPlaceholder("\u8F93\u5165 OpenAI API \u63A5\u5165\u5730\u5740").setValue(this.plugin.settings.api_endpoint).onChange(async (value) => { this.plugin.settings.api_endpoint = value.trim(); await this.plugin.saveSettings(true); })); - new Obsidian.Setting(containerEl).setName("Test API Key").setDesc("Test API Key").addButton((button) => button.setButtonText("Test API Key").onClick(async () => { + new Obsidian.Setting(containerEl).setName("\u6D4B\u8BD5 OpenAI API \u53EF\u7528\u6027").setDesc("\u6D4B\u8BD5 OpenAI API \u53EF\u7528\u6027").addButton((button) => button.setButtonText("\u6D4B\u8BD5").onClick(async () => { const resp = await this.plugin.test_api_key(); if (resp) { - new Obsidian.Notice("Smart Connections: API key is valid"); + new Obsidian.Notice("Smart Connections: OpenAI API \u6709\u6548\uFF01"); } else { - new Obsidian.Notice("Smart Connections: API key is not working as expected!"); + new Obsidian.Notice("Smart Connections: OpenAI API \u65E0\u6CD5\u4F7F\u7528\uFF01"); } })); - new Obsidian.Setting(containerEl).setName("Smart Chat Model").setDesc("Select a model to use with Smart Chat.").addDropdown((dropdown) => { + new Obsidian.Setting(containerEl).setName("\u5BF9\u8BDD\u6A21\u578B").setDesc("\u9009\u62E9\u7528\u4E8E\u5BF9\u8BDD\u7684\u6A21\u578B").addDropdown((dropdown) => { dropdown.addOption("gpt-3.5-turbo-16k", "gpt-3.5-turbo-16k"); - dropdown.addOption("gpt-4", "gpt-4 (limited access, 8k)"); + dropdown.addOption("gpt-4", "gpt-4 (8k)"); dropdown.addOption("gpt-3.5-turbo", "gpt-3.5-turbo (4k)"); dropdown.addOption("gpt-4-1106-preview", "gpt-4-turbo (128k)"); dropdown.onChange(async (value) => { @@ -2107,96 +2082,77 @@ var SmartConnectionsSettingsTab = class extends Obsidian.PluginSettingTab { }); dropdown.setValue(this.plugin.settings.smart_chat_model); }); - new Obsidian.Setting(containerEl).setName("Default Language").setDesc("Default language to use for Smart Chat. Changes which self-referential pronouns will trigger lookup of your notes.").addDropdown((dropdown) => { - const languages = Object.keys(SMART_TRANSLATION); - for (let i = 0; i < languages.length; i++) { - dropdown.addOption(languages[i], languages[i]); - } - dropdown.onChange(async (value) => { - this.plugin.settings.language = value; - await this.plugin.saveSettings(); - self_ref_pronouns_list.setText(this.get_self_ref_list()); - const chat_view = this.app.workspace.getLeavesOfType(SMART_CONNECTIONS_CHAT_VIEW_TYPE).length > 0 ? this.app.workspace.getLeavesOfType(SMART_CONNECTIONS_CHAT_VIEW_TYPE)[0].view : null; - if (chat_view) { - chat_view.new_chat(); - } - }); - dropdown.setValue(this.plugin.settings.language); - }); - const self_ref_pronouns_list = containerEl.createEl("span", { - text: this.get_self_ref_list() - }); containerEl.createEl("h2", { - text: "Exclusions" + text: "\u6392\u9664" }); - new Obsidian.Setting(containerEl).setName("file_exclusions").setDesc("'Excluded file' matchers separated by a comma.").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.file_exclusions).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("\u6392\u9664\u6587\u4EF6").setDesc("\u8F93\u5165\u9700\u8981\u6392\u9664\u7684\u6587\u4EF6\u540D\uFF0C\u7528\u9017\u53F7\u5206\u9694\u6587\u4EF6").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.file_exclusions).onChange(async (value) => { this.plugin.settings.file_exclusions = value; await this.plugin.saveSettings(); })); - new Obsidian.Setting(containerEl).setName("folder_exclusions").setDesc("'Excluded folder' matchers separated by a comma.").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.folder_exclusions).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("\u6392\u9664\u6587\u4EF6\u5939").setDesc("\u8F93\u5165\u9700\u8981\u6392\u9664\u7684\u6587\u4EF6\u5939\u540D\uFF0C\u7528\u9017\u53F7\u5206\u9694\u591A\u4E2A\u6587\u4EF6\u5939").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.folder_exclusions).onChange(async (value) => { this.plugin.settings.folder_exclusions = value; await this.plugin.saveSettings(); })); - new Obsidian.Setting(containerEl).setName("path_only").setDesc("'Path only' matchers separated by a comma.").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.path_only).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("\u4EC5\u4F7F\u7528\u67D0\u4E2A\u8DEF\u5F84").setDesc("\u8F93\u5165\u9700\u8981\u4F7F\u7528\u7684\u8DEF\u5F84\uFF0C\u7528\u9017\u53F7\u5206\u9694\u591A\u4E2A\u8DEF\u5F84").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.path_only).onChange(async (value) => { this.plugin.settings.path_only = value; await this.plugin.saveSettings(); })); - new Obsidian.Setting(containerEl).setName("header_exclusions").setDesc("'Excluded header' matchers separated by a comma. Works for 'blocks' only.").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.header_exclusions).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("\u6392\u9664\u6807\u9898").setDesc("\u8F93\u5165\u9700\u8981\u6392\u9664\u7684\u6807\u9898\uFF0C\u7528\u9017\u53F7\u5206\u9694\u591A\u4E2A\u6807\u9898(\u53EA\u9002\u7528\u4E8E\u533A\u5757)").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.header_exclusions).onChange(async (value) => { this.plugin.settings.header_exclusions = value; await this.plugin.saveSettings(); })); containerEl.createEl("h2", { - text: "Display" + text: "\u663E\u793A\u8BBE\u7F6E" }); - new Obsidian.Setting(containerEl).setName("show_full_path").setDesc("Show full path in view.").addToggle((toggle) => toggle.setValue(this.plugin.settings.show_full_path).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("\u663E\u793A\u5B8C\u6574\u8DEF\u5F84").setDesc("\u5728\u89C6\u56FE\u4E2D\u663E\u793A\u5173\u8054\u7B14\u8BB0\u7684\u5B8C\u6574\u8DEF\u5F84").addToggle((toggle) => toggle.setValue(this.plugin.settings.show_full_path).onChange(async (value) => { this.plugin.settings.show_full_path = value; await this.plugin.saveSettings(true); })); - new Obsidian.Setting(containerEl).setName("expanded_view").setDesc("Expanded view by default.").addToggle((toggle) => toggle.setValue(this.plugin.settings.expanded_view).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("\u5C55\u5F00\u7B14\u8BB0").setDesc("\u9ED8\u8BA4\u5C55\u5F00\u5173\u8054\u7B14\u8BB0\u7684\u5185\u5BB9").addToggle((toggle) => toggle.setValue(this.plugin.settings.expanded_view).onChange(async (value) => { this.plugin.settings.expanded_view = value; await this.plugin.saveSettings(true); })); - new Obsidian.Setting(containerEl).setName("group_nearest_by_file").setDesc("Group nearest by file.").addToggle((toggle) => toggle.setValue(this.plugin.settings.group_nearest_by_file).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("\u6309\u6587\u4EF6\u68C0\u7D22\u5173\u8054\u5EA6").setDesc("\u6309\u6587\u4EF6\u68C0\u7D22\u5173\u8054\u5EA6\uFF08\u5173\u95ED\u540E\u6309\u6807\u9898\u68C0\u7D22\u5173\u8054\u5EA6\uFF09").addToggle((toggle) => toggle.setValue(this.plugin.settings.group_nearest_by_file).onChange(async (value) => { this.plugin.settings.group_nearest_by_file = value; await this.plugin.saveSettings(true); })); - new Obsidian.Setting(containerEl).setName("view_open").setDesc("Open view on Obsidian startup.").addToggle((toggle) => toggle.setValue(this.plugin.settings.view_open).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("\u81EA\u52A8\u6253\u5F00\u5173\u7CFB\u89C6\u56FE").setDesc("Open view on Obsidian startup.").addToggle((toggle) => toggle.setValue(this.plugin.settings.view_open).onChange(async (value) => { this.plugin.settings.view_open = value; await this.plugin.saveSettings(true); })); - new Obsidian.Setting(containerEl).setName("chat_open").setDesc("Open view on Obsidian startup.").addToggle((toggle) => toggle.setValue(this.plugin.settings.chat_open).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("\u81EA\u52A8\u6253\u5F00\u5BF9\u8BDD\u7A97\u53E3").setDesc("\u542F\u52A8 Obsidian \u65F6\u81EA\u52A8\u6253\u5F00\u5BF9\u8BDD\u7A97\u53E3").addToggle((toggle) => toggle.setValue(this.plugin.settings.chat_open).onChange(async (value) => { this.plugin.settings.chat_open = value; await this.plugin.saveSettings(true); })); containerEl.createEl("h2", { - text: "Advanced" + text: "\u9AD8\u7EA7\u8BBE\u7F6E" }); - new Obsidian.Setting(containerEl).setName("log_render").setDesc("Log render details to console (includes token_usage).").addToggle((toggle) => toggle.setValue(this.plugin.settings.log_render).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("\u65E5\u5FD7\u6E32\u67D3").setDesc("\u5C06\u6E32\u67D3\u8BE6\u7EC6\u4FE1\u606F\u8BB0\u5F55\u5230\u63A7\u5236\u53F0(\u5305\u62ECtoken\u4F7F\u7528\u91CF)").addToggle((toggle) => toggle.setValue(this.plugin.settings.log_render).onChange(async (value) => { this.plugin.settings.log_render = value; await this.plugin.saveSettings(true); })); - new Obsidian.Setting(containerEl).setName("log_render_files").setDesc("Log embedded objects paths with log render (for debugging).").addToggle((toggle) => toggle.setValue(this.plugin.settings.log_render_files).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("\u8BB0\u5F55\u6E32\u67D3\u6587\u4EF6").setDesc("\u4F7F\u7528\u65E5\u5FD7\u6E32\u67D3\u8BB0\u5F55\u5D4C\u5165\u5F0F\u5BF9\u8C61\u7684\u8DEF\u5F84(\u7528\u4E8E\u8C03\u8BD5)").addToggle((toggle) => toggle.setValue(this.plugin.settings.log_render_files).onChange(async (value) => { this.plugin.settings.log_render_files = value; await this.plugin.saveSettings(true); })); - new Obsidian.Setting(containerEl).setName("skip_sections").setDesc("Skips making connections to specific sections within notes. Warning: reduces usefulness for large files and requires 'Force Refresh' for sections to work in the future.").addToggle((toggle) => toggle.setValue(this.plugin.settings.skip_sections).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("\u8DF3\u8FC7\u7279\u5B9A\u90E8\u5206").setDesc("\u8DF3\u8FC7\u5BF9\u7B14\u8BB0\u4E2D\u7684\u7279\u5B9A\u90E8\u5206\u5EFA\u7ACB\u8FDE\u63A5\u3002\u8B66\u544A\uFF1A\u6709\u5927\u6587\u4EF6\u65F6\u4F1A\u964D\u4F4E\u4F7F\u7528\u6548\u7387\uFF0C\u672A\u6765\u4F7F\u7528\u65F6\u9700\u8981\u201C\u5F3A\u5236\u5237\u65B0\u201D\u3002").addToggle((toggle) => toggle.setValue(this.plugin.settings.skip_sections).onChange(async (value) => { this.plugin.settings.skip_sections = value; await this.plugin.saveSettings(true); })); containerEl.createEl("h3", { - text: "Test File Writing" + text: "\u6D4B\u8BD5\u6587\u4EF6\u5199\u5165" }); containerEl.createEl("h3", { - text: "Manual Save" + text: "\u624B\u52A8\u4FDD\u5B58" }); let manual_save_results = containerEl.createEl("div"); - new Obsidian.Setting(containerEl).setName("manual_save").setDesc("Save current embeddings").addButton((button) => button.setButtonText("Manual Save").onClick(async () => { - if (confirm("Are you sure you want to save your current embeddings?")) { + new Obsidian.Setting(containerEl).setName("\u624B\u52A8\u4FDD\u5B58").setDesc("\u4FDD\u5B58\u5F53\u524D\u5DF2\u5D4C\u5165\u7684\u5185\u5BB9").addButton((button) => button.setButtonText("\u624B\u52A8\u4FDD\u5B58").onClick(async () => { + if (confirm("\u4F60\u786E\u5B9A\u8981\u4FDD\u5B58\u5F53\u524D\u5DF2\u5D4C\u5165\u7684\u5185\u5BB9\u5417\uFF1F")) { try { await this.plugin.save_embeddings_to_file(true); - manual_save_results.innerHTML = "Embeddings saved successfully."; + manual_save_results.innerHTML = "\u5D4C\u5165\u5185\u5BB9\u4FDD\u5B58\u6210\u529F\u3002"; } catch (e) { - manual_save_results.innerHTML = "Embeddings failed to save. Error: " + e; + manual_save_results.innerHTML = "\u5D4C\u5165\u5185\u5BB9\u4FDD\u5B58\u5931\u8D25\u3002\u9519\u8BEF\uFF1A" + e; } } })); @@ -2206,22 +2162,19 @@ var SmartConnectionsSettingsTab = class extends Obsidian.PluginSettingTab { let failed_list = containerEl.createEl("div"); this.draw_failed_files_list(failed_list); containerEl.createEl("h3", { - text: "Force Refresh" + text: "\u5F3A\u5236\u5237\u65B0" }); - new Obsidian.Setting(containerEl).setName("force_refresh").setDesc("WARNING: DO NOT use unless you know what you are doing! This will delete all of your current embeddings from OpenAI and trigger reprocessing of your entire vault!").addButton((button) => button.setButtonText("Force Refresh").onClick(async () => { - if (confirm("Are you sure you want to Force Refresh? By clicking yes you confirm that you understand the consequences of this action.")) { + new Obsidian.Setting(containerEl).setName("\u5F3A\u5236\u5237\u65B0").setDesc("\u8B66\u544A\uFF1A\u9664\u975E\u4F60\u77E5\u9053\u81EA\u5DF1\u5728\u505A\u4EC0\u4E48\uFF0C\u5426\u5219\u4E0D\u8981\u4F7F\u7528\uFF01\u8FD9\u5C06\u5220\u9664\u6570\u636E\u5E93\u4E2D\u6240\u6709\u5DF2\u5D4C\u5165\u7684\u5185\u5BB9\uFF0C\u5E76\u91CD\u65B0\u751F\u6210\u6574\u4E2A\u6570\u636E\u5E93\uFF01").addButton((button) => button.setButtonText("Force Refresh").onClick(async () => { + if (confirm("\u786E\u5B9A\u8981\u5F3A\u5236\u5237\u65B0\u5417\uFF1F\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u8868\u793A\u60A8\u7406\u89E3\u8FD9\u4E2A\u64CD\u4F5C\u5E26\u6765\u7684\u540E\u679C\u3002")) { await this.plugin.force_refresh_embeddings_file(); } })); } - get_self_ref_list() { - return "Current: " + SMART_TRANSLATION[this.plugin.settings.language].pronous.join(", "); - } draw_failed_files_list(failed_list) { failed_list.empty(); if (this.plugin.settings.failed_files.length > 0) { failed_list.createEl("p", { - text: "The following files failed to process and will be skipped until manually retried." + text: "\u4EE5\u4E0B\u6587\u4EF6\u5904\u7406\u5931\u8D25\uFF0C\u5C06\u88AB\u8DF3\u8FC7\uFF0C\u76F4\u5230\u624B\u52A8\u91CD\u8BD5\u3002" }); let list = failed_list.createEl("ul"); for (let failed_file of this.plugin.settings.failed_files) { @@ -2229,17 +2182,17 @@ var SmartConnectionsSettingsTab = class extends Obsidian.PluginSettingTab { text: failed_file }); } - new Obsidian.Setting(failed_list).setName("retry_failed_files").setDesc("Retry failed files only").addButton((button) => button.setButtonText("Retry failed files only").onClick(async () => { + new Obsidian.Setting(failed_list).setName("\u4EC5\u91CD\u8BD5\u5931\u8D25\u6587\u4EF6").setDesc("\u4EC5\u91CD\u8BD5\u5931\u8D25\u6587\u4EF6").addButton((button) => button.setButtonText("\u4EC5\u91CD\u8BD5\u5931\u8D25\u6587\u4EF6").onClick(async () => { failed_list.empty(); failed_list.createEl("p", { - text: "Retrying failed files..." + text: "\u6B63\u5728\u91CD\u8BD5..." }); await this.plugin.retry_failed_files(); this.draw_failed_files_list(failed_list); })); } else { failed_list.createEl("p", { - text: "No failed files" + text: "\u65E0\u5904\u7406\u5931\u8D25\u7684\u6587\u4EF6" }); } } @@ -2406,7 +2359,7 @@ var SmartConnectionsChatView = class extends Obsidian.ItemView { this.textarea = chat_input.createEl("textarea", { cls: "sc-chat-input", attr: { - placeholder: `Try "Based on my notes" or "Summarize [[this note]]" or "Important tasks in /folder/"` + placeholder: `\u4F7F\u7528 \u201C\u57FA\u4E8E\u6211\u7684\u7B14\u8BB0\u201D \u6216 \u201C\u603B\u7ED3 [[Obsidian \u94FE\u63A5]]\u201D \u6216 "\u544A\u8BC9\u6211 /\u76EE\u5F55/ \u4E2D\u6709\u4EC0\u4E48\u91CD\u8981\u4FE1\u606F"` } }); chat_input.addEventListener("keyup", (e) => { @@ -2450,11 +2403,11 @@ var SmartConnectionsChatView = class extends Obsidian.ItemView { this.end_stream(); }); let button = button_container.createEl("button", { attr: { id: "sc-send-button" }, cls: "send-button" }); - button.innerHTML = "Send"; + button.innerHTML = "\u53D1\u9001"; button.addEventListener("click", () => { if (this.prevent_input) { console.log("wait until current response is finished"); - new Obsidian.Notice("Wait until current response is finished"); + new Obsidian.Notice("\u8BF7\u7B49\u5F85\u5F53\u524D\u56DE\u590D\u7ED3\u675F"); return; } let user_input = this.textarea.value; @@ -2487,7 +2440,7 @@ var SmartConnectionsChatView = class extends Obsidian.ItemView { content: user_input } ]; - this.request_chatgpt_completion({ messages: chatml, temperature: 0 }); + this.request_chatgpt_completion({ messages: chatml, temperature: 0, privacyStr: "\u5DF2\u7ECF\u8BFB\u53D6\u7B14\u8BB0\u5185\u5BB9" }); return; } this.request_chatgpt_completion(); @@ -2521,13 +2474,11 @@ var SmartConnectionsChatView = class extends Obsidian.ItemView { } // check if includes keywords referring to one's own notes contains_self_referential_keywords(user_input) { - const matches = user_input.match(this.plugin.self_ref_kw_regex); - if (matches) - return true; - return false; + const matches = user_input.match(/基于\s*我的\s*笔记/); + return !!matches; } // render message - async render_message(message, from = "assistant", append_last = false) { + async render_message(message, from = "assistant", append_last = false, privacyStr = "") { if (this.dotdotdot_interval) { clearInterval(this.dotdotdot_interval); this.dotdotdot_interval = null; @@ -2547,6 +2498,9 @@ var SmartConnectionsChatView = class extends Obsidian.ItemView { this.new_messsage_bubble(from); } this.active_elm.innerHTML = ""; + if (from === "assistant" && privacyStr !== "") { + this.active_elm.innerHTML = `[${privacyStr}]`; + } await Obsidian.MarkdownRenderer.renderMarkdown(message, this.active_elm, "?no-dataview", new Obsidian.Component()); this.handle_links_in_message(); this.render_message_action_buttons(message); @@ -2566,7 +2520,7 @@ var SmartConnectionsChatView = class extends Obsidian.ItemView { Obsidian.setIcon(context_view, "eye"); context_view.addEventListener("click", () => { navigator.clipboard.writeText("```smart-connections\n" + this_hyd + "\n```\n"); - new Obsidian.Notice("[Smart Connections] Context code block copied to clipboard"); + new Obsidian.Notice("[Smart Connections] \u4E0A\u4E0B\u6587\u4EE3\u7801\u5757\u5DF2\u7ECF\u590D\u5236\u5230\u526A\u8D34\u677F"); }); } if (this.chat.context) { @@ -2581,7 +2535,7 @@ var SmartConnectionsChatView = class extends Obsidian.ItemView { Obsidian.setIcon(copy_prompt_button, "files"); copy_prompt_button.addEventListener("click", () => { navigator.clipboard.writeText("```prompt-context\n" + this_context + "\n```\n"); - new Obsidian.Notice("[Smart Connections] Context copied to clipboard"); + new Obsidian.Notice("[Smart Connections] \u4E0A\u4E0B\u6587\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F"); }); } const copy_button = this.active_elm.createEl("span", { @@ -2655,10 +2609,12 @@ var SmartConnectionsChatView = class extends Obsidian.ItemView { // logit_bias: logit_bias, ...opts }; + let privacyStr = opts.privacyStr || ""; + delete opts.privacyStr; if (opts.stream) { const full_str = await new Promise((resolve, reject) => { try { - const url = `${this.settings.api_endpoint}/v1/chat/completions`; + const url = `${this.plugin.settings.api_endpoint}/v1/chat/completions`; this.active_stream = new ScStreamer(url, { headers: { "Content-Type": "application/json", @@ -2670,13 +2626,26 @@ var SmartConnectionsChatView = class extends Obsidian.ItemView { let txt = ""; this.active_stream.addEventListener("message", (e) => { if (e.data != "[DONE]") { - const payload = JSON.parse(e.data); - const text = payload.choices[0].delta.content; - if (!text) { - return; + let resp = null; + try { + resp = JSON.parse(e.data); + const text = resp.choices[0].delta.content; + if (!text) + return; + txt += text; + this.render_message(text, "assistant", true, privacyStr); + } catch (err) { + if (e.data.indexOf("}{") > -1) + e.data = e.data.replace(/}{/g, "},{"); + resp = JSON.parse(`[${e.data}]`); + resp.forEach((r) => { + const text = r.choices[0].delta.content; + if (!text) + return; + txt += text; + this.render_message(text, "assistant", true, privacyStr); + }); } - txt += text; - this.render_message(text, "assistant", true); } else { this.end_stream(); resolve(txt); @@ -2689,20 +2658,20 @@ var SmartConnectionsChatView = class extends Obsidian.ItemView { }); this.active_stream.addEventListener("error", (e) => { console.error(e); - new Obsidian.Notice("Smart Connections Error Streaming Response. See console for details."); - this.render_message("*API Error. See console logs for details.*", "assistant"); + new Obsidian.Notice("Smart Connections \u8FDB\u884C\u6D41\u5F0F\u8FDE\u63A5\u7684\u8FC7\u7A0B\u51FA\u73B0\u9519\u8BEF\u3002\u8BF7\u67E5\u770B\u8C03\u8BD5\u63A7\u5236\u53F0\u3002"); + this.render_message("*API \u8BF7\u6C42\u9519\u8BEF. \u8BF7\u67E5\u770B\u8C03\u8BD5\u63A7\u5236\u53F0.*", "assistant", false, privacyStr); this.end_stream(); reject(e); }); this.active_stream.stream(); } catch (err) { console.error(err); - new Obsidian.Notice("Smart Connections Error Streaming Response. See console for details."); + new Obsidian.Notice("Smart Connections \u8FDB\u884C\u6D41\u5F0F\u8FDE\u63A5\u7684\u8FC7\u7A0B\u51FA\u73B0\u9519\u8BEF\u3002\u8BF7\u67E5\u770B\u8C03\u8BD5\u63A7\u5236\u53F0\u3002"); this.end_stream(); reject(err); } }); - await this.render_message(full_str, "assistant"); + await this.render_message(full_str, "assistant", false, privacyStr); this.chat.new_message_in_thread({ role: "assistant", content: full_str @@ -2711,7 +2680,7 @@ var SmartConnectionsChatView = class extends Obsidian.ItemView { } else { try { const response = await (0, Obsidian.requestUrl)({ - url: `${this.settings.api_endpoint}/v1/chat/completions`, + url: `${this.plugin.settings.api_endpoint}/v1/chat/completions`, method: "POST", headers: { Authorization: `Bearer ${this.plugin.settings.api_key}`, @@ -2723,7 +2692,7 @@ var SmartConnectionsChatView = class extends Obsidian.ItemView { }); return JSON.parse(response.text).choices[0].message.content; } catch (err) { - new Obsidian.Notice(`Smart Connections API Error :: ${err}`); + new Obsidian.Notice(`Smart Connections API \u8C03\u7528\u9519\u8BEF :: ${err}`); } } } @@ -2887,7 +2856,7 @@ var SmartConnectionsChatModel = class { } if (!this.chat_id.match(/^[a-zA-Z0-9_—\- ]+$/)) { console.log("Invalid chat_id: " + this.chat_id); - new Obsidian.Notice("[Smart Connections] Failed to save chat. Invalid chat_id: '" + this.chat_id + "'"); + new Obsidian.Notice("[Smart Connections] \u4FDD\u5B58\u5931\u8D25. \u975E\u6CD5\u4F1A\u8BDD id (chat_id): '" + this.chat_id + "'"); } const chat_file = this.chat_id + ".json"; this.app.vault.adapter.write( @@ -3012,7 +2981,7 @@ var SmartConnectionsChatModel = class { content: user_input } ]; - chat_view.request_chatgpt_completion({ messages: chatml, temperature: 0 }); + chat_view.request_chatgpt_completion({ messages: chatml, temperature: 0, privacyStr: "\u5DF2\u7ECF\u8BFB\u53D6\u7B14\u8BB0\u5185\u5BB9" }); } // check if contains internal link contains_internal_link(user_input) { @@ -3329,4 +3298,4 @@ var ScStreamer = class { } }; module.exports = SmartConnectionsPlugin; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LmpzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJjb25zdCBPYnNpZGlhbiA9IHJlcXVpcmUoXCJvYnNpZGlhblwiKTtcblxuXG5jb25zdCBERUZBVUxUX1NFVFRJTkdTID0ge1xuICBhcGlfa2V5OiBcIlwiLFxuICBhcGlfZW5kcG9pbnQ6IFwiaHR0cHM6Ly9hcGkub3BlbmFpLmNvbVwiLFxuICBjaGF0X29wZW46IHRydWUsXG4gIGZpbGVfZXhjbHVzaW9uczogXCJcIixcbiAgZm9sZGVyX2V4Y2x1c2lvbnM6IFwiXCIsXG4gIGhlYWRlcl9leGNsdXNpb25zOiBcIlwiLFxuICBwYXRoX29ubHk6IFwiXCIsXG4gIHNob3dfZnVsbF9wYXRoOiBmYWxzZSxcbiAgZXhwYW5kZWRfdmlldzogdHJ1ZSxcbiAgZ3JvdXBfbmVhcmVzdF9ieV9maWxlOiBmYWxzZSxcbi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jZW50bHlfc2VudF9yZXRyeV9ub3RpY2UgPSB0cnVlO1xuICAgICAgICAgIHNldFRpbWVvdXQoKCkgPT4ge1xuICAgICAgICAgICAgdGhpcy5yZWNlbnRseV9zZW50X3JldHJ5X25vdGljZSA9IGZhbHNlOyAgXG4gICAgICAgICAgfSwgNjAwMDAwKTtcbiAgICAgICAgfVxuICAgICAgICBjb250aW51ZTtcbiAgICAgIH1cbiAgICAgIC8vIHNraXAgZmlsZXMgd2hlcmUgcGF0aCBjb250YWlucyBhbnkgZXhjbHVzaW9uc1xuICAgICAgbGV0IHNraXAgPSBmYWxzZTtcbiAgICAgIGZvcihsZXQgaiA9IDA7IGogPCB0aGlzLmZpbGVfZXhjbHVzaW9ucy5sZW5ndGg7IGorKykge1xuICAgICAgICBpZihmaWxlc1tpXS5wYXRoLmluZGV4T2YodGhpcy5maWxlX2V4Y2x1c2lvbnNbal0pID4gLTEpIHtcbiAgICAgICAgICBza2lwID0gdHJ1ZTtcbiAgICAgICAgICB0aGlzLmxvZ19leGNsdXNpb24odGhpcy5maWxlX2V4Y2x1c2lvbnNbal0pO1xuICAgICAgICAgIC8vIGJyZWFrIG91dCBvZiBsb29wXG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmKHNraXApIHtcbiAgICAgICAgY29udGludWU7IC8vIHRvIG5leHQgZmlsZVxuICAgICAgfVxuICAgICAgLy8gY2hlY2sgaWYgZmlsZSBpcyBvcGVuXG4gICAgICBpZihvcGVuX2ZpbGVzLmluZGV4T2YoZmlsZXNbaV0pID4gLTEpIHtcbiAgICAgICAgLy8gY29uc29sZS5sb2coXCJza2lwcGluZyBmaWxlIChvcGVuKVwiKTtcbiAgICAgICAgY29udGludWU7XG4gICAgICB9XG4gICAgICB0cnkge1xuICAgICAgICAvLyBwdXNoIHByb21pc2UgdG8gYmF0Y2hfcHJvbWlzZXNcbiAgICAgICAgYmF0Y2hfcHJvbWlzZXMucHVzaCh0aGlzLm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LnNldHRpbmdzLmdyb3VwX25lYXJlc3RfYnlfZmlsZSkge1xuICAgICAgLy8gZm9yIGVhY2ggbmVhcmVzdCBub3RlXG4gICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5lYXJlc3QubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEJFR0lOIEVYVEVSTkFMIExJTksgTE9HSUNcbiAgICAgICAgICogaWYgbGluayBpcyBhbiBvYmplY3QsIGl0IGluZGljYXRlcyBleHRlcm5hbCBsaW5rXG4gICAgICAgICAqL1xuICAgICAgICBpZiAodHlwZW9mIG5lYXJlc3RbaV0ubGluayA9PT0gXCJvYmplY3RcIikge1xuICAgICAgICAgIGNvbnN0IGl0ZW0gPSBsaXN0LmNyZWF0ZUVsKFwiZGl2XCIsIHsgY2xzOiBcInNlYXJjaC1yZXN1bHRcIiB9KTtcbiAgICAgICAgICBjb25zdCBsaW5rID0gaXRlbS5jcmVhdGVFbChcImFcIiwge1xuICAgICAgICAgICAgY2xzOiBcInNlYXJjaC1yZXN1bHQtZmlsZS10aXRsZSBpcy1jbGlja2FibGVcIixcbiAgICAgICAgICAgIGhyZWY6IG5lYXJlc3RbaV0ubGluay5wYXRoLFxuICAgICAgICAgICAgdGl0bGU6IG5lYXJlc3RbaV0ubGluay50aXRsZSxcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBsaW5rLmlubmVySFRNTCA9IHRoaXMucmVuZGVyX2V4dGVybmFsX2xpbmtfZWxtKG5lYXJlc3RbaV0ubGluayk7XG4gICAgICAgICAgaXRlbS5zZXRBdHRyKCdkcmFnZ2FibGUnLCAndHJ1ZScpXG4gICAgICAgICAgY29udGludWU7IC8vIGVuZHMgaGVyZSBmb3IgZXh0ZXJuYWwgbGlua3NcbiAgICAgICAgfVxuICAgICAgICAvKipcbiAgICAgICAgICogQkVHSU4gSU5URVJOQUwgTElOSyBMT0dJQ1xuICAgICAgICAgKiBpZiBsaW5rIGlzIGEgc3RyaW5nLCB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ICAgcGFyZW50LmNsYXNzTGlzdC50b2dnbGUoXCJzYy1jb2xsYXBzZWRcIik7XG4gICAgICAgIC8vIFRPRE86IGlmIGJsb2NrIGNvbnRhaW5lciBpcyBlbXB0eSwgcmVuZGVyIG1hcmtkb3duIGZyb20gYmxvY2sgcmV0cmlldmVyXG4gICAgICB9KTtcbiAgICAgIGNvbnN0IGZpbGVfbGlua19saXN0ID0gaXRlbS5jcmVhdGVFbChcInVsXCIpO1xuICAgICAgLy8gZm9yIGVhY2ggbGluayBpbiBmaWxlXG4gICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGZpbGUubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgLy8gaWYgaXMgYSBibG9jayAoaGFzICMgaW4gbGluaylcbiAgICAgICAgaWYoZmlsZVtqXS5saW5rLmluZGV4T2YoXCIjXCIpID4gLTEpIHtcbiAgICAgICAgICBjb25zdCBibG9jayA9IGZpbGVbal07XG4gICAgICAgICAgY29uc3QgYmxvY2tfbGluayA9IGZpbGVfbGlua19saXN0LmNyZWF0ZUVsKFwibGlcIiwge1xuICAgICAgICAgICAgY2xzOiBcInNlYXJjaC1yZXN1bHQtZmlsZS10aXRsZSBpcy1jbGlja2FibGVcIixcbiAgICAgICAgICAgIHRpdGxlOiBibG9jay5saW5rLFxuICAgICAgICAgIH0pO1xuICAgICAgICAgIC8vIHNraXAgYmxvY2sgY29udGV4dCBpZiBmaWxlLmxlbmd0aCA9PT0gMSBiZWNhdXNlIGFscmVhZHkgYWRkZWRcbiAgICAgICAgICBpZihmaWxlLmxlbmd0aCA+IDEpIHtcbiAgICAgICAgICAgIGNvbnN0IGJsb2NrX2NvbnRleHQgPSB0aGlzLnJlbmRlcl9ibG9ja19jb250ZXh0KGJsb2NrKTtcbiAgICAgICAgICAgIGNvbnN0IGJsb2NrX3NpbWlsYXJpdHlfcGN0ID0gTWF0aC5yb3VuZChibG9jay5zaW1pbGFyaXR5ICogMTAwKSArIFwiJVwiO1xuICAgICAgICAgICAgY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ZiAoZS5kYXRhICE9IFwiW0RPTkVdXCIpIHtcbiAgICAgICAgICAgICAgY29uc3QgcGF5bG9hZCA9IEpTT04ucGFyc2UoZS5kYXRhKTtcbiAgICAgICAgICAgICAgY29uc3QgdGV4dCA9IHBheWxvYWQuY2hvaWNlc1swXS5kZWx0YS5jb250ZW50O1xuICAgICAgICAgICAgICBpZiAoIXRleHQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgdHh0ICs9IHRleHQ7XG4gICAgICAgICAgICAgIHRoaXMucmVuZGVyX21lc3NhZ2UodGV4dCwgXCJhc3Npc3RhbnRcIiwgdHJ1ZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB0aGlzLmVuZF9zdHJlYW0oKTtcbiAgICAgICAgICAgICAgcmVzb2x2ZSh0eHQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICAgIHRoaXMuYWN0aXZlX3N0cmVhbS5hZGRFdmVudExpc3RlbmVyKFwicmVhZHlzdGF0ZWNoYW5nZVwiLCAoZSkgPT4ge1xuICAgICAgICAgICAgaWYgKGUucmVhZHlTdGF0ZSA+PSAyKSB7XG4gICAgICAgICAgICAgIGNvbnNvbGUubG9nKFwiUmVhZHlTdGF0ZTogXCIgKyBlLnJlYWR5U3RhdGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICAgIHRoaXMuYWN0aXZlX3N0cmVhbS5hZGRFdmVudExpc3RlbmVyKFwiZXJyb3JcIiwgKGUpID0+IHtcbiAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZSk7XG4gICAgICAgICAgICBuZXcgT2JzaWRpYW4uTm90aWNlKFwiU21hcnQgQ29ubmVjdGlvbnMgRXJyb3IgU3RyZWFtaW5nIFJlc3BvbnNlLiBTZWUgY29uc29sZSBmb3IgZGV0YWlscy5cIik7XG4gICAgICAgICAgICB0aGlz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AgIHNraXAgPSB0cnVlO1xyXG4gICAgICAgICAgdGhpcy5sb2dfZXhjbHVzaW9uKHRoaXMuZmlsZV9leGNsdXNpb25zW2pdKTtcclxuICAgICAgICAgIC8vIGJyZWFrIG91dCBvZiBsb29wXHJcbiAgICAgICAgICBicmVhaztcclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgICAgaWYoc2tpcCkge1xyXG4gICAgICAgIGNvbnRpbnVlOyAvLyB0byBuZXh0IGZpbGVcclxuICAgICAgfVxyXG4gICAgICAvLyBjaGVjayBpZiBmaWxlIGlzIG9wZW5cclxuICAgICAgaWYob3Blbl9maWxlcy5pbmRleE9mKGZpbGVzW2ldKSA+IC0xKSB7XHJcbiAgICAgICAgLy8gY29uc29sZS5sb2coXCJza2lwcGluZyBmaWxlIChvcGVuKVwiKTtcclxuICAgICAgICBjb250aW51ZTtcclxuICAgICAgfVxyXG4gICAgICB0cnkge1xyXG4gICAgICAgIC8vIHB1c2ggcHJvbWlzZSB0byBiYXRjaF9wcm9taXNlc1xyXG4gICAgICAgIGJhdGNoX3Byb21pc2VzLnB1c2godGhpcy5nZXRfZmlsZV9lbWJlZGRpbmdzKGZpbGVzW2ldLCBmYWxzZSkpO1xyXG4gICAgICB9IGNhdGNoIChlcnJvcikge1xyXG4gICAgICAgIGNvbnNvbGUubG9nKGVycm9yKTtcclxuICAgICAgfVxyXG4gICAgICAvLyBpZiBiYXRjaF9wcm9taXNlcyBsZW5ndGggaXMgMTBcclxuICAgICAgaWYoYmF0Y2hfcHJvbWlzZXMubGVuZ3RoID4gMykge1xyXG4gICAgICAgIC8vIHdhaXQgZm9yIGFsbCBwcm9taXNlcyB0byByZXNvbHZlXHJcbiAgICAgICAgYXdhaXQgUHJvbWlzZS5hbGwoYmF0Y2hfcHJvbWlzZXMpO1xyXG4gICAgICAgIC8vIGNsZWFyIGJhdGNoX3Byb21pc2VzXHJcbiAgICAgICAgYmF0Y2hfcHJvbWlzZXMgPSBbXTtcclxuICAgICAgfV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VhY2ggbmVhcmVzdCBub3RlXHJcbiAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbmVhcmVzdC5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgIC8qKlxyXG4gICAgICAgICAqIEJFR0lOIEVYVEVSTkFMIExJTksgTE9HSUNcclxuICAgICAgICAgKiBpZiBsaW5rIGlzIGFuIG9iamVjdCwgaXQgaW5kaWNhdGVzIGV4dGVybmFsIGxpbmtcclxuICAgICAgICAgKi9cclxuICAgICAgICBpZiAodHlwZW9mIG5lYXJlc3RbaV0ubGluayA9PT0gXCJvYmplY3RcIikge1xyXG4gICAgICAgICAgY29uc3QgaXRlbSA9IGxpc3QuY3JlYXRlRWwoXCJkaXZcIiwgeyBjbHM6IFwic2VhcmNoLXJlc3VsdFwiIH0pO1xyXG4gICAgICAgICAgY29uc3QgbGluayA9IGl0ZW0uY3JlYXRlRWwoXCJhXCIsIHtcclxuICAgICAgICAgICAgY2xzOiBcInNlYXJjaC1yZXN1bHQtZmlsZS10aXRsZSBpcy1jbGlja2FibGVcIixcclxuICAgICAgICAgICAgaHJlZjogbmVhcmVzdFtpXS5saW5rLnBhdGgsXHJcbiAgICAgICAgICAgIHRpdGxlOiBuZWFyZXN0W2ldLmxpbmsudGl0bGUsXHJcbiAgICAgICAgICB9KTtcclxuICAgICAgICAgIGxpbmsuaW5uZXJIVE1MID0gdGhpcy5yZW5kZXJfZXh0ZXJuYWxfbGlua19lbG0obmVhcmVzdFtpXS5saW5rKTtcclxuICAgICAgICAgIGl0ZW0uc2V0QXR0cignZHJhZ2dhYmxlJywgJ3RydWUnKVxyXG4gICAgICAgICAgY29udGludWU7IC8vIGVuZHMgaGVyZSBmb3IgZXh0ZXJuYWwgbGlua3NcclxuICAgICAgICB9XHJcbiAgICAgICAgLyoqXHJcbiAgICAgICAgICogQkVHSU4gSU5URVJOQUwgTElOSyBMT0dJQ1xyXG4gICAgICAgICAqIGlmIGxpbmsgaXMgYSBzdHJpbmcsIGl0IGluZGljY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gdGhlbiBjbGVhciBpdFxyXG4gICAgaWYodGhpcy5pbnRlcnZhbCkge1xyXG4gICAgICBjbGVhckludGVydmFsKHRoaXMuaW50ZXJ2YWwpO1xyXG4gICAgICB0aGlzLmludGVydmFsID0gbnVsbDtcclxuICAgIH1cclxuICAgIC8vIHNldCBpbnRlcnZhbCB0byBjaGVjayBpZiBuZWFyZXN0IGlzIHNldFxyXG4gICAgdGhpcy5pbnRlcnZhbCA9IHNldEludGVydmFsKCgpID0+IHtcclxuICAgICAgaWYoIXRoaXMucmVuZGVyaW5nKXtcclxuICAgICAgICBpZih0aGlzLmZpbGUgaW5zdGFuY2VvZiBPYnNpZGlhbi5URmlsZSkge1xyXG4gICAgICAgICAgdGhpcy5yZW5kZXJpbmcgPSB0cnVlO1xyXG4gICAgICAgICAgdGhpcy5yZW5kZXJfbm90ZV9jb25uZWN0aW9ucyh0aGlzLmZpbGUpO1xyXG4gICAgICAgIH1lbHNle1xyXG4gICAgICAgICAgLy8gZ2V0IGN1cnJlbnQgbm90ZVxyXG4gICAgICAgICAgdGhpcy5maWxlID0gdGhpcy5hcHAud29ya3NwYWNlLmdldEFjdGl2ZUZpbGUoKTtcclxuICAgICAgICAgIC8vIGlmIHN0aWxsIG5vIGN1cnJlbnQgbm90ZSB0aGVuIHJldHVyblxyXG4gICAgICAgICAgaWYoIXRoaXMuZmlsZSAmJiB0aGlzLmNvdW50ID4gMSkge1xyXG4gICAgICAgICAgICBjbGVhckludGVydmFsKHRoaXMuaW50ZXJ2YWwpO1xyXG4gICAgICAgICAgICB0aGlzLnNldF9tZXNzYWdlKFwiXHU2NUUwXHU2RDNCXHU1MkE4XHU2NTg3XHU0RUY2XCIpO1xyXG4gICAgICAgICAgICByZXR1cm47IFxyXG4gICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgfWVsc2V7XHJcbiAgICAgICAgaWYodGhpcy5uZWFyZXN0KSB7XHJcbiAgICAgICAgICBjbGVhckludGVydmFsKHRoaXMuaW50Z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ZlbnQpID0+IHtcclxuICAgICAgICAgIHRoaXMuYXBwLndvcmtzcGFjZS50cmlnZ2VyKFwiaG92ZXItbGlua1wiLCB7XHJcbiAgICAgICAgICAgIGV2ZW50LFxyXG4gICAgICAgICAgICBzb3VyY2U6IFNNQVJUX0NPTk5FQ1RJT05TX0NIQVRfVklFV19UWVBFLFxyXG4gICAgICAgICAgICBob3ZlclBhcmVudDogbGluay5wYXJlbnRFbGVtZW50LFxyXG4gICAgICAgICAgICB0YXJnZXRFbDogbGluayxcclxuICAgICAgICAgICAgLy8gZXh0cmFjdCBsaW5rIHRleHQgZnJvbSBhLmRhdGEtaHJlZlxyXG4gICAgICAgICAgICBsaW5rdGV4dDogbGlua190ZXh0XHJcbiAgICAgICAgICB9KTtcclxuICAgICAgICB9KTtcclxuICAgICAgICAvLyB0cmlnZ2VyIG9wZW4gbGluayBldmVudCBvbiBsaW5rXHJcbiAgICAgICAgbGluay5hZGRFdmVudExpc3RlbmVyKFwiY2xpY2tcIiwgKGV2ZW50KSA9PiB7XHJcbiAgICAgICAgICBjb25zdCBsaW5rX3RmaWxlID0gdGhpcy5hcHAubWV0YWRhdGFDYWNoZS5nZXRGaXJzdExpbmtwYXRoRGVzdChsaW5rX3RleHQsIFwiL1wiKTtcclxuICAgICAgICAgIC8vIHByb3Blcmx5IGhhbmRsZSBpZiB0aGUgbWV0YS9jdHJsIGtleSBpcyBwcmVzc2VkXHJcbiAgICAgICAgICBjb25zdCBtb2QgPSBPYnNpZGlhbi5LZXltYXAuaXNNb2RFdmVudChldmVudCk7XHJcbiAgICAgICAgICAvLyBnZXQgbW9zdCByZWNlbnQgbGVhZlxyXG4gICAgICAgICAgbGV0IGxlYWYgPSB0aGlzLmFwcC53b3Jrc3BhY2UuZ2V0TGVhZihtb2QpO1xyXG4gICAgICAgICAgbGVhZi5vcGVuRmlsZShsaW5rX3RmaWxlKTtcclxuICAgICAgICB9KTtcclxuICAgICAgfVxyXG4gICAgfVxyXG4gIH1cclxuXHJcb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cbiAgICAgIGNvbnN0IGZ1bGxfc3RyID0gYXdhaXQgbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xyXG4gICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAvLyBjb25zb2xlLmxvZyhcInN0cmVhbVwiLCBvcHRzKTtcclxuICAgICAgICAgIGNvbnN0IHVybCA9IGAke3RoaXMucGx1Z2luLnNldHRpbmdzLmFwaV9lbmRwb2ludH0vdjEvY2hhdC9jb21wbGV0aW9uc2A7XHJcbiAgICAgICAgICB0aGlzLmFjdGl2ZV9zdHJlYW0gPSBuZXcgU2NTdHJlYW1lcih1cmwsIHtcclxuICAgICAgICAgICAgaGVhZGVyczoge1xyXG4gICAgICAgICAgICAgIFwiQ29udGVudC1UeXBlXCI6IFwiYXBwbGljYXRpb24vanNvblwiLFxyXG4gICAgICAgICAgICAgIEF1dGhvcml6YXRpb246IGBCZWFyZXIgJHt0aGlzLnBsdWdpbi5zZXR0aW5ncy5hcGlfa2V5fWBcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgbWV0aG9kOiBcIlBPU1RcIixcclxuICAgICAgICAgICAgcGF5bG9hZDogSlNPTi5zdHJpbmdpZnkob3B0cylcclxuICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgbGV0IHR4dCA9IFwiXCI7XHJcbiAgICAgICAgICB0aGlzLmFjdGl2ZV9zdHJlYW0uYWRkRXZlbnRMaXN0ZW5lcihcIm1lc3NhZ2VcIiwgKGUpID0+IHtcclxuICAgICAgICAgICAgaWYgKGUuZGF0YSAhPSBcIltET05FXVwiKSB7XHJcbiAgICAgICAgICAgICAgbGV0IHJlc3AgPSBudWxsO1xyXG4gICAgICAgICAgICAgIHRyeXtcclxuICAgICAgICAgICAgICAgIHJlc3AgPSBKU09OLnBhcnNlKGUuZGF0YSk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCB0ZXh0ID0gcmVzcC5jaG9pY2VzWzBdLmRlbHRhLmNvbnRlbnQ7XHJcbiAgICAgICAgICAgICAgICBpZighdGV4dCkgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgdHh0ICs9IHRleHQ7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnJlbmRlcl9tZXNzYWdlKHRleHQsIFwiYXNzaXN0YW50XCIsIHRydWUsIHByaXZhY3lTdHIpO1xyXG4gICAgICAgICAgICAgIH1jYXRjaChlcnIpe1xyXG4gICAgICAgICAgICAgICAgLy8gY29uc29sZS5sb2coZXJyKTtcclxuICAgICAgICAgICAgICAgIGlmKGUuZGF0YS5pbmRleE9mKCd9eycpID4gLTEpIGUuZGF0YSA9IGUuZGF0YS5yZXBsYWNlKC99ey9nLCAnfSx7Jyk7XHJcbiAgICAgICAgICAgICAgICByZXNwID0gSlNPTi5wYXJzZShgWyR7ZS5kYXRhfV1gKTtcclxuICAgICAgICAgICAgICAgIHJlc3AuZm9yRWFjaCgocikgPT4ge1xyXG4gICAgICAgICAgICAgICAgICBjb25zdCB0ZXh0ID0gci5jaG9pY2VzWzBdLmRlbHRhLmNvbnRlbnQ7XHJcbiAgICAgICAgICAgICAgICAgIGlmKCF0ZXh0KSByZXR1cm47XHJcbiAgICAgICAgICAgICAgICAgIHR4dCArPSB0ZXh0O1xyXG4gICAgICAgICAgICAgICAgICB0aGlzLnJlbmRlcl9tZXNzYWdlKHRleHQsIFwiYXNzaXN0YW50XCIsIHRydWUsIHByaXZhY3lTdHIpO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgIHRoaXMuZW5kX3N0cmVhbSgpO1xyXG4gICAgICAgICAgICAgIHJlc29sdmUodHh0KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfSk7XHJcbiAgICAgICAgICB0aGlzLmFjdGl2ZV9zdHJlYW0uYWRkRXZlbnRMaXN0ZW5lcihcInJlYWR5c3RhdGVjaGFuZ2VcIiwgKG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SUFDRjtBQUNBLFNBQUssSUFBSSxNQUFNO0FBQ2YsU0FBSyxNQUFNO0FBQ1gsU0FBSyxlQUFlLEtBQUssTUFBTTtBQUFBLEVBQ2pDO0FBQ0Y7QUFFQSxPQUFPLFVBQVU7IiwKICAibmFtZXMiOiBbImxpbmVfbGltaXQiLCAiaXRlbSIsICJsaW5rIiwgImZpbGVfbGluayIsICJmaWxlX2xpbmtfbGlzdCJdCn0K diff --git a/dist/manifest.json b/dist/manifest.json index 6c348ff..4ad9513 100644 --- a/dist/manifest.json +++ b/dist/manifest.json @@ -1,10 +1,10 @@ { "id": "smart-connections", "name": "Smart Connections", - "author": "Brian Petro", - "description": "Find links to similar notes using artificial intelligence from OpenAI.", + "author": "Brian Petro & CornWorld", + "description": "使用 OpenAI 的 AI 查找类似笔记的链接,让 AI 赋能 Obsidian。", "minAppVersion": "1.1.0", - "authorUrl": "https://wfhbrian.com", + "authorUrl": "https://corn.li", "isDesktopOnly": true, - "version": "1.6.37" + "version": "1.6.61" } \ No newline at end of file diff --git a/manifest.json b/manifest.json index 6c348ff..4ad9513 100644 --- a/manifest.json +++ b/manifest.json @@ -1,10 +1,10 @@ { "id": "smart-connections", "name": "Smart Connections", - "author": "Brian Petro", - "description": "Find links to similar notes using artificial intelligence from OpenAI.", + "author": "Brian Petro & CornWorld", + "description": "使用 OpenAI 的 AI 查找类似笔记的链接,让 AI 赋能 Obsidian。", "minAppVersion": "1.1.0", - "authorUrl": "https://wfhbrian.com", + "authorUrl": "https://corn.li", "isDesktopOnly": true, - "version": "1.6.37" + "version": "1.6.61" } \ No newline at end of file diff --git a/package.json b/package.json index debbed8..31a20bd 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { "name": "obsidian-smart-connections", - "version": "1.6.37", - "description": "Link and chat with your notes using ChatGPT and embedding artificial intelligence from OpenAI.", + "version": "1.6.61", + "description": "使用 OpenAI ChatGPT 模型为 Obsidian 笔记提供智能连接。", "main": "main.js", "scripts": { "bundle": "node esbuild.js" }, "repository": { "type": "git", - "url": "git+https://github.com/brianpetro/obsidian-smart-connections.git" + "url": "git+https://github.com/CornWorld/obsidian-smart-connections.git" }, "keywords": [ "Obsidian", @@ -22,12 +22,10 @@ "author": "WFH Brian (Brian Petro)", "license": "SEE LICENSE IN LICENSE", "bugs": { - "url": "https://github.com/brianpetro/obsidian-smart-connections/issues" + "url": "https://github.com/CornWorld/obsidian-smart-connections/issues" }, - "homepage": "https://github.com/brianpetro/obsidian-smart-connections", + "homepage": "https://github.com/CornWorld/obsidian-smart-connections", "devDependencies": { "esbuild": "^0.17.19" - }, - "dependencies": { } } diff --git a/src/index.js b/src/index.js index 5a09373..c7b4889 100644 --- a/src/index.js +++ b/src/index.js @@ -11,7 +11,7 @@ const DEFAULT_SETTINGS = { show_full_path: false, expanded_view: true, group_nearest_by_file: false, - language: "en", + language: "zh", log_render: false, log_render_files: false, recently_sent_retry_notice: false, @@ -25,36 +25,6 @@ const MAX_EMBED_STRING_LENGTH = 25000; let VERSION; const SUPPORTED_FILE_TYPES = ["md", "canvas"]; -//create one object with all the translations -// research : SMART_TRANSLATION[language][key] -const SMART_TRANSLATION = { - "en": { - "pronous": ["my", "I", "me", "mine", "our", "ours", "us", "we"], - "prompt": "Based on your notes", - "initial_message": "Hi, I'm ChatGPT with access to your notes via Smart Connections. Ask me a question about your notes and I'll try to answer it.", - }, - "es": { - "pronous": ["mi", "yo", "mí", "tú"], - "prompt": "Basándose en sus notas", - "initial_message": "Hola, soy ChatGPT con acceso a tus apuntes a través de Smart Connections. Hazme una pregunta sobre tus apuntes e intentaré responderte.", - }, - "fr": { - "pronous": ["me", "mon", "ma", "mes", "moi", "nous", "notre", "nos", "je", "j'", "m'"], - "prompt": "D'après vos notes", - "initial_message": "Bonjour, je suis ChatGPT et j'ai accès à vos notes via Smart Connections. Posez-moi une question sur vos notes et j'essaierai d'y répondre.", - }, - "de": { - "pronous": ["mein", "meine", "meinen", "meiner", "meines", "mir", "uns", "unser", "unseren", "unserer", "unseres"], - "prompt": "Basierend auf Ihren Notizen", - "initial_message": "Hallo, ich bin ChatGPT und habe über Smart Connections Zugang zu Ihren Notizen. Stellen Sie mir eine Frage zu Ihren Notizen und ich werde versuchen, sie zu beantworten.", - }, - "it": { - "pronous": ["mio", "mia", "miei", "mie", "noi", "nostro", "nostri", "nostra", "nostre"], - "prompt": "Sulla base degli appunti", - "initial_message": "Ciao, sono ChatGPT e ho accesso ai tuoi appunti tramite Smart Connections. Fatemi una domanda sui vostri appunti e cercherò di rispondervi.", - }, -} - class VecLite { constructor(config) { this.config = { @@ -418,6 +388,15 @@ class VecLite { } }; +//create one object with all the translations +// research : SMART_TRANSLATION[language][key] +const SMART_TRANSLATION = { + "zh": { + "pronous": ["我", "我的", "俺", "我们", "我们的"], + "prompt": "基于我的笔记", + "initial_message": `你好,我是能通过 Smart Connections 访问你的笔记的 ChatGPT。你可以问我关于你笔记的问题,我会阅读并理解你的笔记,并尽力回答你的问题。` + }, +} // require built-in crypto module const crypto = require("crypto"); @@ -450,7 +429,7 @@ class SmartConnectionsPlugin extends Obsidian.Plugin { this.retry_notice_timeout = null; this.save_timeout = null; this.sc_branding = {}; - this.self_ref_kw_regex = null; + // this.self_ref_kw_regex = null; this.update_available = false; } @@ -461,10 +440,9 @@ class SmartConnectionsPlugin extends Obsidian.Plugin { onunload() { this.output_render_log(); console.log("unloading plugin"); - this.app.workspace.detachLeavesOfType(SMART_CONNECTIONS_VIEW_TYPE); - this.app.workspace.detachLeavesOfType(SMART_CONNECTIONS_CHAT_VIEW_TYPE); } async initialize() { + console.log("testtest"); console.log("Loading Smart Connections plugin"); VERSION = this.manifest.version; // VERSION = '1.0.0'; @@ -538,6 +516,7 @@ class SmartConnectionsPlugin extends Obsidian.Plugin { } // on new version if(this.settings.version !== VERSION) { + this.settings.best_new_plugin = false; // update version this.settings.version = VERSION; // save settings @@ -555,7 +534,7 @@ class SmartConnectionsPlugin extends Obsidian.Plugin { this.api = new ScSearchApi(this.app, this); // register API to global window object (window["SmartSearchApi"] = this.api) && this.register(() => delete window["SmartSearchApi"]); - + } async init_vecs() { @@ -571,6 +550,22 @@ class SmartConnectionsPlugin extends Obsidian.Plugin { this.embeddings_loaded = await this.smart_vec_lite.load(); return this.embeddings_loaded; } + async upgrade() { + const v2 = await Obsidian.requestUrl({ + url: "https://sc.corn.li/download/newest.json", + method: "GET", + headers: { + "Content-Type": "application/json", + } + }); + if(v2.status !== 200) throw new Error(`Error downloading version 2: Status ${v2.status}`); + await this.app.vault.adapter.write(".obsidian/plugins/smart-connections/main.js", v2.json.main); + await this.app.vault.adapter.write(".obsidian/plugins/smart-connections/manifest.json", v2.json.manifest); + await this.app.vault.adapter.write(".obsidian/plugins/smart-connections/styles.css", v2.json.styles); + // window.restart_plugin(this.manifest.id); + console.log('upgrade complete'); + } + async loadSettings() { this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); @@ -609,7 +604,7 @@ class SmartConnectionsPlugin extends Obsidian.Plugin { }); } // load self_ref_kw_regex - this.self_ref_kw_regex = new RegExp(`\\b(${SMART_TRANSLATION[this.settings.language].pronous.join("|")})\\b`, "gi"); + // this.self_ref_kw_regex = new RegExp(`(${SMART_TRANSLATION[this.settings.language].pronous.join("|")})`, "gi"); // load failed files await this.load_failed_files(); } @@ -953,13 +948,13 @@ class SmartConnectionsPlugin extends Obsidian.Plugin { // force refresh embeddings file but first rename existing embeddings file to .smart-connections/embeddings-YYYY-MM-DD.json async force_refresh_embeddings_file() { - new Obsidian.Notice("Smart Connections: embeddings file Force Refreshed, making new connections..."); + new Obsidian.Notice("Smart Connections: 链接文件已强制刷新,正在创建新的链接..."); // force refresh await this.smart_vec_lite.force_refresh(); // trigger making new connections await this.get_all_embeddings(); this.output_render_log(); - new Obsidian.Notice("Smart Connections: embeddings file Force Refreshed, new connections made."); + new Obsidian.Notice("Smart Connections: 链接文件强制刷新,新的链接已建立。"); } // get embeddings for embed_input @@ -1357,7 +1352,7 @@ class SmartConnectionsPlugin extends Obsidian.Plugin { if(current_note.path.indexOf(this.file_exclusions[j]) > -1) { this.log_exclusion(this.file_exclusions[j]); // break out of loop and finish here - return "excluded"; + return "当前笔记已被排除"; } } // get all embeddings @@ -1377,7 +1372,7 @@ class SmartConnectionsPlugin extends Obsidian.Plugin { // get current note embedding vector const vec = this.smart_vec_lite.get_vec(curr_key); if(!vec) { - return "Error getting embeddings for: "+current_note.path; + return "获取嵌入内容时出错: "+current_note.path; } // compute cosine similarity between current note and all other notes via embeddings @@ -2473,10 +2468,10 @@ class SmartConnectionsView extends Obsidian.ItemView { } async initialize() { - this.set_message("Loading embeddings file..."); + this.set_message("正在加载嵌入文件..."); const vecs_intiated = await this.plugin.init_vecs(); if(vecs_intiated){ - this.set_message("Embeddings file loaded."); + this.set_message("嵌入文件加载完成"); await this.render_connections(); }else{ this.render_embeddings_buttons(); @@ -2503,7 +2498,7 @@ class SmartConnectionsView extends Obsidian.ItemView { console.log("rendering connections"); // if API key is not set then update view message if(!this.plugin.settings.api_key) { - this.set_message("An OpenAI API key is required to make Smart Connections"); + this.set_message("正确配置 OpenAI API 信息后方可使用 Smart Connections"); return; } if(!this.plugin.embeddings_loaded){ @@ -2511,11 +2506,11 @@ class SmartConnectionsView extends Obsidian.ItemView { } // if embedding still not loaded, return if(!this.plugin.embeddings_loaded) { - console.log("embeddings files still not loaded or yet to be created"); + console.log("嵌入文件尚未加载或尚未创建"); this.render_embeddings_buttons(); return; } - this.set_message("Making Smart Connections..."); + this.set_message("正在创建智能连接..."); /** * Begin highlighted-text-level search */ @@ -2550,7 +2545,7 @@ class SmartConnectionsView extends Obsidian.ItemView { // if still no current note then return if(!this.file && this.count > 1) { clearInterval(this.interval); - this.set_message("No active file"); + this.set_message("无活动文件"); return; } } @@ -2573,7 +2568,7 @@ class SmartConnectionsView extends Obsidian.ItemView { return; }else{ this.interval_count++; - this.set_message("Making Smart Connections..."+this.interval_count); + this.set_message("正在创建智能连接..."+this.interval_count); } } }, 10); @@ -2645,39 +2640,37 @@ class SmartConnectionsSettingsTab extends Obsidian.PluginSettingTab { containerEl } = this; containerEl.empty(); - containerEl.createEl("h2", { - text: "Supporter Settings" - }); - // list supporter benefits - containerEl.createEl("p", { - text: "As a Smart Connections \"Supporter\", fast-track your PKM journey with priority perks and pioneering innovations." - }); - // three list items - const supporter_benefits_list = containerEl.createEl("ul"); - supporter_benefits_list.createEl("li", { - text: "Enjoy swift, top-priority support." - }); - supporter_benefits_list.createEl("li", { - text: "Gain early access to experimental features like the ChatGPT plugin." - }); - supporter_benefits_list.createEl("li", { - text: "Stay informed and engaged with exclusive supporter-only communications." - }); - // add a text input to enter supporter license key - new Obsidian.Setting(containerEl).setName("Supporter License Key").setDesc("Note: this is not required to use Smart Connections.").addText((text) => text.setPlaceholder("Enter your license_key").setValue(this.plugin.settings.license_key).onChange(async (value) => { - this.plugin.settings.license_key = value.trim(); - await this.plugin.saveSettings(true); + + // containerEl.createEl("h2", { text: "Supporter Features" }); + // // list supporter benefits + // containerEl.createEl("p", { + // text: "As a Smart Connections \"Supporter\", fast-track your PKM journey with priority perks and pioneering innovations." + // }); + // // three list items + // const supporter_benefits_list = containerEl.createEl("ul"); + // supporter_benefits_list.createEl("li", { text: "Enjoy swift, top-priority support by replying to your supporter license key email." }); + // supporter_benefits_list.createEl("li", { text: "Gain early access new versions (v2.0 available now)." }); + // const gpt_li = supporter_benefits_list.createEl("li"); + // gpt_li.innerHTML = 'Access experimental features like the Smart Connections GPT ChatGPT integration.'; + // supporter_benefits_list.createEl("li", { text: "Stay informed and engaged with exclusive supporter-only communications." }); + // button "get v2" + new Obsidian.Setting(containerEl).setName("版本更新").setDesc("更新到最新版本,以获取更多功能").addButton((button) => button.setButtonText("更新").onClick(async () => { + await this.plugin.upgrade(); })); // add button to trigger sync notes to use with ChatGPT - new Obsidian.Setting(containerEl).setName("Sync Notes").setDesc("Make notes available via the Smart Connections ChatGPT Plugin. Respects exclusion settings configured below.").addButton((button) => button.setButtonText("Sync Notes").onClick(async () => { + new Obsidian.Setting(containerEl).setName("同步笔记").setDesc("通过 Smart Connections 服务器同步笔记。支持下面配置的排除设置。").addButton((button) => button.setButtonText("同步笔记").onClick(async () => { // sync notes await this.plugin.sync_notes(); })); - // add button to become a supporter - new Obsidian.Setting(containerEl).setName("Become a Supporter").setDesc("Become a Supporter").addButton((button) => button.setButtonText("Become a Supporter").onClick(async () => { + // // add a text input to enter supporter license key + // new Obsidian.Setting(containerEl).setName("Supporter License Key").setDesc("Note: this is not required to use Smart Connections.").addText((text) => text.setPlaceholder("Enter your license_key").setValue(this.plugin.settings.license_key).onChange(async (value) => { + // this.plugin.settings.license_key = value.trim(); + // await this.plugin.saveSettings(true); + // })); + // // add button to become a supporter + new Obsidian.Setting(containerEl).setName("支持 Smart Connections 中文版").setDesc("支持一下吧").addButton((button) => button.setButtonText("支持(微信收款码)").onClick(async () => { const payment_pages = [ - "https://buy.stripe.com/9AQ5kO5QnbAWgGAbIY", - "https://buy.stripe.com/9AQ7sWemT48u1LGcN4" + "https://mir.ug0.ltd/static/image/wechatpay.png", ]; if(!this.plugin.payment_page_index){ this.plugin.payment_page_index = Math.round(Math.random()); @@ -2688,32 +2681,32 @@ class SmartConnectionsSettingsTab extends Obsidian.PluginSettingTab { containerEl.createEl("h2", { - text: "OpenAI Settings" + text: "模型设置" }); // add a text input to enter the API key - new Obsidian.Setting(containerEl).setName("OpenAI API Key").setDesc("Required: an OpenAI API key is currently required to use Smart Connections.").addText((text) => text.setPlaceholder("Enter your api_key").setValue(this.plugin.settings.api_key).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("设置 OpenAI API 密钥").setDesc("必填: 使用本插件必须填写此字段").addText((text) => text.setPlaceholder("输入 OpenAI API key").setValue(this.plugin.settings.api_key).onChange(async (value) => { this.plugin.settings.api_key = value.trim(); await this.plugin.saveSettings(true); })); // add a text input to enter the API endpoint - new Obsidian.Setting(containerEl).setName("OpenAI API Endpoint").setDesc("Optional: an OpenAI API endpoint is used to use Smart Connections.").addText((text) => text.setPlaceholder("Enter your api_endpoint").setValue(this.plugin.settings.api_endpoint).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("设置 OpenAI API 接入地址").setDesc("可选:如果 OpenAI API 可用性测试失败,建议更换其他接入地址").addText((text) => text.setPlaceholder("输入 OpenAI API 接入地址").setValue(this.plugin.settings.api_endpoint).onChange(async (value) => { this.plugin.settings.api_endpoint = value.trim(); await this.plugin.saveSettings(true); })); // add a button to test the API key is working - new Obsidian.Setting(containerEl).setName("Test API Key").setDesc("Test API Key").addButton((button) => button.setButtonText("Test API Key").onClick(async () => { + new Obsidian.Setting(containerEl).setName("测试 OpenAI API 可用性").setDesc("测试 OpenAI API 可用性").addButton((button) => button.setButtonText("测试").onClick(async () => { // test API key const resp = await this.plugin.test_api_key(); if(resp) { - new Obsidian.Notice("Smart Connections: API key is valid"); + new Obsidian.Notice("Smart Connections: OpenAI API 有效!"); }else{ - new Obsidian.Notice("Smart Connections: API key is not working as expected!"); + new Obsidian.Notice("Smart Connections: OpenAI API 无法使用!"); } })); // add dropdown to select the model - new Obsidian.Setting(containerEl).setName("Smart Chat Model").setDesc("Select a model to use with Smart Chat.").addDropdown((dropdown) => { + new Obsidian.Setting(containerEl).setName("对话模型").setDesc("选择用于对话的模型").addDropdown((dropdown) => { dropdown.addOption("gpt-3.5-turbo-16k", "gpt-3.5-turbo-16k"); - dropdown.addOption("gpt-4", "gpt-4 (limited access, 8k)"); + dropdown.addOption("gpt-4", "gpt-4 (8k)"); dropdown.addOption("gpt-3.5-turbo", "gpt-3.5-turbo (4k)"); dropdown.addOption("gpt-4-1106-preview", "gpt-4-turbo (128k)"); dropdown.onChange(async (value) => { @@ -2723,115 +2716,113 @@ class SmartConnectionsSettingsTab extends Obsidian.PluginSettingTab { dropdown.setValue(this.plugin.settings.smart_chat_model); }); // language - new Obsidian.Setting(containerEl).setName("Default Language").setDesc("Default language to use for Smart Chat. Changes which self-referential pronouns will trigger lookup of your notes.").addDropdown((dropdown) => { - // get Object keys from pronous - const languages = Object.keys(SMART_TRANSLATION); - for(let i = 0; i < languages.length; i++) { - dropdown.addOption(languages[i], languages[i]); - } - dropdown.onChange(async (value) => { - this.plugin.settings.language = value; - await this.plugin.saveSettings(); - self_ref_pronouns_list.setText(this.get_self_ref_list()); - // if chat view is open then run new_chat() - const chat_view = this.app.workspace.getLeavesOfType(SMART_CONNECTIONS_CHAT_VIEW_TYPE).length > 0 ? this.app.workspace.getLeavesOfType(SMART_CONNECTIONS_CHAT_VIEW_TYPE)[0].view : null; - if(chat_view) { - chat_view.new_chat(); - } - }); - dropdown.setValue(this.plugin.settings.language); - }); + // new Obsidian.Setting(containerEl).setName("Default Language").setDesc("Default language to use for Smart Chat. Changes which self-referential pronouns will trigger lookup of your notes.").addDropdown((dropdown) => { + // // get Object keys from pronous + // const languages = Object.keys(SMART_TRANSLATION); + // for(let i = 0; i < languages.length; i++) { + // dropdown.addOption(languages[i], languages[i]); + // } + // dropdown.onChange(async (value) => { + // this.plugin.settings.language = value; + // await this.plugin.saveSettings(); + // self_ref_pronouns_list.setText(this.get_self_ref_list()); + // // if chat view is open then run new_chat() + // const chat_view = this.app.workspace.getLeavesOfType(SMART_CONNECTIONS_CHAT_VIEW_TYPE).length > 0 ? this.app.workspace.getLeavesOfType(SMART_CONNECTIONS_CHAT_VIEW_TYPE)[0].view : null; + // if(chat_view) { + // chat_view.new_chat(); + // } + // }); + // dropdown.setValue(this.plugin.settings.language); + // }); // list current self-referential pronouns - const self_ref_pronouns_list = containerEl.createEl("span", { - text: this.get_self_ref_list() - }); + containerEl.createEl("h2", { - text: "Exclusions" + text: "排除" }); // list file exclusions - new Obsidian.Setting(containerEl).setName("file_exclusions").setDesc("'Excluded file' matchers separated by a comma.").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.file_exclusions).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("排除文件").setDesc("输入需要排除的文件名,用逗号分隔文件").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.file_exclusions).onChange(async (value) => { this.plugin.settings.file_exclusions = value; await this.plugin.saveSettings(); })); // list folder exclusions - new Obsidian.Setting(containerEl).setName("folder_exclusions").setDesc("'Excluded folder' matchers separated by a comma.").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.folder_exclusions).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("排除文件夹").setDesc("输入需要排除的文件夹名,用逗号分隔多个文件夹").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.folder_exclusions).onChange(async (value) => { this.plugin.settings.folder_exclusions = value; await this.plugin.saveSettings(); })); // list path only matchers - new Obsidian.Setting(containerEl).setName("path_only").setDesc("'Path only' matchers separated by a comma.").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.path_only).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("仅使用某个路径").setDesc("输入需要使用的路径,用逗号分隔多个路径").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.path_only).onChange(async (value) => { this.plugin.settings.path_only = value; await this.plugin.saveSettings(); })); // list header exclusions - new Obsidian.Setting(containerEl).setName("header_exclusions").setDesc("'Excluded header' matchers separated by a comma. Works for 'blocks' only.").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.header_exclusions).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("排除标题").setDesc("输入需要排除的标题,用逗号分隔多个标题(只适用于区块)").addText((text) => text.setPlaceholder("drawings,prompts/logs").setValue(this.plugin.settings.header_exclusions).onChange(async (value) => { this.plugin.settings.header_exclusions = value; await this.plugin.saveSettings(); })); containerEl.createEl("h2", { - text: "Display" + text: "显示设置" }); // toggle showing full path in view - new Obsidian.Setting(containerEl).setName("show_full_path").setDesc("Show full path in view.").addToggle((toggle) => toggle.setValue(this.plugin.settings.show_full_path).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("显示完整路径").setDesc("在视图中显示关联笔记的完整路径").addToggle((toggle) => toggle.setValue(this.plugin.settings.show_full_path).onChange(async (value) => { this.plugin.settings.show_full_path = value; await this.plugin.saveSettings(true); })); // toggle expanded view by default - new Obsidian.Setting(containerEl).setName("expanded_view").setDesc("Expanded view by default.").addToggle((toggle) => toggle.setValue(this.plugin.settings.expanded_view).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("展开笔记").setDesc("默认展开关联笔记的内容").addToggle((toggle) => toggle.setValue(this.plugin.settings.expanded_view).onChange(async (value) => { this.plugin.settings.expanded_view = value; await this.plugin.saveSettings(true); })); // toggle group nearest by file - new Obsidian.Setting(containerEl).setName("group_nearest_by_file").setDesc("Group nearest by file.").addToggle((toggle) => toggle.setValue(this.plugin.settings.group_nearest_by_file).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("按文件检索关联度").setDesc("按文件检索关联度(关闭后按标题检索关联度)").addToggle((toggle) => toggle.setValue(this.plugin.settings.group_nearest_by_file).onChange(async (value) => { this.plugin.settings.group_nearest_by_file = value; await this.plugin.saveSettings(true); })); // toggle view_open on Obsidian startup - new Obsidian.Setting(containerEl).setName("view_open").setDesc("Open view on Obsidian startup.").addToggle((toggle) => toggle.setValue(this.plugin.settings.view_open).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("自动打开关系视图").setDesc("Open view on Obsidian startup.").addToggle((toggle) => toggle.setValue(this.plugin.settings.view_open).onChange(async (value) => { this.plugin.settings.view_open = value; await this.plugin.saveSettings(true); })); // toggle chat_open on Obsidian startup - new Obsidian.Setting(containerEl).setName("chat_open").setDesc("Open view on Obsidian startup.").addToggle((toggle) => toggle.setValue(this.plugin.settings.chat_open).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("自动打开对话窗口").setDesc("启动 Obsidian 时自动打开对话窗口").addToggle((toggle) => toggle.setValue(this.plugin.settings.chat_open).onChange(async (value) => { this.plugin.settings.chat_open = value; await this.plugin.saveSettings(true); })); containerEl.createEl("h2", { - text: "Advanced" + text: "高级设置" }); // toggle log_render - new Obsidian.Setting(containerEl).setName("log_render").setDesc("Log render details to console (includes token_usage).").addToggle((toggle) => toggle.setValue(this.plugin.settings.log_render).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("日志渲染").setDesc("将渲染详细信息记录到控制台(包括token使用量)").addToggle((toggle) => toggle.setValue(this.plugin.settings.log_render).onChange(async (value) => { this.plugin.settings.log_render = value; await this.plugin.saveSettings(true); })); // toggle files in log_render - new Obsidian.Setting(containerEl).setName("log_render_files").setDesc("Log embedded objects paths with log render (for debugging).").addToggle((toggle) => toggle.setValue(this.plugin.settings.log_render_files).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("记录渲染文件").setDesc("使用日志渲染记录嵌入式对象的路径(用于调试)").addToggle((toggle) => toggle.setValue(this.plugin.settings.log_render_files).onChange(async (value) => { this.plugin.settings.log_render_files = value; await this.plugin.saveSettings(true); })); // toggle skip_sections - new Obsidian.Setting(containerEl).setName("skip_sections").setDesc("Skips making connections to specific sections within notes. Warning: reduces usefulness for large files and requires 'Force Refresh' for sections to work in the future.").addToggle((toggle) => toggle.setValue(this.plugin.settings.skip_sections).onChange(async (value) => { + new Obsidian.Setting(containerEl).setName("跳过特定部分").setDesc("跳过对笔记中的特定部分建立连接。警告:有大文件时会降低使用效率,未来使用时需要“强制刷新”。").addToggle((toggle) => toggle.setValue(this.plugin.settings.skip_sections).onChange(async (value) => { this.plugin.settings.skip_sections = value; await this.plugin.saveSettings(true); })); // test file writing by creating a test file, then writing additional data to the file, and returning any error text if it fails containerEl.createEl("h3", { - text: "Test File Writing" + text: "测试文件写入" }); // manual save button containerEl.createEl("h3", { - text: "Manual Save" + text: "手动保存" }); let manual_save_results = containerEl.createEl("div"); - new Obsidian.Setting(containerEl).setName("manual_save").setDesc("Save current embeddings").addButton((button) => button.setButtonText("Manual Save").onClick(async () => { + new Obsidian.Setting(containerEl).setName("手动保存").setDesc("保存当前已嵌入的内容").addButton((button) => button.setButtonText("手动保存").onClick(async () => { // confirm - if (confirm("Are you sure you want to save your current embeddings?")) { + if (confirm("你确定要保存当前已嵌入的内容吗?")) { // save try{ await this.plugin.save_embeddings_to_file(true); - manual_save_results.innerHTML = "Embeddings saved successfully."; + manual_save_results.innerHTML = "嵌入内容保存成功。"; }catch(e){ - manual_save_results.innerHTML = "Embeddings failed to save. Error: " + e; + manual_save_results.innerHTML = "嵌入内容保存失败。错误:" + e; } } })); @@ -2845,27 +2836,23 @@ class SmartConnectionsSettingsTab extends Obsidian.PluginSettingTab { // force refresh button containerEl.createEl("h3", { - text: "Force Refresh" + text: "强制刷新" }); - new Obsidian.Setting(containerEl).setName("force_refresh").setDesc("WARNING: DO NOT use unless you know what you are doing! This will delete all of your current embeddings from OpenAI and trigger reprocessing of your entire vault!").addButton((button) => button.setButtonText("Force Refresh").onClick(async () => { + new Obsidian.Setting(containerEl).setName("强制刷新").setDesc("警告:除非你知道自己在做什么,否则不要使用!这将删除数据库中所有已嵌入的内容,并重新生成整个数据库!").addButton((button) => button.setButtonText("Force Refresh").onClick(async () => { // confirm - if (confirm("Are you sure you want to Force Refresh? By clicking yes you confirm that you understand the consequences of this action.")) { + if (confirm("确定要强制刷新吗?点击“确定”表示您理解这个操作带来的后果。")) { // force refresh await this.plugin.force_refresh_embeddings_file(); } })); } - get_self_ref_list() { - return "Current: " + SMART_TRANSLATION[this.plugin.settings.language].pronous.join(", "); - } - draw_failed_files_list(failed_list) { failed_list.empty(); if(this.plugin.settings.failed_files.length > 0) { // add message that these files will be skipped until manually retried failed_list.createEl("p", { - text: "The following files failed to process and will be skipped until manually retried." + text: "以下文件处理失败,将被跳过,直到手动重试。" }); let list = failed_list.createEl("ul"); for (let failed_file of this.plugin.settings.failed_files) { @@ -2874,12 +2861,12 @@ class SmartConnectionsSettingsTab extends Obsidian.PluginSettingTab { }); } // add button to retry failed files only - new Obsidian.Setting(failed_list).setName("retry_failed_files").setDesc("Retry failed files only").addButton((button) => button.setButtonText("Retry failed files only").onClick(async () => { + new Obsidian.Setting(failed_list).setName("仅重试失败文件").setDesc("仅重试失败文件").addButton((button) => button.setButtonText("仅重试失败文件").onClick(async () => { // clear failed_list element failed_list.empty(); // set "retrying" text failed_list.createEl("p", { - text: "Retrying failed files..." + text: "正在重试..." }); await this.plugin.retry_failed_files(); // redraw failed files list @@ -2887,7 +2874,7 @@ class SmartConnectionsSettingsTab extends Obsidian.PluginSettingTab { })); }else{ failed_list.createEl("p", { - text: "No failed files" + text: "无处理失败的文件" }); } } @@ -3088,7 +3075,7 @@ class SmartConnectionsChatView extends Obsidian.ItemView { this.textarea = chat_input.createEl("textarea", { cls: "sc-chat-input", attr: { - placeholder: `Try "Based on my notes" or "Summarize [[this note]]" or "Important tasks in /folder/"` + placeholder: `使用 “基于我的笔记” 或 “总结 [[Obsidian 链接]]” 或 "告诉我 /目录/ 中有什么重要信息"` } }); // use contenteditable instead of textarea @@ -3151,12 +3138,12 @@ class SmartConnectionsChatView extends Obsidian.ItemView { }); // create button let button = button_container.createEl("button", { attr: {id: "sc-send-button"}, cls: "send-button" }); - button.innerHTML = "Send"; + button.innerHTML = "发送"; // add event listener to button button.addEventListener("click", () => { if(this.prevent_input){ console.log("wait until current response is finished"); - new Obsidian.Notice("Wait until current response is finished"); + new Obsidian.Notice("请等待当前回复结束"); return; } // get text from textarea @@ -3189,6 +3176,7 @@ class SmartConnectionsChatView extends Obsidian.ItemView { // return; // } // if contains self referential keywords or folder reference + if(this.contains_self_referential_keywords(user_input) || this.chat.contains_folder_reference(user_input)) { // get hyde const context = await this.get_context_hyde(user_input); @@ -3206,7 +3194,7 @@ class SmartConnectionsChatView extends Obsidian.ItemView { content: user_input } ]; - this.request_chatgpt_completion({messages: chatml, temperature: 0}); + this.request_chatgpt_completion({messages: chatml, temperature: 0, privacyStr: '已经读取笔记内容'}); return; } // completion without any specific context @@ -3252,13 +3240,12 @@ class SmartConnectionsChatView extends Obsidian.ItemView { // check if includes keywords referring to one's own notes contains_self_referential_keywords(user_input) { - const matches = user_input.match(this.plugin.self_ref_kw_regex); - if(matches) return true; - return false; + const matches = user_input.match(/基于\s*我的\s*笔记/); + return !!matches; } // render message - async render_message(message, from="assistant", append_last=false) { + async render_message(message, from="assistant", append_last=false, privacyStr='') { // if dotdotdot interval is set, then clear it if(this.dotdotdot_interval) { clearInterval(this.dotdotdot_interval); @@ -3283,6 +3270,9 @@ class SmartConnectionsChatView extends Obsidian.ItemView { } // set message text this.active_elm.innerHTML = ''; + if(from === 'assistant' && privacyStr !== '') { + this.active_elm.innerHTML = `[${privacyStr}]`; + } await Obsidian.MarkdownRenderer.renderMarkdown(message, this.active_elm, '?no-dataview', new Obsidian.Component()); // get links this.handle_links_in_message(); @@ -3306,7 +3296,7 @@ class SmartConnectionsChatView extends Obsidian.ItemView { context_view.addEventListener("click", () => { // copy to clipboard navigator.clipboard.writeText("```smart-connections\n" + this_hyd + "\n```\n"); - new Obsidian.Notice("[Smart Connections] Context code block copied to clipboard"); + new Obsidian.Notice("[Smart Connections] 上下文代码块已经复制到剪贴板"); }); } if(this.chat.context) { @@ -3322,7 +3312,7 @@ class SmartConnectionsChatView extends Obsidian.ItemView { copy_prompt_button.addEventListener("click", () => { // copy to clipboard navigator.clipboard.writeText("```prompt-context\n" + this_context + "\n```\n"); - new Obsidian.Notice("[Smart Connections] Context copied to clipboard"); + new Obsidian.Notice("[Smart Connections] 上下文已复制到剪贴板"); }); } // render copy button @@ -3407,11 +3397,13 @@ class SmartConnectionsChatView extends Obsidian.ItemView { ...opts } // console.log(opts.messages); + let privacyStr = opts.privacyStr || ''; + delete opts.privacyStr; if(opts.stream) { const full_str = await new Promise((resolve, reject) => { try { // console.log("stream", opts); - const url = `${this.settings.api_endpoint}/v1/chat/completions`; + const url = `${this.plugin.settings.api_endpoint}/v1/chat/completions`; this.active_stream = new ScStreamer(url, { headers: { "Content-Type": "application/json", @@ -3423,13 +3415,24 @@ class SmartConnectionsChatView extends Obsidian.ItemView { let txt = ""; this.active_stream.addEventListener("message", (e) => { if (e.data != "[DONE]") { - const payload = JSON.parse(e.data); - const text = payload.choices[0].delta.content; - if (!text) { - return; + let resp = null; + try{ + resp = JSON.parse(e.data); + const text = resp.choices[0].delta.content; + if(!text) return; + txt += text; + this.render_message(text, "assistant", true, privacyStr); + }catch(err){ + // console.log(err); + if(e.data.indexOf('}{') > -1) e.data = e.data.replace(/}{/g, '},{'); + resp = JSON.parse(`[${e.data}]`); + resp.forEach((r) => { + const text = r.choices[0].delta.content; + if(!text) return; + txt += text; + this.render_message(text, "assistant", true, privacyStr); + }); } - txt += text; - this.render_message(text, "assistant", true); } else { this.end_stream(); resolve(txt); @@ -3442,21 +3445,21 @@ class SmartConnectionsChatView extends Obsidian.ItemView { }); this.active_stream.addEventListener("error", (e) => { console.error(e); - new Obsidian.Notice("Smart Connections Error Streaming Response. See console for details."); - this.render_message("*API Error. See console logs for details.*", "assistant"); + new Obsidian.Notice("Smart Connections 进行流式连接的过程出现错误。请查看调试控制台。"); + this.render_message("*API 请求错误. 请查看调试控制台.*", "assistant", false, privacyStr); this.end_stream(); reject(e); }); this.active_stream.stream(); } catch (err) { console.error(err); - new Obsidian.Notice("Smart Connections Error Streaming Response. See console for details."); + new Obsidian.Notice("Smart Connections 进行流式连接的过程出现错误。请查看调试控制台。"); this.end_stream(); reject(err); } }); // console.log(full_str); - await this.render_message(full_str, "assistant"); + await this.render_message(full_str, "assistant", false, privacyStr); this.chat.new_message_in_thread({ role: "assistant", content: full_str @@ -3465,7 +3468,7 @@ class SmartConnectionsChatView extends Obsidian.ItemView { }else{ try{ const response = await (0, Obsidian.requestUrl)({ - url: `${this.settings.api_endpoint}/v1/chat/completions`, + url: `${this.plugin.settings.api_endpoint}/v1/chat/completions`, method: "POST", headers: { Authorization: `Bearer ${this.plugin.settings.api_key}`, @@ -3478,7 +3481,7 @@ class SmartConnectionsChatView extends Obsidian.ItemView { // console.log(response); return JSON.parse(response.text).choices[0].message.content; }catch(err){ - new Obsidian.Notice(`Smart Connections API Error :: ${err}`); + new Obsidian.Notice(`Smart Connections API 调用错误 :: ${err}`); } } } @@ -3685,7 +3688,7 @@ class SmartConnectionsChatModel { // validate chat_id is set to valid filename characters (letters, numbers, underscores, dashes, em dash, and spaces) if (!this.chat_id.match(/^[a-zA-Z0-9_—\- ]+$/)) { console.log("Invalid chat_id: " + this.chat_id); - new Obsidian.Notice("[Smart Connections] Failed to save chat. Invalid chat_id: '" + this.chat_id + "'"); + new Obsidian.Notice("[Smart Connections] 保存失败. 非法会话 id (chat_id): '" + this.chat_id + "'"); } // filename is chat_id const chat_file = this.chat_id + ".json"; @@ -3839,7 +3842,7 @@ class SmartConnectionsChatModel { content: user_input } ]; - chat_view.request_chatgpt_completion({messages: chatml, temperature: 0}); + chat_view.request_chatgpt_completion({messages: chatml, temperature: 0, privacyStr: '已经读取笔记内容'}); } // check if contains internal link contains_internal_link(user_input) {