Skip to content

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

:rotating_light:

Vanessa4266ac9bba67
diff --git a/app/src/layout/dock/AgentChat.ts b/app/src/layout/dock/AgentChat.ts
index 82d84c37be..c66e70400a 100644
--- a/app/src/layout/dock/AgentChat.ts
+++ b/app/src/layout/dock/AgentChat.ts
@@ -1361,7 +1361,7 @@ export class AgentChat extends Model {
if (step.toolCalls.length > 0) {
const newTools = step.toolCalls.filter(tc => !seenTools[tc.name]);
if (newTools.length > 0) {
- detail += `<div class="agent-chat__thinking-tools-line"><span class="agent-chat__thinking-summary">Tool calls:</span>`;
+ detail += "<div class=\"agent-chat__thinking-tools-line\"><span class=\"agent-chat__thinking-summary\">Tool calls:</span>";
for (let j = 0; j < newTools.length; j++) {
const tc = newTools[j];
seenTools[tc.name] = true;
diff --git a/app/src/layout/dock/AgentMessageRenderer.ts b/app/src/layout/dock/AgentMessageRenderer.ts
index 31c32b3f96..6acf31c348 100644
--- a/app/src/layout/dock/AgentMessageRenderer.ts
+++ b/app/src/layout/dock/AgentMessageRenderer.ts
@@ -96,7 +96,7 @@ export const renderRetryCardHTML = (attempt: number, maxRetries: number): string
};
export const renderToolsLineHTML = (newTools: Array<{name: string; result?: string}>): string => {
- let detailLines = `<div class="agent-chat__thinking-tools-line"><span class="agent-chat__thinking-summary">Tool calls:</span>`;
+ let detailLines = "<div class=\"agent-chat__thinking-tools-line\"><span class=\"agent-chat__thinking-summary\">Tool calls:</span>";
for (let i = 0; i < newTools.length; i++) {
detailLines += '<span class="agent-chat__thinking-tool">' + escapeHtml(newTools[i].name) + "</span>";
}
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index 4610e9c127..0287738aa3 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -211,7 +211,6 @@ export const fileAnnotationRefMenu = (protyle: IProtyle, refElement: HTMLElement
return;
}
hideElements(["util", "toolbar", "hint"], protyle);
- const id = nodeElement.getAttribute("data-node-id");
let oldHTML = nodeElement.outerHTML;
window.siyuan.menus.menu.remove();
window.siyuan.menus.menu.element.setAttribute("data-name", Constants.MENU_INLINE_FILE_ANNOTATION_REF);
@@ -714,7 +713,6 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => {
protyle.toolbar.showContent(protyle, range, nodeElement);
/// #else
const oldHTML = nodeElement.outerHTML;
- const id = nodeElement.getAttribute("data-node-id");
const captionElement = hasClosestByTag(range.startContainer, "CAPTION");
if (range.toString() !== "" || (range.cloneContents().childNodes[0] as HTMLElement)?.classList?.contains("emoji")) {
window.siyuan.menus.menu.append(new MenuItem({
@@ -786,7 +784,6 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => {
}
}).element);
if (!protyle.disabled) {
- const id = nodeElement.getAttribute("data-node-id");
window.siyuan.menus.menu.append(new MenuItem({
id: "cut",
icon: "iconCut",
@@ -1481,7 +1478,6 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
}
hideTooltip();
hideElements(["util", "toolbar", "hint"], protyle);
- const id = nodeElement.getAttribute("data-node-id");
let html = nodeElement.outerHTML;
const linkAddress = linkElement.getAttribute("data-href");
let inputElements: NodeListOf<HTMLTextAreaElement>;
@@ -1769,7 +1765,6 @@ export const tagMenu = (protyle: IProtyle, tagElement: HTMLElement) => {
return;
}
hideElements(["util", "toolbar", "hint"], protyle);
- const id = nodeElement.getAttribute("data-node-id");
let inputElement: HTMLInputElement;
const oldHTML = nodeElement.outerHTML;
window.siyuan.menus.menu.removeCB = () => {
@@ -1957,7 +1952,6 @@ export const inlineMathMenu = (protyle: IProtyle, element: Element) => {
if (!nodeElement) {
return;
}
- const id = nodeElement.getAttribute("data-node-id");
const html = nodeElement.outerHTML;
window.siyuan.menus.menu.append(new MenuItem({
id: "copy",
@@ -2036,7 +2030,6 @@ const genImageHeightMenu = (label: string, imgElement: HTMLElement, protyle: IPr
};
export const iframeMenu = (protyle: IProtyle, nodeElement: Element) => {
- const id = nodeElement.getAttribute("data-node-id");
const iframeElement = nodeElement.querySelector("iframe");
let html = nodeElement.outerHTML;
const subMenus: IMenu[] = [{
@@ -2107,7 +2100,6 @@ export const iframeMenu = (protyle: IProtyle, nodeElement: Element) => {
};
export const videoMenu = (protyle: IProtyle, nodeElement: Element, type: string) => {
- const id = nodeElement.getAttribute("data-node-id");
const videoElement = nodeElement.querySelector(type === "NodeVideo" ? "video" : "audio");
let html = nodeElement.outerHTML;
const subMenus: IMenu[] = [{
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 048d8476ad..570abd0fae 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -964,7 +964,6 @@ export class WYSIWYG {
target.parentElement.parentElement.classList.add("img--drag");
}
- const id = nodeElement.getAttribute("data-node-id");
const html = nodeElement.outerHTML;
const x = event.clientX;
const dragElement = target.previousElementSibling as HTMLElement;
@@ -1054,7 +1053,6 @@ export class WYSIWYG {
nodeElement.firstElementChild.style.webkitUserModify = "read-only";
nodeElement.style.cursor = "col-resize";
target.removeAttribute("style");
- const id = nodeElement.getAttribute("data-node-id");
const x = event.clientX;
const colIndex = parseInt(target.getAttribute("data-col-index"));
const colElement = nodeElement.querySelectorAll("table col")[colIndex] as HTMLElement;
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index 68031429af..dc57e1c281 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -1498,7 +1498,6 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
!isInEmbedBlock(nodeElement)) {
const editElement = getContenteditableElement(nodeElement);
if (editElement) {
- const id = nodeElement.getAttribute("data-node-id");
const html = nodeElement.outerHTML;
// 需要 EscapeHTMLStr https://github.com/siyuan-note/siyuan/issues/11451
editElement.innerHTML = "```" + window.siyuan.storage[Constants.LOCAL_CODELANG] + "\n" + Lute.EscapeHTMLStr(editElement.textContent) + "<wbr>\n```";
diff --git a/app/src/util/agentSSE.ts b/app/src/util/agentSSE.ts
index 230cfa9a1a..e21c693eda 100644
--- a/app/src/util/agentSSE.ts
+++ b/app/src/util/agentSSE.ts
@@ -62,7 +62,6 @@ export async function fetchAgentSSE(
});
if (!response.ok) {
- const text = await response.text();
onError(new Error(window.siyuan.languages._kernel[28]));
return;
}