feat(coding-agent/tools): added examples to coding-agent tools
- Added `examples` support to `StringEnum` schemas and propagated it to tool metadata. - Added concise descriptions and example values across coding-agent tool schemas for clearer guidance. - Documented the new StringEnum examples capability in `packages/ai/CHANGELOG.md`. - Cast `real` to `HASHLINE_BIGRAMS` elements in `staleBigramFor` test setup.
This commit is contained in:
@@ -38,28 +38,27 @@ const utf8Decoder = new TextDecoder("utf-8", { fatal: true });
|
||||
|
||||
const vimStepSchema = Type.Object({
|
||||
kbd: Type.Array(Type.String(), {
|
||||
description: "Vim key sequences ONLY (e.g. ggdGi, 3Go, dd). NEVER put file content here — use insert for text.",
|
||||
description: "vim key sequences",
|
||||
examples: [["ggdGi"], ["3Go"], ["dd"]],
|
||||
}),
|
||||
insert: Type.Optional(
|
||||
Type.String({
|
||||
description:
|
||||
"Raw text to type into the buffer. kbd must leave INSERT mode active first (e.g. via o, O, i, cc).",
|
||||
description: "raw text to insert",
|
||||
examples: ["hello world"],
|
||||
}),
|
||||
),
|
||||
});
|
||||
|
||||
const vimSchema = Type.Object({
|
||||
file: Type.String({ description: "File path to edit." }),
|
||||
file: Type.String({ description: "file path", examples: ["src/foo.ts"] }),
|
||||
steps: Type.Optional(
|
||||
Type.Array(vimStepSchema, {
|
||||
description:
|
||||
"Ordered editing steps. Each step executes kbd sequences, then optionally inserts text. INSERT mode is auto-exited between steps.",
|
||||
description: "editing steps",
|
||||
}),
|
||||
),
|
||||
pause: Type.Optional(
|
||||
Type.Boolean({
|
||||
description:
|
||||
"Advanced: skip auto-save after the last step. Rarely needed. Omit or set false for normal use — edits auto-save.",
|
||||
description: "skip auto-save",
|
||||
}),
|
||||
),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user