agent-bober 0.5.3 → 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.
- package/README.md +13 -7
- package/dist/contracts/eval-result.d.ts +339 -0
- package/dist/contracts/eval-result.d.ts.map +1 -1
- package/dist/contracts/eval-result.js +36 -0
- package/dist/contracts/eval-result.js.map +1 -1
- package/dist/evaluators/builtin/playwright.d.ts.map +1 -1
- package/dist/evaluators/builtin/playwright.js +50 -15
- package/dist/evaluators/builtin/playwright.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/orchestrator/agent-loader.d.ts +26 -0
- package/dist/orchestrator/agent-loader.d.ts.map +1 -0
- package/dist/orchestrator/agent-loader.js +125 -0
- package/dist/orchestrator/agent-loader.js.map +1 -0
- package/dist/orchestrator/agentic-loop.d.ts +53 -0
- package/dist/orchestrator/agentic-loop.d.ts.map +1 -0
- package/dist/orchestrator/agentic-loop.js +145 -0
- package/dist/orchestrator/agentic-loop.js.map +1 -0
- package/dist/orchestrator/evaluator-agent.d.ts +4 -1
- package/dist/orchestrator/evaluator-agent.d.ts.map +1 -1
- package/dist/orchestrator/evaluator-agent.js +107 -84
- package/dist/orchestrator/evaluator-agent.js.map +1 -1
- package/dist/orchestrator/generator-agent.d.ts +14 -2
- package/dist/orchestrator/generator-agent.d.ts.map +1 -1
- package/dist/orchestrator/generator-agent.js +96 -73
- package/dist/orchestrator/generator-agent.js.map +1 -1
- package/dist/orchestrator/model-resolver.d.ts +9 -0
- package/dist/orchestrator/model-resolver.d.ts.map +1 -0
- package/dist/orchestrator/model-resolver.js +21 -0
- package/dist/orchestrator/model-resolver.js.map +1 -0
- package/dist/orchestrator/pipeline.d.ts.map +1 -1
- package/dist/orchestrator/pipeline.js +21 -4
- package/dist/orchestrator/pipeline.js.map +1 -1
- package/dist/orchestrator/planner-agent.d.ts +3 -2
- package/dist/orchestrator/planner-agent.d.ts.map +1 -1
- package/dist/orchestrator/planner-agent.js +39 -75
- package/dist/orchestrator/planner-agent.js.map +1 -1
- package/dist/orchestrator/tools/handlers.d.ts +9 -0
- package/dist/orchestrator/tools/handlers.d.ts.map +1 -0
- package/dist/orchestrator/tools/handlers.js +279 -0
- package/dist/orchestrator/tools/handlers.js.map +1 -0
- package/dist/orchestrator/tools/index.d.ts +21 -0
- package/dist/orchestrator/tools/index.d.ts.map +1 -0
- package/dist/orchestrator/tools/index.js +33 -0
- package/dist/orchestrator/tools/index.js.map +1 -0
- package/dist/orchestrator/tools/schemas.d.ts +16 -0
- package/dist/orchestrator/tools/schemas.d.ts.map +1 -0
- package/dist/orchestrator/tools/schemas.js +138 -0
- package/dist/orchestrator/tools/schemas.js.map +1 -0
- package/package.json +1 -1
|
@@ -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,M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,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.
|
|
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",
|