academic-army 0.1.2 → 0.1.4
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 +9 -2
- package/README.zh-CN.md +9 -2
- package/dist/cli.js +2 -43
- package/dist/cli.js.map +1 -1
- package/dist/developing/pipeline.d.ts +88 -3
- package/dist/developing/pipeline.d.ts.map +1 -1
- package/dist/developing/pipeline.js +84 -64
- package/dist/developing/pipeline.js.map +1 -1
- package/dist/developing/pipelineskill.d.ts +98 -7
- package/dist/developing/pipelineskill.d.ts.map +1 -1
- package/dist/developing/pipelineskill.js +23 -70
- package/dist/developing/pipelineskill.js.map +1 -1
- package/dist/evolve-skill/pipeline.d.ts +48 -3
- package/dist/evolve-skill/pipeline.d.ts.map +1 -1
- package/dist/evolve-skill/pipeline.js +44 -35
- package/dist/evolve-skill/pipeline.js.map +1 -1
- package/package.json +2 -6
- package/dist/pipeline.d.ts +0 -13
- package/dist/pipeline.d.ts.map +0 -1
- package/dist/pipeline.js +0 -24
- package/dist/pipeline.js.map +0 -1
package/README.md
CHANGED
|
@@ -76,13 +76,18 @@ The repo scaffold skill does not implement paper methods, harness logic, tests,
|
|
|
76
76
|
|
|
77
77
|
### 5. Run the development loop
|
|
78
78
|
|
|
79
|
-
After the planning artifacts are ready, run:
|
|
79
|
+
After the planning artifacts are ready, write the next high-level development objective into `output/goal.md`, then run:
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
+
$EDITOR output/goal.md
|
|
82
83
|
bash runs/develop.sh
|
|
83
84
|
```
|
|
84
85
|
|
|
85
|
-
Run [`runs/develop.sh`](runs/develop.sh) to call the TypeScript `developing` pipeline, which reads the three planning artifacts and iteratively writes code under `output/codebase`.
|
|
86
|
+
Run [`runs/develop.sh`](runs/develop.sh) to call the TypeScript `developing` pipeline, which reads the three planning artifacts plus the current `--goal-path` file and iteratively writes code under `output/codebase`. Each time you want the next new task, update `output/goal.md` before rerunning the wrapper.
|
|
87
|
+
|
|
88
|
+
The development loop currently uses `output/developing/TODO.md` as a temporary task-memory file. If a new goal starts inheriting old context, manually delete that TODO file before rerunning; the pipeline will recreate it. This TODO-based memory is a temporary solution, and a more advanced memory mechanism should replace or extend it later.
|
|
89
|
+
|
|
90
|
+
See [`src/README.md`](src/README.md) for the TypeScript entry points and [`src/developing/README.md`](src/developing/README.md) for the development loop implementation.
|
|
86
91
|
|
|
87
92
|
## Common Tasks
|
|
88
93
|
|
|
@@ -104,6 +109,8 @@ npm run evolve-skill
|
|
|
104
109
|
|
|
105
110
|
For the shared CLI and pipeline structure, see [`src/README.md`](src/README.md).
|
|
106
111
|
|
|
112
|
+
For `developing` and `developing-skill`, update the file passed to `--goal-path` when you want to run a new task focus. The prepared wrappers use `output/goal.md`.
|
|
113
|
+
|
|
107
114
|
### Call DeepResearch
|
|
108
115
|
|
|
109
116
|
AcademicArmy includes a local stdio MCP implementation in the [`mcp-server`](mcp-server) directory. It exposes one tool:
|
package/README.zh-CN.md
CHANGED
|
@@ -76,13 +76,18 @@ repo scaffold skill 不实现论文方法、harness 逻辑、测试、metric、l
|
|
|
76
76
|
|
|
77
77
|
### 5. 运行开发循环
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
三份规划产物准备好后,先把下一轮高层开发目标写进 `output/goal.md`,然后运行:
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
+
$EDITOR output/goal.md
|
|
82
83
|
bash runs/develop.sh
|
|
83
84
|
```
|
|
84
85
|
|
|
85
|
-
运行 [`runs/develop.sh`](runs/develop.sh) 来调用 TypeScript 的 `developing` pipeline
|
|
86
|
+
运行 [`runs/develop.sh`](runs/develop.sh) 来调用 TypeScript 的 `developing` pipeline,读取三份规划产物和当前 `--goal-path` 文件,并在 `output/codebase` 下迭代写代码。每次想执行下一个新任务时,先更新 `output/goal.md`,再重新运行 wrapper。
|
|
87
|
+
|
|
88
|
+
开发循环现在使用 `output/developing/TODO.md` 作为临时任务记忆文件。如果新 goal 开始继承旧上下文,可以在重新运行前手动删除这个 TODO 文件;pipeline 会自动重新创建它。这个基于 TODO 的记忆机制是临时方案,之后会实现更高级的记忆机制来替代或扩展它。
|
|
89
|
+
|
|
90
|
+
TypeScript 入口和目录结构见 [`src/README.zh-CN.md`](src/README.zh-CN.md),开发循环实现见 [`src/developing/README.zh-CN.md`](src/developing/README.zh-CN.md)。
|
|
86
91
|
|
|
87
92
|
## 常见任务
|
|
88
93
|
|
|
@@ -104,6 +109,8 @@ npm run evolve-skill
|
|
|
104
109
|
|
|
105
110
|
TypeScript pipeline 的目录结构和实现说明见 [`src/README.zh-CN.md`](src/README.zh-CN.md)。
|
|
106
111
|
|
|
112
|
+
对于 `developing` 和 `developing-skill`,每次想切换到新的任务重点时,更新传给 `--goal-path` 的文件即可。预设 wrappers 使用的是 `output/goal.md`。
|
|
113
|
+
|
|
107
114
|
### 调用 DeepResearch
|
|
108
115
|
|
|
109
116
|
AcademicArmy 在 [`mcp-server`](mcp-server) 目录下提供了本地 stdio MCP 实现。它只暴露一个工具:
|
package/dist/cli.js
CHANGED
|
@@ -1,47 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { runPipelinesCli } from "coding-agent-forge";
|
|
3
3
|
import { developingPipeline, developingSkillPipeline } from "./developing/index.js";
|
|
4
4
|
import { evolveSkillPipeline } from "./evolve-skill/index.js";
|
|
5
|
-
|
|
6
|
-
return {
|
|
7
|
-
name: entry.name,
|
|
8
|
-
description: entry.description,
|
|
9
|
-
run: (args) => runPipelineCli(entry.definition, args),
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
const cliDefinitions = [
|
|
13
|
-
defineCli({
|
|
14
|
-
name: "developing",
|
|
15
|
-
description: "Run the code development loop.",
|
|
16
|
-
definition: developingPipeline,
|
|
17
|
-
}),
|
|
18
|
-
defineCli({
|
|
19
|
-
name: "developing-skill",
|
|
20
|
-
description: "Run the code development loop and evolve its skill.",
|
|
21
|
-
definition: developingSkillPipeline,
|
|
22
|
-
}),
|
|
23
|
-
defineCli({
|
|
24
|
-
name: "evolve-skill",
|
|
25
|
-
description: "Run the skill evolution loop.",
|
|
26
|
-
definition: evolveSkillPipeline,
|
|
27
|
-
}),
|
|
28
|
-
];
|
|
29
|
-
function buildHelp() {
|
|
30
|
-
const pipelineList = cliDefinitions
|
|
31
|
-
.map((pipeline) => ` ${pipeline.name.padEnd(16)} ${pipeline.description}`)
|
|
32
|
-
.join("\n");
|
|
33
|
-
return `Usage: npm run cli -- <pipeline> [...args]
|
|
34
|
-
|
|
35
|
-
Available pipelines:
|
|
36
|
-
${pipelineList}`;
|
|
37
|
-
}
|
|
38
|
-
const [pipelineName, ...pipelineArgs] = process.argv.slice(2);
|
|
39
|
-
const pipelineDefinition = cliDefinitions.find((pipeline) => pipeline.name === pipelineName);
|
|
40
|
-
if (pipelineDefinition === undefined) {
|
|
41
|
-
console.log(buildHelp());
|
|
42
|
-
process.exitCode = 1;
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
await pipelineDefinition.run(pipelineArgs);
|
|
46
|
-
}
|
|
5
|
+
await runPipelinesCli([developingPipeline, developingSkillPipeline, evolveSkillPipeline], process.argv.slice(2));
|
|
47
6
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,eAAe,CACnB,CAAC,kBAAkB,EAAE,uBAAuB,EAAE,mBAAmB,CAAC,EAClE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACtB,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AgentTeam } from "coding-agent-forge";
|
|
2
|
-
import { type ParsedPipelineArgs } from "../pipeline.js";
|
|
3
2
|
import { type CodingManagerVariables, type CodeReviewerVariables, type DeveloperVariables } from "./agents/index.js";
|
|
4
3
|
import type { DevelopingAgentVariables } from "./agents/types.js";
|
|
5
4
|
export type DevelopingAgentVariablesByName = {
|
|
@@ -25,7 +24,93 @@ export type DevelopingHooks = {
|
|
|
25
24
|
afterRevision?: (revision: number, agentVariables: DevelopingAgentVariables, currentTask: string, developerReport: string, reviewerReport: string, revisionReports: readonly string[]) => Promise<void> | void;
|
|
26
25
|
afterTodoUpdate?: (agentVariables: DevelopingAgentVariables, currentTask: string, revisionReport: string, todoUpdateReport: string) => Promise<void> | void;
|
|
27
26
|
};
|
|
28
|
-
export declare function parseDevelopingArgs(args: readonly string[]): ParsedPipelineArgs<DevelopingOptions>;
|
|
29
27
|
export declare function developing(team: AgentTeam<DevelopingAgentVariablesByName>, options: DevelopingOptions): Promise<void>;
|
|
30
|
-
export declare const
|
|
28
|
+
export declare const developingArgsOptions: {
|
|
29
|
+
readonly "target-path": {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly description: "Target repository folder to create or modify";
|
|
32
|
+
};
|
|
33
|
+
readonly "achive-dir": {
|
|
34
|
+
readonly type: "string";
|
|
35
|
+
readonly description: "Archive folder for per-iteration reports";
|
|
36
|
+
};
|
|
37
|
+
readonly "artifact-path": {
|
|
38
|
+
readonly type: "string";
|
|
39
|
+
readonly description: "Working artifact folder containing TODO.md";
|
|
40
|
+
};
|
|
41
|
+
readonly "coding-style-skill-path": {
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
readonly description: "Coding style skill path used by the agents";
|
|
44
|
+
};
|
|
45
|
+
readonly "paper-blueprint-path": {
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
readonly description: "Paper blueprint path used by the agents";
|
|
48
|
+
};
|
|
49
|
+
readonly "experiment-plan-path": {
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
readonly description: "Experiment plan path used by the agents";
|
|
52
|
+
};
|
|
53
|
+
readonly "coding-plan-path": {
|
|
54
|
+
readonly type: "string";
|
|
55
|
+
readonly description: "Coding plan path used by the agents";
|
|
56
|
+
};
|
|
57
|
+
readonly "goal-path": {
|
|
58
|
+
readonly type: "string";
|
|
59
|
+
readonly description: "Goal document path";
|
|
60
|
+
};
|
|
61
|
+
readonly "max-iterations": {
|
|
62
|
+
readonly type: "string";
|
|
63
|
+
readonly default: "10";
|
|
64
|
+
readonly description: "Maximum number of development iterations";
|
|
65
|
+
};
|
|
66
|
+
readonly "max-revision-iterations": {
|
|
67
|
+
readonly type: "string";
|
|
68
|
+
readonly default: "3";
|
|
69
|
+
readonly description: "Maximum review revisions per development iteration";
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export declare const developingPipeline: import("coding-agent-forge").Pipeline<{
|
|
73
|
+
readonly "target-path": {
|
|
74
|
+
readonly type: "string";
|
|
75
|
+
readonly description: "Target repository folder to create or modify";
|
|
76
|
+
};
|
|
77
|
+
readonly "achive-dir": {
|
|
78
|
+
readonly type: "string";
|
|
79
|
+
readonly description: "Archive folder for per-iteration reports";
|
|
80
|
+
};
|
|
81
|
+
readonly "artifact-path": {
|
|
82
|
+
readonly type: "string";
|
|
83
|
+
readonly description: "Working artifact folder containing TODO.md";
|
|
84
|
+
};
|
|
85
|
+
readonly "coding-style-skill-path": {
|
|
86
|
+
readonly type: "string";
|
|
87
|
+
readonly description: "Coding style skill path used by the agents";
|
|
88
|
+
};
|
|
89
|
+
readonly "paper-blueprint-path": {
|
|
90
|
+
readonly type: "string";
|
|
91
|
+
readonly description: "Paper blueprint path used by the agents";
|
|
92
|
+
};
|
|
93
|
+
readonly "experiment-plan-path": {
|
|
94
|
+
readonly type: "string";
|
|
95
|
+
readonly description: "Experiment plan path used by the agents";
|
|
96
|
+
};
|
|
97
|
+
readonly "coding-plan-path": {
|
|
98
|
+
readonly type: "string";
|
|
99
|
+
readonly description: "Coding plan path used by the agents";
|
|
100
|
+
};
|
|
101
|
+
readonly "goal-path": {
|
|
102
|
+
readonly type: "string";
|
|
103
|
+
readonly description: "Goal document path";
|
|
104
|
+
};
|
|
105
|
+
readonly "max-iterations": {
|
|
106
|
+
readonly type: "string";
|
|
107
|
+
readonly default: "10";
|
|
108
|
+
readonly description: "Maximum number of development iterations";
|
|
109
|
+
};
|
|
110
|
+
readonly "max-revision-iterations": {
|
|
111
|
+
readonly type: "string";
|
|
112
|
+
readonly default: "3";
|
|
113
|
+
readonly description: "Maximum review revisions per development iteration";
|
|
114
|
+
};
|
|
115
|
+
}, DevelopingAgentVariablesByName>;
|
|
31
116
|
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/developing/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/developing/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAKV,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAElE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,gBAAgB,EAAE,sBAAsB,CAAC;IACzC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,eAAe,EAAE,qBAAqB,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,M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from "node:fs";
|
|
2
|
-
import {
|
|
3
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
4
|
import path from "node:path";
|
|
4
|
-
import { parseArgs } from "node:util";
|
|
5
|
-
import { definePipeline } from "../pipeline.js";
|
|
6
5
|
import { agentFactories, } from "./agents/index.js";
|
|
7
|
-
const USAGE = [
|
|
8
|
-
"Usage: npm run developing --",
|
|
9
|
-
"--config <path>",
|
|
10
|
-
"--target-path <folder>",
|
|
11
|
-
"--achive-dir <folder>",
|
|
12
|
-
"--artifact-path <folder>",
|
|
13
|
-
"--coding-style-skill-path <path>",
|
|
14
|
-
"--paper-blueprint-path <path>",
|
|
15
|
-
"--experiment-plan-path <path>",
|
|
16
|
-
"--coding-plan-path <path>",
|
|
17
|
-
"--goal-path <path>",
|
|
18
|
-
"[--max-iterations <positive-integer>]",
|
|
19
|
-
"[--max-revision-iterations <positive-integer>]",
|
|
20
|
-
].join(" ");
|
|
21
6
|
const FINISH_MARK = "FINISHED";
|
|
22
7
|
const ACCEPT_MARK = "ACCEPT";
|
|
23
|
-
export function parseDevelopingArgs(args) {
|
|
24
|
-
const { values: { config, "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, }, } = parseArgs({
|
|
25
|
-
args: [...args],
|
|
26
|
-
options: {
|
|
27
|
-
config: { type: "string", multiple: true },
|
|
28
|
-
"target-path": { type: "string" },
|
|
29
|
-
"achive-dir": { type: "string" },
|
|
30
|
-
"artifact-path": { type: "string" },
|
|
31
|
-
"coding-style-skill-path": { type: "string" },
|
|
32
|
-
"paper-blueprint-path": { type: "string" },
|
|
33
|
-
"experiment-plan-path": { type: "string" },
|
|
34
|
-
"coding-plan-path": { type: "string" },
|
|
35
|
-
"goal-path": { type: "string" },
|
|
36
|
-
"max-iterations": { type: "string" },
|
|
37
|
-
"max-revision-iterations": { type: "string" },
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
if (config === undefined ||
|
|
41
|
-
targetPath === undefined ||
|
|
42
|
-
achiveDir === undefined ||
|
|
43
|
-
artifactPath === undefined ||
|
|
44
|
-
codingStyleSkillPath === undefined ||
|
|
45
|
-
paperBlueprintPath === undefined ||
|
|
46
|
-
experimentPlanPath === undefined ||
|
|
47
|
-
codingPlanPath === undefined ||
|
|
48
|
-
goalPath === undefined) {
|
|
49
|
-
throw new Error(USAGE);
|
|
50
|
-
}
|
|
51
|
-
return {
|
|
52
|
-
configPaths: config,
|
|
53
|
-
runningOptions: {
|
|
54
|
-
targetPath,
|
|
55
|
-
achiveDir,
|
|
56
|
-
artifactPath,
|
|
57
|
-
codingStyleSkillPath,
|
|
58
|
-
paperBlueprintPath,
|
|
59
|
-
experimentPlanPath,
|
|
60
|
-
codingPlanPath,
|
|
61
|
-
goalPath,
|
|
62
|
-
maxIterations: Number(maxIterations ?? 10),
|
|
63
|
-
maxRevisionIterations: Number(maxRevisionIterations ?? 3),
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
8
|
export async function developing(team, options) {
|
|
68
9
|
const logRecord = (thread, record) => {
|
|
69
10
|
console.log(thread.recordToPrettyString(record));
|
|
@@ -151,7 +92,6 @@ export async function developing(team, options) {
|
|
|
151
92
|
revisionReport,
|
|
152
93
|
}, logRecord)).trim();
|
|
153
94
|
await writeText(path.join(archiveDir, "todo_update_report.md"), todoUpdateReport);
|
|
154
|
-
await cp(artifactPath, path.join(archiveDir, "artifacts"), { recursive: true });
|
|
155
95
|
await options.hooks?.afterTodoUpdate?.(agentVariables, currentTask, revisionReport, todoUpdateReport);
|
|
156
96
|
}
|
|
157
97
|
throw new Error(`Reached --max-iterations ${String(options.maxIterations)} before the coding-manager returned ${FINISH_MARK}.`);
|
|
@@ -167,9 +107,89 @@ async function readGoal(goalPath) {
|
|
|
167
107
|
}
|
|
168
108
|
return goal;
|
|
169
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
|
+
};
|
|
170
154
|
export const developingPipeline = definePipeline({
|
|
155
|
+
name: "developing",
|
|
156
|
+
description: "Run the code development loop.",
|
|
157
|
+
argsOptions: developingArgsOptions,
|
|
171
158
|
agentFactories,
|
|
172
|
-
|
|
173
|
-
|
|
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
|
+
},
|
|
174
194
|
});
|
|
175
195
|
//# sourceMappingURL=pipeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/developing/pipeline.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/developing/pip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AAkB,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,15 +1,106 @@
|
|
|
1
|
-
import { type AgentFactoryMap,
|
|
2
|
-
import { type ParsedPipelineArgs } from "../pipeline.js";
|
|
1
|
+
import { AgentTeam, type AgentFactoryMap, type PipelineOptions } from "coding-agent-forge";
|
|
3
2
|
import { type TrajectoryOptimizerVariables } from "./agents/index.js";
|
|
4
|
-
import { type DevelopingAgentVariablesByName
|
|
3
|
+
import { type DevelopingAgentVariablesByName } from "./pipeline.js";
|
|
5
4
|
export type DevelopingSkillAgentVariables = DevelopingAgentVariablesByName & {
|
|
6
5
|
"trajectory-optimizer": TrajectoryOptimizerVariables;
|
|
7
6
|
};
|
|
8
|
-
export
|
|
9
|
-
|
|
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
|
+
};
|
|
10
54
|
};
|
|
11
|
-
export
|
|
55
|
+
export type DevelopingSkillOptions = PipelineOptions<typeof developingSkillArgsOptions>;
|
|
12
56
|
export declare function developingSkill(team: AgentTeam<DevelopingSkillAgentVariables>, options: DevelopingSkillOptions): Promise<void>;
|
|
13
57
|
export declare const developingSkillAgentFactories: AgentFactoryMap;
|
|
14
|
-
export declare const developingSkillPipeline: import("
|
|
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>;
|
|
15
106
|
//# sourceMappingURL=pipelineskill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipelineskill.d.ts","sourceRoot":"","sources":["../../src/developing/pipelineskill.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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,75 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { definePipeline } from "../pipeline.js";
|
|
1
|
+
import { definePipeline, } from "coding-agent-forge";
|
|
3
2
|
import { agentFactories as developingAgentFactories, TrajectoryOptimizerAgent, } from "./agents/index.js";
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"--metaskill-path <path>",
|
|
13
|
-
"--paper-blueprint-path <path>",
|
|
14
|
-
"--experiment-plan-path <path>",
|
|
15
|
-
"--coding-plan-path <path>",
|
|
16
|
-
"--goal-path <path>",
|
|
17
|
-
"[--max-iterations <positive-integer>]",
|
|
18
|
-
"[--max-revision-iterations <positive-integer>]",
|
|
19
|
-
].join(" ");
|
|
20
|
-
export function parseDevelopingSkillArgs(args) {
|
|
21
|
-
const { values: { config, "target-path": targetPath, "achive-dir": achiveDir, "artifact-path": artifactPath, "coding-style-skill-path": codingStyleSkillPath, "metaskill-path": metaskillPath, "paper-blueprint-path": paperBlueprintPath, "experiment-plan-path": experimentPlanPath, "coding-plan-path": codingPlanPath, "goal-path": goalPath, "max-iterations": maxIterations, "max-revision-iterations": maxRevisionIterations, }, } = parseArgs({
|
|
22
|
-
args: [...args],
|
|
23
|
-
options: {
|
|
24
|
-
config: { type: "string", multiple: true },
|
|
25
|
-
"target-path": { type: "string" },
|
|
26
|
-
"achive-dir": { type: "string" },
|
|
27
|
-
"artifact-path": { type: "string" },
|
|
28
|
-
"coding-style-skill-path": { type: "string" },
|
|
29
|
-
"metaskill-path": { type: "string" },
|
|
30
|
-
"paper-blueprint-path": { type: "string" },
|
|
31
|
-
"experiment-plan-path": { type: "string" },
|
|
32
|
-
"coding-plan-path": { type: "string" },
|
|
33
|
-
"goal-path": { type: "string" },
|
|
34
|
-
"max-iterations": { type: "string" },
|
|
35
|
-
"max-revision-iterations": { type: "string" },
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
if (config === undefined ||
|
|
39
|
-
targetPath === undefined ||
|
|
40
|
-
achiveDir === undefined ||
|
|
41
|
-
artifactPath === undefined ||
|
|
42
|
-
codingStyleSkillPath === undefined ||
|
|
43
|
-
metaskillPath === undefined ||
|
|
44
|
-
paperBlueprintPath === undefined ||
|
|
45
|
-
experimentPlanPath === undefined ||
|
|
46
|
-
codingPlanPath === undefined ||
|
|
47
|
-
goalPath === undefined) {
|
|
48
|
-
throw new Error(USAGE);
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
configPaths: config,
|
|
52
|
-
runningOptions: {
|
|
53
|
-
targetPath,
|
|
54
|
-
achiveDir,
|
|
55
|
-
artifactPath,
|
|
56
|
-
codingStyleSkillPath,
|
|
57
|
-
metaskillPath,
|
|
58
|
-
paperBlueprintPath,
|
|
59
|
-
experimentPlanPath,
|
|
60
|
-
codingPlanPath,
|
|
61
|
-
goalPath,
|
|
62
|
-
maxIterations: Number(maxIterations ?? 10),
|
|
63
|
-
maxRevisionIterations: Number(maxRevisionIterations ?? 3),
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
}
|
|
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
|
+
};
|
|
67
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
|
+
}
|
|
68
16
|
const logRecord = (thread, record) => {
|
|
69
17
|
console.log(thread.recordToPrettyString(record));
|
|
70
18
|
};
|
|
71
19
|
let trajectoryOptimizer;
|
|
72
|
-
|
|
20
|
+
const developingOptions = {
|
|
73
21
|
...options,
|
|
74
22
|
hooks: {
|
|
75
23
|
beforeRevisionLoop: async (agentVariables, currentTask) => {
|
|
@@ -91,20 +39,25 @@ export async function developingSkill(team, options) {
|
|
|
91
39
|
currentTask,
|
|
92
40
|
revisionReport,
|
|
93
41
|
todoUpdateReport,
|
|
94
|
-
metaskillPath
|
|
42
|
+
metaskillPath,
|
|
95
43
|
}, logRecord)).trim();
|
|
96
44
|
console.log(`\n# Skill trajectory optimizer report\n${optimizerReport}\n`);
|
|
97
45
|
},
|
|
98
46
|
},
|
|
99
|
-
}
|
|
47
|
+
};
|
|
48
|
+
await developingPipeline.run(team, developingOptions);
|
|
100
49
|
}
|
|
101
50
|
export const developingSkillAgentFactories = {
|
|
102
51
|
...developingAgentFactories,
|
|
103
52
|
"trajectory-optimizer": (thread, constants) => new TrajectoryOptimizerAgent(thread, constants),
|
|
104
53
|
};
|
|
105
54
|
export const developingSkillPipeline = definePipeline({
|
|
55
|
+
name: "developing-skill",
|
|
56
|
+
description: "Run the code development loop and evolve its skill.",
|
|
57
|
+
argsOptions: developingSkillArgsOptions,
|
|
106
58
|
agentFactories: developingSkillAgentFactories,
|
|
107
|
-
|
|
108
|
-
|
|
59
|
+
async run(team, options) {
|
|
60
|
+
await developingSkill(team, options);
|
|
61
|
+
},
|
|
109
62
|
});
|
|
110
63
|
//# sourceMappingURL=pipelineskill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipelineskill.js","sourceRoot":"","sources":["../../src/developing/pipelineskill.ts"],"names":[],"mappings":"
|
|
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;I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aAAa;iBACd,EACD,SAAS,CACV,CACF,CAAC,IAAI,EAAE,CAAC;gBAET,OAAO,CAAC,GAAG,CAAC,0CAA0C,eAAe,IAAI,CAAC,CAAC;YAC7E,CAAC;SACiB;KACrB,CAAC;IACF,MAAM,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;AACxD,CAAC;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAoB;IAC5D,GAAG,wBAAwB;IAC3B,sBAAsB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC,IAAI,wBAAwB,CAAC,MAAM,EAAE,SAAS,CAAC;CAC/F,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,cAAc,CAAC;IACpD,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,qDAAqD;IAClE,WAAW,EAAE,0BAA0B;IACvC,cAAc,EAAE,6BAA6B;IAC7C,KAAK,CAAC,GAAG,CACP,IAA8C,EAC9C,OAA2D;QAE3D,MAAM,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AgentTeam } from "coding-agent-forge";
|
|
2
|
-
import type { ParsedPipelineArgs } from "../pipeline.js";
|
|
3
2
|
import type { SkillEvaluatorVariables, SkillModifierVariables, SkillRunnerVariables } from "./agents/index.js";
|
|
4
3
|
export type EvolveSkillAgentVariables = {
|
|
5
4
|
"skill-runner": SkillRunnerVariables;
|
|
@@ -13,7 +12,53 @@ export type EvolveSkillOptions = {
|
|
|
13
12
|
taskPaths: readonly string[];
|
|
14
13
|
rounds: number;
|
|
15
14
|
};
|
|
16
|
-
export declare function parseEvolveSkillArgs(args: readonly string[]): ParsedPipelineArgs<EvolveSkillOptions>;
|
|
17
15
|
export declare function evolveSkill(team: AgentTeam<EvolveSkillAgentVariables>, options: EvolveSkillOptions): Promise<void>;
|
|
18
|
-
export declare const
|
|
16
|
+
export declare const evolveSkillArgsOptions: {
|
|
17
|
+
readonly "skill-path": {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly description: "Skill directory or file to revise";
|
|
20
|
+
};
|
|
21
|
+
readonly "artifact-path": {
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
readonly description: "Output folder cleared and reused by each runner round";
|
|
24
|
+
};
|
|
25
|
+
readonly "metaskill-path": {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
readonly description: "Metaskill design document used by the evaluator and modifier";
|
|
28
|
+
};
|
|
29
|
+
readonly "task-path": {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly multiple: true;
|
|
32
|
+
readonly description: "Fixed task used by the runner to test the skill";
|
|
33
|
+
};
|
|
34
|
+
readonly rounds: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
readonly default: "3";
|
|
37
|
+
readonly description: "Number of self-evolve rounds to run";
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export declare const evolveSkillPipeline: import("coding-agent-forge").Pipeline<{
|
|
41
|
+
readonly "skill-path": {
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
readonly description: "Skill directory or file to revise";
|
|
44
|
+
};
|
|
45
|
+
readonly "artifact-path": {
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
readonly description: "Output folder cleared and reused by each runner round";
|
|
48
|
+
};
|
|
49
|
+
readonly "metaskill-path": {
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
readonly description: "Metaskill design document used by the evaluator and modifier";
|
|
52
|
+
};
|
|
53
|
+
readonly "task-path": {
|
|
54
|
+
readonly type: "string";
|
|
55
|
+
readonly multiple: true;
|
|
56
|
+
readonly description: "Fixed task used by the runner to test the skill";
|
|
57
|
+
};
|
|
58
|
+
readonly rounds: {
|
|
59
|
+
readonly type: "string";
|
|
60
|
+
readonly default: "3";
|
|
61
|
+
readonly description: "Number of self-evolve rounds to run";
|
|
62
|
+
};
|
|
63
|
+
}, EvolveSkillAgentVariables>;
|
|
19
64
|
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/evolve-skill/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/evolve-skill/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAKV,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,yBAAyB,GAAG;IACtC,cAAc,EAAE,oBAAoB,CAAC;IACrC,iBAAiB,EAAE,uBAAuB,CAAC;IAC3C,gBAAgB,EAAE,sBAAsB,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAsB,WAAW,CAC/B,IAAI,EAAE,SAAS,CAAC,yBAAyB,CAAC,EAC1C,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAuDf;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;CAuBK,CAAC;AAEzC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;6BAmC9B,CAAC"}
|
|
@@ -1,38 +1,6 @@
|
|
|
1
|
+
import { definePipeline, } from "coding-agent-forge";
|
|
1
2
|
import { mkdir, readFile, rm } from "node:fs/promises";
|
|
2
|
-
import { parseArgs } from "node:util";
|
|
3
|
-
import { definePipeline } from "../pipeline.js";
|
|
4
3
|
import { agentFactories } from "./agents/index.js";
|
|
5
|
-
const USAGE = "Usage: npm run evolve-skill -- --config <path> --skill-path <path> --artifact-path <folder> --metaskill-path <path> --task-path <path> [--task-path <path> ...] [--rounds <positive-integer>]";
|
|
6
|
-
export function parseEvolveSkillArgs(args) {
|
|
7
|
-
const { values: { config, "skill-path": skillPath, "artifact-path": artifactPath, "metaskill-path": metaskillPath, "task-path": taskPath, rounds, }, } = parseArgs({
|
|
8
|
-
args: [...args],
|
|
9
|
-
options: {
|
|
10
|
-
config: { type: "string", multiple: true },
|
|
11
|
-
"skill-path": { type: "string" },
|
|
12
|
-
"artifact-path": { type: "string" },
|
|
13
|
-
"metaskill-path": { type: "string" },
|
|
14
|
-
"task-path": { type: "string", multiple: true },
|
|
15
|
-
rounds: { type: "string" },
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
if (config === undefined ||
|
|
19
|
-
skillPath === undefined ||
|
|
20
|
-
artifactPath === undefined ||
|
|
21
|
-
metaskillPath === undefined ||
|
|
22
|
-
taskPath === undefined) {
|
|
23
|
-
throw new Error(USAGE);
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
configPaths: config,
|
|
27
|
-
runningOptions: {
|
|
28
|
-
skillPath,
|
|
29
|
-
artifactPath,
|
|
30
|
-
metaskillPath,
|
|
31
|
-
taskPaths: taskPath,
|
|
32
|
-
rounds: Number(rounds ?? 3),
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
4
|
export async function evolveSkill(team, options) {
|
|
37
5
|
const logRecord = (thread, record) => {
|
|
38
6
|
console.log(thread.recordToPrettyString(record));
|
|
@@ -66,9 +34,50 @@ export async function evolveSkill(team, options) {
|
|
|
66
34
|
console.log(`# Edit\n${edit}\n`);
|
|
67
35
|
}
|
|
68
36
|
}
|
|
37
|
+
export const evolveSkillArgsOptions = {
|
|
38
|
+
"skill-path": {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "Skill directory or file to revise",
|
|
41
|
+
},
|
|
42
|
+
"artifact-path": {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "Output folder cleared and reused by each runner round",
|
|
45
|
+
},
|
|
46
|
+
"metaskill-path": {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "Metaskill design document used by the evaluator and modifier",
|
|
49
|
+
},
|
|
50
|
+
"task-path": {
|
|
51
|
+
type: "string",
|
|
52
|
+
multiple: true,
|
|
53
|
+
description: "Fixed task used by the runner to test the skill",
|
|
54
|
+
},
|
|
55
|
+
rounds: {
|
|
56
|
+
type: "string",
|
|
57
|
+
default: "3",
|
|
58
|
+
description: "Number of self-evolve rounds to run",
|
|
59
|
+
},
|
|
60
|
+
};
|
|
69
61
|
export const evolveSkillPipeline = definePipeline({
|
|
62
|
+
name: "evolve-skill",
|
|
63
|
+
description: "Run the skill evolution loop.",
|
|
64
|
+
argsOptions: evolveSkillArgsOptions,
|
|
70
65
|
agentFactories,
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
async run(team, options) {
|
|
67
|
+
const { "skill-path": skillPath, "artifact-path": artifactPath, "metaskill-path": metaskillPath, "task-path": taskPaths, rounds, } = options;
|
|
68
|
+
if (skillPath === undefined ||
|
|
69
|
+
artifactPath === undefined ||
|
|
70
|
+
metaskillPath === undefined ||
|
|
71
|
+
taskPaths === undefined) {
|
|
72
|
+
throw new Error("--skill-path, --artifact-path, --metaskill-path and --task-path are required");
|
|
73
|
+
}
|
|
74
|
+
await evolveSkill(team, {
|
|
75
|
+
skillPath,
|
|
76
|
+
artifactPath,
|
|
77
|
+
metaskillPath,
|
|
78
|
+
taskPaths,
|
|
79
|
+
rounds: Number(rounds),
|
|
80
|
+
});
|
|
81
|
+
},
|
|
73
82
|
});
|
|
74
83
|
//# sourceMappingURL=pipeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/evolve-skill/pipeline.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","s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AChD,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,+BAA+B;IAC5C,WAAW,EAAE,sBAAsB;IACnC,cAAc;IACd,KAAK,CAAC,GAAG,CACP,IAA0C,EAC1C,OAAuD;QAEvD,MAAM,EACJ,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,YAAY,EAC7B,gBAAgB,EAAE,aAAa,EAC/B,WAAW,EAAE,SAAS,EACtB,MAAM,GACP,GAAG,OAAO,CAAC;QACZ,IACE,SAAS,KAAK,SAAS;YACvB,YAAY,KAAK,SAAS;YAC1B,aAAa,KAAK,SAAS;YAC3B,SAAS,KAAK,SAAS,EACvB,CAAC;YACD,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;QACJ,CAAC;QAED,MAAM,WAAW,CAAC,IAAI,EAAE;YACtB,SAAS;YACT,YAAY;YACZ,aAAa;YACb,SAAS;YACT,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;SACvB,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "academic-army",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Agent workflows and skills for AcademicArmy.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -12,10 +12,6 @@
|
|
|
12
12
|
"node": ">=20.19"
|
|
13
13
|
},
|
|
14
14
|
"exports": {
|
|
15
|
-
".": {
|
|
16
|
-
"types": "./dist/pipeline.d.ts",
|
|
17
|
-
"import": "./dist/pipeline.js"
|
|
18
|
-
},
|
|
19
15
|
"./developing": {
|
|
20
16
|
"types": "./dist/developing/index.d.ts",
|
|
21
17
|
"import": "./dist/developing/index.js"
|
|
@@ -55,7 +51,7 @@
|
|
|
55
51
|
},
|
|
56
52
|
"dependencies": {
|
|
57
53
|
"@openai/codex-sdk": "^0.134.0",
|
|
58
|
-
"coding-agent-forge": "^1.
|
|
54
|
+
"coding-agent-forge": "^1.3.1"
|
|
59
55
|
},
|
|
60
56
|
"devDependencies": {
|
|
61
57
|
"@eslint/js": "^10.0.1",
|
package/dist/pipeline.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AgentTeam, type AgentFactoryMap, type AgentVariablesByName } from "coding-agent-forge";
|
|
2
|
-
export type ParsedPipelineArgs<Options> = {
|
|
3
|
-
configPaths: readonly string[];
|
|
4
|
-
runningOptions: Options;
|
|
5
|
-
};
|
|
6
|
-
export type PipelineDefinition<VariablesByName extends AgentVariablesByName, Options> = {
|
|
7
|
-
agentFactories: AgentFactoryMap;
|
|
8
|
-
parseArgs: (args: readonly string[]) => ParsedPipelineArgs<Options>;
|
|
9
|
-
run: (team: AgentTeam<VariablesByName>, options: Options) => Promise<void>;
|
|
10
|
-
};
|
|
11
|
-
export declare function definePipeline<VariablesByName extends AgentVariablesByName, Options>(definition: PipelineDefinition<VariablesByName, Options>): PipelineDefinition<VariablesByName, Options>;
|
|
12
|
-
export declare function runPipelineCli<VariablesByName extends AgentVariablesByName, Options>(definition: PipelineDefinition<VariablesByName, Options>, args: readonly string[]): Promise<void>;
|
|
13
|
-
//# sourceMappingURL=pipeline.d.ts.map
|
package/dist/pipeline.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAIT,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAE1B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,kBAAkB,CAAC,OAAO,IAAI;IACxC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,eAAe,SAAS,oBAAoB,EAAE,OAAO,IAAI;IACtF,cAAc,EAAE,eAAe,CAAC;IAChC,SAAS,EAAE,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACpE,GAAG,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5E,CAAC;AAEF,wBAAgB,cAAc,CAAC,eAAe,SAAS,oBAAoB,EAAE,OAAO,EAClF,UAAU,EAAE,kBAAkB,CAAC,eAAe,EAAE,OAAO,CAAC,GACvD,kBAAkB,CAAC,eAAe,EAAE,OAAO,CAAC,CAE9C;AA0BD,wBAAsB,cAAc,CAAC,eAAe,SAAS,oBAAoB,EAAE,OAAO,EACxF,UAAU,EAAE,kBAAkB,CAAC,eAAe,EAAE,OAAO,CAAC,EACxD,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
package/dist/pipeline.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { AgentTeam, isPlainObject, loadYamls, mergeConfig, } from "coding-agent-forge";
|
|
2
|
-
export function definePipeline(definition) {
|
|
3
|
-
return definition;
|
|
4
|
-
}
|
|
5
|
-
function buildPipelineAgentTeam(rawConfig, definition) {
|
|
6
|
-
if (!isPlainObject(rawConfig.agents)) {
|
|
7
|
-
throw new Error("Config must define an agents object");
|
|
8
|
-
}
|
|
9
|
-
const configuredAgents = Object.fromEntries(Object.entries(rawConfig.agents).filter(([name]) => Object.hasOwn(definition.agentFactories, name)));
|
|
10
|
-
const agents = Object.fromEntries(Object.keys(definition.agentFactories).map((name) => [name, { kind: name }]));
|
|
11
|
-
return new AgentTeam(mergeConfig({ ...rawConfig, agents: configuredAgents }, { agents }), definition.agentFactories);
|
|
12
|
-
}
|
|
13
|
-
export async function runPipelineCli(definition, args) {
|
|
14
|
-
const { configPaths, runningOptions } = definition.parseArgs(args);
|
|
15
|
-
const rawConfig = await loadYamls(...configPaths);
|
|
16
|
-
const team = buildPipelineAgentTeam(rawConfig, definition);
|
|
17
|
-
try {
|
|
18
|
-
await definition.run(team, runningOptions);
|
|
19
|
-
}
|
|
20
|
-
finally {
|
|
21
|
-
await team.close();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=pipeline.js.map
|
package/dist/pipeline.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,aAAa,EACb,SAAS,EACT,WAAW,GAIZ,MAAM,oBAAoB,CAAC;AAa5B,MAAM,UAAU,cAAc,CAC5B,UAAwD;IAExD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,sBAAsB,CAC7B,SAAsB,EACtB,UAAwD;IAExD,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,WAAW,CACzC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CACjD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,IAAI,CAAC,CAC/C,CACF,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAC/B,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAC7E,CAAC;IAEF,OAAO,IAAI,SAAS,CAClB,WAAW,CAAC,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAAE,EAAE,MAAM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