developing-agent-forge 1.0.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/LICENSE +21 -0
- package/README.md +169 -0
- package/README.zh-CN.md +169 -0
- package/developing-forge.yaml +61 -0
- package/dist/agents/developer.d.ts +9 -0
- package/dist/agents/developer.d.ts.map +1 -0
- package/dist/agents/developer.js +29 -0
- package/dist/agents/developer.js.map +1 -0
- package/dist/agents/factory.d.ts +3 -0
- package/dist/agents/factory.d.ts.map +1 -0
- package/dist/agents/factory.js +11 -0
- package/dist/agents/factory.js.map +1 -0
- package/dist/agents/index.d.ts +7 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +7 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/manager.d.ts +19 -0
- package/dist/agents/manager.d.ts.map +1 -0
- package/dist/agents/manager.js +45 -0
- package/dist/agents/manager.js.map +1 -0
- package/dist/agents/prompts.d.ts +3 -0
- package/dist/agents/prompts.d.ts.map +1 -0
- package/dist/agents/prompts.js +12 -0
- package/dist/agents/prompts.js.map +1 -0
- package/dist/agents/reviewer.d.ts +10 -0
- package/dist/agents/reviewer.d.ts.map +1 -0
- package/dist/agents/reviewer.js +30 -0
- package/dist/agents/reviewer.js.map +1 -0
- package/dist/agents/trajectory-optimizer.d.ts +19 -0
- package/dist/agents/trajectory-optimizer.d.ts.map +1 -0
- package/dist/agents/trajectory-optimizer.js +47 -0
- package/dist/agents/trajectory-optimizer.js.map +1 -0
- package/dist/agents/types.d.ts +16 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +21 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +12 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/pipeline/development.d.ts +14 -0
- package/dist/pipeline/development.d.ts.map +1 -0
- package/dist/pipeline/development.js +55 -0
- package/dist/pipeline/development.js.map +1 -0
- package/dist/pipeline/index.d.ts +5 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +5 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/pipeline.d.ts +78 -0
- package/dist/pipeline/pipeline.d.ts.map +1 -0
- package/dist/pipeline/pipeline.js +84 -0
- package/dist/pipeline/pipeline.js.map +1 -0
- package/dist/pipeline/pipelineskill.d.ts +81 -0
- package/dist/pipeline/pipelineskill.d.ts.map +1 -0
- package/dist/pipeline/pipelineskill.js +60 -0
- package/dist/pipeline/pipelineskill.js.map +1 -0
- package/dist/pipeline/revision.d.ts +10 -0
- package/dist/pipeline/revision.d.ts.map +1 -0
- package/dist/pipeline/revision.js +52 -0
- package/dist/pipeline/revision.js.map +1 -0
- package/metaskills/coding-style/METASKILL.md +214 -0
- package/package.json +62 -0
- package/skills/coding-style/SKILL.md +802 -0
- package/skills/coding-style/agents/openai.yaml +4 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DevelopingAgent, type DevelopingAgentVariables } from "./types.js";
|
|
2
|
+
export type CodeReviewerVariables = DevelopingAgentVariables & {
|
|
3
|
+
acceptMark: string;
|
|
4
|
+
currentTask: string;
|
|
5
|
+
developerReport: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class CodeReviewerAgent extends DevelopingAgent<CodeReviewerVariables> {
|
|
8
|
+
protected buildPrompt(variables: Readonly<CodeReviewerVariables>): string;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=reviewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewer.d.ts","sourceRoot":"","sources":["../../src/agents/reviewer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,KAAK,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE5E,MAAM,MAAM,qBAAqB,GAAG,wBAAwB,GAAG;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,qBAAa,iBAAkB,SAAQ,eAAe,CAAC,qBAAqB,CAAC;IAC3E,SAAS,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,qBAAqB,CAAC,GAAG,MAAM;CA4B1E"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { codingStyleSkillInstruction, goalInstruction } from "./prompts.js";
|
|
2
|
+
import { DevelopingAgent } from "./types.js";
|
|
3
|
+
export class CodeReviewerAgent extends DevelopingAgent {
|
|
4
|
+
buildPrompt(variables) {
|
|
5
|
+
const codingStyleSkillPath = this.workspaceRelativePath(variables.codingStyleSkillPath);
|
|
6
|
+
const targetPath = this.workspaceRelativePath(variables.targetPath);
|
|
7
|
+
const codingStyleSkillInstructionText = codingStyleSkillInstruction(codingStyleSkillPath);
|
|
8
|
+
const goalInstructionText = goalInstruction(variables.goal);
|
|
9
|
+
return (codingStyleSkillInstructionText +
|
|
10
|
+
`
|
|
11
|
+
|
|
12
|
+
Work in the target repository at ${targetPath}/.
|
|
13
|
+
Review the current developer task result. Read only.
|
|
14
|
+
|
|
15
|
+
${goalInstructionText}
|
|
16
|
+
|
|
17
|
+
Current developer task:
|
|
18
|
+
${variables.currentTask}
|
|
19
|
+
|
|
20
|
+
Developer report:
|
|
21
|
+
${variables.developerReport}
|
|
22
|
+
|
|
23
|
+
If the code for the current task is complete and needs no more changes, output exactly:
|
|
24
|
+
${variables.acceptMark}
|
|
25
|
+
|
|
26
|
+
Otherwise output the revision feedback for the Developer.
|
|
27
|
+
`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=reviewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewer.js","sourceRoot":"","sources":["../../src/agents/reviewer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAiC,MAAM,YAAY,CAAC;AAQ5E,MAAM,OAAO,iBAAkB,SAAQ,eAAsC;IACjE,WAAW,CAAC,SAA0C;QAC9D,MAAM,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;QACxF,MAAM,UAAU,GAAG,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACpE,MAAM,+BAA+B,GAAG,2BAA2B,CAAC,oBAAoB,CAAC,CAAC;QAC1F,MAAM,mBAAmB,GAAG,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAE5D,OAAO,CACL,+BAA+B;YAC/B;;mCAE6B,UAAU;;;EAG3C,mBAAmB;;;EAGnB,SAAS,CAAC,WAAW;;;EAGrB,SAAS,CAAC,eAAe;;;EAGzB,SAAS,CAAC,UAAU;;;CAGrB,CACI,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Agent } from "coding-agent-forge/agent";
|
|
2
|
+
import type { DevelopingAgentVariables } from "./types.js";
|
|
3
|
+
type ScanTrajectoryOptimizerVariables = DevelopingAgentVariables & {
|
|
4
|
+
phase: "scan";
|
|
5
|
+
currentTask: string;
|
|
6
|
+
};
|
|
7
|
+
type OptimizeTrajectoryOptimizerVariables = DevelopingAgentVariables & {
|
|
8
|
+
phase: "optimize";
|
|
9
|
+
currentTask: string;
|
|
10
|
+
revisionReport: string;
|
|
11
|
+
todoUpdateReport: string;
|
|
12
|
+
metaskillPath: string;
|
|
13
|
+
};
|
|
14
|
+
export type TrajectoryOptimizerVariables = ScanTrajectoryOptimizerVariables | OptimizeTrajectoryOptimizerVariables;
|
|
15
|
+
export declare class TrajectoryOptimizerAgent extends Agent<TrajectoryOptimizerVariables> {
|
|
16
|
+
protected buildPrompt(variables: Readonly<TrajectoryOptimizerVariables>): string;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=trajectory-optimizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trajectory-optimizer.d.ts","sourceRoot":"","sources":["../../src/agents/trajectory-optimizer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAGjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D,KAAK,gCAAgC,GAAG,wBAAwB,GAAG;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,oCAAoC,GAAG,wBAAwB,GAAG;IACrE,KAAK,EAAE,UAAU,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GACpC,gCAAgC,GAChC,oCAAoC,CAAC;AAEzC,qBAAa,wBAAyB,SAAQ,KAAK,CAAC,4BAA4B,CAAC;IAC/E,SAAS,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,4BAA4B,CAAC,GAAG,MAAM;CA2CjF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Agent } from "coding-agent-forge/agent";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { goalInstruction } from "./prompts.js";
|
|
4
|
+
export class TrajectoryOptimizerAgent extends Agent {
|
|
5
|
+
buildPrompt(variables) {
|
|
6
|
+
const goalInstructionText = goalInstruction(variables.goal);
|
|
7
|
+
if (variables.phase === "scan") {
|
|
8
|
+
return `
|
|
9
|
+
Work in the target repository at ${variables.targetPath}/.
|
|
10
|
+
Scan the target repository at ${variables.targetPath}/ and the skill at ${variables.codingStyleSkillPath} before the Developer starts the current task. Read only.
|
|
11
|
+
|
|
12
|
+
${goalInstructionText}
|
|
13
|
+
|
|
14
|
+
Current developer task:
|
|
15
|
+
${variables.currentTask}
|
|
16
|
+
|
|
17
|
+
Output a concise baseline of the repository state relevant to this task and the main guidance the skill should provide.
|
|
18
|
+
`;
|
|
19
|
+
}
|
|
20
|
+
const metaskill = readFileSync(variables.metaskillPath, "utf8");
|
|
21
|
+
return `
|
|
22
|
+
Revise the skill at ${variables.codingStyleSkillPath} so it produces better development trajectories.
|
|
23
|
+
|
|
24
|
+
The metaskill below contains the design goals and tips of this skill:
|
|
25
|
+
|
|
26
|
+
${metaskill}
|
|
27
|
+
|
|
28
|
+
Read:
|
|
29
|
+
- target repository: ${variables.targetPath}
|
|
30
|
+
${goalInstructionText}
|
|
31
|
+
|
|
32
|
+
Current developer task:
|
|
33
|
+
${variables.currentTask}
|
|
34
|
+
|
|
35
|
+
Revision report:
|
|
36
|
+
${variables.revisionReport}
|
|
37
|
+
|
|
38
|
+
TODO update report:
|
|
39
|
+
${variables.todoUpdateReport}
|
|
40
|
+
|
|
41
|
+
Evaluate whether the skill produced a good modification trajectory, then edit the skill directly. Focus on missing, misleading, or redundant guidance that affected task selection, coding, review, or TODO update.
|
|
42
|
+
|
|
43
|
+
Output a concise optimizer report with the main skill changes.
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=trajectory-optimizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trajectory-optimizer.js","sourceRoot":"","sources":["../../src/agents/trajectory-optimizer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAoB/C,MAAM,OAAO,wBAAyB,SAAQ,KAAmC;IACrE,WAAW,CAAC,SAAiD;QACrE,MAAM,mBAAmB,GAAG,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAE5D,IAAI,SAAS,CAAC,KAAK,KAAK,MAAM,EAAE,CAAC;YAC/B,OAAO;mCACsB,SAAS,CAAC,UAAU;gCACvB,SAAS,CAAC,UAAU,sBAAsB,SAAS,CAAC,oBAAoB;;EAEtG,mBAAmB;;;EAGnB,SAAS,CAAC,WAAW;;;CAGtB,CAAC;QACE,CAAC;QAED,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QAChE,OAAO;sBACW,SAAS,CAAC,oBAAoB;;;;EAIlD,SAAS;;;uBAGY,SAAS,CAAC,UAAU;EACzC,mBAAmB;;;EAGnB,SAAS,CAAC,WAAW;;;EAGrB,SAAS,CAAC,cAAc;;;EAGxB,SAAS,CAAC,gBAAgB;;;;;CAK3B,CAAC;IACA,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PromptConstants, Thread } from "coding-agent-forge";
|
|
2
|
+
import { Agent } from "coding-agent-forge/agent";
|
|
3
|
+
export type DevelopingAgentVariables = {
|
|
4
|
+
targetPath: string;
|
|
5
|
+
codingStyleSkillPath: string;
|
|
6
|
+
goal: string;
|
|
7
|
+
};
|
|
8
|
+
export type DevelopingAgentConstants = {
|
|
9
|
+
workspacePath: string;
|
|
10
|
+
};
|
|
11
|
+
export declare abstract class DevelopingAgent<Variables extends DevelopingAgentVariables> extends Agent<Variables, DevelopingAgentConstants> {
|
|
12
|
+
protected readonly workspacePath: string;
|
|
13
|
+
constructor(thread: Thread, constants: Readonly<PromptConstants>);
|
|
14
|
+
protected workspaceRelativePath(filePath: string): string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agents/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAIjD,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,8BAAsB,eAAe,CAAC,SAAS,SAAS,wBAAwB,CAAE,SAAQ,KAAK,CAC7F,SAAS,EACT,wBAAwB,CACzB;IACC,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;gBAE7B,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,eAAe,CAAC;IAahE,SAAS,CAAC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;CAG1D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Agent } from "coding-agent-forge/agent";
|
|
2
|
+
import { statSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
export class DevelopingAgent extends Agent {
|
|
5
|
+
workspacePath;
|
|
6
|
+
constructor(thread, constants) {
|
|
7
|
+
if (!constants.workspacePath) {
|
|
8
|
+
throw new Error("Developing agent constants.workspacePath must be configured.");
|
|
9
|
+
}
|
|
10
|
+
const workspacePath = path.resolve(constants.workspacePath);
|
|
11
|
+
if (!statSync(workspacePath).isDirectory()) {
|
|
12
|
+
throw new Error(`workspacePath must be a directory: ${workspacePath}`);
|
|
13
|
+
}
|
|
14
|
+
super(thread, { workspacePath });
|
|
15
|
+
this.workspacePath = workspacePath;
|
|
16
|
+
}
|
|
17
|
+
workspaceRelativePath(filePath) {
|
|
18
|
+
return path.relative(this.workspacePath, path.resolve(filePath)) || ".";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/agents/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,IAAI,MAAM,WAAW,CAAC;AAY7B,MAAM,OAAgB,eAA4D,SAAQ,KAGzF;IACoB,aAAa,CAAS;IAEzC,YAAY,MAAc,EAAE,SAAoC;QAC9D,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;QAClF,CAAC;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QAC5D,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,sCAAsC,aAAa,EAAE,CAAC,CAAC;QACzE,CAAC;QACD,KAAK,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAES,qBAAqB,CAAC,QAAgB;QAC9C,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,GAAG,CAAC;IAC1E,CAAC;CACF"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import { runPipelinesCli } from "coding-agent-forge";
|
|
4
|
+
import { developingPipeline, developingSkillPipeline } from "./pipeline/index.js";
|
|
5
|
+
function isDirectCli() {
|
|
6
|
+
const entry = process.argv[1];
|
|
7
|
+
return entry !== undefined && import.meta.url === pathToFileURL(entry).href;
|
|
8
|
+
}
|
|
9
|
+
if (isDirectCli()) {
|
|
10
|
+
await runPipelinesCli([developingPipeline, developingSkillPipeline], process.argv.slice(2));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAElF,SAAS,WAAW;IAClB,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9B,OAAO,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;AAC9E,CAAC;AAED,IAAI,WAAW,EAAE,EAAE,CAAC;IAClB,MAAM,eAAe,CAAC,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9F,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Development, Revision, developing, developingArgsOptions, developingPipeline, developingSkill, developingSkillArgsOptions, developingSkillPipeline, } from "./pipeline/index.js";
|
|
2
|
+
export type { DevelopmentAgentVariablesByName, DevelopmentCallbacks, DevelopingOptions, DevelopingSkillAgentVariables, DevelopingSkillOptions, RevisionAgentVariablesByName, } from "./pipeline/index.js";
|
|
3
|
+
export { CodeReviewerAgent, CodingManagerAgent, DeveloperAgent, DevelopingAgent, TrajectoryOptimizerAgent, agentFactories, } from "./agents/index.js";
|
|
4
|
+
export type { CodeReviewerVariables, CodingManagerVariables, DeveloperVariables, DevelopingAgentConstants, DevelopingAgentVariables, TrajectoryOptimizerVariables, } from "./agents/index.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,QAAQ,EACR,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,+BAA+B,EAC/B,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,wBAAwB,EACxB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Development, Revision, developing, developingArgsOptions, developingPipeline, developingSkill, developingSkillArgsOptions, developingSkillPipeline, } from "./pipeline/index.js";
|
|
2
|
+
export { CodeReviewerAgent, CodingManagerAgent, DeveloperAgent, DevelopingAgent, TrajectoryOptimizerAgent, agentFactories, } from "./agents/index.js";
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,QAAQ,EACR,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAW7B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,wBAAwB,EACxB,cAAc,GACf,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentTeam, RecordCallback } from "coding-agent-forge";
|
|
2
|
+
import type { CodingManagerVariables, DevelopingAgentVariables } from "../agents/index.js";
|
|
3
|
+
import { type RevisionAgentVariablesByName } from "./revision.js";
|
|
4
|
+
export type DevelopmentAgentVariablesByName = RevisionAgentVariablesByName & {
|
|
5
|
+
"coding-manager": CodingManagerVariables;
|
|
6
|
+
};
|
|
7
|
+
export type DevelopmentCallbacks = {
|
|
8
|
+
onTaskStart?: (agentVariables: DevelopingAgentVariables, currentTask: string) => Promise<void> | void;
|
|
9
|
+
onTaskFinish?: (agentVariables: DevelopingAgentVariables, currentTask: string, revisionReports: readonly string[], todoUpdateReport: string) => Promise<void> | void;
|
|
10
|
+
};
|
|
11
|
+
export declare class Development {
|
|
12
|
+
develop(team: AgentTeam<DevelopmentAgentVariablesByName>, targetPath: string, achiveDir: string, artifactPath: string, codingStyleSkillPath: string, goal: string, maxIterations: number, maxRevisionIterations: number, callbacks?: DevelopmentCallbacks, logRecord?: RecordCallback): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=development.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"development.d.ts","sourceRoot":"","sources":["../../src/pipeline/development.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAY,KAAK,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAE5E,MAAM,MAAM,+BAA+B,GAAG,4BAA4B,GAAG;IAC3E,gBAAgB,EAAE,sBAAsB,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,CAAC,EAAE,CACZ,cAAc,EAAE,wBAAwB,EACxC,WAAW,EAAE,MAAM,KAChB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,CACb,cAAc,EAAE,wBAAwB,EACxC,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,SAAS,MAAM,EAAE,EAClC,gBAAgB,EAAE,MAAM,KACrB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC3B,CAAC;AAIF,qBAAa,WAAW;IAChB,OAAO,CACX,IAAI,EAAE,SAAS,CAAC,+BAA+B,CAAC,EAChD,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,oBAAoB,EAAE,MAAM,EAC5B,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,qBAAqB,EAAE,MAAM,EAC7B,SAAS,CAAC,EAAE,oBAAoB,EAChC,SAAS,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,IAAI,CAAC;CAsFjB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { Revision } from "./revision.js";
|
|
5
|
+
const FINISH_MARK = "FINISHED";
|
|
6
|
+
export class Development {
|
|
7
|
+
async develop(team, targetPath, achiveDir, artifactPath, codingStyleSkillPath, goal, maxIterations, maxRevisionIterations, callbacks, logRecord) {
|
|
8
|
+
const resolvedAchiveDir = path.resolve(achiveDir);
|
|
9
|
+
const resolvedArtifactPath = path.resolve(artifactPath);
|
|
10
|
+
const todoPath = path.join(resolvedArtifactPath, "TODO.md");
|
|
11
|
+
const agentVariables = {
|
|
12
|
+
targetPath: path.resolve(targetPath),
|
|
13
|
+
codingStyleSkillPath: path.resolve(codingStyleSkillPath),
|
|
14
|
+
goal,
|
|
15
|
+
};
|
|
16
|
+
const revision = new Revision();
|
|
17
|
+
await mkdir(resolvedAchiveDir, { recursive: true });
|
|
18
|
+
await mkdir(resolvedArtifactPath, { recursive: true });
|
|
19
|
+
if (!existsSync(todoPath)) {
|
|
20
|
+
await writeFile(todoPath, "# TODO", "utf8");
|
|
21
|
+
}
|
|
22
|
+
await mkdir(agentVariables.targetPath, { recursive: true });
|
|
23
|
+
for (let iteration = 1; iteration <= maxIterations; iteration++) {
|
|
24
|
+
console.log(`\n# Developing iteration ${String(iteration)}\n`);
|
|
25
|
+
const archiveDir = path.join(resolvedAchiveDir, new Date().toISOString().replace(/[:.]/g, "-"));
|
|
26
|
+
await mkdir(archiveDir, { recursive: true });
|
|
27
|
+
const codingManager = await team.createAgent("coding-manager");
|
|
28
|
+
const currentTask = (await codingManager.runStreamed({
|
|
29
|
+
...agentVariables,
|
|
30
|
+
todoPath,
|
|
31
|
+
finishMark: FINISH_MARK,
|
|
32
|
+
phase: "select",
|
|
33
|
+
}, logRecord)).trim();
|
|
34
|
+
await writeFile(path.join(archiveDir, "current_task.md"), currentTask, "utf8");
|
|
35
|
+
if (currentTask.trim() === FINISH_MARK) {
|
|
36
|
+
console.log(`\n# ${FINISH_MARK}\n`);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
await callbacks?.onTaskStart?.(agentVariables, currentTask);
|
|
40
|
+
const revisionReports = await revision.revise(team, agentVariables.targetPath, agentVariables.codingStyleSkillPath, agentVariables.goal, archiveDir, maxRevisionIterations, currentTask, logRecord);
|
|
41
|
+
const todoUpdateReport = (await codingManager.runStreamed({
|
|
42
|
+
...agentVariables,
|
|
43
|
+
todoPath,
|
|
44
|
+
finishMark: FINISH_MARK,
|
|
45
|
+
phase: "update",
|
|
46
|
+
currentTask,
|
|
47
|
+
revisionReport: revisionReports.join("\n\n"),
|
|
48
|
+
}, logRecord)).trim();
|
|
49
|
+
await writeFile(path.join(archiveDir, "todo_update_report.md"), todoUpdateReport, "utf8");
|
|
50
|
+
await callbacks?.onTaskFinish?.(agentVariables, currentTask, revisionReports, todoUpdateReport);
|
|
51
|
+
}
|
|
52
|
+
throw new Error(`Reached --max-iterations ${String(maxIterations)} before the coding-manager returned ${FINISH_MARK}.`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=development.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"development.js","sourceRoot":"","sources":["../../src/pipeline/development.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Development, type DevelopmentAgentVariablesByName, type DevelopmentCallbacks, } from "./development.js";
|
|
2
|
+
export { Revision, type RevisionAgentVariablesByName } from "./revision.js";
|
|
3
|
+
export { developing, developingArgsOptions, developingPipeline, type DevelopingOptions, } from "./pipeline.js";
|
|
4
|
+
export { developingSkill, developingSkillArgsOptions, developingSkillPipeline, type DevelopingSkillAgentVariables, type DevelopingSkillOptions, } from "./pipelineskill.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pipeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,+BAA+B,EACpC,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,KAAK,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,uBAAuB,EACvB,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,GAC5B,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Development, } from "./development.js";
|
|
2
|
+
export { Revision } from "./revision.js";
|
|
3
|
+
export { developing, developingArgsOptions, developingPipeline, } from "./pipeline.js";
|
|
4
|
+
export { developingSkill, developingSkillArgsOptions, developingSkillPipeline, } from "./pipelineskill.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pipeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,GAGZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAqC,MAAM,eAAe,CAAC;AAC5E,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,kBAAkB,GAEnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,uBAAuB,GAGxB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { AgentTeam } from "coding-agent-forge";
|
|
2
|
+
import { type DevelopmentAgentVariablesByName, type DevelopmentCallbacks } from "./development.js";
|
|
3
|
+
export type DevelopingOptions = {
|
|
4
|
+
targetPath: string;
|
|
5
|
+
achiveDir: string;
|
|
6
|
+
artifactPath: string;
|
|
7
|
+
codingStyleSkillPath: string;
|
|
8
|
+
goalPath: string;
|
|
9
|
+
maxIterations: number;
|
|
10
|
+
maxRevisionIterations: number;
|
|
11
|
+
callbacks?: DevelopmentCallbacks;
|
|
12
|
+
};
|
|
13
|
+
export declare function developing(team: AgentTeam<DevelopmentAgentVariablesByName>, options: DevelopingOptions): Promise<void>;
|
|
14
|
+
export declare const developingArgsOptions: {
|
|
15
|
+
readonly "target-path": {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly description: "Target repository folder to create or modify";
|
|
18
|
+
};
|
|
19
|
+
readonly "achive-dir": {
|
|
20
|
+
readonly type: "string";
|
|
21
|
+
readonly description: "Archive folder for per-iteration reports";
|
|
22
|
+
};
|
|
23
|
+
readonly "artifact-path": {
|
|
24
|
+
readonly type: "string";
|
|
25
|
+
readonly description: "Working artifact folder containing TODO.md";
|
|
26
|
+
};
|
|
27
|
+
readonly "coding-style-skill-path": {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly description: "Coding style skill path used by the agents";
|
|
30
|
+
};
|
|
31
|
+
readonly "goal-path": {
|
|
32
|
+
readonly type: "string";
|
|
33
|
+
readonly description: "Goal document path";
|
|
34
|
+
};
|
|
35
|
+
readonly "max-iterations": {
|
|
36
|
+
readonly type: "string";
|
|
37
|
+
readonly default: "10";
|
|
38
|
+
readonly description: "Maximum number of development iterations";
|
|
39
|
+
};
|
|
40
|
+
readonly "max-revision-iterations": {
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
readonly default: "3";
|
|
43
|
+
readonly description: "Maximum review revisions per development iteration";
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare const developingPipeline: import("coding-agent-forge").Pipeline<{
|
|
47
|
+
readonly "target-path": {
|
|
48
|
+
readonly type: "string";
|
|
49
|
+
readonly description: "Target repository folder to create or modify";
|
|
50
|
+
};
|
|
51
|
+
readonly "achive-dir": {
|
|
52
|
+
readonly type: "string";
|
|
53
|
+
readonly description: "Archive folder for per-iteration reports";
|
|
54
|
+
};
|
|
55
|
+
readonly "artifact-path": {
|
|
56
|
+
readonly type: "string";
|
|
57
|
+
readonly description: "Working artifact folder containing TODO.md";
|
|
58
|
+
};
|
|
59
|
+
readonly "coding-style-skill-path": {
|
|
60
|
+
readonly type: "string";
|
|
61
|
+
readonly description: "Coding style skill path used by the agents";
|
|
62
|
+
};
|
|
63
|
+
readonly "goal-path": {
|
|
64
|
+
readonly type: "string";
|
|
65
|
+
readonly description: "Goal document path";
|
|
66
|
+
};
|
|
67
|
+
readonly "max-iterations": {
|
|
68
|
+
readonly type: "string";
|
|
69
|
+
readonly default: "10";
|
|
70
|
+
readonly description: "Maximum number of development iterations";
|
|
71
|
+
};
|
|
72
|
+
readonly "max-revision-iterations": {
|
|
73
|
+
readonly type: "string";
|
|
74
|
+
readonly default: "3";
|
|
75
|
+
readonly description: "Maximum review revisions per development iteration";
|
|
76
|
+
};
|
|
77
|
+
}, DevelopmentAgentVariablesByName>;
|
|
78
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/pipeline/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAKV,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAClC,CAAC;AAEF,wBAAsB,UAAU,CAC9B,IAAI,EAAE,SAAS,CAAC,+BAA+B,CAAC,EAChD,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAmBf;AAUD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BM,CAAC;AAEzC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAgD7B,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { definePipeline, } from "coding-agent-forge";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { agentFactories } from "../agents/index.js";
|
|
5
|
+
import { Development, } from "./development.js";
|
|
6
|
+
export async function developing(team, options) {
|
|
7
|
+
const logRecord = (thread, record) => {
|
|
8
|
+
console.log(thread.recordToPrettyString(record));
|
|
9
|
+
};
|
|
10
|
+
const goal = await readGoal(options.goalPath);
|
|
11
|
+
await new Development().develop(team, options.targetPath, options.achiveDir, options.artifactPath, options.codingStyleSkillPath, goal, options.maxIterations, options.maxRevisionIterations, options.callbacks, logRecord);
|
|
12
|
+
}
|
|
13
|
+
async function readGoal(goalPath) {
|
|
14
|
+
const goal = (await readFile(path.resolve(goalPath), "utf8")).trim();
|
|
15
|
+
if (goal === "") {
|
|
16
|
+
throw new Error(`Goal file must not be empty: ${goalPath}`);
|
|
17
|
+
}
|
|
18
|
+
return goal;
|
|
19
|
+
}
|
|
20
|
+
export const developingArgsOptions = {
|
|
21
|
+
"target-path": {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "Target repository folder to create or modify",
|
|
24
|
+
},
|
|
25
|
+
"achive-dir": {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "Archive folder for per-iteration reports",
|
|
28
|
+
},
|
|
29
|
+
"artifact-path": {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Working artifact folder containing TODO.md",
|
|
32
|
+
},
|
|
33
|
+
"coding-style-skill-path": {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "Coding style skill path used by the agents",
|
|
36
|
+
},
|
|
37
|
+
"goal-path": {
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "Goal document path",
|
|
40
|
+
},
|
|
41
|
+
"max-iterations": {
|
|
42
|
+
type: "string",
|
|
43
|
+
default: "10",
|
|
44
|
+
description: "Maximum number of development iterations",
|
|
45
|
+
},
|
|
46
|
+
"max-revision-iterations": {
|
|
47
|
+
type: "string",
|
|
48
|
+
default: "3",
|
|
49
|
+
description: "Maximum review revisions per development iteration",
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
export const developingPipeline = definePipeline({
|
|
53
|
+
name: "developing",
|
|
54
|
+
description: "Run the code development loop.",
|
|
55
|
+
argsOptions: developingArgsOptions,
|
|
56
|
+
agentFactories,
|
|
57
|
+
async run(team, options) {
|
|
58
|
+
const { "target-path": targetPath, "achive-dir": achiveDir, "artifact-path": artifactPath, "coding-style-skill-path": codingStyleSkillPath, "goal-path": goalPath, "max-iterations": maxIterations, "max-revision-iterations": maxRevisionIterations, callbacks, } = options;
|
|
59
|
+
if (targetPath === undefined ||
|
|
60
|
+
achiveDir === undefined ||
|
|
61
|
+
artifactPath === undefined ||
|
|
62
|
+
codingStyleSkillPath === undefined ||
|
|
63
|
+
goalPath === undefined) {
|
|
64
|
+
throw new Error([
|
|
65
|
+
"--target-path",
|
|
66
|
+
"--achive-dir",
|
|
67
|
+
"--artifact-path",
|
|
68
|
+
"--coding-style-skill-path",
|
|
69
|
+
"--goal-path",
|
|
70
|
+
].join(", ") + " are required");
|
|
71
|
+
}
|
|
72
|
+
await developing(team, {
|
|
73
|
+
targetPath,
|
|
74
|
+
achiveDir,
|
|
75
|
+
artifactPath,
|
|
76
|
+
codingStyleSkillPath,
|
|
77
|
+
goalPath,
|
|
78
|
+
maxIterations: Number(maxIterations),
|
|
79
|
+
maxRevisionIterations: Number(maxRevisionIterations),
|
|
80
|
+
...(callbacks === undefined ? {} : { callbacks }),
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/pipeline/pipeline.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { AgentTeam, type PipelineOptions } from "coding-agent-forge";
|
|
2
|
+
import { type TrajectoryOptimizerVariables } from "../agents/index.js";
|
|
3
|
+
import type { DevelopmentAgentVariablesByName } from "./development.js";
|
|
4
|
+
export type DevelopingSkillAgentVariables = DevelopmentAgentVariablesByName & {
|
|
5
|
+
"trajectory-optimizer": TrajectoryOptimizerVariables;
|
|
6
|
+
};
|
|
7
|
+
export declare const developingSkillArgsOptions: {
|
|
8
|
+
readonly "target-path": {
|
|
9
|
+
readonly type: "string";
|
|
10
|
+
readonly description: "Target repository folder to create or modify";
|
|
11
|
+
};
|
|
12
|
+
readonly "achive-dir": {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "Archive folder for per-iteration reports";
|
|
15
|
+
};
|
|
16
|
+
readonly "artifact-path": {
|
|
17
|
+
readonly type: "string";
|
|
18
|
+
readonly description: "Working artifact folder containing TODO.md";
|
|
19
|
+
};
|
|
20
|
+
readonly "coding-style-skill-path": {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
readonly description: "Coding style skill path used by the agents";
|
|
23
|
+
};
|
|
24
|
+
readonly "goal-path": {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
readonly description: "Goal document path";
|
|
27
|
+
};
|
|
28
|
+
readonly "max-iterations": {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly default: "10";
|
|
31
|
+
readonly description: "Maximum number of development iterations";
|
|
32
|
+
};
|
|
33
|
+
readonly "max-revision-iterations": {
|
|
34
|
+
readonly type: "string";
|
|
35
|
+
readonly default: "3";
|
|
36
|
+
readonly description: "Maximum review revisions per development iteration";
|
|
37
|
+
};
|
|
38
|
+
readonly "metaskill-path": {
|
|
39
|
+
readonly type: "string";
|
|
40
|
+
readonly description: "Metaskill design document used by the trajectory optimizer";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export type DevelopingSkillOptions = PipelineOptions<typeof developingSkillArgsOptions>;
|
|
44
|
+
export declare function developingSkill(team: AgentTeam<DevelopingSkillAgentVariables>, options: DevelopingSkillOptions): Promise<void>;
|
|
45
|
+
export declare const developingSkillPipeline: import("coding-agent-forge").Pipeline<{
|
|
46
|
+
readonly "target-path": {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
readonly description: "Target repository folder to create or modify";
|
|
49
|
+
};
|
|
50
|
+
readonly "achive-dir": {
|
|
51
|
+
readonly type: "string";
|
|
52
|
+
readonly description: "Archive folder for per-iteration reports";
|
|
53
|
+
};
|
|
54
|
+
readonly "artifact-path": {
|
|
55
|
+
readonly type: "string";
|
|
56
|
+
readonly description: "Working artifact folder containing TODO.md";
|
|
57
|
+
};
|
|
58
|
+
readonly "coding-style-skill-path": {
|
|
59
|
+
readonly type: "string";
|
|
60
|
+
readonly description: "Coding style skill path used by the agents";
|
|
61
|
+
};
|
|
62
|
+
readonly "goal-path": {
|
|
63
|
+
readonly type: "string";
|
|
64
|
+
readonly description: "Goal document path";
|
|
65
|
+
};
|
|
66
|
+
readonly "max-iterations": {
|
|
67
|
+
readonly type: "string";
|
|
68
|
+
readonly default: "10";
|
|
69
|
+
readonly description: "Maximum number of development iterations";
|
|
70
|
+
};
|
|
71
|
+
readonly "max-revision-iterations": {
|
|
72
|
+
readonly type: "string";
|
|
73
|
+
readonly default: "3";
|
|
74
|
+
readonly description: "Maximum review revisions per development iteration";
|
|
75
|
+
};
|
|
76
|
+
readonly "metaskill-path": {
|
|
77
|
+
readonly type: "string";
|
|
78
|
+
readonly description: "Metaskill design document used by the trajectory optimizer";
|
|
79
|
+
};
|
|
80
|
+
}, DevelopingSkillAgentVariables>;
|
|
81
|
+
//# sourceMappingURL=pipelineskill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipelineskill.d.ts","sourceRoot":"","sources":["../../src/pipeline/pipelineskill.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAGT,KAAK,eAAe,EAErB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAkB,KAAK,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,KAAK,EAAE,+BAA+B,EAAwB,MAAM,kBAAkB,CAAC;AAG9F,MAAM,MAAM,6BAA6B,GAAG,+BAA+B,GAAG;IAC5E,sBAAsB,EAAE,4BAA4B,CAAC;CACtD,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMC,CAAC;AAEzC,MAAM,MAAM,sBAAsB,GAAG,eAAe,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAExF,wBAAsB,eAAe,CACnC,IAAI,EAAE,SAAS,CAAC,6BAA6B,CAAC,EAC9C,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAqDf;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAWlC,CAAC"}
|