agentweaver 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/README.md ADDED
@@ -0,0 +1,243 @@
1
+ # AgentWeaver
2
+
3
+ `AgentWeaver` is a TypeScript/Node.js CLI for engineering workflows around Jira, Codex, and Claude.
4
+
5
+ It orchestrates a flow like:
6
+
7
+ `plan -> implement -> test -> review -> review-fix -> test`
8
+
9
+ The package is designed to run as an npm CLI and includes an interactive terminal UI built on `neo-blessed`.
10
+
11
+ ## What It Does
12
+
13
+ - Fetches a Jira issue by key or browse URL
14
+ - Generates workflow artifacts such as design, implementation plan, QA plan, reviews, and summaries
15
+ - Runs workflow stages like `plan`, `implement`, `review`, `review-fix`, `test`, and `auto`
16
+ - Persists `auto` pipeline state on disk so runs can resume
17
+ - Uses Docker runtime services for isolated Codex execution and build verification
18
+
19
+ ## Repository Layout
20
+
21
+ - `src/` — main TypeScript sources
22
+ - `src/index.ts` — CLI entrypoint and workflow orchestration
23
+ - `src/interactive-ui.ts` — interactive TUI built with `neo-blessed`
24
+ - `src/markdown.ts` — markdown-to-terminal renderer for the TUI
25
+ - `docker-compose.yml` — runtime services for Codex and build verification
26
+ - `Dockerfile.codex` — container image for Codex runtime
27
+ - `verify_build.sh` — project-specific verification entrypoint used by `verify-build`
28
+ - `package.json` — npm package metadata and scripts
29
+ - `tsconfig.json` — TypeScript configuration
30
+
31
+ ## Requirements
32
+
33
+ - Node.js `>= 18.19.0`
34
+ - npm
35
+ - Docker with `docker compose` or `docker-compose`
36
+ - `codex` CLI for `plan` and Codex-driven steps
37
+ - `claude` CLI for review and summary steps
38
+
39
+ ## Installation
40
+
41
+ Local development:
42
+
43
+ ```bash
44
+ npm install
45
+ npm run build
46
+ ```
47
+
48
+ Global install after publication:
49
+
50
+ ```bash
51
+ npm install -g agentweaver
52
+ ```
53
+
54
+ One-off usage after publication:
55
+
56
+ ```bash
57
+ npx agentweaver --help
58
+ ```
59
+
60
+ ## Environment
61
+
62
+ Required:
63
+
64
+ - `JIRA_API_KEY` — Jira API token used to fetch issue JSON
65
+
66
+ Common optional variables:
67
+
68
+ - `JIRA_BASE_URL` — required when you pass only an issue key like `DEMO-123`
69
+ - `AGENTWEAVER_HOME` — path to the AgentWeaver installation directory
70
+ - `DOCKER_COMPOSE_BIN` — override compose command, for example `docker compose`
71
+ - `CODEX_BIN` — override `codex` executable path
72
+ - `CLAUDE_BIN` — override `claude` executable path
73
+ - `CODEX_MODEL` — defaults to `gpt-5.4`
74
+ - `CLAUDE_REVIEW_MODEL` — defaults to `opus`
75
+ - `CLAUDE_SUMMARY_MODEL` — defaults to `haiku`
76
+
77
+ Example `.env`:
78
+
79
+ ```bash
80
+ JIRA_API_KEY=your-jira-api-token
81
+ JIRA_BASE_URL=https://jira.example.com
82
+ AGENTWEAVER_HOME=/absolute/path/to/AgentWeaver
83
+ CODEX_BIN=codex
84
+ CLAUDE_BIN=claude
85
+ CODEX_MODEL=gpt-5.4
86
+ CLAUDE_REVIEW_MODEL=opus
87
+ CLAUDE_SUMMARY_MODEL=haiku
88
+ GOPRIVATE=gitlab.example.org/*
89
+ GONOSUMDB=gitlab.example.org/*
90
+ GONOPROXY=gitlab.example.org/*
91
+ GIT_ALLOW_PROTOCOL=file:https:ssh
92
+ ```
93
+
94
+ ## Usage
95
+
96
+ Direct CLI usage:
97
+
98
+ ```bash
99
+ agentweaver plan DEMO-3288
100
+ agentweaver implement DEMO-3288
101
+ agentweaver review DEMO-3288
102
+ agentweaver auto DEMO-3288
103
+ ```
104
+
105
+ From source checkout:
106
+
107
+ ```bash
108
+ node dist/index.js plan DEMO-3288
109
+ node dist/index.js auto DEMO-3288
110
+ ```
111
+
112
+ Interactive mode:
113
+
114
+ ```bash
115
+ agentweaver DEMO-3288
116
+ ```
117
+
118
+ When you run from a working project directory, set `AGENTWEAVER_HOME` to the AgentWeaver installation:
119
+
120
+ ```bash
121
+ AGENTWEAVER_HOME=/absolute/path/to/AgentWeaver agentweaver DEMO-3288
122
+ ```
123
+
124
+ Useful commands:
125
+
126
+ ```bash
127
+ agentweaver --help
128
+ agentweaver auto --help-phases
129
+ agentweaver auto-status DEMO-3288
130
+ agentweaver auto-reset DEMO-3288
131
+ ```
132
+
133
+ ## Interactive TUI
134
+
135
+ Interactive mode opens a full-screen terminal UI with:
136
+
137
+ - command input
138
+ - activity log
139
+ - task summary pane
140
+ - command list/help
141
+ - keyboard navigation between panes
142
+
143
+ Current navigation:
144
+
145
+ - `Enter` — run command
146
+ - `Tab` / `Shift+Tab` — switch panes
147
+ - `Ctrl+J` — focus activity log
148
+ - `Ctrl+K` — focus command input
149
+ - `Ctrl+U` — focus task summary
150
+ - `Ctrl+H` — focus commands pane
151
+ - `PgUp` / `PgDn` / `Home` / `End` — scroll focused panes
152
+ - `?` or `F1` — help overlay
153
+ - `q` or `Ctrl+C` — exit
154
+
155
+ ## Docker Runtime
156
+
157
+ Docker is used as an isolated execution environment for Codex and build/test verification.
158
+
159
+ Main services:
160
+
161
+ - `codex` — interactive Codex container
162
+ - `codex-exec` — non-interactive `codex exec`
163
+ - `verify-build` — project verification script inside container
164
+ - `codex-login` — interactive login container
165
+ - `dockerd` — internal Docker daemon for testcontainers/build flows
166
+
167
+ Typical login flow:
168
+
169
+ ```bash
170
+ PROJECT_DIR="$PWD" docker compose -f "$AGENTWEAVER_HOME/docker-compose.yml" run --rm codex-login
171
+ ```
172
+
173
+ Interactive Codex container:
174
+
175
+ ```bash
176
+ PROJECT_DIR="$PWD" docker compose -f "$AGENTWEAVER_HOME/docker-compose.yml" run --rm codex
177
+ ```
178
+
179
+ Non-interactive Codex run:
180
+
181
+ ```bash
182
+ PROJECT_DIR="$PWD" docker compose -f "$AGENTWEAVER_HOME/docker-compose.yml" run --rm \
183
+ -e CODEX_PROMPT="Review the project and fix failing tests" \
184
+ codex-exec
185
+ ```
186
+
187
+ Build verification:
188
+
189
+ ```bash
190
+ PROJECT_DIR="$PWD" docker compose -f "$AGENTWEAVER_HOME/docker-compose.yml" run --rm verify-build
191
+ ```
192
+
193
+ ## Development
194
+
195
+ Install dependencies and build:
196
+
197
+ ```bash
198
+ npm install
199
+ npm run build
200
+ ```
201
+
202
+ Type-check only:
203
+
204
+ ```bash
205
+ npm run check
206
+ ```
207
+
208
+ Preview publish tarball:
209
+
210
+ ```bash
211
+ npm run pack:check
212
+ ```
213
+
214
+ Run from source in dev mode:
215
+
216
+ ```bash
217
+ npm run dev -- --help
218
+ ```
219
+
220
+ ## Publishing
221
+
222
+ The package is prepared for npm publication and currently includes:
223
+
224
+ - npm bin entry: `agentweaver`
225
+ - `prepublishOnly` build/typecheck
226
+ - tarball filtering through `files`
227
+ - public publish config
228
+
229
+ Publish flow:
230
+
231
+ ```bash
232
+ npm login
233
+ npm publish
234
+ ```
235
+
236
+ If you want a public package, verify the package name and license before publishing.
237
+
238
+ ## Security Notes
239
+
240
+ - the Codex container does not receive host `docker.sock`
241
+ - Docker access for tests goes through isolated `dockerd`
242
+ - secure Git protocols only: `ssh` and `https`
243
+ - `dockerd` runs privileged because DinD requires it; this is still safer than exposing host Docker directly
@@ -0,0 +1,29 @@
1
+ import { existsSync } from "node:fs";
2
+ import { TaskRunnerError } from "./errors.js";
3
+ export const REVIEW_FILE_RE = /^review-(.+)-(\d+)\.md$/;
4
+ export const REVIEW_REPLY_FILE_RE = /^review-reply-(.+)-(\d+)\.md$/;
5
+ export const READY_TO_MERGE_FILE = "ready-to-merge.md";
6
+ export function artifactFile(prefix, taskKey, iteration) {
7
+ return `${prefix}-${taskKey}-${iteration}.md`;
8
+ }
9
+ export function designFile(taskKey) {
10
+ return artifactFile("design", taskKey, 1);
11
+ }
12
+ export function planFile(taskKey) {
13
+ return artifactFile("plan", taskKey, 1);
14
+ }
15
+ export function qaFile(taskKey) {
16
+ return artifactFile("qa", taskKey, 1);
17
+ }
18
+ export function taskSummaryFile(taskKey) {
19
+ return artifactFile("task", taskKey, 1);
20
+ }
21
+ export function planArtifacts(taskKey) {
22
+ return [designFile(taskKey), planFile(taskKey), qaFile(taskKey)];
23
+ }
24
+ export function requireArtifacts(paths, message) {
25
+ const missing = paths.filter((filePath) => !existsSync(filePath));
26
+ if (missing.length > 0) {
27
+ throw new TaskRunnerError(`${message}\nMissing files: ${missing.join(", ")}`);
28
+ }
29
+ }
package/dist/errors.js ADDED
@@ -0,0 +1,6 @@
1
+ export class TaskRunnerError extends Error {
2
+ constructor(message) {
3
+ super(message);
4
+ this.name = "TaskRunnerError";
5
+ }
6
+ }