agentic-forge 0.0.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +31 -21
- package/dist/checkpoints/manager.d.ts +5 -0
- package/dist/checkpoints/manager.js +87 -0
- package/dist/checkpoints/manager.js.map +1 -0
- package/{src → dist}/claude/.claude/skills/analyze/SKILL.md +1 -1
- package/{src → dist}/claude/.claude/skills/create-checkpoint/SKILL.md +1 -1
- package/{src → dist}/claude/.claude/skills/create-log/SKILL.md +1 -1
- package/{src → dist}/claude/.claude/skills/fix-analyze/SKILL.md +1 -1
- package/{src → dist}/claude/.claude/skills/git-branch/SKILL.md +1 -1
- package/{src → dist}/claude/.claude/skills/git-commit/SKILL.md +1 -1
- package/{src → dist}/claude/.claude/skills/git-pr/SKILL.md +1 -1
- package/{src → dist}/claude/.claude/skills/sdlc-plan/SKILL.md +1 -1
- package/{src → dist}/claude/.claude/skills/sdlc-review/SKILL.md +1 -1
- package/{src → dist}/claude/.claude/skills/workflow-builder/SKILL.md +1 -1
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +155 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/config-cmd.d.ts +2 -0
- package/dist/commands/config-cmd.js +30 -0
- package/dist/commands/config-cmd.js.map +1 -0
- package/{src/commands/index.ts → dist/commands/index.d.ts} +1 -10
- package/dist/commands/index.js +13 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +6 -0
- package/dist/commands/init.js +83 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/release-notes.d.ts +5 -0
- package/dist/commands/release-notes.js +68 -0
- package/dist/commands/release-notes.js.map +1 -0
- package/dist/commands/resume.d.ts +5 -0
- package/dist/commands/resume.js +79 -0
- package/dist/commands/resume.js.map +1 -0
- package/dist/commands/run.d.ts +14 -0
- package/dist/commands/run.js +193 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/shortcuts.d.ts +2 -0
- package/dist/commands/shortcuts.js +11 -0
- package/dist/commands/shortcuts.js.map +1 -0
- package/dist/commands/skills-dir.d.ts +2 -0
- package/dist/commands/skills-dir.js +9 -0
- package/dist/commands/skills-dir.js.map +1 -0
- package/dist/commands/status.d.ts +4 -0
- package/dist/commands/status.js +99 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/update.d.ts +4 -0
- package/dist/commands/update.js +65 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/version.d.ts +3 -0
- package/dist/commands/version.js +26 -0
- package/dist/commands/version.js.map +1 -0
- package/dist/commands/workflows.d.ts +4 -0
- package/dist/commands/workflows.js +109 -0
- package/dist/commands/workflows.js.map +1 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.js +110 -0
- package/dist/config.js.map +1 -0
- package/dist/console.d.ts +103 -0
- package/dist/console.js +670 -0
- package/dist/console.js.map +1 -0
- package/dist/executor.d.ts +27 -0
- package/dist/executor.js +236 -0
- package/dist/executor.js.map +1 -0
- package/dist/git/worktree.d.ts +23 -0
- package/dist/git/worktree.js +170 -0
- package/dist/git/worktree.js.map +1 -0
- package/dist/logging/logger.d.ts +27 -0
- package/dist/logging/logger.js +69 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/orchestrator.d.ts +44 -0
- package/dist/orchestrator.js +587 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/parser.d.ts +17 -0
- package/dist/parser.js +184 -0
- package/dist/parser.js.map +1 -0
- package/dist/progress.d.ts +29 -0
- package/dist/progress.js +275 -0
- package/dist/progress.js.map +1 -0
- package/dist/ralph-loop.d.ts +26 -0
- package/dist/ralph-loop.js +194 -0
- package/dist/ralph-loop.js.map +1 -0
- package/dist/renderer.d.ts +15 -0
- package/dist/renderer.js +123 -0
- package/dist/renderer.js.map +1 -0
- package/dist/runner.d.ts +84 -0
- package/dist/runner.js +529 -0
- package/dist/runner.js.map +1 -0
- package/dist/signal-manager.d.ts +16 -0
- package/dist/signal-manager.js +50 -0
- package/dist/signal-manager.js.map +1 -0
- package/dist/steps/base.d.ts +28 -0
- package/dist/steps/base.js +23 -0
- package/dist/steps/base.js.map +1 -0
- package/dist/steps/conditional-step.d.ts +12 -0
- package/dist/steps/conditional-step.js +106 -0
- package/dist/steps/conditional-step.js.map +1 -0
- package/{src/steps/index.ts → dist/steps/index.d.ts} +1 -9
- package/dist/steps/index.js +8 -0
- package/dist/steps/index.js.map +1 -0
- package/dist/steps/parallel-step.d.ts +11 -0
- package/dist/steps/parallel-step.js +166 -0
- package/dist/steps/parallel-step.js.map +1 -0
- package/dist/steps/prompt-step.d.ts +8 -0
- package/dist/steps/prompt-step.js +94 -0
- package/dist/steps/prompt-step.js.map +1 -0
- package/dist/steps/ralph-loop-step.d.ts +8 -0
- package/dist/steps/ralph-loop-step.js +132 -0
- package/dist/steps/ralph-loop-step.js.map +1 -0
- package/dist/steps/serial-step.d.ts +10 -0
- package/dist/steps/serial-step.js +57 -0
- package/dist/steps/serial-step.js.map +1 -0
- package/dist/types.d.ts +118 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/package.json +56 -2
- package/.gitattributes +0 -24
- package/.github/workflows/ci.yml +0 -70
- package/.markdownlint-cli2.jsonc +0 -16
- package/.prettierignore +0 -3
- package/.prettierrc +0 -6
- package/.vscode/agentic-forge.code-workspace +0 -26
- package/CHANGELOG.md +0 -100
- package/CLAUDE.md +0 -158
- package/CONTRIBUTING.md +0 -152
- package/biome.json +0 -21
- package/scripts/copy-assets.js +0 -21
- package/src/checkpoints/manager.ts +0 -119
- package/src/cli.ts +0 -182
- package/src/commands/config-cmd.ts +0 -28
- package/src/commands/init.ts +0 -96
- package/src/commands/release-notes.ts +0 -85
- package/src/commands/resume.ts +0 -103
- package/src/commands/run.ts +0 -234
- package/src/commands/shortcuts.ts +0 -11
- package/src/commands/skills-dir.ts +0 -11
- package/src/commands/status.ts +0 -112
- package/src/commands/update.ts +0 -64
- package/src/commands/version.ts +0 -27
- package/src/commands/workflows.ts +0 -129
- package/src/config.ts +0 -129
- package/src/console.ts +0 -790
- package/src/executor.ts +0 -354
- package/src/git/worktree.ts +0 -236
- package/src/logging/logger.ts +0 -95
- package/src/orchestrator.ts +0 -815
- package/src/parser.ts +0 -225
- package/src/progress.ts +0 -306
- package/src/ralph-loop.ts +0 -260
- package/src/renderer.ts +0 -164
- package/src/runner.ts +0 -634
- package/src/signal-manager.ts +0 -55
- package/src/steps/base.ts +0 -71
- package/src/steps/conditional-step.ts +0 -144
- package/src/steps/parallel-step.ts +0 -213
- package/src/steps/prompt-step.ts +0 -121
- package/src/steps/ralph-loop-step.ts +0 -186
- package/src/steps/serial-step.ts +0 -84
- package/src/types.ts +0 -141
- package/tests/config.test.ts +0 -219
- package/tests/console.test.ts +0 -506
- package/tests/executor.test.ts +0 -339
- package/tests/init.test.ts +0 -86
- package/tests/logger.test.ts +0 -110
- package/tests/parser.test.ts +0 -290
- package/tests/progress.test.ts +0 -345
- package/tests/ralph-loop.test.ts +0 -418
- package/tests/renderer.test.ts +0 -350
- package/tests/runner.test.ts +0 -497
- package/tests/setup.test.ts +0 -7
- package/tests/signal-manager.test.ts +0 -26
- package/tests/steps.test.ts +0 -412
- package/tests/worktree.test.ts +0 -411
- package/tsconfig.json +0 -18
- package/vitest.config.ts +0 -8
- /package/{src → dist}/agents/explorer.md +0 -0
- /package/{src → dist}/agents/reviewer.md +0 -0
- /package/{src → dist}/claude/.claude/skills/analyze/references/bug.md +0 -0
- /package/{src → dist}/claude/.claude/skills/analyze/references/debt.md +0 -0
- /package/{src → dist}/claude/.claude/skills/analyze/references/doc.md +0 -0
- /package/{src → dist}/claude/.claude/skills/analyze/references/security.md +0 -0
- /package/{src → dist}/claude/.claude/skills/analyze/references/style.md +0 -0
- /package/{src → dist}/claude/.claude/skills/orchestrate/SKILL.md +0 -0
- /package/{src → dist}/claude/.claude/skills/sdlc-plan/references/bug.md +0 -0
- /package/{src → dist}/claude/.claude/skills/sdlc-plan/references/chore.md +0 -0
- /package/{src → dist}/claude/.claude/skills/sdlc-plan/references/feature.md +0 -0
- /package/{src → dist}/claude/.claude/skills/workflow-builder/references/REFERENCE.md +0 -0
- /package/{src → dist}/claude/.claude/skills/workflow-builder/references/workflow-example.yaml +0 -0
- /package/{src → dist}/prompts/agentic-system.md +0 -0
- /package/{src → dist}/templates/analysis/bug.md.j2 +0 -0
- /package/{src → dist}/templates/analysis/debt.md.j2 +0 -0
- /package/{src → dist}/templates/analysis/doc.md.j2 +0 -0
- /package/{src → dist}/templates/analysis/security.md.j2 +0 -0
- /package/{src → dist}/templates/analysis/style.md.j2 +0 -0
- /package/{src → dist}/templates/analysis-summary.md.j2 +0 -0
- /package/{src → dist}/templates/checkpoint.md.j2 +0 -0
- /package/{src → dist}/templates/implementation-report.md.j2 +0 -0
- /package/{src → dist}/templates/memory.md.j2 +0 -0
- /package/{src → dist}/templates/plan-bug.md.j2 +0 -0
- /package/{src → dist}/templates/plan-chore.md.j2 +0 -0
- /package/{src → dist}/templates/plan-feature.md.j2 +0 -0
- /package/{src → dist}/templates/progress.json.j2 +0 -0
- /package/{src → dist}/templates/ralph-report.md.j2 +0 -0
- /package/{src → dist}/workflows/analyze-codebase-merge.yaml +0 -0
- /package/{src → dist}/workflows/analyze-codebase.yaml +0 -0
- /package/{src → dist}/workflows/analyze-single.yaml +0 -0
- /package/{src → dist}/workflows/demo.yaml +0 -0
- /package/{src → dist}/workflows/one-shot.yaml +0 -0
- /package/{src → dist}/workflows/plan-build-review.yaml +0 -0
- /package/{src → dist}/workflows/ralph-loop.yaml +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Version command handler. */
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
export function cmdVersion() {
|
|
7
|
+
try {
|
|
8
|
+
const packageJsonPath = path.join(__dirname, "..", "..", "package.json");
|
|
9
|
+
const pkg = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
10
|
+
process.stdout.write(`agentic-forge ${pkg.version}\n`);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
process.stdout.write("agentic-forge version unknown (package not installed)\n");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function getVersion() {
|
|
17
|
+
try {
|
|
18
|
+
const packageJsonPath = path.join(__dirname, "..", "..", "package.json");
|
|
19
|
+
const pkg = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
20
|
+
return pkg.version;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return "unknown";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/commands/version.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE/D,MAAM,UAAU,UAAU;IACzB,IAAI,CAAC;QACJ,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QACzE,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAwB,CAAC;QACtF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;IACjF,CAAC;AACF,CAAC;AAED,MAAM,UAAU,UAAU;IACzB,IAAI,CAAC;QACJ,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QACzE,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAwB,CAAC;QACtF,OAAO,GAAG,CAAC,OAAO,CAAC;IACpB,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/** Workflows command handler. */
|
|
2
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import yaml from "js-yaml";
|
|
5
|
+
import { getBundledWorkflowsDir, getProjectWorkflowsDir, getUserWorkflowsDir } from "./run.js";
|
|
6
|
+
function getWorkflowMetadata(filePath) {
|
|
7
|
+
try {
|
|
8
|
+
const content = yaml.load(readFileSync(filePath, "utf-8"));
|
|
9
|
+
if (!content || typeof content !== "object") {
|
|
10
|
+
return { name: path.basename(filePath, ".yaml"), description: "", variables: [] };
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
name: content.name ?? path.basename(filePath, ".yaml"),
|
|
14
|
+
description: content.description ?? "",
|
|
15
|
+
variables: content.variables ?? [],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return { name: path.basename(filePath, ".yaml"), description: "", variables: [] };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function listAllWorkflows() {
|
|
23
|
+
const workflows = [];
|
|
24
|
+
const searchLocations = [
|
|
25
|
+
[getProjectWorkflowsDir(), "project"],
|
|
26
|
+
[getUserWorkflowsDir(), "user"],
|
|
27
|
+
[getBundledWorkflowsDir(), "bundled"],
|
|
28
|
+
];
|
|
29
|
+
for (const [directory, locationType] of searchLocations) {
|
|
30
|
+
if (existsSync(directory)) {
|
|
31
|
+
const files = readdirSync(directory)
|
|
32
|
+
.filter((f) => f.endsWith(".yaml"))
|
|
33
|
+
.sort();
|
|
34
|
+
for (const file of files) {
|
|
35
|
+
const fullPath = path.join(directory, file);
|
|
36
|
+
const metadata = getWorkflowMetadata(fullPath);
|
|
37
|
+
workflows.push([path.basename(file, ".yaml"), fullPath, locationType, metadata]);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return workflows;
|
|
42
|
+
}
|
|
43
|
+
export function cmdWorkflows(options) {
|
|
44
|
+
const workflows = listAllWorkflows();
|
|
45
|
+
if (workflows.length === 0) {
|
|
46
|
+
process.stdout.write("No workflows found.\n");
|
|
47
|
+
process.stdout.write("\nSearched locations:\n");
|
|
48
|
+
process.stdout.write(` - Project: ${getProjectWorkflowsDir()}\n`);
|
|
49
|
+
process.stdout.write(` - User: ${getUserWorkflowsDir()}\n`);
|
|
50
|
+
process.stdout.write(` - Bundled: ${getBundledWorkflowsDir()}\n`);
|
|
51
|
+
process.stdout.write("\nUse 'agentic-forge init' to copy bundled workflows locally.\n");
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const verbose = options.verbose ?? false;
|
|
55
|
+
// Group by location
|
|
56
|
+
const byLocation = {};
|
|
57
|
+
for (const [name, wfPath, location, metadata] of workflows) {
|
|
58
|
+
if (!byLocation[location]) {
|
|
59
|
+
byLocation[location] = [];
|
|
60
|
+
}
|
|
61
|
+
byLocation[location].push([name, wfPath, metadata]);
|
|
62
|
+
}
|
|
63
|
+
process.stdout.write("Available Workflows\n");
|
|
64
|
+
process.stdout.write(`${"=".repeat(50)}\n\n`);
|
|
65
|
+
const locationOrder = ["project", "user", "bundled"];
|
|
66
|
+
const locationLabels = {
|
|
67
|
+
project: "Project",
|
|
68
|
+
user: "User",
|
|
69
|
+
bundled: "Bundled",
|
|
70
|
+
};
|
|
71
|
+
for (const location of locationOrder) {
|
|
72
|
+
if (!byLocation[location]) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
process.stdout.write(`${locationLabels[location]}:\n`);
|
|
76
|
+
for (const [name, , metadata] of byLocation[location]) {
|
|
77
|
+
let desc = metadata.description;
|
|
78
|
+
if (desc) {
|
|
79
|
+
if (desc.length > 60 && !verbose) {
|
|
80
|
+
desc = `${desc.slice(0, 57)}...`;
|
|
81
|
+
}
|
|
82
|
+
process.stdout.write(` ${name.padEnd(25)} ${desc}\n`);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
process.stdout.write(` ${name}\n`);
|
|
86
|
+
}
|
|
87
|
+
if (verbose && metadata.variables.length > 0) {
|
|
88
|
+
const required = metadata.variables.filter((v) => v.required).map((v) => v.name);
|
|
89
|
+
const optional = metadata.variables.filter((v) => !v.required).map((v) => v.name);
|
|
90
|
+
if (required.length > 0) {
|
|
91
|
+
process.stdout.write(` Required: ${required.join(", ")}\n`);
|
|
92
|
+
}
|
|
93
|
+
if (optional.length > 0) {
|
|
94
|
+
process.stdout.write(` Optional: ${optional.join(", ")}\n`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
process.stdout.write("\n");
|
|
99
|
+
}
|
|
100
|
+
process.stdout.write(`Total: ${workflows.length} workflow(s)\n\n`);
|
|
101
|
+
process.stdout.write("Usage:\n");
|
|
102
|
+
process.stdout.write(" agentic-forge run <workflow-name>\n");
|
|
103
|
+
process.stdout.write(" agentic-forge run <workflow-name> --var key=value\n\n");
|
|
104
|
+
process.stdout.write("Examples:\n");
|
|
105
|
+
process.stdout.write(' agentic-forge run one-shot --var task="Add login button"\n');
|
|
106
|
+
process.stdout.write(" agentic-forge run analyze-single --var analysis_type=bug\n");
|
|
107
|
+
process.stdout.write(' agentic-forge run plan-build-review --var task="Refactor auth"\n');
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=workflows.js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M,GAAG,CAAC,EAAE,CAAC;oBACzB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAChE,CAAC;YACF,CAAC;QACF,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,SAAS,CAAC,MAAM,kBAAkB,CAAC,CAAC;IACnE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACjC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC9D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAChF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IACpC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;IACrF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;IACrF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;AAC5F,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Configuration management for agentic-forge. */
|
|
2
|
+
export declare function getConfigPath(repoRoot?: string): string;
|
|
3
|
+
export declare function getDefaultConfig(): Record<string, unknown>;
|
|
4
|
+
export declare function loadConfig(repoRoot?: string): Record<string, unknown>;
|
|
5
|
+
export declare function saveConfig(config: Record<string, unknown>, repoRoot?: string): void;
|
|
6
|
+
export declare function getConfigValue(key: string, repoRoot?: string): unknown;
|
|
7
|
+
export declare function setConfigValue(key: string, value: string, repoRoot?: string): void;
|
|
8
|
+
export declare function deepMerge(base: Record<string, unknown>, override: Record<string, unknown>): Record<string, unknown>;
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/** Configuration management for agentic-forge. */
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
const DEFAULT_CONFIG = {
|
|
5
|
+
outputDirectory: "agentic",
|
|
6
|
+
logging: {
|
|
7
|
+
enabled: true,
|
|
8
|
+
level: "Error",
|
|
9
|
+
},
|
|
10
|
+
git: {
|
|
11
|
+
mainBranch: "main",
|
|
12
|
+
autoCommit: true,
|
|
13
|
+
autoPr: true,
|
|
14
|
+
},
|
|
15
|
+
defaults: {
|
|
16
|
+
model: "sonnet",
|
|
17
|
+
maxRetry: 3,
|
|
18
|
+
timeoutMinutes: 60,
|
|
19
|
+
trackProgress: true,
|
|
20
|
+
terminalOutput: "base",
|
|
21
|
+
},
|
|
22
|
+
execution: {
|
|
23
|
+
maxWorkers: 4,
|
|
24
|
+
pollingIntervalSeconds: 5,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export function getConfigPath(repoRoot) {
|
|
28
|
+
const root = repoRoot ?? process.cwd();
|
|
29
|
+
return path.join(root, "agentic", "config.json");
|
|
30
|
+
}
|
|
31
|
+
export function getDefaultConfig() {
|
|
32
|
+
return deepCopy(DEFAULT_CONFIG);
|
|
33
|
+
}
|
|
34
|
+
export function loadConfig(repoRoot) {
|
|
35
|
+
const configPath = getConfigPath(repoRoot);
|
|
36
|
+
if (existsSync(configPath)) {
|
|
37
|
+
const content = readFileSync(configPath, "utf-8");
|
|
38
|
+
const userConfig = JSON.parse(content);
|
|
39
|
+
return deepMerge(getDefaultConfig(), userConfig);
|
|
40
|
+
}
|
|
41
|
+
return getDefaultConfig();
|
|
42
|
+
}
|
|
43
|
+
export function saveConfig(config, repoRoot) {
|
|
44
|
+
const configPath = getConfigPath(repoRoot);
|
|
45
|
+
const dir = path.dirname(configPath);
|
|
46
|
+
mkdirSync(dir, { recursive: true });
|
|
47
|
+
writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
48
|
+
}
|
|
49
|
+
export function getConfigValue(key, repoRoot) {
|
|
50
|
+
const config = loadConfig(repoRoot);
|
|
51
|
+
const parts = key.split(".");
|
|
52
|
+
let value = config;
|
|
53
|
+
for (const part of parts) {
|
|
54
|
+
if (value !== null &&
|
|
55
|
+
typeof value === "object" &&
|
|
56
|
+
!Array.isArray(value) &&
|
|
57
|
+
part in value) {
|
|
58
|
+
value = value[part];
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
export function setConfigValue(key, value, repoRoot) {
|
|
67
|
+
const config = loadConfig(repoRoot);
|
|
68
|
+
const parts = key.split(".");
|
|
69
|
+
let target = config;
|
|
70
|
+
for (const part of parts.slice(0, -1)) {
|
|
71
|
+
if (!(part in target)) {
|
|
72
|
+
target[part] = {};
|
|
73
|
+
}
|
|
74
|
+
target = target[part];
|
|
75
|
+
}
|
|
76
|
+
let parsedValue = value;
|
|
77
|
+
if (value.toLowerCase() === "true") {
|
|
78
|
+
parsedValue = true;
|
|
79
|
+
}
|
|
80
|
+
else if (value.toLowerCase() === "false") {
|
|
81
|
+
parsedValue = false;
|
|
82
|
+
}
|
|
83
|
+
else if (/^\d+$/.test(value)) {
|
|
84
|
+
parsedValue = Number.parseInt(value, 10);
|
|
85
|
+
}
|
|
86
|
+
target[parts[parts.length - 1]] = parsedValue;
|
|
87
|
+
saveConfig(config, repoRoot);
|
|
88
|
+
}
|
|
89
|
+
export function deepMerge(base, override) {
|
|
90
|
+
const result = { ...base };
|
|
91
|
+
for (const key of Object.keys(override)) {
|
|
92
|
+
if (key in result &&
|
|
93
|
+
typeof result[key] === "object" &&
|
|
94
|
+
result[key] !== null &&
|
|
95
|
+
!Array.isArray(result[key]) &&
|
|
96
|
+
typeof override[key] === "object" &&
|
|
97
|
+
override[key] !== null &&
|
|
98
|
+
!Array.isArray(override[key])) {
|
|
99
|
+
result[key] = deepMerge(result[key], override[key]);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
result[key] = override[key];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
function deepCopy(obj) {
|
|
108
|
+
return JSON.parse(JSON.stringify(obj));
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAElD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,cAAc,GAA4B;IAC/C,eAAe,EAAE,SAAS;IAC1B,OAAO,EAAE;QACR,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,OAAO;KACd;IACD,GAAG,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,UAAU,EAAE,IAAI;QAChB,MAAM,EAAE,IAAI;KACZ;IACD,QAAQ,EAAE;QACT,KAAK,EAAE,QAAQ;QACf,QAAQ,EAAE,CAAC;QACX,cAAc,EAAE,EAAE;QAClB,aAAa,EAAE,IAAI;QACnB,cAAc,EAAE,MAAM;KACtB;IACD,SAAS,EAAE;QACV,UAAU,EAAE,CAAC;QACb,sBAAsB,EAAE,CAAC;KACzB;CACD,CAAC;AAEF,MAAM,UAAU,aAAa,CAAC,QAAiB;IAC9C,MAAM,IAAI,GAAG,QAAQ,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACvC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC/B,OAAO,QAAQ,CAAC,cAAc,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,UA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GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzC,IACC,GAAG,IAAI,MAAM;YACb,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ;YAC/B,MAAM,CAAC,GAAG,CAAC,KAAK,IAAI;YACpB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC3B,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,QAAQ;YACjC,QAAQ,CAAC,GAAG,CAAC,KAAK,IAAI;YACtB,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAC5B,CAAC;YACF,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CACtB,MAAM,CAAC,GAAG,CAA4B,EACtC,QAAQ,CAAC,GAAG,CAA4B,CACxC,CAAC;QACH,CAAC;aAAM,CAAC;YACP,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,QAAQ,CAAC,GAA4B;IAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAA4B,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/** Console output utilities for workflow execution. */
|
|
2
|
+
import type { Writable } from "node:stream";
|
|
3
|
+
export declare const OutputLevel: {
|
|
4
|
+
readonly BASE: "base";
|
|
5
|
+
readonly ALL: "all";
|
|
6
|
+
};
|
|
7
|
+
export type OutputLevel = (typeof OutputLevel)[keyof typeof OutputLevel];
|
|
8
|
+
export declare const Color: {
|
|
9
|
+
readonly RESET: "\u001B[0m";
|
|
10
|
+
readonly BOLD: "\u001B[1m";
|
|
11
|
+
readonly DIM: "\u001B[2m";
|
|
12
|
+
readonly RED: "\u001B[31m";
|
|
13
|
+
readonly GREEN: "\u001B[32m";
|
|
14
|
+
readonly YELLOW: "\u001B[33m";
|
|
15
|
+
readonly BLUE: "\u001B[34m";
|
|
16
|
+
readonly MAGENTA: "\u001B[35m";
|
|
17
|
+
readonly CYAN: "\u001B[36m";
|
|
18
|
+
readonly WHITE: "\u001B[37m";
|
|
19
|
+
readonly BRIGHT_RED: "\u001B[91m";
|
|
20
|
+
readonly BRIGHT_GREEN: "\u001B[92m";
|
|
21
|
+
readonly BRIGHT_YELLOW: "\u001B[93m";
|
|
22
|
+
readonly BRIGHT_BLUE: "\u001B[94m";
|
|
23
|
+
readonly BRIGHT_CYAN: "\u001B[96m";
|
|
24
|
+
};
|
|
25
|
+
export type Color = (typeof Color)[keyof typeof Color];
|
|
26
|
+
export declare function supportsColor(): boolean;
|
|
27
|
+
export declare function colorize(text: string, ...colors: Color[]): string;
|
|
28
|
+
/** Callback to format a model name for display, avoiding circular imports with runner.ts. */
|
|
29
|
+
type ModelFormatter = (model: string) => string | null;
|
|
30
|
+
export declare class ParallelOutputHandler {
|
|
31
|
+
stream: Writable;
|
|
32
|
+
level: OutputLevel;
|
|
33
|
+
private printFn;
|
|
34
|
+
private branches;
|
|
35
|
+
private branchIndex;
|
|
36
|
+
private branchDone;
|
|
37
|
+
private deferredMessages;
|
|
38
|
+
private linesPerBranch;
|
|
39
|
+
private active;
|
|
40
|
+
private currentBranch;
|
|
41
|
+
private accumulatedText;
|
|
42
|
+
private accumulatedRole;
|
|
43
|
+
private accumulatedModel;
|
|
44
|
+
private baseAccumulatedText;
|
|
45
|
+
private messageQueue;
|
|
46
|
+
constructor(stream?: Writable, level?: OutputLevel, printFn?: (message: string) => void);
|
|
47
|
+
private print;
|
|
48
|
+
get isActive(): boolean;
|
|
49
|
+
get hasBranches(): boolean;
|
|
50
|
+
registerBranches(branches: string[]): void;
|
|
51
|
+
updateBranchLine(branch: string, text: string, maxWidth?: number): void;
|
|
52
|
+
markBranchDone(branch: string, success?: boolean): void;
|
|
53
|
+
private clearDisplay;
|
|
54
|
+
enter(): void;
|
|
55
|
+
exit(): void;
|
|
56
|
+
deferMessage(message: string): void;
|
|
57
|
+
setBranch(branchName: string): void;
|
|
58
|
+
getCurrentBranch(): string | null;
|
|
59
|
+
enqueueCurrentMessage(): void;
|
|
60
|
+
private printBranchMessage;
|
|
61
|
+
accumulateText(text: string, role: string, model?: string | null): void;
|
|
62
|
+
accumulateBaseText(text: string): string;
|
|
63
|
+
}
|
|
64
|
+
export declare class ConsoleOutput {
|
|
65
|
+
level: OutputLevel;
|
|
66
|
+
stream: Writable;
|
|
67
|
+
_baseAccumulatedText: string;
|
|
68
|
+
private baseLastDisplayLines;
|
|
69
|
+
_parallelHandler: ParallelOutputHandler;
|
|
70
|
+
private formatModelName;
|
|
71
|
+
constructor(level?: OutputLevel, stream?: Writable);
|
|
72
|
+
/** Set model name formatter to avoid circular imports with runner. */
|
|
73
|
+
setModelFormatter(fn: ModelFormatter): void;
|
|
74
|
+
private printLine;
|
|
75
|
+
private printInplace;
|
|
76
|
+
private clearInplace;
|
|
77
|
+
registerParallelBranches(branches: string[]): void;
|
|
78
|
+
enterParallelMode(): void;
|
|
79
|
+
exitParallelMode(): void;
|
|
80
|
+
setParallelBranch(branchName: string): void;
|
|
81
|
+
markParallelBranchDone(branch: string, success?: boolean): void;
|
|
82
|
+
private isParallelMode;
|
|
83
|
+
private shouldDeferMessage;
|
|
84
|
+
private deferMessage;
|
|
85
|
+
workflowStart(workflowName: string, workflowId: string): void;
|
|
86
|
+
workflowComplete(workflowName: string, status: string): void;
|
|
87
|
+
stepStart(stepName: string, stepType?: string | null, model?: string | null): void;
|
|
88
|
+
stepComplete(stepName: string, summary?: string | null): void;
|
|
89
|
+
stepFailed(stepName: string, error?: string | null): void;
|
|
90
|
+
stepRetry(stepName: string, attempt: number, maxAttempts: number, error?: string | null): void;
|
|
91
|
+
ralphIterationStart(stepName: string, iteration: number, maxIterations: number): void;
|
|
92
|
+
ralphIteration(_stepName: string, _iteration: number, _maxIterations: number, summary?: string | null): void;
|
|
93
|
+
ralphComplete(stepName: string, iteration: number, maxIterations: number): void;
|
|
94
|
+
ralphMaxIterations(stepName: string, maxIterations: number): void;
|
|
95
|
+
info(message: string): void;
|
|
96
|
+
warning(message: string): void;
|
|
97
|
+
error(message: string): void;
|
|
98
|
+
streamText(text: string, role?: string, model?: string | null): void;
|
|
99
|
+
streamComplete(): void;
|
|
100
|
+
}
|
|
101
|
+
export declare function extractJson(output: string): Record<string, unknown> | null;
|
|
102
|
+
export declare function extractSummary(output: string, maxLines?: number, maxChars?: number): string;
|
|
103
|
+
export {};
|