@ofear/xdou 1.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ofir
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,173 @@
1
+ # xdou
2
+
3
+ `xdou` is a terminal-native multi-agent development system.
4
+
5
+ Its north star: selected coding and architecture agents co-develop like a coordinated council of genius collaborators. The operator gives the mission; `xdou` coordinates council proposals, architectural synthesis, implementation, independent review, validation, fix iterations, and durable run artifacts.
6
+
7
+ ## What it does
8
+
9
+ `xdou` coordinates Claude Code, Codex, OpenCode, OpenRouter, and future agents through an artifact-based context bus. Agents do not share raw chat by default. The orchestrator compiles role-specific context packets, stores every run under `.xdou/runs/<run-id>/`, captures diffs/validation/reviews, and keeps the operator in control.
10
+
11
+ A full run follows this loop:
12
+
13
+ 1. **Council** — brainstormer and critic agents independently propose approaches and risks.
14
+ 2. **Synthesis** — the architect agent turns council input into one canonical plan.
15
+ 3. **Implementation** — the implementer agent executes against the synthesized plan.
16
+ 4. **Validation** — detected project test/build/typecheck commands run automatically.
17
+ 5. **Review** — one or more reviewer agents inspect the diff and validation result.
18
+ 6. **Fix loop** — if implementation, validation, or review blocks, the fixer agent patches and validation/review rerun up to `--max-fix-attempts`.
19
+ 7. **Summary** — final run state is written to `.xdou/runs/<run-id>/final-summary.md`.
20
+
21
+ ## Install / local development
22
+
23
+ ```bash
24
+ npm install
25
+ npm run build
26
+ node dist/cli.js help
27
+ ```
28
+
29
+ During development you can run from source:
30
+
31
+ ```bash
32
+ npm run dev -- help
33
+ ```
34
+
35
+ ## Commands
36
+
37
+ ```bash
38
+ xdou init
39
+ xdou agents detect
40
+ xdou brainstorm "Design the implementation"
41
+ xdou plan "Add GitHub OAuth login"
42
+ xdou run "Add GitHub OAuth login" --max-fix-attempts 2
43
+ xdou status
44
+ xdou status --json
45
+ xdou runs list
46
+ xdou runs list --json
47
+ xdou context
48
+ xdou config validate
49
+ ```
50
+
51
+ Global flags:
52
+
53
+ ```bash
54
+ --cwd <path> Run against another repository
55
+ --json Emit machine-readable JSON where supported
56
+ --agents a,b,c Override team agents for brainstorm/plan/run
57
+ --max-fix-attempts <n> Maximum fixer iterations for xdou run
58
+ ```
59
+
60
+ ## Safety model
61
+
62
+ - `xdou run` refuses to launch mutating coding agents unless the operator checkout is a clean git worktree.
63
+ - Mutating implementation, validation, review, and fixer phases run in an isolated git worktree by default.
64
+ - The operator checkout remains untouched; generated changes live in `.xdou/worktrees/<run-id>/`.
65
+ - The canonical patch is captured at `.xdou/runs/<run-id>/diff.patch`.
66
+ - `xdou init` adds `.xdou/runs/` and `.xdou/worktrees/` to `.gitignore` so xdou artifacts do not dirty the project.
67
+ - High-autonomy modes such as Codex `fullAuto` are opt-in through config.
68
+
69
+ ## Applying generated changes
70
+
71
+ Inspect the run first:
72
+
73
+ ```bash
74
+ xdou status
75
+ xdou context
76
+ xdou runs list
77
+ ```
78
+
79
+ Then inspect artifacts:
80
+
81
+ ```bash
82
+ cat .xdou/runs/<run-id>/final-summary.md
83
+ cat .xdou/runs/<run-id>/diff.patch
84
+ ```
85
+
86
+ Apply the patch manually if accepted:
87
+
88
+ ```bash
89
+ git apply .xdou/runs/<run-id>/diff.patch
90
+ ```
91
+
92
+ Or inspect the isolated worktree directly:
93
+
94
+ ```bash
95
+ cd .xdou/worktrees/<run-id>
96
+ git diff HEAD -- .
97
+ ```
98
+
99
+ Failed/blocked runs preserve their worktree for debugging.
100
+
101
+ ## Artifacts
102
+
103
+ Each run creates inspectable artifacts under `.xdou/runs/<run-id>/`, including:
104
+
105
+ - `mission.md`
106
+ - `project.md`
107
+ - `council.md`
108
+ - `plan.md`
109
+ - `synthesis.md`
110
+ - `diff.patch`
111
+ - `validation.json`
112
+ - `review.md`
113
+ - `final-summary.md`
114
+ - `timeline.ndjson`
115
+ - `fixes/attempt-<n>/...` when fixer iterations run
116
+ - per-agent inbox/result files under `agents/<agent-id>/`
117
+
118
+ ## Requirements
119
+
120
+ - Node.js >= 20.19
121
+ - Git repository for project runs
122
+ - Optional external agents installed/authenticated:
123
+ - `claude`
124
+ - `codex`
125
+ - `opencode`
126
+
127
+ ## Configuration
128
+
129
+ Edit `xdou.yaml`:
130
+
131
+ ```yaml
132
+ artifactDir: .xdou
133
+
134
+ agents:
135
+ qwen:
136
+ type: openrouter
137
+ model: qwen/qwen3-coder
138
+ roles: [critic, reviewer]
139
+ safe-codex:
140
+ type: codex
141
+ command: codex
142
+ fullAuto: false
143
+
144
+ teams:
145
+ default:
146
+ brainstormers: [claude, codex, qwen]
147
+ architect: claude
148
+ critic: qwen
149
+ implementer: safe-codex
150
+ reviewer: [claude, qwen]
151
+ fixer: safe-codex
152
+ ```
153
+
154
+ Validate config:
155
+
156
+ ```bash
157
+ xdou config validate
158
+ ```
159
+
160
+ ## Design principles
161
+
162
+ - Use existing OSS agent CLIs/APIs instead of reinventing coding agents.
163
+ - Claude Code: architecture/review/debugging.
164
+ - Codex: implementation/fixes/refactors.
165
+ - OpenCode: optional provider-agnostic worker.
166
+ - OpenRouter: optional reasoning/review council member via `OPENROUTER_API_KEY`.
167
+ - Context sharing is artifact-based: mission, council, synthesis, plan, diff, validation, reviews, summary.
168
+ - External agent commands are invoked with argv arrays, not shell prompt interpolation.
169
+ - Validation commands may use shell syntax and are run only after code generation in the isolated worktree.
170
+
171
+ ## Security notes
172
+
173
+ External coding agents can execute commands and modify files in the isolated worktree. Use trusted repositories, review generated patches before applying, and keep high-autonomy modes opt-in. API keys such as `OPENROUTER_API_KEY` are read from the environment by the relevant adapter.
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node