agentweaver 0.1.9 → 0.1.11

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.
Files changed (101) hide show
  1. package/README.md +226 -200
  2. package/dist/artifacts.js +101 -56
  3. package/dist/errors.js +7 -0
  4. package/dist/executors/{codex-local-executor.js → codex-executor.js} +4 -4
  5. package/dist/executors/configs/{codex-local-config.js → codex-config.js} +1 -1
  6. package/dist/executors/configs/jira-fetch-config.js +2 -0
  7. package/dist/executors/configs/telegram-notifier-config.js +3 -0
  8. package/dist/executors/fetch-gitlab-diff-executor.js +1 -1
  9. package/dist/executors/fetch-gitlab-review-executor.js +1 -1
  10. package/dist/executors/git-commit-executor.js +25 -0
  11. package/dist/executors/telegram-notifier-executor.js +54 -0
  12. package/dist/flow-state.js +46 -1
  13. package/dist/gitlab.js +13 -8
  14. package/dist/index.js +507 -520
  15. package/dist/interactive-ui.js +495 -87
  16. package/dist/jira.js +52 -5
  17. package/dist/pipeline/auto-flow.js +6 -6
  18. package/dist/pipeline/context.js +1 -0
  19. package/dist/pipeline/declarative-flows.js +7 -4
  20. package/dist/pipeline/flow-catalog.js +60 -23
  21. package/dist/pipeline/flow-model-settings.js +77 -0
  22. package/dist/pipeline/flow-specs/auto-common.json +446 -0
  23. package/dist/pipeline/flow-specs/auto-golang.json +563 -0
  24. package/dist/pipeline/flow-specs/{bug-analyze.json → bugz/bug-analyze.json} +43 -25
  25. package/dist/pipeline/flow-specs/{bug-fix.json → bugz/bug-fix.json} +5 -4
  26. package/dist/pipeline/flow-specs/git-commit.json +196 -0
  27. package/dist/pipeline/flow-specs/{gitlab-diff-review.json → gitlab/gitlab-diff-review.json} +20 -50
  28. package/dist/pipeline/flow-specs/gitlab/gitlab-review.json +165 -0
  29. package/dist/pipeline/flow-specs/{mr-description.json → gitlab/mr-description.json} +17 -10
  30. package/dist/pipeline/flow-specs/{run-go-linter-loop.json → go/run-go-linter-loop.json} +40 -14
  31. package/dist/pipeline/flow-specs/{run-go-tests-loop.json → go/run-go-tests-loop.json} +40 -14
  32. package/dist/pipeline/flow-specs/implement.json +5 -4
  33. package/dist/pipeline/flow-specs/plan.json +40 -148
  34. package/dist/pipeline/flow-specs/{review-fix.json → review/review-fix.json} +73 -13
  35. package/dist/pipeline/flow-specs/review/review-loop.json +280 -0
  36. package/dist/pipeline/flow-specs/review/review-project.json +87 -0
  37. package/dist/pipeline/flow-specs/review/review.json +126 -0
  38. package/dist/pipeline/flow-specs/task-describe.json +191 -11
  39. package/dist/pipeline/launch-profile-config.js +38 -0
  40. package/dist/pipeline/node-registry.js +75 -45
  41. package/dist/pipeline/nodes/build-failure-summary-node.js +16 -29
  42. package/dist/pipeline/nodes/build-review-fix-prompt-node.js +36 -0
  43. package/dist/pipeline/nodes/codex-prompt-node.js +41 -0
  44. package/dist/pipeline/nodes/commit-message-form-node.js +79 -0
  45. package/dist/pipeline/nodes/git-commit-form-node.js +138 -0
  46. package/dist/pipeline/nodes/git-commit-node.js +28 -0
  47. package/dist/pipeline/nodes/git-status-node.js +221 -0
  48. package/dist/pipeline/nodes/gitlab-review-artifacts-node.js +10 -6
  49. package/dist/pipeline/nodes/jira-context-node.js +10 -0
  50. package/dist/pipeline/nodes/llm-prompt-node.js +62 -0
  51. package/dist/pipeline/nodes/plan-codex-node.js +1 -1
  52. package/dist/pipeline/nodes/read-file-node.js +11 -0
  53. package/dist/pipeline/nodes/review-findings-form-node.js +18 -14
  54. package/dist/pipeline/nodes/select-files-form-node.js +72 -0
  55. package/dist/pipeline/nodes/telegram-notifier-node.js +28 -0
  56. package/dist/pipeline/nodes/user-input-node.js +29 -8
  57. package/dist/pipeline/nodes/write-selection-file-node.js +46 -0
  58. package/dist/pipeline/prompt-registry.js +2 -4
  59. package/dist/pipeline/prompt-runtime.js +13 -3
  60. package/dist/pipeline/registry.js +6 -8
  61. package/dist/pipeline/spec-compiler.js +5 -0
  62. package/dist/pipeline/spec-loader.js +18 -7
  63. package/dist/pipeline/spec-types.js +7 -3
  64. package/dist/pipeline/spec-validator.js +4 -0
  65. package/dist/pipeline/types.js +1 -0
  66. package/dist/pipeline/value-resolver.js +40 -38
  67. package/dist/prompts.js +104 -110
  68. package/dist/runtime/agentweaver-home.js +8 -0
  69. package/dist/runtime/command-resolution.js +0 -38
  70. package/dist/runtime/env-loader.js +43 -0
  71. package/dist/runtime/process-runner.js +45 -1
  72. package/dist/structured-artifact-schema-registry.js +53 -0
  73. package/dist/structured-artifact-schemas.json +0 -20
  74. package/dist/structured-artifacts.js +3 -43
  75. package/dist/user-input.js +30 -2
  76. package/package.json +2 -6
  77. package/Dockerfile.codex +0 -56
  78. package/dist/executors/claude-executor.js +0 -46
  79. package/dist/executors/codex-docker-executor.js +0 -27
  80. package/dist/executors/configs/claude-config.js +0 -12
  81. package/dist/executors/configs/codex-docker-config.js +0 -10
  82. package/dist/executors/configs/verify-build-config.js +0 -7
  83. package/dist/executors/verify-build-executor.js +0 -123
  84. package/dist/pipeline/flow-specs/auto.json +0 -979
  85. package/dist/pipeline/flow-specs/gitlab-review.json +0 -317
  86. package/dist/pipeline/flow-specs/plan-opencode.json +0 -603
  87. package/dist/pipeline/flow-specs/preflight.json +0 -206
  88. package/dist/pipeline/flow-specs/review-project.json +0 -243
  89. package/dist/pipeline/flow-specs/review.json +0 -312
  90. package/dist/pipeline/flow-specs/run-linter-loop.json +0 -155
  91. package/dist/pipeline/flow-specs/run-tests-loop.json +0 -155
  92. package/dist/pipeline/flows/preflight-flow.js +0 -19
  93. package/dist/pipeline/nodes/claude-prompt-node.js +0 -54
  94. package/dist/pipeline/nodes/codex-docker-prompt-node.js +0 -32
  95. package/dist/pipeline/nodes/codex-local-prompt-node.js +0 -32
  96. package/dist/pipeline/nodes/review-claude-node.js +0 -38
  97. package/dist/pipeline/nodes/review-reply-codex-node.js +0 -40
  98. package/dist/pipeline/nodes/verify-build-node.js +0 -15
  99. package/dist/runtime/docker-runtime.js +0 -51
  100. package/docker-compose.yml +0 -445
  101. package/verify_build.sh +0 -105
@@ -1,54 +0,0 @@
1
- import { readFileSync } from "node:fs";
2
- import { requireArtifacts } from "../../artifacts.js";
3
- import { printInfo, printPrompt, printSummary } from "../../tui.js";
4
- import { toExecutorContext } from "../types.js";
5
- export const claudePromptNode = {
6
- kind: "claude-prompt",
7
- version: 1,
8
- async run(context, params) {
9
- printInfo(params.labelText);
10
- printPrompt("Claude", params.prompt);
11
- const executor = context.executors.get("claude");
12
- const value = await executor.execute(toExecutorContext(context), {
13
- prompt: params.prompt,
14
- ...(params.command ? { command: params.command } : {}),
15
- ...(params.model ? { model: params.model } : {}),
16
- env: { ...context.env },
17
- }, executor.defaultConfig);
18
- const outputs = [
19
- ...(params.requiredArtifacts ?? []).map((path) => ({ kind: "artifact", path, required: true })),
20
- ...(params.outputFile ? [{ kind: "artifact", path: params.outputFile, required: true }] : []),
21
- ];
22
- if (!params.outputFile) {
23
- return { value, outputs };
24
- }
25
- requireArtifacts([params.outputFile], params.missingArtifactsMessage ?? `Claude prompt did not produce ${params.outputFile}.`);
26
- const artifactText = readFileSync(params.outputFile, "utf8").trim();
27
- if (params.summaryTitle) {
28
- printSummary(params.summaryTitle, artifactText);
29
- }
30
- return {
31
- value: {
32
- ...value,
33
- artifactText,
34
- },
35
- outputs,
36
- };
37
- },
38
- checks(_context, params) {
39
- const requiredArtifacts = [
40
- ...(params.requiredArtifacts ?? []),
41
- ...(params.outputFile ? [params.outputFile] : []),
42
- ];
43
- if (requiredArtifacts.length === 0) {
44
- return [];
45
- }
46
- return [
47
- {
48
- kind: "require-artifacts",
49
- paths: requiredArtifacts,
50
- message: params.missingArtifactsMessage ?? "Claude prompt node did not produce required artifacts.",
51
- },
52
- ];
53
- },
54
- };
@@ -1,32 +0,0 @@
1
- import { printInfo, printPrompt } from "../../tui.js";
2
- import { toExecutorContext } from "../types.js";
3
- export const codexDockerPromptNode = {
4
- kind: "codex-docker-prompt",
5
- version: 1,
6
- async run(context, params) {
7
- printInfo(params.labelText);
8
- printPrompt("Codex", params.prompt);
9
- const executor = context.executors.get("codex-docker");
10
- const value = await executor.execute(toExecutorContext(context), {
11
- dockerComposeFile: params.dockerComposeFile,
12
- prompt: params.prompt,
13
- ...(params.model ? { model: params.model } : {}),
14
- }, executor.defaultConfig);
15
- return {
16
- value,
17
- outputs: (params.requiredArtifacts ?? []).map((path) => ({ kind: "artifact", path, required: true })),
18
- };
19
- },
20
- checks(_context, params) {
21
- if (!params.requiredArtifacts || params.requiredArtifacts.length === 0) {
22
- return [];
23
- }
24
- return [
25
- {
26
- kind: "require-artifacts",
27
- paths: params.requiredArtifacts,
28
- message: params.missingArtifactsMessage ?? "Codex docker node did not produce required artifacts.",
29
- },
30
- ];
31
- },
32
- };
@@ -1,32 +0,0 @@
1
- import { printInfo, printPrompt } from "../../tui.js";
2
- import { toExecutorContext } from "../types.js";
3
- export const codexLocalPromptNode = {
4
- kind: "codex-local-prompt",
5
- version: 1,
6
- async run(context, params) {
7
- printInfo(params.labelText);
8
- printPrompt("Codex", params.prompt);
9
- const executor = context.executors.get("codex-local");
10
- const value = await executor.execute(toExecutorContext(context), {
11
- prompt: params.prompt,
12
- ...(params.model ? { model: params.model } : {}),
13
- env: { ...context.env },
14
- }, executor.defaultConfig);
15
- return {
16
- value,
17
- outputs: (params.requiredArtifacts ?? []).map((path) => ({ kind: "artifact", path, required: true })),
18
- };
19
- },
20
- checks(_context, params) {
21
- if (!params.requiredArtifacts || params.requiredArtifacts.length === 0) {
22
- return [];
23
- }
24
- return [
25
- {
26
- kind: "require-artifacts",
27
- paths: params.requiredArtifacts,
28
- message: params.missingArtifactsMessage ?? "Codex local node did not produce required artifacts.",
29
- },
30
- ];
31
- },
32
- };
@@ -1,38 +0,0 @@
1
- import { artifactFile, designFile, planFile } from "../../artifacts.js";
2
- import { REVIEW_PROMPT_TEMPLATE, formatPrompt, formatTemplate } from "../../prompts.js";
3
- import { printInfo, printPrompt } from "../../tui.js";
4
- import { toExecutorContext } from "../types.js";
5
- export const reviewClaudeNode = {
6
- kind: "review-claude",
7
- version: 1,
8
- async run(context, params) {
9
- const reviewFile = artifactFile("review", params.taskKey, params.iteration);
10
- const prompt = formatPrompt(formatTemplate(REVIEW_PROMPT_TEMPLATE, {
11
- jira_task_file: params.jiraTaskFile,
12
- design_file: designFile(params.taskKey),
13
- plan_file: planFile(params.taskKey),
14
- review_file: reviewFile,
15
- }), params.extraPrompt);
16
- printInfo(`Running Claude review mode (iteration ${params.iteration})`);
17
- printPrompt("Claude", prompt);
18
- const executor = context.executors.get("claude");
19
- const value = await executor.execute(toExecutorContext(context), {
20
- prompt,
21
- command: params.claudeCmd,
22
- env: { ...context.env },
23
- }, executor.defaultConfig);
24
- return {
25
- value,
26
- outputs: [{ kind: "artifact", path: reviewFile, required: true }],
27
- };
28
- },
29
- checks(_context, params) {
30
- return [
31
- {
32
- kind: "require-artifacts",
33
- paths: [artifactFile("review", params.taskKey, params.iteration)],
34
- message: "Claude review did not produce the required review artifact.",
35
- },
36
- ];
37
- },
38
- };
@@ -1,40 +0,0 @@
1
- import { artifactFile, designFile, planFile } from "../../artifacts.js";
2
- import { REVIEW_REPLY_PROMPT_TEMPLATE, formatPrompt, formatTemplate } from "../../prompts.js";
3
- import { printInfo, printPrompt } from "../../tui.js";
4
- import { toExecutorContext } from "../types.js";
5
- export const reviewReplyCodexNode = {
6
- kind: "review-reply-codex",
7
- version: 1,
8
- async run(context, params) {
9
- const reviewFile = artifactFile("review", params.taskKey, params.iteration);
10
- const reviewReplyFile = artifactFile("review-reply", params.taskKey, params.iteration);
11
- const prompt = formatPrompt(formatTemplate(REVIEW_REPLY_PROMPT_TEMPLATE, {
12
- review_file: reviewFile,
13
- jira_task_file: params.jiraTaskFile,
14
- design_file: designFile(params.taskKey),
15
- plan_file: planFile(params.taskKey),
16
- review_reply_file: reviewReplyFile,
17
- }), params.extraPrompt);
18
- printInfo(`Running Codex review reply mode (iteration ${params.iteration})`);
19
- printPrompt("Codex", prompt);
20
- const executor = context.executors.get("codex-local");
21
- const value = await executor.execute(toExecutorContext(context), {
22
- prompt,
23
- command: params.codexCmd,
24
- env: { ...context.env },
25
- }, executor.defaultConfig);
26
- return {
27
- value,
28
- outputs: [{ kind: "artifact", path: reviewReplyFile, required: true }],
29
- };
30
- },
31
- checks(_context, params) {
32
- return [
33
- {
34
- kind: "require-artifacts",
35
- paths: [artifactFile("review-reply", params.taskKey, params.iteration)],
36
- message: "Codex review reply did not produce the required review-reply artifact.",
37
- },
38
- ];
39
- },
40
- };
@@ -1,15 +0,0 @@
1
- import { printInfo } from "../../tui.js";
2
- import { toExecutorContext } from "../types.js";
3
- export const verifyBuildNode = {
4
- kind: "verify-build",
5
- version: 1,
6
- async run(context, params) {
7
- printInfo(params.labelText);
8
- const executor = context.executors.get("verify-build");
9
- const value = await executor.execute(toExecutorContext(context), {
10
- dockerComposeFile: params.dockerComposeFile,
11
- ...(params.service ? { service: params.service } : {}),
12
- }, executor.defaultConfig);
13
- return { value };
14
- },
15
- };
@@ -1,51 +0,0 @@
1
- import { existsSync, mkdirSync, writeFileSync } from "node:fs";
2
- import os from "node:os";
3
- import path from "node:path";
4
- export function agentweaverHome(packageRoot) {
5
- const configured = process.env.AGENTWEAVER_HOME?.trim();
6
- if (configured) {
7
- return path.resolve(configured);
8
- }
9
- return packageRoot;
10
- }
11
- export function defaultDockerComposeFile(packageRoot) {
12
- return path.join(agentweaverHome(packageRoot), "docker-compose.yml");
13
- }
14
- function defaultCodexHomeDir(packageRoot) {
15
- return path.join(agentweaverHome(packageRoot), ".codex-home");
16
- }
17
- function ensureRuntimeBindPath(targetPath, isDir) {
18
- mkdirSync(path.dirname(targetPath), { recursive: true });
19
- if (isDir) {
20
- mkdirSync(targetPath, { recursive: true });
21
- }
22
- else if (!existsSync(targetPath)) {
23
- writeFileSync(targetPath, "", "utf8");
24
- }
25
- return targetPath;
26
- }
27
- function defaultHostSshDir(packageRoot) {
28
- const candidate = path.join(os.homedir(), ".ssh");
29
- if (existsSync(candidate)) {
30
- return candidate;
31
- }
32
- return ensureRuntimeBindPath(path.join(agentweaverHome(packageRoot), ".runtime", "ssh"), true);
33
- }
34
- function defaultHostGitconfig(packageRoot) {
35
- const candidate = path.join(os.homedir(), ".gitconfig");
36
- if (existsSync(candidate)) {
37
- return candidate;
38
- }
39
- return ensureRuntimeBindPath(path.join(agentweaverHome(packageRoot), ".runtime", "gitconfig"), false);
40
- }
41
- export function dockerRuntimeEnv(packageRoot) {
42
- const env = { ...process.env };
43
- env.AGENTWEAVER_HOME ??= agentweaverHome(packageRoot);
44
- env.PROJECT_DIR ??= process.cwd();
45
- env.CODEX_HOME_DIR ??= ensureRuntimeBindPath(defaultCodexHomeDir(packageRoot), true);
46
- env.HOST_SSH_DIR ??= defaultHostSshDir(packageRoot);
47
- env.HOST_GITCONFIG ??= defaultHostGitconfig(packageRoot);
48
- env.LOCAL_UID ??= typeof process.getuid === "function" ? String(process.getuid()) : "1000";
49
- env.LOCAL_GID ??= typeof process.getgid === "function" ? String(process.getgid()) : "1000";
50
- return env;
51
- }