@aiagentflow/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +232 -0
- package/dist/agents/base.d.ts +69 -0
- package/dist/agents/base.d.ts.map +1 -0
- package/dist/agents/base.js +78 -0
- package/dist/agents/base.js.map +1 -0
- package/dist/agents/factory.d.ts +21 -0
- package/dist/agents/factory.d.ts.map +1 -0
- package/dist/agents/factory.js +50 -0
- package/dist/agents/factory.js.map +1 -0
- package/dist/agents/roles/architect.d.ts +23 -0
- package/dist/agents/roles/architect.d.ts.map +1 -0
- package/dist/agents/roles/architect.js +39 -0
- package/dist/agents/roles/architect.js.map +1 -0
- package/dist/agents/roles/coder.d.ts +19 -0
- package/dist/agents/roles/coder.d.ts.map +1 -0
- package/dist/agents/roles/coder.js +38 -0
- package/dist/agents/roles/coder.js.map +1 -0
- package/dist/agents/roles/fixer.d.ts +19 -0
- package/dist/agents/roles/fixer.d.ts.map +1 -0
- package/dist/agents/roles/fixer.js +29 -0
- package/dist/agents/roles/fixer.js.map +1 -0
- package/dist/agents/roles/judge.d.ts +24 -0
- package/dist/agents/roles/judge.d.ts.map +1 -0
- package/dist/agents/roles/judge.js +38 -0
- package/dist/agents/roles/judge.js.map +1 -0
- package/dist/agents/roles/reviewer.d.ts +28 -0
- package/dist/agents/roles/reviewer.d.ts.map +1 -0
- package/dist/agents/roles/reviewer.js +49 -0
- package/dist/agents/roles/reviewer.js.map +1 -0
- package/dist/agents/roles/tester.d.ts +19 -0
- package/dist/agents/roles/tester.d.ts.map +1 -0
- package/dist/agents/roles/tester.js +29 -0
- package/dist/agents/roles/tester.js.map +1 -0
- package/dist/agents/types.d.ts +13 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +25 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/cli/commands/config.d.ts +9 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +30 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +12 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +63 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/init.d.ts +12 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +231 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/run.d.ts +11 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +66 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +24 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/config/defaults.d.ts +22 -0
- package/dist/core/config/defaults.d.ts.map +1 -0
- package/dist/core/config/defaults.js +60 -0
- package/dist/core/config/defaults.js.map +1 -0
- package/dist/core/config/manager.d.ts +45 -0
- package/dist/core/config/manager.d.ts.map +1 -0
- package/dist/core/config/manager.js +106 -0
- package/dist/core/config/manager.js.map +1 -0
- package/dist/core/config/schema.d.ts +780 -0
- package/dist/core/config/schema.d.ts.map +1 -0
- package/dist/core/config/schema.js +102 -0
- package/dist/core/config/schema.js.map +1 -0
- package/dist/core/config/types.d.ts +24 -0
- package/dist/core/config/types.d.ts.map +1 -0
- package/dist/core/config/types.js +11 -0
- package/dist/core/config/types.js.map +1 -0
- package/dist/core/errors.d.ts +36 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +60 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/workflow/approval.d.ts +22 -0
- package/dist/core/workflow/approval.d.ts.map +1 -0
- package/dist/core/workflow/approval.js +54 -0
- package/dist/core/workflow/approval.js.map +1 -0
- package/dist/core/workflow/engine.d.ts +128 -0
- package/dist/core/workflow/engine.d.ts.map +1 -0
- package/dist/core/workflow/engine.js +159 -0
- package/dist/core/workflow/engine.js.map +1 -0
- package/dist/core/workflow/file-parser.d.ts +41 -0
- package/dist/core/workflow/file-parser.d.ts.map +1 -0
- package/dist/core/workflow/file-parser.js +138 -0
- package/dist/core/workflow/file-parser.js.map +1 -0
- package/dist/core/workflow/qa-policy.d.ts +55 -0
- package/dist/core/workflow/qa-policy.d.ts.map +1 -0
- package/dist/core/workflow/qa-policy.js +119 -0
- package/dist/core/workflow/qa-policy.js.map +1 -0
- package/dist/core/workflow/runner.d.ts +30 -0
- package/dist/core/workflow/runner.d.ts.map +1 -0
- package/dist/core/workflow/runner.js +273 -0
- package/dist/core/workflow/runner.js.map +1 -0
- package/dist/core/workflow/session.d.ts +37 -0
- package/dist/core/workflow/session.d.ts.map +1 -0
- package/dist/core/workflow/session.js +93 -0
- package/dist/core/workflow/session.js.map +1 -0
- package/dist/core/workflow/task-queue.d.ts +46 -0
- package/dist/core/workflow/task-queue.d.ts.map +1 -0
- package/dist/core/workflow/task-queue.js +106 -0
- package/dist/core/workflow/task-queue.js.map +1 -0
- package/dist/core/workflow/test-runner.d.ts +25 -0
- package/dist/core/workflow/test-runner.d.ts.map +1 -0
- package/dist/core/workflow/test-runner.js +50 -0
- package/dist/core/workflow/test-runner.js.map +1 -0
- package/dist/core/workflow/token-tracker.d.ts +54 -0
- package/dist/core/workflow/token-tracker.d.ts.map +1 -0
- package/dist/core/workflow/token-tracker.js +98 -0
- package/dist/core/workflow/token-tracker.js.map +1 -0
- package/dist/git/client.d.ts +47 -0
- package/dist/git/client.d.ts.map +1 -0
- package/dist/git/client.js +109 -0
- package/dist/git/client.js.map +1 -0
- package/dist/prompts/library.d.ts +35 -0
- package/dist/prompts/library.d.ts.map +1 -0
- package/dist/prompts/library.js +238 -0
- package/dist/prompts/library.js.map +1 -0
- package/dist/providers/anthropic.d.ts +55 -0
- package/dist/providers/anthropic.d.ts.map +1 -0
- package/dist/providers/anthropic.js +237 -0
- package/dist/providers/anthropic.js.map +1 -0
- package/dist/providers/ollama.d.ts +44 -0
- package/dist/providers/ollama.d.ts.map +1 -0
- package/dist/providers/ollama.js +211 -0
- package/dist/providers/ollama.js.map +1 -0
- package/dist/providers/registry.d.ts +36 -0
- package/dist/providers/registry.d.ts.map +1 -0
- package/dist/providers/registry.js +91 -0
- package/dist/providers/registry.js.map +1 -0
- package/dist/providers/types.d.ts +100 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +12 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +9 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/fs.d.ts +30 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +80 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/logger.d.ts +46 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +87 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/validation.d.ts +28 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +38 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File parser — extracts code blocks from agent output and writes to disk.
|
|
3
|
+
*
|
|
4
|
+
* Agents output code in a structured format:
|
|
5
|
+
* FILE: path/to/file.ts
|
|
6
|
+
* ```
|
|
7
|
+
* <code content>
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* This module parses that format and writes files to the project directory.
|
|
11
|
+
*
|
|
12
|
+
* Dependency direction: file-parser.ts → utils/fs, core/errors
|
|
13
|
+
* Used by: workflow runner
|
|
14
|
+
*/
|
|
15
|
+
/** A parsed file extracted from agent output. */
|
|
16
|
+
export interface ParsedFile {
|
|
17
|
+
/** Relative path from project root. */
|
|
18
|
+
path: string;
|
|
19
|
+
/** File contents. */
|
|
20
|
+
content: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Parse agent output to extract file blocks.
|
|
24
|
+
*
|
|
25
|
+
* Supports two formats:
|
|
26
|
+
* 1. FILE: path/to/file.ts followed by a fenced code block
|
|
27
|
+
* 2. ```language:path/to/file.ts (language annotation with path)
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseFiles(output: string): ParsedFile[];
|
|
30
|
+
/**
|
|
31
|
+
* Write parsed files to disk under the project root.
|
|
32
|
+
*
|
|
33
|
+
* Creates parent directories as needed. Returns the list of written file paths.
|
|
34
|
+
*/
|
|
35
|
+
export declare function writeFiles(projectRoot: string, files: ParsedFile[]): string[];
|
|
36
|
+
/**
|
|
37
|
+
* Parse agent output and write extracted files to disk.
|
|
38
|
+
* Combines parseFiles + writeFiles in one call.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseAndWriteFiles(projectRoot: string, output: string): string[];
|
|
41
|
+
//# sourceMappingURL=file-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-parser.d.ts","sourceRoot":"","sources":["../../../src/core/workflow/file-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,iDAAiD;AACjD,MAAM,WAAW,UAAU;IACvB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,CAoFvD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,CAyB7E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAShF"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File parser — extracts code blocks from agent output and writes to disk.
|
|
3
|
+
*
|
|
4
|
+
* Agents output code in a structured format:
|
|
5
|
+
* FILE: path/to/file.ts
|
|
6
|
+
* ```
|
|
7
|
+
* <code content>
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* This module parses that format and writes files to the project directory.
|
|
11
|
+
*
|
|
12
|
+
* Dependency direction: file-parser.ts → utils/fs, core/errors
|
|
13
|
+
* Used by: workflow runner
|
|
14
|
+
*/
|
|
15
|
+
import { writeFileSync, mkdirSync } from 'node:fs';
|
|
16
|
+
import { join, dirname } from 'node:path';
|
|
17
|
+
import { logger } from '../../utils/logger.js';
|
|
18
|
+
/**
|
|
19
|
+
* Parse agent output to extract file blocks.
|
|
20
|
+
*
|
|
21
|
+
* Supports two formats:
|
|
22
|
+
* 1. FILE: path/to/file.ts followed by a fenced code block
|
|
23
|
+
* 2. ```language:path/to/file.ts (language annotation with path)
|
|
24
|
+
*/
|
|
25
|
+
export function parseFiles(output) {
|
|
26
|
+
const files = [];
|
|
27
|
+
// Pattern 1: FILE: path\n```\ncontent\n```
|
|
28
|
+
const fileBlockPattern = /FILE:\s*(.+?)\n```[\w]*\n([\s\S]*?)```/g;
|
|
29
|
+
let match;
|
|
30
|
+
match = fileBlockPattern.exec(output);
|
|
31
|
+
while (match !== null) {
|
|
32
|
+
const path = match[1]?.trim();
|
|
33
|
+
const content = match[2];
|
|
34
|
+
if (path && content) {
|
|
35
|
+
files.push({ path, content });
|
|
36
|
+
}
|
|
37
|
+
match = fileBlockPattern.exec(output);
|
|
38
|
+
}
|
|
39
|
+
// Pattern 2: ```language:path/to/file.ts\ncontent\n```
|
|
40
|
+
if (files.length === 0) {
|
|
41
|
+
const annotatedPattern = /```\w+:(.+?)\n([\s\S]*?)```/g;
|
|
42
|
+
match = annotatedPattern.exec(output);
|
|
43
|
+
while (match !== null) {
|
|
44
|
+
const path = match[1]?.trim();
|
|
45
|
+
const content = match[2];
|
|
46
|
+
if (path && content) {
|
|
47
|
+
files.push({ path, content });
|
|
48
|
+
}
|
|
49
|
+
match = annotatedPattern.exec(output);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// Pattern 3: Code block with "// filename.ts" or "# filename.py" as first line
|
|
53
|
+
if (files.length === 0) {
|
|
54
|
+
const codeBlockPattern = /```\w*\n([\s\S]*?)```/g;
|
|
55
|
+
match = codeBlockPattern.exec(output);
|
|
56
|
+
while (match !== null) {
|
|
57
|
+
const content = match[1] ?? '';
|
|
58
|
+
const firstLine = content.split('\n')[0]?.trim() ?? '';
|
|
59
|
+
// Extract filename from "// filename.ts" or "# filename.py" comments
|
|
60
|
+
const commentMatch = firstLine.match(/^(?:\/\/|#)\s*(.+\.\w+)\s*$/);
|
|
61
|
+
if (commentMatch?.[1]) {
|
|
62
|
+
files.push({ path: commentMatch[1], content });
|
|
63
|
+
}
|
|
64
|
+
match = codeBlockPattern.exec(output);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Pattern 4: Markdown heading with filename before code block
|
|
68
|
+
// e.g., **hello.ts** or ### hello.ts followed by ```
|
|
69
|
+
if (files.length === 0) {
|
|
70
|
+
const headingPattern = /(?:\*\*|#{1,4}\s*)([^\s*]+\.\w+)\*{0,2}\s*\n+```\w*\n([\s\S]*?)```/g;
|
|
71
|
+
match = headingPattern.exec(output);
|
|
72
|
+
while (match !== null) {
|
|
73
|
+
const path = match[1]?.trim();
|
|
74
|
+
const content = match[2];
|
|
75
|
+
if (path && content) {
|
|
76
|
+
files.push({ path, content });
|
|
77
|
+
}
|
|
78
|
+
match = headingPattern.exec(output);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// Pattern 5: Inline filename reference before code block
|
|
82
|
+
// e.g., `greeting.ts`: or Here is greeting.ts: or (greeting.ts)
|
|
83
|
+
if (files.length === 0) {
|
|
84
|
+
const inlinePattern = /`([^\s`]+\.\w{1,4})`[:\s]*\n+```\w*\n([\s\S]*?)```/g;
|
|
85
|
+
match = inlinePattern.exec(output);
|
|
86
|
+
while (match !== null) {
|
|
87
|
+
const path = match[1]?.trim();
|
|
88
|
+
const content = match[2];
|
|
89
|
+
if (path && content) {
|
|
90
|
+
files.push({ path, content });
|
|
91
|
+
}
|
|
92
|
+
match = inlinePattern.exec(output);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (files.length === 0) {
|
|
96
|
+
logger.debug('File parser: no patterns matched. Output preview: ' +
|
|
97
|
+
output.substring(0, 200).replace(/\n/g, '\\n'));
|
|
98
|
+
}
|
|
99
|
+
return files;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Write parsed files to disk under the project root.
|
|
103
|
+
*
|
|
104
|
+
* Creates parent directories as needed. Returns the list of written file paths.
|
|
105
|
+
*/
|
|
106
|
+
export function writeFiles(projectRoot, files) {
|
|
107
|
+
const writtenPaths = [];
|
|
108
|
+
for (const file of files) {
|
|
109
|
+
// Prevent path traversal
|
|
110
|
+
if (file.path.includes('..')) {
|
|
111
|
+
logger.warn(`Skipping file with path traversal: ${file.path}`);
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
const absolutePath = join(projectRoot, file.path);
|
|
115
|
+
const dir = dirname(absolutePath);
|
|
116
|
+
mkdirSync(dir, { recursive: true });
|
|
117
|
+
writeFileSync(absolutePath, file.content, 'utf-8');
|
|
118
|
+
writtenPaths.push(file.path);
|
|
119
|
+
logger.debug(`Wrote: ${file.path}`);
|
|
120
|
+
}
|
|
121
|
+
if (writtenPaths.length > 0) {
|
|
122
|
+
logger.info(`Wrote ${writtenPaths.length} file(s)`);
|
|
123
|
+
}
|
|
124
|
+
return writtenPaths;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Parse agent output and write extracted files to disk.
|
|
128
|
+
* Combines parseFiles + writeFiles in one call.
|
|
129
|
+
*/
|
|
130
|
+
export function parseAndWriteFiles(projectRoot, output) {
|
|
131
|
+
const files = parseFiles(output);
|
|
132
|
+
if (files.length === 0) {
|
|
133
|
+
logger.debug('No file blocks found in agent output');
|
|
134
|
+
return [];
|
|
135
|
+
}
|
|
136
|
+
return writeFiles(projectRoot, files);
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=file-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-parser.js","sourceRoot":"","sources":["../../../src/core/workflow/file-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAU/C;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,MAAc;IACrC,MAAM,KAAK,GAAiB,EAAE,CAAC;IAE/B,2CAA2C;IAC3C,MAAM,gBAAgB,GAAG,yCAAyC,CAAC;IACnE,IAAI,KAA6B,CAAC;IAElC,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,OAAO,KAAK,KAAK,IAAI,EAAE,CAAC;QACpB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,IAAI,IAAI,OAAO,EAAE,CAAC;YAClB,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QAClC,CAAC;QACD,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IAED,uDAAuD;IACvD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,MAAM,gBAAgB,GAAG,8BAA8B,CAAC;QACxD,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtC,OAAO,KAAK,KAA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K,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QA policies — configurable quality acceptance rules.
|
|
3
|
+
*
|
|
4
|
+
* Defines rules that the judge agent uses to evaluate work quality.
|
|
5
|
+
* Users can customize these via `.aiagentflow/policies/qa-rules.md`
|
|
6
|
+
* or through config options.
|
|
7
|
+
*
|
|
8
|
+
* Dependency direction: qa-policy.ts → config/types, utils
|
|
9
|
+
* Used by: judge agent, workflow runner
|
|
10
|
+
*/
|
|
11
|
+
/** QA policy configuration. */
|
|
12
|
+
export interface QAPolicy {
|
|
13
|
+
/** Minimum test coverage percentage (0-100). 0 = disabled. */
|
|
14
|
+
minTestCoverage: number;
|
|
15
|
+
/** Require all tests to pass before approval. */
|
|
16
|
+
requireAllTestsPass: boolean;
|
|
17
|
+
/** Require reviewer approval before proceeding. */
|
|
18
|
+
requireReviewApproval: boolean;
|
|
19
|
+
/** Maximum allowed critical issues from reviewer. */
|
|
20
|
+
maxCriticalIssues: number;
|
|
21
|
+
/** Maximum allowed warnings from reviewer. */
|
|
22
|
+
maxWarnings: number;
|
|
23
|
+
/** Custom rules loaded from policy file. */
|
|
24
|
+
customRules: string;
|
|
25
|
+
}
|
|
26
|
+
/** Default QA policy settings. */
|
|
27
|
+
export declare const DEFAULT_QA_POLICY: QAPolicy;
|
|
28
|
+
/**
|
|
29
|
+
* Load QA policy from project config and policy files.
|
|
30
|
+
* Merges config defaults with user-defined policy file.
|
|
31
|
+
*/
|
|
32
|
+
export declare function loadQAPolicy(projectRoot: string, overrides?: Partial<QAPolicy>): QAPolicy;
|
|
33
|
+
/**
|
|
34
|
+
* Evaluate review output against the QA policy.
|
|
35
|
+
*
|
|
36
|
+
* Returns whether the review passes the policy requirements.
|
|
37
|
+
*/
|
|
38
|
+
export declare function evaluateReview(reviewContent: string, policy: QAPolicy): QAEvaluation;
|
|
39
|
+
/**
|
|
40
|
+
* Format the QA policy as context for the judge agent.
|
|
41
|
+
*/
|
|
42
|
+
export declare function formatPolicyForAgent(policy: QAPolicy): string;
|
|
43
|
+
export interface QAEvaluation {
|
|
44
|
+
passed: boolean;
|
|
45
|
+
criticalCount: number;
|
|
46
|
+
warningCount: number;
|
|
47
|
+
totalIssues: number;
|
|
48
|
+
issues: ReviewIssue[];
|
|
49
|
+
}
|
|
50
|
+
interface ReviewIssue {
|
|
51
|
+
severity: 'critical' | 'warning' | 'nit';
|
|
52
|
+
description: string;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=qa-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qa-policy.d.ts","sourceRoot":"","sources":["../../../src/core/workflow/qa-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,+BAA+B;AAC/B,MAAM,WAAW,QAAQ;IACrB,8DAA8D;IAC9D,eAAe,EAAE,MAAM,CAAC;IACxB,iDAAiD;IACjD,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mDAAmD;IACnD,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qDAAqD;IACrD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,kCAAkC;AAClC,eAAO,MAAM,iBAAiB,EAAE,QAO/B,CAAC;AAKF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAWzF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,YAAY,CAepF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,CA6B7D;AAID,MAAM,WAAW,YAAY;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,WAAW,EAAE,CAAC;CACzB;AAED,UAAU,WAAW;IACjB,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,KAAK,CAAC;IACzC,WAAW,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QA policies — configurable quality acceptance rules.
|
|
3
|
+
*
|
|
4
|
+
* Defines rules that the judge agent uses to evaluate work quality.
|
|
5
|
+
* Users can customize these via `.aiagentflow/policies/qa-rules.md`
|
|
6
|
+
* or through config options.
|
|
7
|
+
*
|
|
8
|
+
* Dependency direction: qa-policy.ts → config/types, utils
|
|
9
|
+
* Used by: judge agent, workflow runner
|
|
10
|
+
*/
|
|
11
|
+
import { join } from 'node:path';
|
|
12
|
+
import { existsSync } from 'node:fs';
|
|
13
|
+
import { CONFIG_DIR_NAME } from '../config/defaults.js';
|
|
14
|
+
import { readTextFile } from '../../utils/fs.js';
|
|
15
|
+
import { logger } from '../../utils/logger.js';
|
|
16
|
+
/** Default QA policy settings. */
|
|
17
|
+
export const DEFAULT_QA_POLICY = {
|
|
18
|
+
minTestCoverage: 0,
|
|
19
|
+
requireAllTestsPass: true,
|
|
20
|
+
requireReviewApproval: true,
|
|
21
|
+
maxCriticalIssues: 0,
|
|
22
|
+
maxWarnings: 5,
|
|
23
|
+
customRules: '',
|
|
24
|
+
};
|
|
25
|
+
const POLICIES_DIR = 'policies';
|
|
26
|
+
const QA_RULES_FILE = 'qa-rules.md';
|
|
27
|
+
/**
|
|
28
|
+
* Load QA policy from project config and policy files.
|
|
29
|
+
* Merges config defaults with user-defined policy file.
|
|
30
|
+
*/
|
|
31
|
+
export function loadQAPolicy(projectRoot, overrides) {
|
|
32
|
+
const policy = { ...DEFAULT_QA_POLICY, ...overrides };
|
|
33
|
+
// Load custom rules from policy file
|
|
34
|
+
const rulesPath = join(projectRoot, CONFIG_DIR_NAME, POLICIES_DIR, QA_RULES_FILE);
|
|
35
|
+
if (existsSync(rulesPath)) {
|
|
36
|
+
policy.customRules = readTextFile(rulesPath);
|
|
37
|
+
logger.debug(`Loaded QA rules from ${rulesPath}`);
|
|
38
|
+
}
|
|
39
|
+
return policy;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Evaluate review output against the QA policy.
|
|
43
|
+
*
|
|
44
|
+
* Returns whether the review passes the policy requirements.
|
|
45
|
+
*/
|
|
46
|
+
export function evaluateReview(reviewContent, policy) {
|
|
47
|
+
const issues = parseReviewIssues(reviewContent);
|
|
48
|
+
const criticalCount = issues.filter(i => i.severity === 'critical').length;
|
|
49
|
+
const warningCount = issues.filter(i => i.severity === 'warning').length;
|
|
50
|
+
const passed = criticalCount <= policy.maxCriticalIssues &&
|
|
51
|
+
warningCount <= policy.maxWarnings;
|
|
52
|
+
return {
|
|
53
|
+
passed,
|
|
54
|
+
criticalCount,
|
|
55
|
+
warningCount,
|
|
56
|
+
totalIssues: issues.length,
|
|
57
|
+
issues,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Format the QA policy as context for the judge agent.
|
|
62
|
+
*/
|
|
63
|
+
export function formatPolicyForAgent(policy) {
|
|
64
|
+
const rules = [
|
|
65
|
+
'## QA Acceptance Criteria',
|
|
66
|
+
'',
|
|
67
|
+
];
|
|
68
|
+
if (policy.requireAllTestsPass) {
|
|
69
|
+
rules.push('- All tests MUST pass');
|
|
70
|
+
}
|
|
71
|
+
if (policy.requireReviewApproval) {
|
|
72
|
+
rules.push('- Code review MUST be approved');
|
|
73
|
+
}
|
|
74
|
+
if (policy.maxCriticalIssues === 0) {
|
|
75
|
+
rules.push('- Zero critical issues allowed');
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
rules.push(`- Maximum ${policy.maxCriticalIssues} critical issue(s) allowed`);
|
|
79
|
+
}
|
|
80
|
+
if (policy.maxWarnings < 999) {
|
|
81
|
+
rules.push(`- Maximum ${policy.maxWarnings} warning(s) allowed`);
|
|
82
|
+
}
|
|
83
|
+
if (policy.minTestCoverage > 0) {
|
|
84
|
+
rules.push(`- Minimum test coverage: ${policy.minTestCoverage}%`);
|
|
85
|
+
}
|
|
86
|
+
if (policy.customRules) {
|
|
87
|
+
rules.push('', '## Custom Project Rules', '', policy.customRules);
|
|
88
|
+
}
|
|
89
|
+
return rules.join('\n');
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Parse a review output to extract issues with severity.
|
|
93
|
+
*
|
|
94
|
+
* Matches only structured issue markers where the severity keyword
|
|
95
|
+
* appears as a label at the start of a line (optionally bulleted/numbered),
|
|
96
|
+
* e.g.:
|
|
97
|
+
* - **CRITICAL**: description
|
|
98
|
+
* - CRITICAL: description
|
|
99
|
+
* - 1. WARNING: description
|
|
100
|
+
* - NIT: description
|
|
101
|
+
*
|
|
102
|
+
* Does NOT match casual mentions like "no critical issues found".
|
|
103
|
+
*/
|
|
104
|
+
function parseReviewIssues(content) {
|
|
105
|
+
const issues = [];
|
|
106
|
+
const lines = content.split('\n');
|
|
107
|
+
// Matches lines where severity keyword appears as a structured label:
|
|
108
|
+
// Optional leading bullet/number, optional markdown bold, then KEYWORD followed by colon
|
|
109
|
+
const issuePattern = /^\s*(?:[-*•]|\d+[.)]\s*)?\s*\*{0,2}(CRITICAL|WARNING|NIT)\*{0,2}\s*:/i;
|
|
110
|
+
for (const line of lines) {
|
|
111
|
+
const match = line.match(issuePattern);
|
|
112
|
+
if (match?.[1]) {
|
|
113
|
+
const severity = match[1].toLowerCase();
|
|
114
|
+
issues.push({ severity, description: line.trim() });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return issues;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=qa-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qa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M,CAAC,eAAe,GAAG,CAAC,CAAC;IACtE,CAAC;IAED,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,yBAAyB,EAAE,EAAE,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAiBD;;;;;;;;;;;;GAYG;AACH,SAAS,iBAAiB,CAAC,OAAe;IACtC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAElC,sEAAsE;IACtE,yFAAyF;IACzF,MAAM,YAAY,GAAG,uEAAuE,CAAC;IAE7F,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QACvC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACb,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAoC,CAAC;YAC1E,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACxD,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow runner — orchestrates agents through the workflow engine.
|
|
3
|
+
*
|
|
4
|
+
* This is the main "brain" that:
|
|
5
|
+
* 1. Creates a workflow context for a task
|
|
6
|
+
* 2. Determines which agent to run next
|
|
7
|
+
* 3. Executes agents and feeds output to the workflow engine
|
|
8
|
+
* 4. Handles transitions, loops, and terminal states
|
|
9
|
+
* 5. Tracks token usage and persists session state
|
|
10
|
+
*
|
|
11
|
+
* Dependency direction: runner.ts → engine, agents/factory, git/client, config
|
|
12
|
+
* Used by: cli/commands/run.ts
|
|
13
|
+
*/
|
|
14
|
+
import { type WorkflowContext } from './engine.js';
|
|
15
|
+
export interface RunOptions {
|
|
16
|
+
/** Project root directory. */
|
|
17
|
+
projectRoot: string;
|
|
18
|
+
/** The task to accomplish. */
|
|
19
|
+
task: string;
|
|
20
|
+
/** Skip all human approval gates (autonomous mode). */
|
|
21
|
+
auto?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Run a full workflow for a task.
|
|
25
|
+
*
|
|
26
|
+
* Orchestrates the agent pipeline: Architect → Coder → Reviewer → Tester → Fixer → Judge.
|
|
27
|
+
* Returns the final workflow context with all accumulated data.
|
|
28
|
+
*/
|
|
29
|
+
export declare function runWorkflow(options: RunOptions): Promise<WorkflowContext>;
|
|
30
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/core/workflow/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAKH,KAAK,eAAe,EACvB,MAAM,aAAa,CAAC;AAcrB,MAAM,WAAW,UAAU;IACvB,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,eAAe,CAAC,CAyG/E"}
|