From 231f6222c5d274d9c779db20af0b63192f9c45ab Mon Sep 17 00:00:00 2001 From: SXP-Simon Date: Fri, 27 Nov 2026 15:22:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(crates/panache-mcp):=20=E5=8C=BA?= =?UTF-8?q?=E5=88=86=E7=94=A8=E6=AD=A3=E6=96=87=E5=BB=BA=E7=A8=BF=E5=92=8C?= =?UTF-8?q?=E6=9F=A5=E6=89=BE=E6=97=A7=E7=A8=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 背景:用户给了新作业正文并想看第一页时,模型可能先去翻旧稿,找不到便要求补传纸张。 解决手段:在启动说明和建稿、查稿两个工具入口说明如何从当前正文开始,以及何时应找回之前的稿件。 收益:新作业可以直接建稿并预览第一页,续改时仍能找回对应的旧稿。 --- crates/panache-mcp/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/panache-mcp/src/main.rs b/crates/panache-mcp/src/main.rs index d58827a5..e8cbd8ca 100644 --- a/crates/panache-mcp/src/main.rs +++ b/crates/panache-mcp/src/main.rs @@ -277,8 +277,7 @@ impl ServerHandler for Panache { "If a required area of a photo is outside the frame, or blur, occlusion or perspective prevents locating it, identify that area before drafting. ", "Ask for a photo clearly showing it or permission to fill only visible areas; wait before saving or trial placement. If partial work was requested, proceed there. ", "For a school assignment, even text alone, set style.homework=true on creation; omit font unless the user specifies one. For further variation (字稍微草一点), inspect describe_controls(group=variation). For requested crossed-out mistakes (涂改痕迹), inspect group=strike. ", - "Use save_section(markdown), then its draft_id and revision for preview_handwriting or export_handwriting. ", - "English letters and digits follow the main font by default. Leave Latin controls unset unless the user requests a different look for them or dislikes how they appear. When the user wants to compare fonts, see list_fonts for sample guidance. Use list_drafts to resume. A paper_path must be readable on the server computer. For a chat photo, use client transfer or run Panache on the computer with the photo. Ask for the missing file only if needed. ", + "English letters and digits follow the main font by default. Leave Latin controls unset unless the user requests a different look for them or dislikes how they appear. When the user wants to compare fonts, see list_fonts for sample guidance. A paper_path must be readable on the server computer. For a chat photo, use client transfer or run Panache on the computer with the photo. Ask for the missing file only if needed. ", "For print-and-report, export once and report review.unreviewed_pages. Look up existing receipts with read_section(view=review); full-page preview_handwriting(view=review) files a check. Last-page lookups use current pagination and cannot confirm the historical last page. Follow photo_appearance.preview_arguments for a native detail crop. ", "If images cannot reach the model, use the reported measurements and ask the user to inspect the page before judging its appearance. ", "Forms, unruled paper and artwork are supported. Follow specified or delegated placement, matching field orientation and preserving printed labels. ", @@ -286,6 +285,7 @@ impl ServerHandler for Panache { "Photo coordinates use native output pixels; local dx/dy use paper-space pixels. ", "Inspect appearance with view=image; revisit actions with read_section(view=trajectory)." ); + let draft_intent = "先判断稿件来源:用户贴了正文或题目,请你写出来并看第一页,第一页指即将生成的成品。第一步直接 save_section(新作业用 style.homework=true),再用返回的 draft_id 预览。用户明确指向已有稿才查找;即使正文和某份旧稿相似,也不要借用旧稿。 "; let mode = if self.0.preserve_reviews { "This connection preserves stored reviews. Use view=image to inspect and export_handwriting to print. " } else { @@ -296,7 +296,7 @@ impl ServerHandler for Panache { "panache-mcp", handwriting_core::app_version(), )) - .with_instructions(format!("{mode}{instructions}")) + .with_instructions(format!("{mode}{draft_intent}{instructions}")) } } @@ -428,7 +428,7 @@ impl Panache { } #[tool( - description = "Save Markdown without rendering. For schoolwork with or without a photo, set style.homework=true. For a local text change try replace_section_text first to check saved placements. For pen-matched flowcharts, use a circuitikz environment with \\draw[->] paths and node labels. On creation, optionally import a local stationery image with paper_path. Append or revise a section with expected_revision. Each section starts a new page. Keep the returned draft_id and revision. Returns detected paper.alignment." + description = "新建:用聊天里给的正文或题目直接生成稿件。要先看第一页,就先保存再预览。Save Markdown without rendering. For schoolwork with or without a photo, set style.homework=true. For a local text change try replace_section_text first to check saved placements. For pen-matched flowcharts, use a circuitikz environment with \\draw[->] paths and node labels. On creation, optionally import a local stationery image with paper_path. Append or revise a section with expected_revision. Each section starts a new page. Keep the returned draft_id and revision. Returns detected paper.alignment." )] async fn save_section(&self, Parameters(input): Parameters) -> CallToolResult { tool_result(save::run(self, input).await) @@ -446,7 +446,7 @@ impl Panache { #[tool( annotations(read_only_hint = true, open_world_hint = false), - description = "Find previously saved drafts across sessions. Returns up to 20 summaries, newest creations first. Continue with before_draft_id=next_before_draft_id when returned." + description = "查旧稿:只在找回、列出或继续修改已存稿件时调用。用户贴了题目让你写并看第一页,请直接调用 save_section;已有其他稿件也不需要先查。 Find previously saved drafts across sessions. Returns up to 20 summaries, newest creations first. Continue with before_draft_id=next_before_draft_id when returned." )] fn list_drafts(&self, Parameters(input): Parameters) -> CallToolResult { tool_result(self.0.drafts.list(&input).map(|result| { From 5d3ea00c614c8ced91d6fd90f5ed64cd56ed0894 Mon Sep 17 00:00:00 2001 From: SXP-Simon Date: Fri, 27 Nov 2026 15:26:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?docs(crates/panache-mcp):=20=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E6=96=B0=E5=BB=BA=E4=B8=8E=E7=BB=AD=E6=94=B9=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E8=AF=B4=E6=98=8E=E7=9A=84=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 背景:新增分流说明使用了中文整句,与现有英文工具描述不一致,原实验也未单独控制语言。 解决手段:在相同位置使用等义英文说明,并用相同中文请求对照两种版本。 收益:保持工具说明语言一致,同时保留按请求区分新建和续改的行为。 --- crates/panache-mcp/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/panache-mcp/src/main.rs b/crates/panache-mcp/src/main.rs index e8cbd8ca..fb9e5b48 100644 --- a/crates/panache-mcp/src/main.rs +++ b/crates/panache-mcp/src/main.rs @@ -285,7 +285,7 @@ impl ServerHandler for Panache { "Photo coordinates use native output pixels; local dx/dy use paper-space pixels. ", "Inspect appearance with view=image; revisit actions with read_section(view=trajectory)." ); - let draft_intent = "先判断稿件来源:用户贴了正文或题目,请你写出来并看第一页,第一页指即将生成的成品。第一步直接 save_section(新作业用 style.homework=true),再用返回的 draft_id 预览。用户明确指向已有稿才查找;即使正文和某份旧稿相似,也不要借用旧稿。 "; + let draft_intent = "First identify the source of the work. When the user supplies text or a problem to write out and asks to see page one, they mean the first page of the new output. Call save_section first (style.homework=true for a new assignment), then preview the returned draft_id. Look up a saved draft only when the user refers to one, even if an existing draft resembles the supplied text. "; let mode = if self.0.preserve_reviews { "This connection preserves stored reviews. Use view=image to inspect and export_handwriting to print. " } else { @@ -428,7 +428,7 @@ impl Panache { } #[tool( - description = "新建:用聊天里给的正文或题目直接生成稿件。要先看第一页,就先保存再预览。Save Markdown without rendering. For schoolwork with or without a photo, set style.homework=true. For a local text change try replace_section_text first to check saved placements. For pen-matched flowcharts, use a circuitikz environment with \\draw[->] paths and node labels. On creation, optionally import a local stationery image with paper_path. Append or revise a section with expected_revision. Each section starts a new page. Keep the returned draft_id and revision. Returns detected paper.alignment." + description = "Create a draft from text or a problem supplied in chat. To show its first page, save first, then preview. Saves Markdown without rendering. For schoolwork with or without a photo, set style.homework=true. For a local text change try replace_section_text first to check saved placements. For pen-matched flowcharts, use a circuitikz environment with \\draw[->] paths and node labels. On creation, optionally import a local stationery image with paper_path. Append or revise a section with expected_revision. Each section starts a new page. Keep the returned draft_id and revision. Returns detected paper.alignment." )] async fn save_section(&self, Parameters(input): Parameters) -> CallToolResult { tool_result(save::run(self, input).await) @@ -446,7 +446,7 @@ impl Panache { #[tool( annotations(read_only_hint = true, open_world_hint = false), - description = "查旧稿:只在找回、列出或继续修改已存稿件时调用。用户贴了题目让你写并看第一页,请直接调用 save_section;已有其他稿件也不需要先查。 Find previously saved drafts across sessions. Returns up to 20 summaries, newest creations first. Continue with before_draft_id=next_before_draft_id when returned." + description = "Look up saved drafts across sessions when the user wants to find, list, or resume earlier work. When the user supplies a problem to write out and wants to see page one, call save_section directly even if other drafts exist. Returns up to 20 summaries, newest creations first. Continue with before_draft_id=next_before_draft_id when returned." )] fn list_drafts(&self, Parameters(input): Parameters) -> CallToolResult { tool_result(self.0.drafts.list(&input).map(|result| {