improve(hashline-edit): rewrite tool description with examples and fix lines schema

- Add XML-structured description (<must>, <operations>, <examples>, <auto>)
- Add 5 concrete examples including BAD pattern showing duplication
- Add explicit anti-duplication warning for range replace
- Move snapshot rule to top-level <must> section
- Clarify batch semantics (multiple ops, not one big replace)
- Fix lines schema: add string[] to union (was string|null, now string[]|string|null)
- Matches runtime RawHashlineEdit type and description text
This commit is contained in:
YeonGyu-Kim
2026-03-17 16:40:40 +09:00
parent b788586caf
commit f2d5f4ca92
8 changed files with 74 additions and 48 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ export function createHashlineEditTool(): ToolDefinition {
pos: tool.schema.string().optional().describe("Primary anchor in LINE#ID format"),
end: tool.schema.string().optional().describe("Range end anchor in LINE#ID format"),
lines: tool.schema
.union([tool.schema.string(), tool.schema.null()])
.union([tool.schema.array(tool.schema.string()), tool.schema.string(), tool.schema.null()])
.describe("Replacement or inserted lines as newline-delimited string. null deletes with replace"),
})
)