agent-bober 0.6.2 → 0.7.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 +156 -28
- package/dist/cli/commands/eval.d.ts +2 -0
- package/dist/cli/commands/eval.d.ts.map +1 -1
- package/dist/cli/commands/eval.js +10 -0
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +181 -61
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +2 -0
- package/dist/cli/commands/plan.d.ts.map +1 -1
- package/dist/cli/commands/plan.js +10 -0
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/run.d.ts +2 -0
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +10 -0
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/sprint.d.ts +2 -0
- package/dist/cli/commands/sprint.d.ts.map +1 -1
- package/dist/cli/commands/sprint.js +10 -0
- package/dist/cli/commands/sprint.js.map +1 -1
- package/dist/cli/index.js +22 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/config/schema.d.ts +160 -43
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +11 -7
- package/dist/config/schema.js.map +1 -1
- package/dist/contracts/sprint-contract.d.ts +8 -8
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +4 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/run-manager.d.ts +47 -0
- package/dist/mcp/run-manager.d.ts.map +1 -0
- package/dist/mcp/run-manager.js +79 -0
- package/dist/mcp/run-manager.js.map +1 -0
- package/dist/mcp/server.d.ts +15 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +107 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/config.d.ts +2 -0
- package/dist/mcp/tools/config.d.ts.map +1 -0
- package/dist/mcp/tools/config.js +153 -0
- package/dist/mcp/tools/config.js.map +1 -0
- package/dist/mcp/tools/contracts.d.ts +2 -0
- package/dist/mcp/tools/contracts.d.ts.map +1 -0
- package/dist/mcp/tools/contracts.js +61 -0
- package/dist/mcp/tools/contracts.js.map +1 -0
- package/dist/mcp/tools/eval.d.ts +2 -0
- package/dist/mcp/tools/eval.d.ts.map +1 -0
- package/dist/mcp/tools/eval.js +157 -0
- package/dist/mcp/tools/eval.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +20 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +47 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/init.d.ts +2 -0
- package/dist/mcp/tools/init.d.ts.map +1 -0
- package/dist/mcp/tools/init.js +121 -0
- package/dist/mcp/tools/init.js.map +1 -0
- package/dist/mcp/tools/plan.d.ts +2 -0
- package/dist/mcp/tools/plan.d.ts.map +1 -0
- package/dist/mcp/tools/plan.js +97 -0
- package/dist/mcp/tools/plan.js.map +1 -0
- package/dist/mcp/tools/principles.d.ts +2 -0
- package/dist/mcp/tools/principles.d.ts.map +1 -0
- package/dist/mcp/tools/principles.js +66 -0
- package/dist/mcp/tools/principles.js.map +1 -0
- package/dist/mcp/tools/registry.d.ts +45 -0
- package/dist/mcp/tools/registry.d.ts.map +1 -0
- package/dist/mcp/tools/registry.js +23 -0
- package/dist/mcp/tools/registry.js.map +1 -0
- package/dist/mcp/tools/run.d.ts +2 -0
- package/dist/mcp/tools/run.d.ts.map +1 -0
- package/dist/mcp/tools/run.js +66 -0
- package/dist/mcp/tools/run.js.map +1 -0
- package/dist/mcp/tools/spec.d.ts +2 -0
- package/dist/mcp/tools/spec.d.ts.map +1 -0
- package/dist/mcp/tools/spec.js +32 -0
- package/dist/mcp/tools/spec.js.map +1 -0
- package/dist/mcp/tools/sprint.d.ts +2 -0
- package/dist/mcp/tools/sprint.d.ts.map +1 -0
- package/dist/mcp/tools/sprint.js +243 -0
- package/dist/mcp/tools/sprint.js.map +1 -0
- package/dist/mcp/tools/status.d.ts +2 -0
- package/dist/mcp/tools/status.d.ts.map +1 -0
- package/dist/mcp/tools/status.js +76 -0
- package/dist/mcp/tools/status.js.map +1 -0
- package/dist/orchestrator/agentic-loop.d.ts +7 -6
- package/dist/orchestrator/agentic-loop.d.ts.map +1 -1
- package/dist/orchestrator/agentic-loop.js +33 -40
- package/dist/orchestrator/agentic-loop.js.map +1 -1
- package/dist/orchestrator/context-handoff.d.ts +20 -20
- package/dist/orchestrator/evaluator-agent.d.ts.map +1 -1
- package/dist/orchestrator/evaluator-agent.js +2 -2
- package/dist/orchestrator/evaluator-agent.js.map +1 -1
- package/dist/orchestrator/generator-agent.d.ts.map +1 -1
- package/dist/orchestrator/generator-agent.js +2 -2
- package/dist/orchestrator/generator-agent.js.map +1 -1
- package/dist/orchestrator/model-resolver.d.ts +35 -4
- package/dist/orchestrator/model-resolver.d.ts.map +1 -1
- package/dist/orchestrator/model-resolver.js +68 -15
- package/dist/orchestrator/model-resolver.js.map +1 -1
- package/dist/orchestrator/planner-agent.d.ts.map +1 -1
- package/dist/orchestrator/planner-agent.js +2 -2
- package/dist/orchestrator/planner-agent.js.map +1 -1
- package/dist/orchestrator/tools/index.d.ts +3 -4
- package/dist/orchestrator/tools/index.d.ts.map +1 -1
- package/dist/orchestrator/tools/index.js.map +1 -1
- package/dist/orchestrator/tools/schemas.d.ts +11 -12
- package/dist/orchestrator/tools/schemas.d.ts.map +1 -1
- package/dist/orchestrator/tools/schemas.js +3 -2
- package/dist/orchestrator/tools/schemas.js.map +1 -1
- package/dist/providers/anthropic.d.ts +15 -0
- package/dist/providers/anthropic.d.ts.map +1 -0
- package/dist/providers/anthropic.js +133 -0
- package/dist/providers/anthropic.js.map +1 -0
- package/dist/providers/factory.d.ts +37 -0
- package/dist/providers/factory.d.ts.map +1 -0
- package/dist/providers/factory.js +119 -0
- package/dist/providers/factory.js.map +1 -0
- package/dist/providers/google.d.ts +39 -0
- package/dist/providers/google.d.ts.map +1 -0
- package/dist/providers/google.js +195 -0
- package/dist/providers/google.js.map +1 -0
- package/dist/providers/index.d.ts +7 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +6 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/openai-compat.d.ts +39 -0
- package/dist/providers/openai-compat.d.ts.map +1 -0
- package/dist/providers/openai-compat.js +42 -0
- package/dist/providers/openai-compat.js.map +1 -0
- package/dist/providers/openai.d.ts +41 -0
- package/dist/providers/openai.d.ts.map +1 -0
- package/dist/providers/openai.js +205 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/providers/types.d.ts +144 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +8 -0
- package/dist/providers/types.js.map +1 -0
- package/package.json +21 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"principles.js","sourceRoot":"","sources":["../../../src/mcp/tools/principles.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,EAAE;AACF,2DAA2D;AAC3D,yDAAyD;AAEzD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,yEAAyE;AAEzE,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAE5C,SAAS,cAAc,CAAC,WAAmB;IACzC,OAAO,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC;AAC1D,CAAC;AAED,wEAAwE;AAExE,MAAM,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BACR,EACD,IAAI,EACJ,CAAC,CACF,CAAC;YACJ,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,IAAI,CAAC,SAAS,CACnB;oBACE,OAAO,EAAE,IAAI;oBACb,OAAO,EACL,sEAAsE;iBACzE,EACD,IAAI,EACJ,CAAC,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A JSON Schema object for describing a tool's input parameters.
|
|
3
|
+
*/
|
|
4
|
+
export interface JsonSchemaObject {
|
|
5
|
+
type: string;
|
|
6
|
+
properties?: Record<string, JsonSchemaProperty>;
|
|
7
|
+
required?: string[];
|
|
8
|
+
additionalProperties?: boolean;
|
|
9
|
+
description?: string;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface JsonSchemaProperty {
|
|
13
|
+
type?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
enum?: unknown[];
|
|
16
|
+
default?: unknown;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Definition of a single MCP tool that agent-bober exposes.
|
|
21
|
+
*/
|
|
22
|
+
export interface BoberToolDefinition {
|
|
23
|
+
/** The tool name as it will appear in tools/list (e.g. "bober_ping"). */
|
|
24
|
+
name: string;
|
|
25
|
+
/** Human-readable description of what the tool does. */
|
|
26
|
+
description: string;
|
|
27
|
+
/** JSON Schema object describing the tool's input parameters. */
|
|
28
|
+
inputSchema: JsonSchemaObject;
|
|
29
|
+
/** Function that executes the tool and returns a string result. */
|
|
30
|
+
handler: (args: Record<string, unknown>) => Promise<string>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Register a tool in the global tool registry.
|
|
34
|
+
* If a tool with the same name is already registered, it is overwritten.
|
|
35
|
+
*/
|
|
36
|
+
export declare function registerTool(tool: BoberToolDefinition): void;
|
|
37
|
+
/**
|
|
38
|
+
* Returns all registered tool definitions.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getAllTools(): BoberToolDefinition[];
|
|
41
|
+
/**
|
|
42
|
+
* Looks up a tool by name. Returns undefined if not found.
|
|
43
|
+
*/
|
|
44
|
+
export declare function getTool(name: string): BoberToolDefinition | undefined;
|
|
45
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/registry.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,WAAW,EAAE,gBAAgB,CAAC;IAC9B,mEAAmE;IACnE,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7D;AAMD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAE5D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,mBAAmB,EAAE,CAEnD;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAErE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// ── Tool Registry ───────────────────────────────────────────────────
|
|
2
|
+
// ── Registry implementation ─────────────────────────────────────────
|
|
3
|
+
const registry = new Map();
|
|
4
|
+
/**
|
|
5
|
+
* Register a tool in the global tool registry.
|
|
6
|
+
* If a tool with the same name is already registered, it is overwritten.
|
|
7
|
+
*/
|
|
8
|
+
export function registerTool(tool) {
|
|
9
|
+
registry.set(tool.name, tool);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Returns all registered tool definitions.
|
|
13
|
+
*/
|
|
14
|
+
export function getAllTools() {
|
|
15
|
+
return Array.from(registry.values());
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Looks up a tool by name. Returns undefined if not found.
|
|
19
|
+
*/
|
|
20
|
+
export function getTool(name) {
|
|
21
|
+
return registry.get(name);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/mcp/tools/registry.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAoCvE,uEAAuE;AAEvE,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA+B,CAAC;AAExD;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,IAAyB;IACpD,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/run.ts"],"names":[],"mappings":"AAgBA,wBAAgB,eAAe,IAAI,IAAI,CA0EtC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// ── bober_run tool ───────────────────────────────────────────────────
|
|
2
|
+
//
|
|
3
|
+
// Accepts { task: string }, starts the full pipeline asynchronously,
|
|
4
|
+
// and returns immediately with a runId. The pipeline runs in the
|
|
5
|
+
// background; poll bober_status to track progress.
|
|
6
|
+
import { cwd } from "node:process";
|
|
7
|
+
import { McpError, ErrorCode } from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
import { configExists, loadConfig } from "../../config/loader.js";
|
|
9
|
+
import { registerTool } from "./registry.js";
|
|
10
|
+
import { runManager } from "../run-manager.js";
|
|
11
|
+
// ── Registration ─────────────────────────────────────────────────────
|
|
12
|
+
export function registerRunTool() {
|
|
13
|
+
registerTool({
|
|
14
|
+
name: "bober_run",
|
|
15
|
+
description: "Start the full Bober pipeline (plan + sprint + eval) asynchronously. " +
|
|
16
|
+
"Accepts a task description and returns immediately with a runId. " +
|
|
17
|
+
"Use bober_status to poll progress. Only one pipeline can run at a time.",
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: {
|
|
21
|
+
task: {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "Feature or project description to build. Passed to the planner.",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
required: ["task"],
|
|
27
|
+
additionalProperties: false,
|
|
28
|
+
},
|
|
29
|
+
handler: async (args) => {
|
|
30
|
+
const task = String(args.task ?? "").trim();
|
|
31
|
+
if (!task) {
|
|
32
|
+
return JSON.stringify({
|
|
33
|
+
error: "task is required and must be a non-empty string.",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const projectRoot = cwd();
|
|
37
|
+
// Require a bober config before starting
|
|
38
|
+
const hasConfig = await configExists(projectRoot);
|
|
39
|
+
if (!hasConfig) {
|
|
40
|
+
throw new McpError(ErrorCode.InvalidRequest, "No bober.config.json found. Run bober_init first.");
|
|
41
|
+
}
|
|
42
|
+
// Reject concurrent runs with a clear error
|
|
43
|
+
if (runManager.isRunning()) {
|
|
44
|
+
const state = runManager.getStatus();
|
|
45
|
+
throw new McpError(ErrorCode.InvalidRequest, `A pipeline is already running (runId: ${state.runId}). Use bober_status to check progress.`);
|
|
46
|
+
}
|
|
47
|
+
let config;
|
|
48
|
+
try {
|
|
49
|
+
config = await loadConfig(projectRoot);
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
return JSON.stringify({
|
|
53
|
+
error: `Failed to load config: ${err instanceof Error ? err.message : String(err)}`,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const runId = runManager.startRun(task, projectRoot, config);
|
|
57
|
+
process.stderr.write(`[bober_run] Started pipeline run ${runId} for task: ${task.slice(0, 100)}\n`);
|
|
58
|
+
return JSON.stringify({
|
|
59
|
+
runId,
|
|
60
|
+
status: "running",
|
|
61
|
+
message: "Pipeline started. Use bober_status to check progress.",
|
|
62
|
+
}, null, 2);
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/mcp/tools/run.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,EAAE;AACF,qEAAqE;AACrE,iEAAiE;AACjE,mDAAmD;AAEnD,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,UAA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AED,IAAI,MAAM,CAAC;YACX,IAAI,CAAC;gBACH,MAAM,GAAG,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC;YACzC,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,IAAI,CAAC,SAAS,CAAC;oBACpB,KAAK,EAAE,0BAA0B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;iBACpF,CAAC,CAAC;YACL,CAAC;YAED,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;YAE7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,oCAAoC,KAAK,cAAc,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,CAC9E,CAAC;YAEF,OAAO,IAAI,CAAC,SAAS,CACnB;gBACE,KAAK;gBACL,MAAM,EAAE,SAAS;gBACjB,OAAO,EACL,uDAAuD;aAC1D,EACD,IAAI,EACJ,CAAC,CACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/spec.ts"],"names":[],"mappings":"AAYA,wBAAgB,gBAAgB,IAAI,IAAI,CA6BvC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// ── bober_spec tool ───────────────────────────────────────────────────
|
|
2
|
+
//
|
|
3
|
+
// Returns the latest PlanSpec JSON.
|
|
4
|
+
// If no plans exist, returns a descriptive error object.
|
|
5
|
+
import { cwd } from "node:process";
|
|
6
|
+
import { loadLatestSpec } from "../../state/index.js";
|
|
7
|
+
import { registerTool } from "./registry.js";
|
|
8
|
+
// ── Registration ─────────────────────────────────────────────────────
|
|
9
|
+
export function registerSpecTool() {
|
|
10
|
+
registerTool({
|
|
11
|
+
name: "bober_spec",
|
|
12
|
+
description: "Return the latest PlanSpec JSON. " +
|
|
13
|
+
"The spec contains the project overview, feature breakdown, and sprint contracts. " +
|
|
14
|
+
"If no plan exists yet, returns an error message.",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {},
|
|
18
|
+
additionalProperties: false,
|
|
19
|
+
},
|
|
20
|
+
handler: async (_args) => {
|
|
21
|
+
const projectRoot = cwd();
|
|
22
|
+
const spec = await loadLatestSpec(projectRoot);
|
|
23
|
+
if (spec === null) {
|
|
24
|
+
return JSON.stringify({
|
|
25
|
+
error: "No plans found. Run bober_plan first.",
|
|
26
|
+
}, null, 2);
|
|
27
|
+
}
|
|
28
|
+
return JSON.stringify(spec, null, 2);
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../src/mcp/tools/spec.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,EAAE;AACF,oCAAoC;AACpC,yDAAyD;AAEzD,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,wEAAwE;AAExE,MAAM,UAAU,gBAAgB;IAC9B,YAAY,CAAC;QACX,IAAI,EAAE,YAAY;QAClB,WAAW,EACT,mCAAmC;YACnC,mFAAmF;YACnF,kDAAkD;QACpD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;YACd,oBAAoB,EAAE,KAAK;SAC5B;QACD,OAAO,EAAE,KAAK,EAAE,KAA8B,EAAmB,EAAE;YACjE,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC;YAE1B,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,WAAW,CAAC,CAAC;YAC/C,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;gBAClB,OAAO,IAAI,CAAC,SAAS,CACnB;oBACE,KAAK,EAAE,uCAAuC;iBAC/C,EACD,IAAI,EACJ,CAAC,CACF,CAAC;YACJ,CAAC;YAED,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACvC,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sprint.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/sprint.ts"],"names":[],"mappings":"AAgEA,wBAAgB,kBAAkB,IAAI,IAAI,CAwPzC"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
// ── bober_sprint tool ────────────────────────────────────────────────
|
|
2
|
+
//
|
|
3
|
+
// Executes the next pending sprint cycle (generate + evaluate).
|
|
4
|
+
// Accepts { continue?: boolean }. Returns a JSON summary of the result.
|
|
5
|
+
import { cwd } from "node:process";
|
|
6
|
+
import { McpError, ErrorCode } from "@modelcontextprotocol/sdk/types.js";
|
|
7
|
+
import { configExists, loadConfig } from "../../config/loader.js";
|
|
8
|
+
import { updateContractStatus } from "../../contracts/sprint-contract.js";
|
|
9
|
+
import { createHandoff, summarizeOlderSprints, } from "../../orchestrator/context-handoff.js";
|
|
10
|
+
import { runGenerator } from "../../orchestrator/generator-agent.js";
|
|
11
|
+
import { runEvaluatorAgent } from "../../orchestrator/evaluator-agent.js";
|
|
12
|
+
import { ensureBoberDir, listContracts, updateContract, loadLatestSpec, appendHistory, } from "../../state/index.js";
|
|
13
|
+
import { getCurrentBranch, getChangedFiles, commitAll } from "../../utils/git.js";
|
|
14
|
+
import { registerTool } from "./registry.js";
|
|
15
|
+
// ── Helpers ──────────────────────────────────────────────────────────
|
|
16
|
+
const PENDING_STATUSES = new Set([
|
|
17
|
+
"proposed",
|
|
18
|
+
"negotiating",
|
|
19
|
+
"agreed",
|
|
20
|
+
"needs-rework",
|
|
21
|
+
]);
|
|
22
|
+
function findNextPendingSprint(contracts) {
|
|
23
|
+
return contracts.find((c) => PENDING_STATUSES.has(c.status)) ?? null;
|
|
24
|
+
}
|
|
25
|
+
async function buildProjectContext(projectRoot, config) {
|
|
26
|
+
let currentBranch;
|
|
27
|
+
try {
|
|
28
|
+
currentBranch = await getCurrentBranch(projectRoot);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
currentBranch = "unknown";
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
name: config.project.name,
|
|
35
|
+
type: config.project.mode,
|
|
36
|
+
techStack: [],
|
|
37
|
+
entryPoints: [],
|
|
38
|
+
currentBranch,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// ── Registration ─────────────────────────────────────────────────────
|
|
42
|
+
export function registerSprintTool() {
|
|
43
|
+
registerTool({
|
|
44
|
+
name: "bober_sprint",
|
|
45
|
+
description: "Execute the next pending sprint in the Bober pipeline (generate + evaluate). " +
|
|
46
|
+
"Finds the first contract in 'proposed' or 'needs-rework' status, runs the " +
|
|
47
|
+
"generate-evaluate-iterate cycle, and returns a JSON result with pass/fail status " +
|
|
48
|
+
"and evaluator feedback. Requires a plan to exist (run bober_plan first).",
|
|
49
|
+
inputSchema: {
|
|
50
|
+
type: "object",
|
|
51
|
+
properties: {
|
|
52
|
+
continue: {
|
|
53
|
+
type: "boolean",
|
|
54
|
+
description: "If true, keep running sprints until all are complete or one fails.",
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
additionalProperties: false,
|
|
59
|
+
},
|
|
60
|
+
handler: async (args) => {
|
|
61
|
+
const shouldContinue = Boolean(args.continue ?? false);
|
|
62
|
+
const projectRoot = cwd();
|
|
63
|
+
const hasConfig = await configExists(projectRoot);
|
|
64
|
+
if (!hasConfig) {
|
|
65
|
+
throw new McpError(ErrorCode.InvalidRequest, "No bober.config.json found. Run bober_init first.");
|
|
66
|
+
}
|
|
67
|
+
let config;
|
|
68
|
+
try {
|
|
69
|
+
config = await loadConfig(projectRoot);
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
return JSON.stringify({
|
|
73
|
+
error: `Failed to load config: ${err instanceof Error ? err.message : String(err)}`,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
await ensureBoberDir(projectRoot);
|
|
77
|
+
const spec = await loadLatestSpec(projectRoot);
|
|
78
|
+
if (!spec) {
|
|
79
|
+
return JSON.stringify({
|
|
80
|
+
error: "No plan found. Run bober_plan first to generate a plan.",
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
const contracts = await listContracts(projectRoot);
|
|
84
|
+
if (contracts.length === 0) {
|
|
85
|
+
return JSON.stringify({
|
|
86
|
+
error: "No sprint contracts found. Run bober_plan first.",
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
const projectContext = await buildProjectContext(projectRoot, config);
|
|
90
|
+
const results = [];
|
|
91
|
+
let continueLoop = true;
|
|
92
|
+
while (continueLoop) {
|
|
93
|
+
const nextSprint = findNextPendingSprint(contracts);
|
|
94
|
+
if (!nextSprint) {
|
|
95
|
+
if (results.length === 0) {
|
|
96
|
+
return JSON.stringify({
|
|
97
|
+
status: "all-complete",
|
|
98
|
+
message: "All sprints are already completed.",
|
|
99
|
+
contracts: contracts.map((c) => ({
|
|
100
|
+
id: c.id,
|
|
101
|
+
feature: c.feature,
|
|
102
|
+
status: c.status,
|
|
103
|
+
})),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
process.stderr.write(`[bober_sprint] Starting sprint: ${nextSprint.feature} (${nextSprint.id})\n`);
|
|
109
|
+
const completedContracts = contracts.filter((c) => c.status === "passed");
|
|
110
|
+
const maxIterations = config.evaluator.maxIterations;
|
|
111
|
+
let currentContract = updateContractStatus(nextSprint, "in-progress");
|
|
112
|
+
await updateContract(projectRoot, currentContract);
|
|
113
|
+
const contractIndex = contracts.findIndex((c) => c.id === currentContract.id);
|
|
114
|
+
if (contractIndex !== -1) {
|
|
115
|
+
contracts[contractIndex] = currentContract;
|
|
116
|
+
}
|
|
117
|
+
let sprintPassed = false;
|
|
118
|
+
let lastEvalSummary;
|
|
119
|
+
let lastEvalScore;
|
|
120
|
+
for (let iteration = 1; iteration <= maxIterations; iteration++) {
|
|
121
|
+
process.stderr.write(`[bober_sprint] Iteration ${iteration}/${maxIterations} for ${currentContract.id}\n`);
|
|
122
|
+
const handoff = createHandoff({
|
|
123
|
+
from: iteration === 1 ? "planner" : "evaluator",
|
|
124
|
+
to: "generator",
|
|
125
|
+
projectContext,
|
|
126
|
+
spec,
|
|
127
|
+
currentContract,
|
|
128
|
+
sprintHistory: completedContracts,
|
|
129
|
+
instructions: `Implement sprint: ${currentContract.feature}\n\n${currentContract.description}`,
|
|
130
|
+
issues: currentContract.evaluatorFeedback
|
|
131
|
+
? [currentContract.evaluatorFeedback]
|
|
132
|
+
: [],
|
|
133
|
+
});
|
|
134
|
+
const compactedHandoff = summarizeOlderSprints(handoff, 3);
|
|
135
|
+
// Generate
|
|
136
|
+
await appendHistory(projectRoot, {
|
|
137
|
+
timestamp: new Date().toISOString(),
|
|
138
|
+
event: "generator-start",
|
|
139
|
+
phase: "generating",
|
|
140
|
+
sprintId: currentContract.id,
|
|
141
|
+
details: { iteration },
|
|
142
|
+
});
|
|
143
|
+
const generatorResult = await runGenerator(compactedHandoff, projectRoot, config);
|
|
144
|
+
if (!generatorResult.success) {
|
|
145
|
+
process.stderr.write(`[bober_sprint] Generator failed: ${generatorResult.notes}\n`);
|
|
146
|
+
currentContract = {
|
|
147
|
+
...currentContract,
|
|
148
|
+
generatorNotes: generatorResult.notes,
|
|
149
|
+
};
|
|
150
|
+
await updateContract(projectRoot, currentContract);
|
|
151
|
+
if (iteration < maxIterations) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
currentContract = updateContractStatus(currentContract, "needs-rework");
|
|
155
|
+
await updateContract(projectRoot, currentContract);
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
// Auto-commit
|
|
159
|
+
if (config.generator.autoCommit) {
|
|
160
|
+
try {
|
|
161
|
+
const hash = await commitAll(projectRoot, `bober: ${currentContract.feature} (round ${iteration})`);
|
|
162
|
+
process.stderr.write(`[bober_sprint] Committed: ${hash}\n`);
|
|
163
|
+
}
|
|
164
|
+
catch (err) {
|
|
165
|
+
process.stderr.write(`[bober_sprint] Auto-commit skipped: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// Evaluate
|
|
169
|
+
currentContract = updateContractStatus(currentContract, "evaluating");
|
|
170
|
+
await updateContract(projectRoot, currentContract);
|
|
171
|
+
let changedFiles;
|
|
172
|
+
try {
|
|
173
|
+
changedFiles = await getChangedFiles(projectRoot);
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
changedFiles = generatorResult.filesChanged;
|
|
177
|
+
}
|
|
178
|
+
const evalHandoff = createHandoff({
|
|
179
|
+
from: "generator",
|
|
180
|
+
to: "evaluator",
|
|
181
|
+
projectContext,
|
|
182
|
+
spec,
|
|
183
|
+
currentContract,
|
|
184
|
+
sprintHistory: completedContracts,
|
|
185
|
+
instructions: `Evaluate sprint: ${currentContract.feature}`,
|
|
186
|
+
changedFiles,
|
|
187
|
+
});
|
|
188
|
+
const evaluation = await runEvaluatorAgent(evalHandoff, projectRoot, config);
|
|
189
|
+
lastEvalSummary = evaluation.summary;
|
|
190
|
+
lastEvalScore = evaluation.score;
|
|
191
|
+
if (evaluation.passed) {
|
|
192
|
+
currentContract = updateContractStatus(currentContract, "passed");
|
|
193
|
+
currentContract = {
|
|
194
|
+
...currentContract,
|
|
195
|
+
evaluatorFeedback: evaluation.summary,
|
|
196
|
+
};
|
|
197
|
+
await updateContract(projectRoot, currentContract);
|
|
198
|
+
sprintPassed = true;
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
// Failed
|
|
202
|
+
currentContract = {
|
|
203
|
+
...currentContract,
|
|
204
|
+
evaluatorFeedback: evaluation.summary,
|
|
205
|
+
};
|
|
206
|
+
await updateContract(projectRoot, currentContract);
|
|
207
|
+
if (iteration >= maxIterations) {
|
|
208
|
+
currentContract = updateContractStatus(currentContract, "needs-rework");
|
|
209
|
+
await updateContract(projectRoot, currentContract);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
// Update local array
|
|
213
|
+
if (contractIndex !== -1) {
|
|
214
|
+
contracts[contractIndex] = currentContract;
|
|
215
|
+
}
|
|
216
|
+
results.push({
|
|
217
|
+
contractId: currentContract.id,
|
|
218
|
+
feature: currentContract.feature,
|
|
219
|
+
status: currentContract.status,
|
|
220
|
+
passed: sprintPassed,
|
|
221
|
+
score: lastEvalScore,
|
|
222
|
+
iteration: maxIterations,
|
|
223
|
+
evaluatorFeedback: lastEvalSummary ?? currentContract.evaluatorFeedback ?? null,
|
|
224
|
+
});
|
|
225
|
+
if (!shouldContinue) {
|
|
226
|
+
continueLoop = false;
|
|
227
|
+
}
|
|
228
|
+
else if (!sprintPassed && config.sprint.requireContracts) {
|
|
229
|
+
continueLoop = false;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
// Return single result if only one sprint ran, otherwise array
|
|
233
|
+
if (results.length === 1) {
|
|
234
|
+
return JSON.stringify(results[0], null, 2);
|
|
235
|
+
}
|
|
236
|
+
return JSON.stringify({
|
|
237
|
+
sprintsRun: results.length,
|
|
238
|
+
results,
|
|
239
|
+
}, null, 2);
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
//# sourceMappingURL=sprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sprint.js","sourceRoot":"","sources":["../../../src/mcp/tools/sprint.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,EAAE;AACF,gEAAgE;AAChE,wEAAwE;AAExE,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,EACJ,CAAC,CACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/status.ts"],"names":[],"mappings":"AAgBA,wBAAgB,kBAAkB,IAAI,IAAI,CAmFzC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// ── bober_status tool ────────────────────────────────────────────────
|
|
2
|
+
//
|
|
3
|
+
// Returns the current pipeline run state.
|
|
4
|
+
// - If a run is active: {runId, status: 'running', progress}
|
|
5
|
+
// - If a run completed/failed: {runId, status: 'completed'|'failed', result}
|
|
6
|
+
// - If no run ever started: {status: 'idle', progress: <progress.md content>}
|
|
7
|
+
import { readFile } from "node:fs/promises";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
import { cwd } from "node:process";
|
|
10
|
+
import { registerTool } from "./registry.js";
|
|
11
|
+
import { runManager } from "../run-manager.js";
|
|
12
|
+
// ── Registration ─────────────────────────────────────────────────────
|
|
13
|
+
export function registerStatusTool() {
|
|
14
|
+
registerTool({
|
|
15
|
+
name: "bober_status",
|
|
16
|
+
description: "Check the status of the running or most recent Bober pipeline. " +
|
|
17
|
+
"Returns progress when active, or the final result when complete. " +
|
|
18
|
+
"When idle, returns the contents of .bober/progress.md.",
|
|
19
|
+
inputSchema: {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {},
|
|
22
|
+
additionalProperties: false,
|
|
23
|
+
},
|
|
24
|
+
handler: async (_args) => {
|
|
25
|
+
const state = runManager.getStatus();
|
|
26
|
+
// No run has ever been started
|
|
27
|
+
if (state === null) {
|
|
28
|
+
const projectRoot = cwd();
|
|
29
|
+
const progressPath = join(projectRoot, ".bober", "progress.md");
|
|
30
|
+
let progressContent;
|
|
31
|
+
try {
|
|
32
|
+
progressContent = await readFile(progressPath, "utf-8");
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
progressContent = "No progress information available yet. Run bober_run to start a pipeline.";
|
|
36
|
+
}
|
|
37
|
+
return JSON.stringify({
|
|
38
|
+
status: "idle",
|
|
39
|
+
progress: progressContent,
|
|
40
|
+
}, null, 2);
|
|
41
|
+
}
|
|
42
|
+
// Active run
|
|
43
|
+
if (state.status === "running") {
|
|
44
|
+
return JSON.stringify({
|
|
45
|
+
runId: state.runId,
|
|
46
|
+
status: state.status,
|
|
47
|
+
task: state.task,
|
|
48
|
+
startedAt: state.startedAt,
|
|
49
|
+
progress: state.progress,
|
|
50
|
+
}, null, 2);
|
|
51
|
+
}
|
|
52
|
+
// Completed run
|
|
53
|
+
if (state.status === "completed") {
|
|
54
|
+
return JSON.stringify({
|
|
55
|
+
runId: state.runId,
|
|
56
|
+
status: state.status,
|
|
57
|
+
task: state.task,
|
|
58
|
+
startedAt: state.startedAt,
|
|
59
|
+
completedAt: state.completedAt,
|
|
60
|
+
result: state.result,
|
|
61
|
+
}, null, 2);
|
|
62
|
+
}
|
|
63
|
+
// Failed run
|
|
64
|
+
return JSON.stringify({
|
|
65
|
+
runId: state.runId,
|
|
66
|
+
status: state.status,
|
|
67
|
+
task: state.task,
|
|
68
|
+
startedAt: state.startedAt,
|
|
69
|
+
completedAt: state.completedAt,
|
|
70
|
+
error: state.error,
|
|
71
|
+
result: state.result,
|
|
72
|
+
}, null, 2);
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/mcp/tools/status.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,EAAE;AACF,0CAA0C;AAC1C,6DAA6D;AAC7D,6EAA6E;AAC7E,8EAA8E;AAE9E,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAA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AQ,EAAE,KAAK,CAAC,QAAQ;iBACzB,EACD,IAAI,EACJ,CAAC,CACF,CAAC;YACJ,CAAC;YAED,gBAAgB;YAChB,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;gBACjC,OAAO,IAAI,CAAC,SAAS,CACnB;oBACE,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;oBAChB,SAAS,EAAE,KAAK,CAAC,SAAS;oBAC1B,WAAW,EAAE,KAAK,CAAC,WAAW;oBAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;iBACrB,EACD,IAAI,EACJ,CAAC,CACF,CAAC;YACJ,CAAC;YAED,aAAa;YACb,OAAO,IAAI,CAAC,SAAS,CACnB;gBACE,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,MAAM,EAAE,KAAK,CAAC,MAAM;aACrB,EACD,IAAI,EACJ,CAAC,CACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { LLMClient, ToolDef } from "../providers/types.js";
|
|
2
2
|
import type { ToolHandler } from "./tools/index.js";
|
|
3
|
-
type Tool = Anthropic.Messages.Tool;
|
|
4
3
|
export interface AgenticLoopParams {
|
|
5
|
-
/**
|
|
6
|
-
client:
|
|
4
|
+
/** Provider-agnostic LLM client. */
|
|
5
|
+
client: LLMClient;
|
|
7
6
|
/** Model ID (resolved via model-resolver). */
|
|
8
7
|
model: string;
|
|
9
8
|
/** System prompt (loaded from agent .md file). */
|
|
@@ -11,7 +10,7 @@ export interface AgenticLoopParams {
|
|
|
11
10
|
/** Initial user message (task description, handoff, etc.). */
|
|
12
11
|
userMessage: string;
|
|
13
12
|
/** Tool schemas to pass to the API. */
|
|
14
|
-
tools:
|
|
13
|
+
tools: ToolDef[];
|
|
15
14
|
/** Handler functions for each tool, keyed by name. */
|
|
16
15
|
toolHandlers: Map<string, ToolHandler>;
|
|
17
16
|
/** Max tool-use round trips before stopping. */
|
|
@@ -46,8 +45,10 @@ export interface AgenticLoopResult {
|
|
|
46
45
|
* This continues until the model stops requesting tools or maxTurns
|
|
47
46
|
* is exceeded.
|
|
48
47
|
*
|
|
48
|
+
* Uses provider-agnostic types throughout. The LLMClient implementation
|
|
49
|
+
* handles all conversion to/from provider-specific formats.
|
|
50
|
+
*
|
|
49
51
|
* @returns The final text response and metadata about the conversation.
|
|
50
52
|
*/
|
|
51
53
|
export declare function runAgenticLoop(params: AgenticLoopParams): Promise<AgenticLoopResult>;
|
|
52
|
-
export {};
|
|
53
54
|
//# sourceMappingURL=agentic-loop.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentic-loop.d.ts","sourceRoot":"","sources":["../../src/orchestrator/agentic-loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"agentic-loop.d.ts","sourceRoot":"","sources":["../../src/orchestrator/agentic-loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAA4D,MAAM,uBAAuB,CAAC;AAE1H,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAKpD,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,MAAM,EAAE,SAAS,CAAC;IAClB,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,uCA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