agentweaver 0.1.9 → 0.1.10
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 +60 -28
- package/dist/artifacts.js +1 -1
- package/dist/errors.js +7 -0
- package/dist/index.js +66 -34
- package/dist/interactive-ui.js +351 -44
- package/dist/pipeline/declarative-flows.js +7 -4
- package/dist/pipeline/flow-catalog.js +28 -21
- package/dist/pipeline/flow-specs/opencode/auto-opencode.json +1365 -0
- package/dist/pipeline/flow-specs/opencode/bugz/bug-analyze-opencode.json +382 -0
- package/dist/pipeline/flow-specs/opencode/bugz/bug-fix-opencode.json +56 -0
- package/dist/pipeline/flow-specs/opencode/gitlab/gitlab-diff-review-opencode.json +308 -0
- package/dist/pipeline/flow-specs/opencode/gitlab/gitlab-review-opencode.json +437 -0
- package/dist/pipeline/flow-specs/opencode/gitlab/mr-description-opencode.json +117 -0
- package/dist/pipeline/flow-specs/opencode/go/run-go-linter-loop-opencode.json +321 -0
- package/dist/pipeline/flow-specs/opencode/go/run-go-tests-loop-opencode.json +321 -0
- package/dist/pipeline/flow-specs/opencode/implement-opencode.json +64 -0
- package/dist/pipeline/flow-specs/{plan-opencode.json → opencode/plan-opencode.json} +4 -4
- package/dist/pipeline/flow-specs/opencode/review/review-fix-opencode.json +209 -0
- package/dist/pipeline/flow-specs/opencode/review/review-opencode.json +452 -0
- package/dist/pipeline/flow-specs/opencode/task-describe-opencode.json +148 -0
- package/dist/pipeline/spec-loader.js +18 -7
- package/dist/runtime/process-runner.js +45 -1
- package/package.json +1 -1
- package/dist/pipeline/flow-specs/preflight.json +0 -206
- package/dist/pipeline/flow-specs/run-linter-loop.json +0 -155
- package/dist/pipeline/flow-specs/run-tests-loop.json +0 -155
|
@@ -2,46 +2,53 @@ import path from "node:path";
|
|
|
2
2
|
import { TaskRunnerError } from "../errors.js";
|
|
3
3
|
import { loadAutoFlow } from "./auto-flow.js";
|
|
4
4
|
import { loadDeclarativeFlow } from "./declarative-flows.js";
|
|
5
|
-
import { listProjectFlowSpecFiles } from "./spec-loader.js";
|
|
6
|
-
export const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
import { listBuiltInFlowSpecFiles, listProjectFlowSpecFiles, projectFlowSpecsDir } from "./spec-loader.js";
|
|
6
|
+
export const BUILT_IN_COMMAND_FLOW_IDS = [
|
|
7
|
+
"auto",
|
|
8
|
+
"bug-analyze",
|
|
9
|
+
"bug-fix",
|
|
10
|
+
"gitlab-diff-review",
|
|
11
|
+
"gitlab-review",
|
|
12
|
+
"mr-description",
|
|
13
|
+
"plan",
|
|
14
|
+
"task-describe",
|
|
15
|
+
"implement",
|
|
16
|
+
"review",
|
|
17
|
+
"review-fix",
|
|
18
|
+
"run-go-tests-loop",
|
|
19
|
+
"run-go-linter-loop",
|
|
20
20
|
];
|
|
21
|
-
function loadBuiltInCatalogEntry(
|
|
21
|
+
function loadBuiltInCatalogEntry(fileName) {
|
|
22
|
+
const relativePath = fileName.replace(/\.json$/i, "").split(/[\\/]+/).filter((segment) => segment.length > 0);
|
|
23
|
+
const id = relativePath.join("/");
|
|
22
24
|
const flow = id === "auto" ? loadAutoFlow() : loadDeclarativeFlow({ source: "built-in", fileName });
|
|
23
25
|
return {
|
|
24
26
|
id,
|
|
25
27
|
source: "built-in",
|
|
26
28
|
fileName,
|
|
27
29
|
absolutePath: flow.absolutePath,
|
|
30
|
+
treePath: ["default", ...relativePath],
|
|
28
31
|
flow,
|
|
29
32
|
};
|
|
30
33
|
}
|
|
31
|
-
function loadProjectCatalogEntry(filePath) {
|
|
34
|
+
function loadProjectCatalogEntry(cwd, filePath) {
|
|
32
35
|
const flow = loadDeclarativeFlow({ source: "project-local", filePath });
|
|
36
|
+
const relativeFilePath = path.relative(projectFlowSpecsDir(cwd), path.resolve(filePath));
|
|
37
|
+
const relativePathWithoutExt = relativeFilePath.replace(/\.json$/i, "");
|
|
38
|
+
const relativeSegments = relativePathWithoutExt.split(path.sep).filter((segment) => segment.length > 0);
|
|
33
39
|
return {
|
|
34
|
-
id:
|
|
40
|
+
id: relativeSegments.join("/"),
|
|
35
41
|
source: "project-local",
|
|
36
42
|
fileName: path.basename(filePath),
|
|
37
43
|
absolutePath: path.resolve(filePath),
|
|
44
|
+
treePath: ["custom", ...relativeSegments],
|
|
38
45
|
flow,
|
|
39
46
|
};
|
|
40
47
|
}
|
|
41
48
|
export function loadInteractiveFlowCatalog(cwd) {
|
|
42
|
-
const entries =
|
|
49
|
+
const entries = listBuiltInFlowSpecFiles().map((fileName) => loadBuiltInCatalogEntry(fileName));
|
|
43
50
|
for (const filePath of listProjectFlowSpecFiles(cwd)) {
|
|
44
|
-
entries.push(loadProjectCatalogEntry(filePath));
|
|
51
|
+
entries.push(loadProjectCatalogEntry(cwd, filePath));
|
|
45
52
|
}
|
|
46
53
|
const byId = new Map();
|
|
47
54
|
for (const entry of entries) {
|
|
@@ -57,7 +64,7 @@ export function findCatalogEntry(flowId, entries) {
|
|
|
57
64
|
return entries.find((entry) => entry.id === flowId);
|
|
58
65
|
}
|
|
59
66
|
export function isBuiltInCommandFlowId(flowId) {
|
|
60
|
-
return
|
|
67
|
+
return BUILT_IN_COMMAND_FLOW_IDS.includes(flowId);
|
|
61
68
|
}
|
|
62
69
|
export function toDeclarativeFlowRef(entry) {
|
|
63
70
|
return entry.source === "built-in"
|