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:
@@ -83,51 +83,51 @@ const debugSchema = Type.Object({
|
||||
"terminate",
|
||||
"sessions",
|
||||
],
|
||||
{ description: "DAP debugger action" },
|
||||
{ description: "dap debugger action" },
|
||||
),
|
||||
program: Type.Optional(Type.String({ description: "Program or script path for launch" })),
|
||||
args: Type.Optional(Type.Array(Type.String(), { description: "Program arguments for launch" })),
|
||||
adapter: Type.Optional(Type.String({ description: "Debugger adapter override (gdb, lldb-dap, debugpy, dlv)" })),
|
||||
cwd: Type.Optional(Type.String({ description: "Working directory for launch or attach" })),
|
||||
file: Type.Optional(Type.String({ description: "Source file for source breakpoints" })),
|
||||
line: Type.Optional(Type.Number({ description: "1-indexed source line for source breakpoints" })),
|
||||
function: Type.Optional(Type.String({ description: "Function name for function breakpoints" })),
|
||||
name: Type.Optional(Type.String({ description: "Variable or data name for data breakpoint info" })),
|
||||
condition: Type.Optional(Type.String({ description: "Breakpoint condition expression" })),
|
||||
hit_condition: Type.Optional(Type.String({ description: "Breakpoint hit condition expression" })),
|
||||
expression: Type.Optional(Type.String({ description: "Expression to evaluate in debugger context" })),
|
||||
context: Type.Optional(Type.String({ description: "Evaluate context (watch, repl, hover, variables, clipboard)" })),
|
||||
frame_id: Type.Optional(Type.Number({ description: "Stack frame ID for scopes/evaluate" })),
|
||||
scope_id: Type.Optional(Type.Number({ description: "Scope variablesReference for variables requests" })),
|
||||
variable_ref: Type.Optional(Type.Number({ description: "Variable reference for variables requests" })),
|
||||
pid: Type.Optional(Type.Number({ description: "Process ID for attach" })),
|
||||
port: Type.Optional(Type.Number({ description: "Port for remote attach when adapter supports it" })),
|
||||
host: Type.Optional(Type.String({ description: "Host for remote attach when adapter supports it" })),
|
||||
levels: Type.Optional(Type.Number({ description: "Maximum stack frames to fetch" })),
|
||||
memory_reference: Type.Optional(Type.String({ description: "Memory reference or address" })),
|
||||
program: Type.Optional(Type.String({ description: "program path", examples: ["./my_app", "src/main.py"] })),
|
||||
args: Type.Optional(Type.Array(Type.String(), { description: "program arguments", examples: [["--verbose"]] })),
|
||||
adapter: Type.Optional(Type.String({ description: "debugger adapter", examples: ["gdb", "lldb-dap", "debugpy", "dlv"] })),
|
||||
cwd: Type.Optional(Type.String({ description: "working directory", examples: ["src/"] })),
|
||||
file: Type.Optional(Type.String({ description: "source file", examples: ["src/main.c"] })),
|
||||
line: Type.Optional(Type.Number({ description: "source line", examples: [42] })),
|
||||
function: Type.Optional(Type.String({ description: "function name", examples: ["main", "handle_request"] })),
|
||||
name: Type.Optional(Type.String({ description: "variable or data name", examples: ["counter", "buffer"] })),
|
||||
condition: Type.Optional(Type.String({ description: "breakpoint condition", examples: ["i == 10", "x > 0"] })),
|
||||
hit_condition: Type.Optional(Type.String({ description: "hit condition" })),
|
||||
expression: Type.Optional(Type.String({ description: "expression to evaluate", examples: ["x + 1", "obj.field"] })),
|
||||
context: Type.Optional(Type.String({ description: "evaluate context", examples: ["watch", "repl", "hover", "variables", "clipboard"] })),
|
||||
frame_id: Type.Optional(Type.Number({ description: "stack frame id" })),
|
||||
scope_id: Type.Optional(Type.Number({ description: "scope variables reference" })),
|
||||
variable_ref: Type.Optional(Type.Number({ description: "variable reference" })),
|
||||
pid: Type.Optional(Type.Number({ description: "process id for attach", examples: [12345] })),
|
||||
port: Type.Optional(Type.Number({ description: "remote attach port", examples: [4711] })),
|
||||
host: Type.Optional(Type.String({ description: "remote attach host", examples: ["127.0.0.1"] })),
|
||||
levels: Type.Optional(Type.Number({ description: "max stack frames" })),
|
||||
memory_reference: Type.Optional(Type.String({ description: "memory reference or address", examples: ["0x7ffd1234"] })),
|
||||
instruction_reference: Type.Optional(
|
||||
Type.String({ description: "Instruction address/reference for instruction breakpoints" }),
|
||||
Type.String({ description: "instruction address or reference" }),
|
||||
),
|
||||
instruction_count: Type.Optional(Type.Number({ description: "Number of instructions to disassemble" })),
|
||||
instruction_offset: Type.Optional(Type.Number({ description: "Instruction offset for disassembly" })),
|
||||
count: Type.Optional(Type.Number({ description: "Number of bytes to read from memory" })),
|
||||
data: Type.Optional(Type.String({ description: "Base64-encoded memory payload for write_memory" })),
|
||||
data_id: Type.Optional(Type.String({ description: "DAP data breakpoint identifier" })),
|
||||
instruction_count: Type.Optional(Type.Number({ description: "instructions to disassemble" })),
|
||||
instruction_offset: Type.Optional(Type.Number({ description: "instruction offset" })),
|
||||
count: Type.Optional(Type.Number({ description: "bytes to read" })),
|
||||
data: Type.Optional(Type.String({ description: "base64 memory payload" })),
|
||||
data_id: Type.Optional(Type.String({ description: "data breakpoint id" })),
|
||||
access_type: Type.Optional(
|
||||
StringEnum(["read", "write", "readWrite"], { description: "Data breakpoint access type" }),
|
||||
StringEnum(["read", "write", "readWrite"], { description: "data breakpoint access type" }),
|
||||
),
|
||||
command: Type.Optional(Type.String({ description: "Custom DAP request command" })),
|
||||
command: Type.Optional(Type.String({ description: "custom dap request command" })),
|
||||
arguments: Type.Optional(
|
||||
Type.Record(Type.String(), Type.Any(), {
|
||||
description: "Arguments object for custom_request",
|
||||
description: "custom request arguments",
|
||||
}),
|
||||
),
|
||||
offset: Type.Optional(Type.Number({ description: "Memory or instruction offset" })),
|
||||
resolve_symbols: Type.Optional(Type.Boolean({ description: "Resolve symbols during disassembly" })),
|
||||
allow_partial: Type.Optional(Type.Boolean({ description: "Allow partial writes for write_memory" })),
|
||||
start_module: Type.Optional(Type.Number({ description: "Modules request start index" })),
|
||||
module_count: Type.Optional(Type.Number({ description: "Maximum modules to fetch" })),
|
||||
timeout: Type.Optional(Type.Number({ description: "Per-request timeout in seconds" })),
|
||||
offset: Type.Optional(Type.Number({ description: "memory or instruction offset" })),
|
||||
resolve_symbols: Type.Optional(Type.Boolean({ description: "resolve symbols during disassembly" })),
|
||||
allow_partial: Type.Optional(Type.Boolean({ description: "allow partial writes" })),
|
||||
start_module: Type.Optional(Type.Number({ description: "modules start index" })),
|
||||
module_count: Type.Optional(Type.Number({ description: "max modules to fetch" })),
|
||||
timeout: Type.Optional(Type.Number({ description: "per-request timeout seconds" })),
|
||||
});
|
||||
|
||||
export type DebugParams = Static<typeof debugSchema>;
|
||||
|
||||
Reference in New Issue
Block a user