agent-bober 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +13 -7
  2. package/agents/bober-evaluator.md +62 -54
  3. package/agents/bober-generator.md +4 -0
  4. package/dist/contracts/eval-result.d.ts +339 -0
  5. package/dist/contracts/eval-result.d.ts.map +1 -1
  6. package/dist/contracts/eval-result.js +36 -0
  7. package/dist/contracts/eval-result.js.map +1 -1
  8. package/dist/evaluators/builtin/playwright.d.ts.map +1 -1
  9. package/dist/evaluators/builtin/playwright.js +50 -15
  10. package/dist/evaluators/builtin/playwright.js.map +1 -1
  11. package/dist/index.d.ts +5 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +4 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/orchestrator/agent-loader.d.ts +26 -0
  16. package/dist/orchestrator/agent-loader.d.ts.map +1 -0
  17. package/dist/orchestrator/agent-loader.js +125 -0
  18. package/dist/orchestrator/agent-loader.js.map +1 -0
  19. package/dist/orchestrator/agentic-loop.d.ts +53 -0
  20. package/dist/orchestrator/agentic-loop.d.ts.map +1 -0
  21. package/dist/orchestrator/agentic-loop.js +145 -0
  22. package/dist/orchestrator/agentic-loop.js.map +1 -0
  23. package/dist/orchestrator/evaluator-agent.d.ts +4 -1
  24. package/dist/orchestrator/evaluator-agent.d.ts.map +1 -1
  25. package/dist/orchestrator/evaluator-agent.js +107 -84
  26. package/dist/orchestrator/evaluator-agent.js.map +1 -1
  27. package/dist/orchestrator/generator-agent.d.ts +14 -2
  28. package/dist/orchestrator/generator-agent.d.ts.map +1 -1
  29. package/dist/orchestrator/generator-agent.js +96 -73
  30. package/dist/orchestrator/generator-agent.js.map +1 -1
  31. package/dist/orchestrator/model-resolver.d.ts +9 -0
  32. package/dist/orchestrator/model-resolver.d.ts.map +1 -0
  33. package/dist/orchestrator/model-resolver.js +21 -0
  34. package/dist/orchestrator/model-resolver.js.map +1 -0
  35. package/dist/orchestrator/pipeline.d.ts.map +1 -1
  36. package/dist/orchestrator/pipeline.js +21 -4
  37. package/dist/orchestrator/pipeline.js.map +1 -1
  38. package/dist/orchestrator/planner-agent.d.ts +3 -2
  39. package/dist/orchestrator/planner-agent.d.ts.map +1 -1
  40. package/dist/orchestrator/planner-agent.js +39 -75
  41. package/dist/orchestrator/planner-agent.js.map +1 -1
  42. package/dist/orchestrator/tools/handlers.d.ts +9 -0
  43. package/dist/orchestrator/tools/handlers.d.ts.map +1 -0
  44. package/dist/orchestrator/tools/handlers.js +279 -0
  45. package/dist/orchestrator/tools/handlers.js.map +1 -0
  46. package/dist/orchestrator/tools/index.d.ts +21 -0
  47. package/dist/orchestrator/tools/index.d.ts.map +1 -0
  48. package/dist/orchestrator/tools/index.js +33 -0
  49. package/dist/orchestrator/tools/index.js.map +1 -0
  50. package/dist/orchestrator/tools/schemas.d.ts +16 -0
  51. package/dist/orchestrator/tools/schemas.d.ts.map +1 -0
  52. package/dist/orchestrator/tools/schemas.js +138 -0
  53. package/dist/orchestrator/tools/schemas.js.map +1 -0
  54. package/package.json +1 -1
  55. package/templates/presets/nextjs/bober.config.json +1 -1
  56. package/templates/presets/react-vite/bober.config.json +1 -1
@@ -0,0 +1,279 @@
1
+ import { readFile, writeFile, mkdir } from "node:fs/promises";
2
+ import { resolve, relative, isAbsolute } from "node:path";
3
+ import { execa } from "execa";
4
+ // ── Constants ──────────────────────────────────────────────────────
5
+ /** Max characters per tool result to prevent context blow-up. */
6
+ const MAX_OUTPUT_CHARS = 100_000;
7
+ /** Default bash command timeout in ms. */
8
+ const DEFAULT_BASH_TIMEOUT = 120_000;
9
+ /** Max files returned by glob. */
10
+ const MAX_GLOB_RESULTS = 500;
11
+ /** Max lines returned by grep. */
12
+ const MAX_GREP_LINES = 300;
13
+ // ── Path sandboxing ────────────────────────────────────────────────
14
+ /**
15
+ * Resolve and validate a file path, ensuring it stays within projectRoot.
16
+ * Returns the absolute path or throws if the path escapes the sandbox.
17
+ */
18
+ function sandboxPath(projectRoot, inputPath) {
19
+ const abs = isAbsolute(inputPath)
20
+ ? resolve(inputPath)
21
+ : resolve(projectRoot, inputPath);
22
+ // Ensure the resolved path is within the project root
23
+ const rel = relative(projectRoot, abs);
24
+ if (rel.startsWith("..") || isAbsolute(rel)) {
25
+ throw new Error(`Path "${inputPath}" resolves outside the project root. Access denied.`);
26
+ }
27
+ return abs;
28
+ }
29
+ /**
30
+ * Truncate output to MAX_OUTPUT_CHARS with a notice.
31
+ */
32
+ function truncate(text, limit = MAX_OUTPUT_CHARS) {
33
+ if (text.length <= limit)
34
+ return text;
35
+ return (text.slice(0, limit) +
36
+ `\n\n[Output truncated at ${limit.toLocaleString()} characters. Use more specific commands or read_file with offset/limit.]`);
37
+ }
38
+ // ── Tool handlers ──────────────────────────────────────────────────
39
+ function createBashHandler(projectRoot) {
40
+ return async (input) => {
41
+ const command = input.command;
42
+ const timeout = input.timeout ?? DEFAULT_BASH_TIMEOUT;
43
+ if (!command) {
44
+ return { output: "Error: 'command' parameter is required.", isError: true };
45
+ }
46
+ try {
47
+ const result = await execa("sh", ["-c", command], {
48
+ cwd: projectRoot,
49
+ timeout,
50
+ reject: false,
51
+ all: true,
52
+ env: { ...process.env },
53
+ });
54
+ const output = result.all ?? result.stdout ?? "";
55
+ const exitCode = result.exitCode ?? -1;
56
+ const parts = [];
57
+ if (exitCode !== 0) {
58
+ parts.push(`Exit code: ${exitCode}`);
59
+ }
60
+ parts.push(output);
61
+ if (result.stderr && !result.all?.includes(result.stderr)) {
62
+ parts.push(`stderr:\n${result.stderr}`);
63
+ }
64
+ return {
65
+ output: truncate(parts.join("\n")),
66
+ isError: exitCode !== 0,
67
+ };
68
+ }
69
+ catch (err) {
70
+ const message = err instanceof Error ? err.message : String(err);
71
+ if (message.includes("ETIMEDOUT") || message.includes("timed out")) {
72
+ return {
73
+ output: `Command timed out after ${timeout}ms. Use a longer timeout or a more specific command.`,
74
+ isError: true,
75
+ };
76
+ }
77
+ return { output: `Error executing command: ${message}`, isError: true };
78
+ }
79
+ };
80
+ }
81
+ function createReadFileHandler(projectRoot) {
82
+ return async (input) => {
83
+ const filePath = input.file_path;
84
+ if (!filePath) {
85
+ return { output: "Error: 'file_path' parameter is required.", isError: true };
86
+ }
87
+ try {
88
+ const abs = sandboxPath(projectRoot, filePath);
89
+ const content = await readFile(abs, "utf-8");
90
+ const lines = content.split("\n");
91
+ const offset = Math.max(1, input.offset ?? 1);
92
+ const limit = input.limit ?? lines.length;
93
+ const slice = lines.slice(offset - 1, offset - 1 + limit);
94
+ const numbered = slice
95
+ .map((line, i) => `${String(offset + i).padStart(6)}\t${line}`)
96
+ .join("\n");
97
+ return { output: truncate(numbered), isError: false };
98
+ }
99
+ catch (err) {
100
+ const message = err instanceof Error ? err.message : String(err);
101
+ if (message.includes("ENOENT")) {
102
+ return { output: `File not found: ${filePath}`, isError: true };
103
+ }
104
+ return { output: `Error reading file: ${message}`, isError: true };
105
+ }
106
+ };
107
+ }
108
+ function createWriteFileHandler(projectRoot) {
109
+ return async (input) => {
110
+ const filePath = input.file_path;
111
+ const content = input.content;
112
+ if (!filePath) {
113
+ return { output: "Error: 'file_path' parameter is required.", isError: true };
114
+ }
115
+ if (content === undefined || content === null) {
116
+ return { output: "Error: 'content' parameter is required.", isError: true };
117
+ }
118
+ try {
119
+ const abs = sandboxPath(projectRoot, filePath);
120
+ // Create parent directories
121
+ const dir = abs.substring(0, abs.lastIndexOf("/"));
122
+ await mkdir(dir, { recursive: true });
123
+ await writeFile(abs, content, "utf-8");
124
+ const bytes = content.length;
125
+ return {
126
+ output: `Wrote ${bytes} bytes to ${filePath}`,
127
+ isError: false,
128
+ };
129
+ }
130
+ catch (err) {
131
+ const message = err instanceof Error ? err.message : String(err);
132
+ return { output: `Error writing file: ${message}`, isError: true };
133
+ }
134
+ };
135
+ }
136
+ function createEditFileHandler(projectRoot) {
137
+ return async (input) => {
138
+ const filePath = input.file_path;
139
+ const oldText = input.old_text;
140
+ const newText = input.new_text;
141
+ if (!filePath) {
142
+ return { output: "Error: 'file_path' parameter is required.", isError: true };
143
+ }
144
+ if (!oldText) {
145
+ return { output: "Error: 'old_text' parameter is required.", isError: true };
146
+ }
147
+ if (newText === undefined || newText === null) {
148
+ return { output: "Error: 'new_text' parameter is required.", isError: true };
149
+ }
150
+ try {
151
+ const abs = sandboxPath(projectRoot, filePath);
152
+ const content = await readFile(abs, "utf-8");
153
+ const idx = content.indexOf(oldText);
154
+ if (idx === -1) {
155
+ // Show a snippet of the file to help the agent find the right text
156
+ const preview = content.slice(0, 500);
157
+ return {
158
+ output: `Error: old_text not found in ${filePath}. ` +
159
+ `The text must match exactly including whitespace and indentation.\n\n` +
160
+ `File starts with:\n${preview}`,
161
+ isError: true,
162
+ };
163
+ }
164
+ const updated = content.slice(0, idx) + newText + content.slice(idx + oldText.length);
165
+ await writeFile(abs, updated, "utf-8");
166
+ return {
167
+ output: `Applied edit to ${filePath}: replaced ${oldText.length} chars with ${newText.length} chars.`,
168
+ isError: false,
169
+ };
170
+ }
171
+ catch (err) {
172
+ const message = err instanceof Error ? err.message : String(err);
173
+ if (message.includes("ENOENT")) {
174
+ return { output: `File not found: ${filePath}`, isError: true };
175
+ }
176
+ return { output: `Error editing file: ${message}`, isError: true };
177
+ }
178
+ };
179
+ }
180
+ function createGlobHandler(projectRoot) {
181
+ return async (input) => {
182
+ const pattern = input.pattern;
183
+ if (!pattern) {
184
+ return { output: "Error: 'pattern' parameter is required.", isError: true };
185
+ }
186
+ const searchDir = input.path
187
+ ? sandboxPath(projectRoot, input.path)
188
+ : projectRoot;
189
+ try {
190
+ // Use the glob package (already a dependency)
191
+ const { glob } = await import("glob");
192
+ const matches = await glob(pattern, {
193
+ cwd: searchDir,
194
+ nodir: true,
195
+ ignore: ["node_modules/**", ".git/**", "dist/**"],
196
+ });
197
+ if (matches.length === 0) {
198
+ return { output: `No files found matching "${pattern}"`, isError: false };
199
+ }
200
+ const limited = matches.slice(0, MAX_GLOB_RESULTS);
201
+ let output = limited.join("\n");
202
+ if (matches.length > MAX_GLOB_RESULTS) {
203
+ output += `\n\n[${matches.length - MAX_GLOB_RESULTS} more files not shown. Use a more specific pattern.]`;
204
+ }
205
+ return { output, isError: false };
206
+ }
207
+ catch (err) {
208
+ const message = err instanceof Error ? err.message : String(err);
209
+ return { output: `Error during glob: ${message}`, isError: true };
210
+ }
211
+ };
212
+ }
213
+ function createGrepHandler(projectRoot) {
214
+ return async (input) => {
215
+ const pattern = input.pattern;
216
+ if (!pattern) {
217
+ return { output: "Error: 'pattern' parameter is required.", isError: true };
218
+ }
219
+ const searchPath = input.path
220
+ ? sandboxPath(projectRoot, input.path)
221
+ : projectRoot;
222
+ try {
223
+ const args = ["-rn", "--color=never"];
224
+ // Add context lines
225
+ const context = input.context;
226
+ if (context && context > 0) {
227
+ args.push(`-C`, String(context));
228
+ }
229
+ // Add glob filter
230
+ const globPattern = input.glob;
231
+ if (globPattern) {
232
+ args.push(`--include=${globPattern}`);
233
+ }
234
+ // Always exclude common dirs
235
+ args.push("--exclude-dir=node_modules", "--exclude-dir=.git", "--exclude-dir=dist");
236
+ args.push(pattern, searchPath);
237
+ const result = await execa("grep", args, {
238
+ cwd: projectRoot,
239
+ reject: false,
240
+ all: true,
241
+ timeout: 30_000,
242
+ });
243
+ const output = result.all ?? result.stdout ?? "";
244
+ if (result.exitCode === 1 && !output.trim()) {
245
+ return { output: `No matches found for pattern "${pattern}"`, isError: false };
246
+ }
247
+ // Limit output lines
248
+ const lines = output.split("\n");
249
+ if (lines.length > MAX_GREP_LINES) {
250
+ const truncated = lines.slice(0, MAX_GREP_LINES).join("\n");
251
+ return {
252
+ output: truncated +
253
+ `\n\n[${lines.length - MAX_GREP_LINES} more lines. Use a more specific pattern or glob filter.]`,
254
+ isError: false,
255
+ };
256
+ }
257
+ return { output: truncate(output), isError: false };
258
+ }
259
+ catch (err) {
260
+ const message = err instanceof Error ? err.message : String(err);
261
+ return { output: `Error during grep: ${message}`, isError: true };
262
+ }
263
+ };
264
+ }
265
+ // ── Factory ────────────────────────────────────────────────────────
266
+ /**
267
+ * Create all tool handlers scoped to a project root.
268
+ */
269
+ export function createToolHandlers(projectRoot) {
270
+ const handlers = new Map();
271
+ handlers.set("bash", createBashHandler(projectRoot));
272
+ handlers.set("read_file", createReadFileHandler(projectRoot));
273
+ handlers.set("write_file", createWriteFileHandler(projectRoot));
274
+ handlers.set("edit_file", createEditFileHandler(projectRoot));
275
+ handlers.set("glob", createGlobHandler(projectRoot));
276
+ handlers.set("grep", createGrepHandler(projectRoot));
277
+ return handlers;
278
+ }
279
+ //# sourceMappingURL=handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../../src/orchestrator/tools/handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,sEAAsE;AAEtE,iEAAiE;AACjE,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAEjC,0CAA0C;AAC1C,MAAM,oBAAoB,GAAG,OAAO,CAAC;AAErC,kCAAkC;AAClC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,kCAAkC;AAClC,MAAM,cAAc,GAAG,GAAG,CAAC;AAQ3B,sEAAsE;AAEtE;;;GAGG;AACH,SAAS,WAAW,CAAC,WAAmB,EAAE,SAAiB;IACzD,MAAM,GAAG,GAAG,UAAU,CAAC,SAAS,CAAC;QAC/B,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;QACpB,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAEpC,sDAAsD;IACtD,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC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AQ,CAAC,GAAG,CAAC,WAAW,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC,CAAC;IAC9D,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC;IAErD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type Anthropic from "@anthropic-ai/sdk";
2
+ import type { ToolHandler } from "./handlers.js";
3
+ export type { ToolHandler } from "./handlers.js";
4
+ type Tool = Anthropic.Messages.Tool;
5
+ export type AgentRole = "planner" | "generator" | "evaluator";
6
+ export interface ToolSet {
7
+ /** Tool schemas to pass to `client.messages.create({ tools })`. */
8
+ schemas: Tool[];
9
+ /** Handler functions keyed by tool name. */
10
+ handlers: Map<string, ToolHandler>;
11
+ }
12
+ /**
13
+ * Build a tool set for a specific agent role.
14
+ *
15
+ * Returns only the tools appropriate for that role:
16
+ * - **planner**: read_file, glob, grep (read-only, no execution)
17
+ * - **generator**: all 6 tools (full filesystem + bash access)
18
+ * - **evaluator**: bash, read_file, glob, grep (can run commands, cannot write/edit files)
19
+ */
20
+ export declare function buildToolSet(role: AgentRole, projectRoot: string): ToolSet;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAI/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIjD,KAAK,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;AAEpC,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC;AAE9D,MAAM,WAAW,OAAO;IACtB,mEAAmE;IACnE,OAAO,EAAE,IAAI,EAAE,CAAC;IAChB,4CAA4C;IAC5C,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACpC;AAYD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,SAAS,EACf,WAAW,EAAE,MAAM,GAClB,OAAO,CAkBT"}
@@ -0,0 +1,33 @@
1
+ import { TOOL_SCHEMAS } from "./schemas.js";
2
+ import { createToolHandlers } from "./handlers.js";
3
+ // ── Role → tool mapping ────────────────────────────────────────────
4
+ const ROLE_TOOLS = {
5
+ planner: ["read_file", "glob", "grep"],
6
+ generator: ["bash", "read_file", "write_file", "edit_file", "glob", "grep"],
7
+ evaluator: ["bash", "read_file", "glob", "grep"],
8
+ };
9
+ // ── Builder ────────────────────────────────────────────────────────
10
+ /**
11
+ * Build a tool set for a specific agent role.
12
+ *
13
+ * Returns only the tools appropriate for that role:
14
+ * - **planner**: read_file, glob, grep (read-only, no execution)
15
+ * - **generator**: all 6 tools (full filesystem + bash access)
16
+ * - **evaluator**: bash, read_file, glob, grep (can run commands, cannot write/edit files)
17
+ */
18
+ export function buildToolSet(role, projectRoot) {
19
+ const toolNames = ROLE_TOOLS[role];
20
+ const allHandlers = createToolHandlers(projectRoot);
21
+ const schemas = [];
22
+ const handlers = new Map();
23
+ for (const name of toolNames) {
24
+ const schema = TOOL_SCHEMAS[name];
25
+ const handler = allHandlers.get(name);
26
+ if (schema && handler) {
27
+ schemas.push(schema);
28
+ handlers.set(name, handler);
29
+ }
30
+ }
31
+ return { schemas, handlers };
32
+ }
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/orchestrator/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAkBnD,sEAAsE;AAEtE,MAAM,UAAU,GAAgC;IAC9C,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC;IACtC,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC;IAC3E,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC;CACjD,CAAC;AAEF,sEAAsE;AAEtE;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAe,EACf,WAAmB;IAEnB,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,WAAW,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAEpD,MAAM,OAAO,GAAW,EAAE,CAAC;IAC3B,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;IAEhD,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAEtC,IAAI,MAAM,IAAI,OAAO,EAAE,CAAC;YACtB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACrB,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type Anthropic from "@anthropic-ai/sdk";
2
+ type Tool = Anthropic.Messages.Tool;
3
+ /**
4
+ * Tool schema definitions for the Anthropic messages API.
5
+ * Each schema matches the `Tool` interface expected by `client.messages.create()`.
6
+ */
7
+ export declare const bashTool: Tool;
8
+ export declare const readFileTool: Tool;
9
+ export declare const writeFileTool: Tool;
10
+ export declare const editFileTool: Tool;
11
+ export declare const globTool: Tool;
12
+ export declare const grepTool: Tool;
13
+ /** All available tool schemas, keyed by tool name. */
14
+ export declare const TOOL_SCHEMAS: Record<string, Tool>;
15
+ export {};
16
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/tools/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAE/C,KAAK,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;AAEpC;;;GAGG;AAEH,eAAO,MAAM,QAAQ,EAAE,IAmBtB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,IAuB1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,IAmB3B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,IAwB1B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,IAmBtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,IA6BtB,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAO7C,CAAC"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Tool schema definitions for the Anthropic messages API.
3
+ * Each schema matches the `Tool` interface expected by `client.messages.create()`.
4
+ */
5
+ export const bashTool = {
6
+ name: "bash",
7
+ description: "Execute a shell command in the project directory. Use for running builds, tests, linters, git commands, dev servers, curl, etc. The command runs with the project root as cwd.",
8
+ input_schema: {
9
+ type: "object",
10
+ properties: {
11
+ command: {
12
+ type: "string",
13
+ description: "The shell command to execute.",
14
+ },
15
+ timeout: {
16
+ type: "number",
17
+ description: "Timeout in milliseconds. Defaults to 120000 (2 minutes). Use longer timeouts for builds and test suites.",
18
+ },
19
+ },
20
+ required: ["command"],
21
+ },
22
+ };
23
+ export const readFileTool = {
24
+ name: "read_file",
25
+ description: "Read a file's contents. Returns the file content with line numbers. Use offset and limit to read specific sections of large files.",
26
+ input_schema: {
27
+ type: "object",
28
+ properties: {
29
+ file_path: {
30
+ type: "string",
31
+ description: "Path to the file, relative to the project root or absolute.",
32
+ },
33
+ offset: {
34
+ type: "number",
35
+ description: "Line number to start reading from (1-based). Optional.",
36
+ },
37
+ limit: {
38
+ type: "number",
39
+ description: "Maximum number of lines to read. Optional.",
40
+ },
41
+ },
42
+ required: ["file_path"],
43
+ },
44
+ };
45
+ export const writeFileTool = {
46
+ name: "write_file",
47
+ description: "Create a new file or overwrite an existing file. Parent directories are created automatically. Use edit_file for targeted modifications to existing files.",
48
+ input_schema: {
49
+ type: "object",
50
+ properties: {
51
+ file_path: {
52
+ type: "string",
53
+ description: "Path to the file, relative to the project root or absolute.",
54
+ },
55
+ content: {
56
+ type: "string",
57
+ description: "The full content to write to the file.",
58
+ },
59
+ },
60
+ required: ["file_path", "content"],
61
+ },
62
+ };
63
+ export const editFileTool = {
64
+ name: "edit_file",
65
+ description: "Apply a targeted find-and-replace edit to an existing file. The old_text must match exactly (including whitespace and indentation). Replaces only the first occurrence.",
66
+ input_schema: {
67
+ type: "object",
68
+ properties: {
69
+ file_path: {
70
+ type: "string",
71
+ description: "Path to the file, relative to the project root or absolute.",
72
+ },
73
+ old_text: {
74
+ type: "string",
75
+ description: "The exact text to find in the file. Must match exactly including whitespace.",
76
+ },
77
+ new_text: {
78
+ type: "string",
79
+ description: "The replacement text.",
80
+ },
81
+ },
82
+ required: ["file_path", "old_text", "new_text"],
83
+ },
84
+ };
85
+ export const globTool = {
86
+ name: "glob",
87
+ description: 'Find files matching a glob pattern. Returns a list of matching file paths relative to the search directory. Example patterns: "**/*.ts", "src/components/**/*.tsx", "*.json".',
88
+ input_schema: {
89
+ type: "object",
90
+ properties: {
91
+ pattern: {
92
+ type: "string",
93
+ description: "The glob pattern to match files against.",
94
+ },
95
+ path: {
96
+ type: "string",
97
+ description: "Directory to search in, relative to project root. Defaults to project root.",
98
+ },
99
+ },
100
+ required: ["pattern"],
101
+ },
102
+ };
103
+ export const grepTool = {
104
+ name: "grep",
105
+ description: "Search file contents using a regular expression pattern. Returns matching lines with file paths and line numbers.",
106
+ input_schema: {
107
+ type: "object",
108
+ properties: {
109
+ pattern: {
110
+ type: "string",
111
+ description: "Regular expression pattern to search for.",
112
+ },
113
+ path: {
114
+ type: "string",
115
+ description: "File or directory to search in, relative to project root. Defaults to project root.",
116
+ },
117
+ glob: {
118
+ type: "string",
119
+ description: 'Glob pattern to filter which files to search (e.g. "*.ts", "*.tsx").',
120
+ },
121
+ context: {
122
+ type: "number",
123
+ description: "Number of context lines to show before and after each match.",
124
+ },
125
+ },
126
+ required: ["pattern"],
127
+ },
128
+ };
129
+ /** All available tool schemas, keyed by tool name. */
130
+ export const TOOL_SCHEMAS = {
131
+ bash: bashTool,
132
+ read_file: readFileTool,
133
+ write_file: writeFileTool,
134
+ edit_file: editFileTool,
135
+ glob: globTool,
136
+ grep: grepTool,
137
+ };
138
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/orchestrator/tools/schemas.ts"],"names":[],"mappings":"AAIA;;;GAGG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAS;IAC5B,IAAI,EAAE,MAAM;IACZ,WAAW,EACT,gLAAgL;IAClL,YAAY,EAAE;QACZ,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+BAA+B;aAC7C;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,0GAA0G;aAC7G;SACF;QACD,QAAQ,EAAE,CAAC,SAAS,CAAC;KACtB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,IAAI,EAAE,WAAW;IACjB,WAAW,EACT,oIAAoI;IACtI,YAAY,EAAE;QACZ,IAAI,EAAE,QAAiB;QACvB,UAAU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QAAiB;QACvB,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0CAA0C;aACxD;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,6EAA6E;aAChF;SACF;QACD,QAAQ,EAAE,CAAC,SAAS,CAAC;KACtB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAS;IAC5B,IAAI,EAAE,MAAM;IACZ,WAAW,EACT,mHAAmH;IACrH,YAAY,EAAE;QACZ,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2CAA2C;aACzD;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,qFAAqF;aACxF;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,sEAAsE;aACzE;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,8DAA8D;aACjE;SACF;QACD,QAAQ,EAAE,CAAC,SAAS,CAAC;KACtB;CACF,CAAC;AAEF,sDAAsD;AACtD,MAAM,CAAC,MAAM,YAAY,GAAyB;IAChD,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE,aAAa;IACzB,SAAS,EAAE,YAAY;IACvB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;CACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-bober",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "Generator-Evaluator multi-agent harness for building applications autonomously with Claude. Implements planner, sprint, and evaluator patterns.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -7,7 +7,7 @@
7
7
  { "type": "lint", "required": true },
8
8
  { "type": "build", "required": true },
9
9
  { "type": "unit-test", "required": true },
10
- { "type": "playwright", "required": false }
10
+ { "type": "playwright", "required": true }
11
11
  ], "maxIterations": 3 },
12
12
  "sprint": { "maxSprints": 10, "requireContracts": true, "sprintSize": "medium" },
13
13
  "pipeline": { "maxIterations": 20, "requireApproval": false, "contextReset": "always" },
@@ -28,7 +28,7 @@
28
28
  { "type": "lint", "required": true },
29
29
  { "type": "build", "required": true },
30
30
  { "type": "unit-test", "required": true },
31
- { "type": "playwright", "required": false }
31
+ { "type": "playwright", "required": true }
32
32
  ],
33
33
  "maxIterations": 3
34
34
  },