


























@@ -407,9 +407,15 @@ describe("diffs plugin registration", () => {
407407expect(on.mock.calls[0]?.[0]).toBe("before_prompt_build");
408408const beforePromptBuild = on.mock.calls[0]?.[1];
409409const promptResult = await beforePromptBuild?.({}, {});
410-expect(promptResult).toMatchObject({
411-prependSystemContext: expect.stringContaining("prefer the `diffs` tool"),
412-});
410+expect(promptResult?.prependSystemContext).toBe(
411+[
412+"When you need to show edits as a real diff, prefer the `diffs` tool instead of writing a manual summary.",
413+"It accepts either `before` + `after` text or a unified `patch`.",
414+"`mode=view` returns `details.viewerUrl` for canvas use; `mode=file` returns `details.filePath`; `mode=both` returns both.",
415+"If you need to send the rendered file, use the `message` tool with `path` or `filePath`.",
416+"Include `path` when you know the filename, and omit presentation overrides unless needed.",
417+].join("\n"),
418+);
413419expect(promptResult?.prependContext).toBeUndefined();
414420415421const registeredTool = registeredToolFactory?.({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。