academic-army 0.1.4 → 0.2.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 +4 -4
- package/README.zh-CN.md +4 -4
- package/agent-forge.yaml +30 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/metaskills/academic-army-coding-style/METASKILL.md +38 -5
- package/package.json +3 -6
- package/runs/develop-skill.sh +4 -5
- package/runs/develop.sh +4 -5
- package/skills/academic-army-coding-style/SKILL.md +705 -806
- package/dist/developing/agents/developer.d.ts +0 -9
- package/dist/developing/agents/developer.d.ts.map +0 -1
- package/dist/developing/agents/developer.js +0 -34
- package/dist/developing/agents/developer.js.map +0 -1
- package/dist/developing/agents/factory.d.ts +0 -3
- package/dist/developing/agents/factory.d.ts.map +0 -1
- package/dist/developing/agents/factory.js +0 -9
- package/dist/developing/agents/factory.js.map +0 -1
- package/dist/developing/agents/index.d.ts +0 -6
- package/dist/developing/agents/index.d.ts.map +0 -1
- package/dist/developing/agents/index.js +0 -6
- package/dist/developing/agents/index.js.map +0 -1
- package/dist/developing/agents/manager.d.ts +0 -19
- package/dist/developing/agents/manager.d.ts.map +0 -1
- package/dist/developing/agents/manager.js +0 -56
- package/dist/developing/agents/manager.js.map +0 -1
- package/dist/developing/agents/prompts.d.ts +0 -3
- package/dist/developing/agents/prompts.d.ts.map +0 -1
- package/dist/developing/agents/prompts.js +0 -12
- package/dist/developing/agents/prompts.js.map +0 -1
- package/dist/developing/agents/reviewer.d.ts +0 -10
- package/dist/developing/agents/reviewer.d.ts.map +0 -1
- package/dist/developing/agents/reviewer.js +0 -35
- package/dist/developing/agents/reviewer.js.map +0 -1
- package/dist/developing/agents/trajectory-optimizer.d.ts +0 -19
- package/dist/developing/agents/trajectory-optimizer.d.ts.map +0 -1
- package/dist/developing/agents/trajectory-optimizer.js +0 -51
- package/dist/developing/agents/trajectory-optimizer.js.map +0 -1
- package/dist/developing/agents/types.d.ts +0 -19
- package/dist/developing/agents/types.d.ts.map +0 -1
- package/dist/developing/agents/types.js +0 -21
- package/dist/developing/agents/types.js.map +0 -1
- package/dist/developing/index.d.ts +0 -3
- package/dist/developing/index.d.ts.map +0 -1
- package/dist/developing/index.js +0 -3
- package/dist/developing/index.js.map +0 -1
- package/dist/developing/pipeline.d.ts +0 -116
- package/dist/developing/pipeline.d.ts.map +0 -1
- package/dist/developing/pipeline.js +0 -195
- package/dist/developing/pipeline.js.map +0 -1
- package/dist/developing/pipelineskill.d.ts +0 -106
- package/dist/developing/pipelineskill.d.ts.map +0 -1
- package/dist/developing/pipelineskill.js +0 -63
- package/dist/developing/pipelineskill.js.map +0 -1
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { definePipeline, } from "coding-agent-forge";
|
|
2
|
-
import { existsSync } from "node:fs";
|
|
3
|
-
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { agentFactories, } from "./agents/index.js";
|
|
6
|
-
const FINISH_MARK = "FINISHED";
|
|
7
|
-
const ACCEPT_MARK = "ACCEPT";
|
|
8
|
-
export async function developing(team, options) {
|
|
9
|
-
const logRecord = (thread, record) => {
|
|
10
|
-
console.log(thread.recordToPrettyString(record));
|
|
11
|
-
};
|
|
12
|
-
const achiveDir = path.resolve(options.achiveDir);
|
|
13
|
-
const artifactPath = path.resolve(options.artifactPath);
|
|
14
|
-
const todoPath = path.join(artifactPath, "TODO.md");
|
|
15
|
-
const goal = await readGoal(options.goalPath);
|
|
16
|
-
const agentVariables = {
|
|
17
|
-
targetPath: path.resolve(options.targetPath),
|
|
18
|
-
codingStyleSkillPath: path.resolve(options.codingStyleSkillPath),
|
|
19
|
-
paperBlueprintPath: path.resolve(options.paperBlueprintPath),
|
|
20
|
-
experimentPlanPath: path.resolve(options.experimentPlanPath),
|
|
21
|
-
codingPlanPath: path.resolve(options.codingPlanPath),
|
|
22
|
-
goal,
|
|
23
|
-
};
|
|
24
|
-
await mkdir(achiveDir, { recursive: true });
|
|
25
|
-
await mkdir(artifactPath, { recursive: true });
|
|
26
|
-
if (!existsSync(todoPath)) {
|
|
27
|
-
await writeText(todoPath, "# TODO");
|
|
28
|
-
}
|
|
29
|
-
await mkdir(agentVariables.targetPath, { recursive: true });
|
|
30
|
-
for (let iteration = 1; iteration <= options.maxIterations; iteration++) {
|
|
31
|
-
console.log(`\n# Developing iteration ${String(iteration)}\n`);
|
|
32
|
-
const archiveDir = path.join(achiveDir, new Date().toISOString().replace(/[:.]/g, "-"));
|
|
33
|
-
await mkdir(archiveDir, { recursive: true });
|
|
34
|
-
const codingManager = await team.createAgent("coding-manager");
|
|
35
|
-
const developer = await team.createAgent("developer");
|
|
36
|
-
const codeReviewer = await team.createAgent("code-reviewer");
|
|
37
|
-
const currentTask = (await codingManager.runStreamed({
|
|
38
|
-
...agentVariables,
|
|
39
|
-
todoPath,
|
|
40
|
-
finishMark: FINISH_MARK,
|
|
41
|
-
phase: "select",
|
|
42
|
-
}, logRecord)).trim();
|
|
43
|
-
await writeText(path.join(archiveDir, "current_task.md"), currentTask);
|
|
44
|
-
if (currentTask.trim() === FINISH_MARK) {
|
|
45
|
-
console.log(`\n# ${FINISH_MARK}\n`);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
let previousReviewerReport = "";
|
|
49
|
-
const revisionReports = [];
|
|
50
|
-
await options.hooks?.beforeRevisionLoop?.(agentVariables, currentTask);
|
|
51
|
-
for (let revision = 1; revision <= options.maxRevisionIterations; revision++) {
|
|
52
|
-
console.log(`\n# Review revision ${String(revision)}\n`);
|
|
53
|
-
const developerVariables = {
|
|
54
|
-
...agentVariables,
|
|
55
|
-
currentTask,
|
|
56
|
-
};
|
|
57
|
-
if (previousReviewerReport) {
|
|
58
|
-
developerVariables.reviewerReport = previousReviewerReport;
|
|
59
|
-
}
|
|
60
|
-
const developerReport = (await developer.runStreamed(developerVariables, logRecord)).trim();
|
|
61
|
-
await writeText(path.join(archiveDir, `developer_report_${String(revision).padStart(3, "0")}.md`), developerReport);
|
|
62
|
-
revisionReports.push(`Developer report ${String(revision)}:\n${developerReport}`);
|
|
63
|
-
const reviewerReport = (await codeReviewer.runStreamed({
|
|
64
|
-
...agentVariables,
|
|
65
|
-
acceptMark: ACCEPT_MARK,
|
|
66
|
-
currentTask,
|
|
67
|
-
developerReport,
|
|
68
|
-
}, logRecord)).trim();
|
|
69
|
-
await writeText(path.join(archiveDir, `code_review_${String(revision).padStart(3, "0")}.md`), reviewerReport);
|
|
70
|
-
revisionReports.push(`Reviewer report ${String(revision)}:\n${reviewerReport}`);
|
|
71
|
-
const accepted = reviewerReport.trim() === ACCEPT_MARK;
|
|
72
|
-
if (accepted) {
|
|
73
|
-
revisionReports.push("Reviewer accepted the changes.");
|
|
74
|
-
}
|
|
75
|
-
if (!accepted && revision === options.maxRevisionIterations) {
|
|
76
|
-
revisionReports.push("Reviewer did not accept the changes before max revision iterations.");
|
|
77
|
-
}
|
|
78
|
-
await options.hooks?.afterRevision?.(revision, agentVariables, currentTask, developerReport, reviewerReport, revisionReports);
|
|
79
|
-
if (accepted) {
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
previousReviewerReport = reviewerReport;
|
|
83
|
-
}
|
|
84
|
-
const revisionReport = revisionReports.join("\n\n");
|
|
85
|
-
await writeText(path.join(archiveDir, "revision_report.md"), revisionReport);
|
|
86
|
-
const todoUpdateReport = (await codingManager.runStreamed({
|
|
87
|
-
...agentVariables,
|
|
88
|
-
todoPath,
|
|
89
|
-
finishMark: FINISH_MARK,
|
|
90
|
-
phase: "update",
|
|
91
|
-
currentTask,
|
|
92
|
-
revisionReport,
|
|
93
|
-
}, logRecord)).trim();
|
|
94
|
-
await writeText(path.join(archiveDir, "todo_update_report.md"), todoUpdateReport);
|
|
95
|
-
await options.hooks?.afterTodoUpdate?.(agentVariables, currentTask, revisionReport, todoUpdateReport);
|
|
96
|
-
}
|
|
97
|
-
throw new Error(`Reached --max-iterations ${String(options.maxIterations)} before the coding-manager returned ${FINISH_MARK}.`);
|
|
98
|
-
}
|
|
99
|
-
async function writeText(filePath, content) {
|
|
100
|
-
await mkdir(path.dirname(filePath), { recursive: true });
|
|
101
|
-
await writeFile(filePath, `${content.trimEnd()}\n`, "utf8");
|
|
102
|
-
}
|
|
103
|
-
async function readGoal(goalPath) {
|
|
104
|
-
const goal = (await readFile(path.resolve(goalPath), "utf8")).trim();
|
|
105
|
-
if (goal === "") {
|
|
106
|
-
throw new Error(`Goal file must not be empty: ${goalPath}`);
|
|
107
|
-
}
|
|
108
|
-
return goal;
|
|
109
|
-
}
|
|
110
|
-
export const developingArgsOptions = {
|
|
111
|
-
"target-path": {
|
|
112
|
-
type: "string",
|
|
113
|
-
description: "Target repository folder to create or modify",
|
|
114
|
-
},
|
|
115
|
-
"achive-dir": {
|
|
116
|
-
type: "string",
|
|
117
|
-
description: "Archive folder for per-iteration reports",
|
|
118
|
-
},
|
|
119
|
-
"artifact-path": {
|
|
120
|
-
type: "string",
|
|
121
|
-
description: "Working artifact folder containing TODO.md",
|
|
122
|
-
},
|
|
123
|
-
"coding-style-skill-path": {
|
|
124
|
-
type: "string",
|
|
125
|
-
description: "Coding style skill path used by the agents",
|
|
126
|
-
},
|
|
127
|
-
"paper-blueprint-path": {
|
|
128
|
-
type: "string",
|
|
129
|
-
description: "Paper blueprint path used by the agents",
|
|
130
|
-
},
|
|
131
|
-
"experiment-plan-path": {
|
|
132
|
-
type: "string",
|
|
133
|
-
description: "Experiment plan path used by the agents",
|
|
134
|
-
},
|
|
135
|
-
"coding-plan-path": {
|
|
136
|
-
type: "string",
|
|
137
|
-
description: "Coding plan path used by the agents",
|
|
138
|
-
},
|
|
139
|
-
"goal-path": {
|
|
140
|
-
type: "string",
|
|
141
|
-
description: "Goal document path",
|
|
142
|
-
},
|
|
143
|
-
"max-iterations": {
|
|
144
|
-
type: "string",
|
|
145
|
-
default: "10",
|
|
146
|
-
description: "Maximum number of development iterations",
|
|
147
|
-
},
|
|
148
|
-
"max-revision-iterations": {
|
|
149
|
-
type: "string",
|
|
150
|
-
default: "3",
|
|
151
|
-
description: "Maximum review revisions per development iteration",
|
|
152
|
-
},
|
|
153
|
-
};
|
|
154
|
-
export const developingPipeline = definePipeline({
|
|
155
|
-
name: "developing",
|
|
156
|
-
description: "Run the code development loop.",
|
|
157
|
-
argsOptions: developingArgsOptions,
|
|
158
|
-
agentFactories,
|
|
159
|
-
async run(team, options) {
|
|
160
|
-
const { "target-path": targetPath, "achive-dir": achiveDir, "artifact-path": artifactPath, "coding-style-skill-path": codingStyleSkillPath, "paper-blueprint-path": paperBlueprintPath, "experiment-plan-path": experimentPlanPath, "coding-plan-path": codingPlanPath, "goal-path": goalPath, "max-iterations": maxIterations, "max-revision-iterations": maxRevisionIterations, hooks, } = options;
|
|
161
|
-
if (targetPath === undefined ||
|
|
162
|
-
achiveDir === undefined ||
|
|
163
|
-
artifactPath === undefined ||
|
|
164
|
-
codingStyleSkillPath === undefined ||
|
|
165
|
-
paperBlueprintPath === undefined ||
|
|
166
|
-
experimentPlanPath === undefined ||
|
|
167
|
-
codingPlanPath === undefined ||
|
|
168
|
-
goalPath === undefined) {
|
|
169
|
-
throw new Error([
|
|
170
|
-
"--target-path",
|
|
171
|
-
"--achive-dir",
|
|
172
|
-
"--artifact-path",
|
|
173
|
-
"--coding-style-skill-path",
|
|
174
|
-
"--paper-blueprint-path",
|
|
175
|
-
"--experiment-plan-path",
|
|
176
|
-
"--coding-plan-path",
|
|
177
|
-
"--goal-path",
|
|
178
|
-
].join(", ") + " are required");
|
|
179
|
-
}
|
|
180
|
-
await developing(team, {
|
|
181
|
-
targetPath,
|
|
182
|
-
achiveDir,
|
|
183
|
-
artifactPath,
|
|
184
|
-
codingStyleSkillPath,
|
|
185
|
-
paperBlueprintPath,
|
|
186
|
-
experimentPlanPath,
|
|
187
|
-
codingPlanPath,
|
|
188
|
-
goalPath,
|
|
189
|
-
maxIterations: Number(maxIterations),
|
|
190
|
-
maxRevisionIterations: Number(maxRevisionIterations),
|
|
191
|
-
...(hooks === undefined ? {} : { hooks }),
|
|
192
|
-
});
|
|
193
|
-
},
|
|
194
|
-
});
|
|
195
|
-
//# sourceMappingURL=pipeline.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/developing/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,GAIf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,cAAc,GAIf,MAAM,mBAAmB,CAAC;AA4C3B,MAAM,WAAW,GAAG,UAAU,CAAC;AAC/B,MAAM,WAAW,GAAG,QAAQ,CAAC;AAE7B,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,IAA+C,EAC/C,OAA0B;IAE1B,MAAM,SAAS,GAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;QACnD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAClD,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IACpD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC9C,MAAM,cAAc,GAA6B;QAC/C,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;QAC5C,oBAAoB,EAAE,IAA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,QAAQ,EACrB,gBAAgB,EAAE,aAAa,EAC/B,yBAAyB,EAAE,qBAAqB,EAChD,KAAK,GACN,GAAG,OAAO,CAAC;QACZ,IACE,UAAU,KAAK,SAAS;YACxB,SAAS,KAAK,SAAS;YACvB,YAAY,KAAK,SAAS;YAC1B,oBAAoB,KAAK,SAAS;YAClC,kBAAkB,KAAK,SAAS;YAChC,kBAAkB,KAAK,SAAS;YAChC,cAAc,KAAK,SAAS;YAC5B,QAAQ,KAAK,SAAS,EACtB,CAAC;YACD,MAAM,IAAI,KAAK,CACb;gBACE,eAAe;gBACf,cAAc;gBACd,iBAAiB;gBACjB,2BAA2B;gBAC3B,wBAAwB;gBACxB,wBAAwB;gBACxB,oBAAoB;gBACpB,aAAa;aACd,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,eAAe,CAC/B,CAAC;QACJ,CAAC;QAED,MAAM,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU;YACV,SAAS;YACT,YAAY;YACZ,oBAAoB;YACpB,kBAAkB;YAClB,kBAAkB;YAClB,cAAc;YACd,QAAQ;YACR,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC;YACpC,qBAAqB,EAAE,MAAM,CAAC,qBAAqB,CAAC;YACpD,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;SAC1C,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { AgentTeam, type AgentFactoryMap, type PipelineOptions } from "coding-agent-forge";
|
|
2
|
-
import { type TrajectoryOptimizerVariables } from "./agents/index.js";
|
|
3
|
-
import { type DevelopingAgentVariablesByName } from "./pipeline.js";
|
|
4
|
-
export type DevelopingSkillAgentVariables = DevelopingAgentVariablesByName & {
|
|
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 "paper-blueprint-path": {
|
|
25
|
-
readonly type: "string";
|
|
26
|
-
readonly description: "Paper blueprint path used by the agents";
|
|
27
|
-
};
|
|
28
|
-
readonly "experiment-plan-path": {
|
|
29
|
-
readonly type: "string";
|
|
30
|
-
readonly description: "Experiment plan path used by the agents";
|
|
31
|
-
};
|
|
32
|
-
readonly "coding-plan-path": {
|
|
33
|
-
readonly type: "string";
|
|
34
|
-
readonly description: "Coding plan path used by the agents";
|
|
35
|
-
};
|
|
36
|
-
readonly "goal-path": {
|
|
37
|
-
readonly type: "string";
|
|
38
|
-
readonly description: "Goal document path";
|
|
39
|
-
};
|
|
40
|
-
readonly "max-iterations": {
|
|
41
|
-
readonly type: "string";
|
|
42
|
-
readonly default: "10";
|
|
43
|
-
readonly description: "Maximum number of development iterations";
|
|
44
|
-
};
|
|
45
|
-
readonly "max-revision-iterations": {
|
|
46
|
-
readonly type: "string";
|
|
47
|
-
readonly default: "3";
|
|
48
|
-
readonly description: "Maximum review revisions per development iteration";
|
|
49
|
-
};
|
|
50
|
-
readonly "metaskill-path": {
|
|
51
|
-
readonly type: "string";
|
|
52
|
-
readonly description: "Metaskill design document used by the trajectory optimizer";
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
export type DevelopingSkillOptions = PipelineOptions<typeof developingSkillArgsOptions>;
|
|
56
|
-
export declare function developingSkill(team: AgentTeam<DevelopingSkillAgentVariables>, options: DevelopingSkillOptions): Promise<void>;
|
|
57
|
-
export declare const developingSkillAgentFactories: AgentFactoryMap;
|
|
58
|
-
export declare const developingSkillPipeline: import("coding-agent-forge").Pipeline<{
|
|
59
|
-
readonly "target-path": {
|
|
60
|
-
readonly type: "string";
|
|
61
|
-
readonly description: "Target repository folder to create or modify";
|
|
62
|
-
};
|
|
63
|
-
readonly "achive-dir": {
|
|
64
|
-
readonly type: "string";
|
|
65
|
-
readonly description: "Archive folder for per-iteration reports";
|
|
66
|
-
};
|
|
67
|
-
readonly "artifact-path": {
|
|
68
|
-
readonly type: "string";
|
|
69
|
-
readonly description: "Working artifact folder containing TODO.md";
|
|
70
|
-
};
|
|
71
|
-
readonly "coding-style-skill-path": {
|
|
72
|
-
readonly type: "string";
|
|
73
|
-
readonly description: "Coding style skill path used by the agents";
|
|
74
|
-
};
|
|
75
|
-
readonly "paper-blueprint-path": {
|
|
76
|
-
readonly type: "string";
|
|
77
|
-
readonly description: "Paper blueprint path used by the agents";
|
|
78
|
-
};
|
|
79
|
-
readonly "experiment-plan-path": {
|
|
80
|
-
readonly type: "string";
|
|
81
|
-
readonly description: "Experiment plan path used by the agents";
|
|
82
|
-
};
|
|
83
|
-
readonly "coding-plan-path": {
|
|
84
|
-
readonly type: "string";
|
|
85
|
-
readonly description: "Coding plan path used by the agents";
|
|
86
|
-
};
|
|
87
|
-
readonly "goal-path": {
|
|
88
|
-
readonly type: "string";
|
|
89
|
-
readonly description: "Goal document path";
|
|
90
|
-
};
|
|
91
|
-
readonly "max-iterations": {
|
|
92
|
-
readonly type: "string";
|
|
93
|
-
readonly default: "10";
|
|
94
|
-
readonly description: "Maximum number of development iterations";
|
|
95
|
-
};
|
|
96
|
-
readonly "max-revision-iterations": {
|
|
97
|
-
readonly type: "string";
|
|
98
|
-
readonly default: "3";
|
|
99
|
-
readonly description: "Maximum review revisions per development iteration";
|
|
100
|
-
};
|
|
101
|
-
readonly "metaskill-path": {
|
|
102
|
-
readonly type: "string";
|
|
103
|
-
readonly description: "Metaskill design document used by the trajectory optimizer";
|
|
104
|
-
};
|
|
105
|
-
}, DevelopingSkillAgentVariables>;
|
|
106
|
-
//# sourceMappingURL=pipelineskill.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipelineskill.d.ts","sourceRoot":"","sources":["../../src/developing/pipelineskill.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,KAAK,eAAe,EAEpB,KAAK,eAAe,EAErB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAGL,KAAK,4BAA4B,EAClC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGL,KAAK,8BAA8B,EAEpC,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,6BAA6B,GAAG,8BAA8B,GAAG;IAC3E,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,CAoDf;AAED,eAAO,MAAM,6BAA6B,EAAE,eAG3C,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAWlC,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { definePipeline, } from "coding-agent-forge";
|
|
2
|
-
import { agentFactories as developingAgentFactories, TrajectoryOptimizerAgent, } from "./agents/index.js";
|
|
3
|
-
import { developingArgsOptions, developingPipeline, } from "./pipeline.js";
|
|
4
|
-
export const developingSkillArgsOptions = {
|
|
5
|
-
"metaskill-path": {
|
|
6
|
-
type: "string",
|
|
7
|
-
description: "Metaskill design document used by the trajectory optimizer",
|
|
8
|
-
},
|
|
9
|
-
...developingArgsOptions,
|
|
10
|
-
};
|
|
11
|
-
export async function developingSkill(team, options) {
|
|
12
|
-
const metaskillPath = options["metaskill-path"];
|
|
13
|
-
if (metaskillPath === undefined) {
|
|
14
|
-
throw new Error("--metaskill-path is required");
|
|
15
|
-
}
|
|
16
|
-
const logRecord = (thread, record) => {
|
|
17
|
-
console.log(thread.recordToPrettyString(record));
|
|
18
|
-
};
|
|
19
|
-
let trajectoryOptimizer;
|
|
20
|
-
const developingOptions = {
|
|
21
|
-
...options,
|
|
22
|
-
hooks: {
|
|
23
|
-
beforeRevisionLoop: async (agentVariables, currentTask) => {
|
|
24
|
-
trajectoryOptimizer = await team.createAgent("trajectory-optimizer");
|
|
25
|
-
const repositoryScan = (await trajectoryOptimizer.runStreamed({
|
|
26
|
-
...agentVariables,
|
|
27
|
-
phase: "scan",
|
|
28
|
-
currentTask,
|
|
29
|
-
}, logRecord)).trim();
|
|
30
|
-
console.log(`\n# Skill trajectory repository scan\n${repositoryScan}\n`);
|
|
31
|
-
},
|
|
32
|
-
afterTodoUpdate: async (agentVariables, currentTask, revisionReport, todoUpdateReport) => {
|
|
33
|
-
if (trajectoryOptimizer === undefined) {
|
|
34
|
-
throw new Error("Trajectory optimizer must scan the repository before optimizing.");
|
|
35
|
-
}
|
|
36
|
-
const optimizerReport = (await trajectoryOptimizer.runStreamed({
|
|
37
|
-
...agentVariables,
|
|
38
|
-
phase: "optimize",
|
|
39
|
-
currentTask,
|
|
40
|
-
revisionReport,
|
|
41
|
-
todoUpdateReport,
|
|
42
|
-
metaskillPath,
|
|
43
|
-
}, logRecord)).trim();
|
|
44
|
-
console.log(`\n# Skill trajectory optimizer report\n${optimizerReport}\n`);
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
await developingPipeline.run(team, developingOptions);
|
|
49
|
-
}
|
|
50
|
-
export const developingSkillAgentFactories = {
|
|
51
|
-
...developingAgentFactories,
|
|
52
|
-
"trajectory-optimizer": (thread, constants) => new TrajectoryOptimizerAgent(thread, constants),
|
|
53
|
-
};
|
|
54
|
-
export const developingSkillPipeline = definePipeline({
|
|
55
|
-
name: "developing-skill",
|
|
56
|
-
description: "Run the code development loop and evolve its skill.",
|
|
57
|
-
argsOptions: developingSkillArgsOptions,
|
|
58
|
-
agentFactories: developingSkillAgentFactories,
|
|
59
|
-
async run(team, options) {
|
|
60
|
-
await developingSkill(team, options);
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
//# sourceMappingURL=pipelineskill.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipelineskill.js","sourceRoot":"","sources":["../../src/developing/pipelineskill.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,GAKf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,cAAc,IAAI,wBAAwB,EAC1C,wBAAwB,GAEzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,qBAAqB,EACrB,kBAAkB,GAGnB,MAAM,eAAe,CAAC;AAMvB,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,gBAAgB,EAAE;QAChB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,4DAA4D;KAC1E;IACD,GAAG,qBAAqB;CACc,CAAC;AAIzC,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,IAA8C,EAC9C,OAA+B;IAE/B,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAChD,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,SAAS,GAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;QACnD,OAAO,CAAC,GAAG,CAAC,MAAM,C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