sweteam 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.
Files changed (206) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +587 -0
  3. package/dist/adapters/adapter.d.ts +19 -0
  4. package/dist/adapters/adapter.d.ts.map +1 -0
  5. package/dist/adapters/adapter.js +20 -0
  6. package/dist/adapters/adapter.js.map +1 -0
  7. package/dist/adapters/claude-code.d.ts +13 -0
  8. package/dist/adapters/claude-code.d.ts.map +1 -0
  9. package/dist/adapters/claude-code.js +150 -0
  10. package/dist/adapters/claude-code.js.map +1 -0
  11. package/dist/adapters/codex.d.ts +13 -0
  12. package/dist/adapters/codex.d.ts.map +1 -0
  13. package/dist/adapters/codex.js +100 -0
  14. package/dist/adapters/codex.js.map +1 -0
  15. package/dist/adapters/custom.d.ts +16 -0
  16. package/dist/adapters/custom.d.ts.map +1 -0
  17. package/dist/adapters/custom.js +167 -0
  18. package/dist/adapters/custom.js.map +1 -0
  19. package/dist/adapters/opencode.d.ts +13 -0
  20. package/dist/adapters/opencode.d.ts.map +1 -0
  21. package/dist/adapters/opencode.js +100 -0
  22. package/dist/adapters/opencode.js.map +1 -0
  23. package/dist/adapters/prompt-detection.d.ts +14 -0
  24. package/dist/adapters/prompt-detection.d.ts.map +1 -0
  25. package/dist/adapters/prompt-detection.js +74 -0
  26. package/dist/adapters/prompt-detection.js.map +1 -0
  27. package/dist/commands/create.d.ts +8 -0
  28. package/dist/commands/create.d.ts.map +1 -0
  29. package/dist/commands/create.js +38 -0
  30. package/dist/commands/create.js.map +1 -0
  31. package/dist/commands/delete.d.ts +2 -0
  32. package/dist/commands/delete.d.ts.map +1 -0
  33. package/dist/commands/delete.js +22 -0
  34. package/dist/commands/delete.js.map +1 -0
  35. package/dist/commands/enter.d.ts +19 -0
  36. package/dist/commands/enter.d.ts.map +1 -0
  37. package/dist/commands/enter.js +73 -0
  38. package/dist/commands/enter.js.map +1 -0
  39. package/dist/commands/init.d.ts +14 -0
  40. package/dist/commands/init.d.ts.map +1 -0
  41. package/dist/commands/init.js +52 -0
  42. package/dist/commands/init.js.map +1 -0
  43. package/dist/commands/list.d.ts +8 -0
  44. package/dist/commands/list.d.ts.map +1 -0
  45. package/dist/commands/list.js +98 -0
  46. package/dist/commands/list.js.map +1 -0
  47. package/dist/commands/show.d.ts +33 -0
  48. package/dist/commands/show.d.ts.map +1 -0
  49. package/dist/commands/show.js +142 -0
  50. package/dist/commands/show.js.map +1 -0
  51. package/dist/commands/stop.d.ts +2 -0
  52. package/dist/commands/stop.d.ts.map +1 -0
  53. package/dist/commands/stop.js +10 -0
  54. package/dist/commands/stop.js.map +1 -0
  55. package/dist/config/discovery.d.ts +12 -0
  56. package/dist/config/discovery.d.ts.map +1 -0
  57. package/dist/config/discovery.js +62 -0
  58. package/dist/config/discovery.js.map +1 -0
  59. package/dist/config/gh-auth.d.ts +5 -0
  60. package/dist/config/gh-auth.d.ts.map +1 -0
  61. package/dist/config/gh-auth.js +18 -0
  62. package/dist/config/gh-auth.js.map +1 -0
  63. package/dist/config/loader.d.ts +38 -0
  64. package/dist/config/loader.d.ts.map +1 -0
  65. package/dist/config/loader.js +72 -0
  66. package/dist/config/loader.js.map +1 -0
  67. package/dist/db/client.d.ts +10 -0
  68. package/dist/db/client.d.ts.map +1 -0
  69. package/dist/db/client.js +84 -0
  70. package/dist/db/client.js.map +1 -0
  71. package/dist/db/schema.d.ts +805 -0
  72. package/dist/db/schema.d.ts.map +1 -0
  73. package/dist/db/schema.js +66 -0
  74. package/dist/db/schema.js.map +1 -0
  75. package/dist/git/git.d.ts +29 -0
  76. package/dist/git/git.d.ts.map +1 -0
  77. package/dist/git/git.js +200 -0
  78. package/dist/git/git.js.map +1 -0
  79. package/dist/index.d.ts +3 -0
  80. package/dist/index.d.ts.map +1 -0
  81. package/dist/index.js +154 -0
  82. package/dist/index.js.map +1 -0
  83. package/dist/lifecycle.d.ts +5 -0
  84. package/dist/lifecycle.d.ts.map +1 -0
  85. package/dist/lifecycle.js +63 -0
  86. package/dist/lifecycle.js.map +1 -0
  87. package/dist/orchestrator/build-handler.d.ts +20 -0
  88. package/dist/orchestrator/build-handler.d.ts.map +1 -0
  89. package/dist/orchestrator/build-handler.js +212 -0
  90. package/dist/orchestrator/build-handler.js.map +1 -0
  91. package/dist/orchestrator/dag.d.ts +10 -0
  92. package/dist/orchestrator/dag.d.ts.map +1 -0
  93. package/dist/orchestrator/dag.js +70 -0
  94. package/dist/orchestrator/dag.js.map +1 -0
  95. package/dist/orchestrator/error-handling.d.ts +21 -0
  96. package/dist/orchestrator/error-handling.d.ts.map +1 -0
  97. package/dist/orchestrator/error-handling.js +124 -0
  98. package/dist/orchestrator/error-handling.js.map +1 -0
  99. package/dist/orchestrator/feedback-handler.d.ts +36 -0
  100. package/dist/orchestrator/feedback-handler.d.ts.map +1 -0
  101. package/dist/orchestrator/feedback-handler.js +316 -0
  102. package/dist/orchestrator/feedback-handler.js.map +1 -0
  103. package/dist/orchestrator/orchestrator.d.ts +21 -0
  104. package/dist/orchestrator/orchestrator.d.ts.map +1 -0
  105. package/dist/orchestrator/orchestrator.js +188 -0
  106. package/dist/orchestrator/orchestrator.js.map +1 -0
  107. package/dist/orchestrator/parallel-runner.d.ts +3 -0
  108. package/dist/orchestrator/parallel-runner.d.ts.map +1 -0
  109. package/dist/orchestrator/parallel-runner.js +111 -0
  110. package/dist/orchestrator/parallel-runner.js.map +1 -0
  111. package/dist/orchestrator/reviewer.d.ts +20 -0
  112. package/dist/orchestrator/reviewer.d.ts.map +1 -0
  113. package/dist/orchestrator/reviewer.js +175 -0
  114. package/dist/orchestrator/reviewer.js.map +1 -0
  115. package/dist/orchestrator/task-runner.d.ts +20 -0
  116. package/dist/orchestrator/task-runner.d.ts.map +1 -0
  117. package/dist/orchestrator/task-runner.js +122 -0
  118. package/dist/orchestrator/task-runner.js.map +1 -0
  119. package/dist/orchestrator/test-runner.d.ts +8 -0
  120. package/dist/orchestrator/test-runner.d.ts.map +1 -0
  121. package/dist/orchestrator/test-runner.js +81 -0
  122. package/dist/orchestrator/test-runner.js.map +1 -0
  123. package/dist/planner/plan-parser.d.ts +14 -0
  124. package/dist/planner/plan-parser.d.ts.map +1 -0
  125. package/dist/planner/plan-parser.js +182 -0
  126. package/dist/planner/plan-parser.js.map +1 -0
  127. package/dist/planner/planner.d.ts +9 -0
  128. package/dist/planner/planner.d.ts.map +1 -0
  129. package/dist/planner/planner.js +151 -0
  130. package/dist/planner/planner.js.map +1 -0
  131. package/dist/repl/repl.d.ts +19 -0
  132. package/dist/repl/repl.d.ts.map +1 -0
  133. package/dist/repl/repl.js +505 -0
  134. package/dist/repl/repl.js.map +1 -0
  135. package/dist/session/agent-log.d.ts +35 -0
  136. package/dist/session/agent-log.d.ts.map +1 -0
  137. package/dist/session/agent-log.js +120 -0
  138. package/dist/session/agent-log.js.map +1 -0
  139. package/dist/session/chat.d.ts +38 -0
  140. package/dist/session/chat.d.ts.map +1 -0
  141. package/dist/session/chat.js +106 -0
  142. package/dist/session/chat.js.map +1 -0
  143. package/dist/session/cost-tracker.d.ts +14 -0
  144. package/dist/session/cost-tracker.d.ts.map +1 -0
  145. package/dist/session/cost-tracker.js +61 -0
  146. package/dist/session/cost-tracker.js.map +1 -0
  147. package/dist/session/export.d.ts +2 -0
  148. package/dist/session/export.d.ts.map +1 -0
  149. package/dist/session/export.js +105 -0
  150. package/dist/session/export.js.map +1 -0
  151. package/dist/session/in-session-commands.d.ts +7 -0
  152. package/dist/session/in-session-commands.d.ts.map +1 -0
  153. package/dist/session/in-session-commands.js +227 -0
  154. package/dist/session/in-session-commands.js.map +1 -0
  155. package/dist/session/interactive.d.ts +37 -0
  156. package/dist/session/interactive.d.ts.map +1 -0
  157. package/dist/session/interactive.js +226 -0
  158. package/dist/session/interactive.js.map +1 -0
  159. package/dist/session/manager.d.ts +63 -0
  160. package/dist/session/manager.d.ts.map +1 -0
  161. package/dist/session/manager.js +229 -0
  162. package/dist/session/manager.js.map +1 -0
  163. package/dist/session/resume.d.ts +7 -0
  164. package/dist/session/resume.d.ts.map +1 -0
  165. package/dist/session/resume.js +53 -0
  166. package/dist/session/resume.js.map +1 -0
  167. package/dist/session/state-machine.d.ts +4 -0
  168. package/dist/session/state-machine.d.ts.map +1 -0
  169. package/dist/session/state-machine.js +47 -0
  170. package/dist/session/state-machine.js.map +1 -0
  171. package/dist/tui/chat-ui.d.ts +16 -0
  172. package/dist/tui/chat-ui.d.ts.map +1 -0
  173. package/dist/tui/chat-ui.js +19 -0
  174. package/dist/tui/chat-ui.js.map +1 -0
  175. package/dist/tui/dashboard.d.ts +17 -0
  176. package/dist/tui/dashboard.d.ts.map +1 -0
  177. package/dist/tui/dashboard.js +57 -0
  178. package/dist/tui/dashboard.js.map +1 -0
  179. package/dist/tui/session-list.d.ts +18 -0
  180. package/dist/tui/session-list.d.ts.map +1 -0
  181. package/dist/tui/session-list.js +26 -0
  182. package/dist/tui/session-list.js.map +1 -0
  183. package/dist/ui/agent-panel.d.ts +9 -0
  184. package/dist/ui/agent-panel.d.ts.map +1 -0
  185. package/dist/ui/agent-panel.js +100 -0
  186. package/dist/ui/agent-panel.js.map +1 -0
  187. package/dist/ui/banner.d.ts +10 -0
  188. package/dist/ui/banner.d.ts.map +1 -0
  189. package/dist/ui/banner.js +100 -0
  190. package/dist/ui/banner.js.map +1 -0
  191. package/dist/ui/markdown.d.ts +19 -0
  192. package/dist/ui/markdown.d.ts.map +1 -0
  193. package/dist/ui/markdown.js +174 -0
  194. package/dist/ui/markdown.js.map +1 -0
  195. package/dist/ui/prompt.d.ts +24 -0
  196. package/dist/ui/prompt.d.ts.map +1 -0
  197. package/dist/ui/prompt.js +226 -0
  198. package/dist/ui/prompt.js.map +1 -0
  199. package/dist/utils/time.d.ts +3 -0
  200. package/dist/utils/time.d.ts.map +1 -0
  201. package/dist/utils/time.js +29 -0
  202. package/dist/utils/time.js.map +1 -0
  203. package/drizzle/migrations/0000_naive_human_fly.sql +56 -0
  204. package/drizzle/migrations/meta/0000_snapshot.json +395 -0
  205. package/drizzle/migrations/meta/_journal.json +13 -0
  206. package/package.json +70 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SiluPanda
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,587 @@
1
+ <p align="center">
2
+ <pre align="center">
3
+ ┌─────────────────┐
4
+ │ ◉ ◉ │
5
+ │ ───────── │
6
+ └─────────────────┘
7
+ </pre>
8
+ </p>
9
+
10
+ <h1 align="center">sweteam</h1>
11
+
12
+ <p align="center">
13
+ <strong>Autonomous coding agent orchestrator — turns high-level goals into PR'd code.</strong><br/>
14
+ <em>It is not another coding agent. It orchestrates the ones you already have.</em>
15
+ </p>
16
+
17
+ <p align="center">
18
+ <img src="https://img.shields.io/npm/v/sweteam?color=blue&label=npm" alt="npm version" />
19
+ <img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="node version" />
20
+ <img src="https://img.shields.io/badge/license-MIT-blue" alt="license" />
21
+ <img src="https://img.shields.io/badge/PRs-welcome-brightgreen" alt="PRs welcome" />
22
+ </p>
23
+
24
+ <p align="center">
25
+ <a href="#quick-start">Quick Start</a> &middot;
26
+ <a href="#how-it-works">How It Works</a> &middot;
27
+ <a href="#commands">Commands</a> &middot;
28
+ <a href="#configuration">Configuration</a> &middot;
29
+ <a href="#contributing">Contributing</a>
30
+ </p>
31
+
32
+ ---
33
+
34
+ ## Why sweteam?
35
+
36
+ Real software isn't built by a single person typing in a terminal. It's built by **teams** — a tech lead breaks down the work, engineers pick up tasks, reviewers catch mistakes, and the whole thing ships through a structured process. That's what makes production code robust.
37
+
38
+ sweteam brings that same discipline to AI coding agents:
39
+
40
+ ```
41
+ How a real engineering team works
42
+ ─────────────────────────────────
43
+
44
+ ┌───────────┐ You describe what you want. The planner
45
+ │ You │ asks questions, proposes an architecture,
46
+ │ (PM) │ and breaks it into scoped tasks — just like
47
+ └─────┬─────┘ a tech lead running a planning session.
48
+
49
+
50
+ ┌────────────┐ The planner decomposes your goal into small
51
+ │ Planner │ tasks with acceptance criteria, dependency
52
+ │ (Tech Lead)│ order, and file-level scope. You review
53
+ └─────┬──────┘ and refine before anything gets built.
54
+
55
+ │ @build
56
+
57
+ ┌───────────┐ Each task is assigned to a coding agent on
58
+ │ Coders │ its own branch. Independent tasks run in
59
+ │(Engineers)│ parallel — like engineers on a team working
60
+ └─────┬─────┘ on separate features simultaneously.
61
+
62
+
63
+ ┌───────────┐ A separate agent reviews each task's diff
64
+ │ Reviewer │ against its acceptance criteria. If the
65
+ │ (Senior) │ review fails, the coder automatically
66
+ └─────┬─────┘ retries — this loop repeats until the
67
+ │ reviewer is satisfied or the max cycle
68
+ │ limit is reached, just like a real senior
69
+ │ engineer blocking a PR until it's right.
70
+
71
+
72
+ ┌───────────┐ Approved tasks are merged, the branch is
73
+ │ Git + PR │ pushed, and a PR is opened. The session
74
+ │ (CI/CD) │ stays open — give feedback, agents iterate
75
+ └─────┬─────┘ on the same PR until you're satisfied.
76
+
77
+
78
+ Done
79
+ ```
80
+
81
+ The key ideas:
82
+
83
+ - **Granular task breakdown** — your goal is decomposed into small, scoped tasks with explicit acceptance criteria, so each agent call has a clear contract
84
+ - **DAG execution** — tasks are organized into a dependency graph and dispatched in the correct order, with independent tasks running in parallel
85
+ - **Multi-model review loop** — every task is reviewed by a separate agent against its acceptance criteria; failures are retried automatically, just like a real code review cycle
86
+ - **Session persistence** — sessions, plans, tasks, diffs, and full conversation history are stored in SQLite; crash, close the terminal, come back tomorrow — nothing is lost
87
+ - **Agent-agnostic** — works with Claude Code, Codex CLI, OpenCode, or any custom CLI that reads stdin and writes stdout
88
+
89
+ sweteam doesn't replace your coding agents. It gives them the same structure that makes real engineering teams ship reliable code.
90
+
91
+ ## Terminal UI
92
+
93
+ When you launch `sweteam`, you're greeted with an interactive REPL:
94
+
95
+ ```
96
+ ╭─── sweteam v0.1.0 ────────────────────────────────────────────╮
97
+ │ │ │
98
+ │ Welcome to sweteam! │ Getting started │
99
+ │ │ /create [repo] Start new │
100
+ │ ┌─────────────────┐ │ /list See all │
101
+ │ │ ◉ ◉ │ │ /enter <id> Resume │
102
+ │ │ ───────── │ │ ──────────────────────────── │
103
+ │ └─────────────────┘ │ Recent sessions │
104
+ │ │ s_a1b2c3d4 Add dark theme │
105
+ │ Orchestrator · v0.1.0 │ s_e5f6g7h8 Fix auth flow │
106
+ │ ~/projects/myrepo │ │
107
+ ╰───────────────────────────────────────────────────────────────╯
108
+
109
+ sweteam>
110
+ ```
111
+
112
+ Inside a session, agents stream their work in real time:
113
+
114
+ ```
115
+ ▶ Coder ─ task-001: Add ThemeConfig and color definitions
116
+ ──────────────────────────────────────────────────────────
117
+ │ Creating src/theme/config.ts with color palette...
118
+ │ Adding ThemeConfig interface with light/dark variants...
119
+ │ Defining CSS custom properties for runtime switching...
120
+ ✓ Coder completed
121
+
122
+ ▶ Reviewer ─ task-001: Add ThemeConfig and color definitions
123
+ ──────────────────────────────────────────────────────────
124
+ │ Checking diff against acceptance criteria...
125
+ │ All criteria met. Approving.
126
+ ✓ Reviewer completed
127
+ ```
128
+
129
+ ## Features
130
+
131
+ - **Session-based** — every interaction lives in a persistent session with full history
132
+ - **Zero config** — discovers installed CLIs automatically, uses their existing auth
133
+ - **Human-in-the-loop planning** — chat with the planner, refine the plan, then go hands-off
134
+ - **Parallel execution** — independent tasks run concurrently across multiple agents
135
+ - **Review loop** — built-in code review with configurable retry cycles
136
+ - **Feedback iterations** — session stays open; you give feedback, agents iterate on the same PR
137
+ - **Live attach** — re-enter any session and see agent output streaming in real time
138
+ - **Git native** — all git/GitHub operations via `git` and `gh` CLI directly
139
+ - **Pluggable agents** — supports Claude Code, Codex CLI, OpenCode, or any custom CLI
140
+
141
+ ## Prerequisites
142
+
143
+ You need at least **one** coding CLI installed:
144
+
145
+ | CLI | Install |
146
+ |---|---|
147
+ | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | `npm install -g @anthropic-ai/claude-code` |
148
+ | [Codex CLI](https://github.com/openai/codex) | `npm install -g @openai/codex` |
149
+ | [OpenCode](https://github.com/opencode-ai/opencode) | `go install github.com/opencode-ai/opencode@latest` |
150
+
151
+ Plus these required tools:
152
+
153
+ - **git** — version control
154
+ - **gh** — [GitHub CLI](https://cli.github.com/) (authenticated via `gh auth login`)
155
+ - **Node.js** — v18+
156
+
157
+ ## Installation
158
+
159
+ ### From npm
160
+
161
+ ```bash
162
+ npm install -g sweteam
163
+ ```
164
+
165
+ ### From source
166
+
167
+ ```bash
168
+ git clone https://github.com/SiluPanda/sweteam.git
169
+ cd sweteam
170
+ npm install
171
+ npm run build
172
+ npm link
173
+ ```
174
+
175
+ ## Quick Start
176
+
177
+ ### 1. Initialize
178
+
179
+ ```bash
180
+ sweteam init
181
+ ```
182
+
183
+ Auto-discovers your installed CLIs and generates `~/.sweteam/config.toml`:
184
+
185
+ ```
186
+ ✓ Found claude (Claude Code v1.x)
187
+ ✓ Found codex (Codex CLI v0.x)
188
+ ✗ opencode not found
189
+ ✓ Found gh (GitHub CLI v2.x)
190
+ ✓ Found git (v2.43)
191
+ Generated ~/.sweteam/config.toml
192
+ ```
193
+
194
+ ### 2. Create a session
195
+
196
+ ```bash
197
+ sweteam create myrepo
198
+ ```
199
+
200
+ Or launch the interactive REPL and create from there:
201
+
202
+ ```bash
203
+ sweteam
204
+ sweteam> /create myrepo
205
+ ```
206
+
207
+ This will:
208
+ - Resolve `myrepo` to your GitHub username (e.g. `YourName/myrepo`)
209
+ - Clone the repo (or fetch latest if already cloned)
210
+ - Create a working branch
211
+ - Enter the **planning chat**
212
+
213
+ ### 3. Plan interactively
214
+
215
+ You're now chatting with the planner agent. Describe your goal, ask questions, refine the approach:
216
+
217
+ ```
218
+ crawlgator-ui> Add dark theme with system preference detection and a Ctrl+T toggle
219
+
220
+ ▶ Planner ─ s_a1b2c3d4: Add dark theme
221
+ ────────────────────────────────────────
222
+ │ I'll break this down into 6 tasks:
223
+
224
+ │ task-001: Add ThemeConfig and color definitions
225
+ │ task-002: Implement system preference detection
226
+ │ task-003: Create dark theme preset
227
+ │ ...
228
+
229
+ │ Type @build when you're ready.
230
+ ✓ Planner completed
231
+
232
+ crawlgator-ui> @build
233
+ ```
234
+
235
+ ### 4. Watch it build
236
+
237
+ sweteam decomposes the plan into tasks, dispatches them to coding agents, reviews each result, and merges into the session branch — all autonomously.
238
+
239
+ ```
240
+ Plan finalized. Starting autonomous build...
241
+
242
+ Found 6 tasks:
243
+
244
+ task-001 Add ThemeConfig and color definitions
245
+ task-002 Implement system preference detection
246
+ task-003 Create dark theme preset (depends on: task-001)
247
+ task-004 Create light theme preset (depends on: task-001)
248
+ task-005 Wire theme into TUI render paths (depends on: task-002, task-003, task-004)
249
+ task-006 Add runtime theme toggle (depends on: task-005)
250
+
251
+ ▶ Coder ─ task-001: Add ThemeConfig and color definitions
252
+ ──────────────────────────────────────────────────────────
253
+ │ Creating src/theme/config.ts...
254
+ │ ...
255
+ ✓ Coder completed
256
+
257
+ ▶ Reviewer ─ task-001: Add ThemeConfig and color definitions
258
+ ──────────────────────────────────────────────────────────
259
+ │ Reviewing diff against acceptance criteria...
260
+ ✓ Reviewer completed
261
+
262
+ Build complete.
263
+
264
+ ✓ task-001 Add ThemeConfig and color definitions
265
+ ✓ task-002 Implement system preference detection
266
+ ✓ task-003 Create dark theme preset
267
+ ✓ task-004 Create light theme preset
268
+ ✓ task-005 Wire theme into TUI render paths
269
+ ⚠ task-006 Add runtime theme toggle — ESCALATED
270
+
271
+ PR: https://github.com/YourName/myrepo/pull/42
272
+
273
+ Review the PR and type @feedback with any changes needed.
274
+ ```
275
+
276
+ ### 5. Give feedback
277
+
278
+ ```
279
+ crawlgator-ui> @feedback The dark theme colors are too muted. Make the accent brighter (#00BFFF).
280
+ ```
281
+
282
+ Agents pick up your feedback, iterate, and push updates to the same PR.
283
+
284
+ ### 6. Re-enter a session
285
+
286
+ Come back later and pick up where you left off. If agents are still running, you'll see their output stream live:
287
+
288
+ ```bash
289
+ sweteam enter s_a1b2c3d4
290
+ ```
291
+
292
+ ```
293
+ Entered session s_a1b2c3d4 (YourName/myrepo)
294
+ Goal: Add dark theme with system preference detection
295
+ Status: building
296
+
297
+ Attaching to live build output... (press Enter to detach)
298
+
299
+ ▶ Coder ─ task-005: Wire theme into TUI render paths
300
+ ──────────────────────────────────────────────────────────
301
+ │ Integrating theme provider into the component tree...
302
+ ```
303
+
304
+ ## Commands
305
+
306
+ ### Top-level commands
307
+
308
+ | Command | Description |
309
+ |---|---|
310
+ | `sweteam` | Launch interactive REPL |
311
+ | `sweteam init` | Auto-discover CLIs and generate config |
312
+ | `sweteam create [repo]` | Create a new session |
313
+ | `sweteam list` | List all sessions |
314
+ | `sweteam enter <session_id>` | Re-enter an existing session |
315
+ | `sweteam show <session_id>` | Show detailed session status |
316
+ | `sweteam stop <session_id>` | Stop a session |
317
+ | `sweteam delete <session_id>` | Delete a session |
318
+
319
+ ### In-session commands
320
+
321
+ Once inside a session, use `@` commands:
322
+
323
+ | Command | Description |
324
+ |---|---|
325
+ | `@build` | Finalize plan and start autonomous coding |
326
+ | `@status` | Show task progress dashboard |
327
+ | `@plan` | Re-display the current plan |
328
+ | `@feedback <text>` | Give feedback on completed work (triggers new iteration) |
329
+ | `@diff` | Show cumulative diff |
330
+ | `@pr` | Show the PR link |
331
+ | `@tasks` | List all tasks with statuses and review info |
332
+ | `@stop` | Stop this session and return to REPL |
333
+ | `@help` | Show available commands |
334
+
335
+ Any other text is sent directly to the planner for conversation.
336
+
337
+ ### REPL commands
338
+
339
+ Inside the interactive REPL, use `/` commands:
340
+
341
+ | Command | Description |
342
+ |---|---|
343
+ | `/create [repo]` | Start a new session |
344
+ | `/list` | See all sessions |
345
+ | `/enter <id>` | Resume a session |
346
+ | `/show <id>` | Inspect a session |
347
+ | `/stop <id>` | Stop a session |
348
+ | `/delete <id>` | Delete a session |
349
+ | `/init` | Re-run CLI discovery |
350
+ | `/help` | Show help |
351
+ | `/exit` | Quit |
352
+
353
+ ### CLI flags
354
+
355
+ ```bash
356
+ sweteam --coder codex # Override coder agent
357
+ sweteam --reviewer claude-code # Override reviewer agent
358
+ sweteam --parallel 5 # Override max parallel tasks
359
+ sweteam --config ./custom.toml # Use custom config file
360
+ ```
361
+
362
+ ### List filters
363
+
364
+ ```bash
365
+ sweteam list --status building # Filter by status
366
+ sweteam list --repo myrepo # Filter by repo name
367
+ ```
368
+
369
+ ## How It Works
370
+
371
+ ### Architecture
372
+
373
+ ```
374
+ ┌──────────────────────────────────────────────────────────┐
375
+ │ sweteam CLI │
376
+ │ │
377
+ │ ┌──────────┐ ┌──────────────┐ ┌────────────────────┐ │
378
+ │ │ Session │ │ Planner │ │ Orchestrator │ │
379
+ │ │ Manager │ │ (chat mode) │ │ (autonomous) │ │
380
+ │ └──────────┘ └──────────────┘ └────────────────────┘ │
381
+ │ │
382
+ │ ┌────────────────────────────────────────────────────┐ │
383
+ │ │ Agent Adapter Layer │ │
384
+ │ │ ┌────────────┐ ┌──────────┐ ┌────────────────────┐ │ │
385
+ │ │ │ Claude Code│ │ Codex CLI│ │ OpenCode / Custom │ │ │
386
+ │ │ └────────────┘ └──────────┘ └────────────────────┘ │ │
387
+ │ └────────────────────────────────────────────────────┘ │
388
+ │ │
389
+ │ ┌──────────────────────┐ ┌──────────────────────────┐ │
390
+ │ │ SQLite + Drizzle │ │ git + gh CLI (native) │ │
391
+ │ │ (session store) │ │ (branches, PRs, commits)│ │
392
+ │ └──────────────────────┘ └──────────────────────────┘ │
393
+ └──────────────────────────────────────────────────────────┘
394
+ ```
395
+
396
+ ### Session lifecycle
397
+
398
+ ```
399
+ /create
400
+
401
+ v
402
+ ┌──────────────────────────┐
403
+ │ planning │ <── chat with planner
404
+ └────────────┬─────────────┘
405
+ │ @build
406
+ v
407
+ ┌──────────────────────────┐
408
+ │ building │ <── agents code + review
409
+ └────────────┬─────────────┘
410
+
411
+ v
412
+ ┌──────────────────────────┐
413
+ │ awaiting_feedback │ <── PR created, user reviews
414
+ └────────────┬─────────────┘
415
+ │ @feedback
416
+ v
417
+ ┌──────────────────────────┐
418
+ │ iterating │ <── agents apply feedback
419
+ └────────────┬─────────────┘
420
+
421
+ v
422
+ awaiting_feedback ─── (loops until satisfied)
423
+
424
+ │ /stop
425
+ v
426
+ ┌──────────────────────────┐
427
+ │ stopped │
428
+ └──────────────────────────┘
429
+ ```
430
+
431
+ ### Task execution pipeline
432
+
433
+ 1. **Plan** — the planner agent decomposes your goal into tasks with dependencies
434
+ 2. **DAG** — tasks are organized into a dependency graph
435
+ 3. **Dispatch** — independent tasks run concurrently (up to `max_parallel`)
436
+ 4. **Code** — each task is assigned to a coding agent on its own git branch
437
+ 5. **Review** — a reviewer agent checks the diff against acceptance criteria
438
+ 6. **Fix loop** — if review finds issues, the coder retries (up to `max_review_cycles`)
439
+ 7. **Merge** — approved tasks are squash-merged into the session branch
440
+ 8. **PR** — the session branch is pushed and a GitHub PR is created
441
+
442
+ ## Configuration
443
+
444
+ Config lives at `~/.sweteam/config.toml`. Generated by `sweteam init`.
445
+
446
+ ```toml
447
+ [roles]
448
+ planner = "claude-code" # Which CLI generates the plan
449
+ coder = "claude-code" # Which CLI writes code
450
+ reviewer = "claude-code" # Which CLI reviews code
451
+
452
+ [execution]
453
+ max_parallel = 3 # Concurrent coding agents
454
+ max_review_cycles = 3 # Review/fix loops before escalating
455
+ branch_prefix = "sw/" # Prefix for all branches
456
+
457
+ [git]
458
+ commit_style = "conventional" # conventional | simple
459
+ squash_on_merge = true
460
+
461
+ [agents.claude-code]
462
+ command = "claude"
463
+ args = ["-p"]
464
+
465
+ [agents.codex]
466
+ command = "codex"
467
+ args = ["-q"]
468
+
469
+ [agents.opencode]
470
+ command = "opencode"
471
+ args = ["--non-interactive"]
472
+ ```
473
+
474
+ ### Custom agents
475
+
476
+ Any CLI that accepts a prompt on stdin and writes output to stdout can be used as an agent:
477
+
478
+ ```toml
479
+ [agents.my-agent]
480
+ command = "my-coding-tool"
481
+ args = ["--mode", "autonomous"]
482
+ prompt_via = "stdin" # stdin | arg | file
483
+ output_from = "stdout" # stdout | file
484
+ ```
485
+
486
+ Then reference it in your roles:
487
+
488
+ ```toml
489
+ [roles]
490
+ coder = "my-agent"
491
+ ```
492
+
493
+ ## Data storage
494
+
495
+ All data is stored locally:
496
+
497
+ ```
498
+ ~/.sweteam/
499
+ ├── sweteam.db # SQLite database (sessions, tasks, messages)
500
+ ├── config.toml # Global configuration
501
+ ├── logs/ # Agent output logs (for live attach)
502
+ │ └── s_a1b2c3d4.jsonl
503
+ └── repos/ # Cloned repositories
504
+ └── YourName--myrepo/
505
+ ```
506
+
507
+ - **No API keys stored** — coding CLIs manage their own authentication
508
+ - **No network calls** — sweteam itself makes zero API requests; only the underlying agents and git/gh do
509
+ - **Full audit trail** — every prompt, response, and system event is stored per session
510
+
511
+ ## Development
512
+
513
+ ```bash
514
+ git clone https://github.com/SiluPanda/sweteam.git
515
+ cd sweteam
516
+ npm install
517
+
518
+ # Run in dev mode (no build step)
519
+ npm run dev
520
+
521
+ # Run with subcommands
522
+ npm run dev -- create myrepo
523
+
524
+ # Run tests
525
+ npm test
526
+
527
+ # Build
528
+ npm run build
529
+
530
+ # Link globally for testing
531
+ npm link
532
+ ```
533
+
534
+ ### Project structure
535
+
536
+ ```
537
+ src/
538
+ ├── index.ts # CLI entry point (Commander.js)
539
+ ├── repl/ # Interactive REPL loop
540
+ ├── session/ # Session manager, state machine, agent log
541
+ ├── planner/ # Planner agent and plan parser
542
+ ├── orchestrator/ # Task runner, reviewer, build/feedback handlers
543
+ ├── adapters/ # Agent adapters (claude-code, codex, opencode, custom)
544
+ ├── commands/ # CLI subcommands (create, list, enter, etc.)
545
+ ├── config/ # Config loader and GitHub auth
546
+ ├── git/ # Git and GitHub CLI wrappers
547
+ ├── ui/ # Terminal UI (banner, prompt, agent panel, markdown)
548
+ ├── db/ # SQLite schema and client (Drizzle ORM)
549
+ └── __tests__/ # Test suite
550
+ ```
551
+
552
+ ### Tech stack
553
+
554
+ | Component | Choice |
555
+ |---|---|
556
+ | Language | TypeScript (ESM, Node.js 18+) |
557
+ | ORM | Drizzle |
558
+ | Database | SQLite via better-sqlite3 |
559
+ | CLI framework | Commander.js |
560
+ | Terminal UI | Custom (chalk, raw-mode prompt) |
561
+ | Git | `git` + `gh` CLI (child process) |
562
+ | IDs | nanoid |
563
+ | Config | TOML |
564
+ | Tests | Vitest |
565
+
566
+ ## Contributing
567
+
568
+ Contributions are welcome. Please open an issue first to discuss what you'd like to change.
569
+
570
+ ```bash
571
+ # Fork and clone
572
+ git clone https://github.com/your-name/sweteam.git
573
+ cd sweteam
574
+ npm install
575
+
576
+ # Create a branch
577
+ git checkout -b feat/my-feature
578
+
579
+ # Make changes, run tests
580
+ npm test
581
+
582
+ # Submit a PR
583
+ ```
584
+
585
+ ## License
586
+
587
+ [MIT](LICENSE)
@@ -0,0 +1,19 @@
1
+ import type { SweteamConfig } from "../config/loader.js";
2
+ export interface AgentResult {
3
+ output: string;
4
+ exitCode: number;
5
+ durationMs: number;
6
+ }
7
+ export interface AgentAdapter {
8
+ name: string;
9
+ isAvailable(): Promise<boolean>;
10
+ execute(opts: {
11
+ prompt: string;
12
+ cwd: string;
13
+ timeout?: number;
14
+ onOutput?: (chunk: string) => void;
15
+ onInputNeeded?: (promptText: string) => Promise<string | null>;
16
+ }): Promise<AgentResult>;
17
+ }
18
+ export declare function resolveAdapter(name: string, config: SweteamConfig): AgentAdapter;
19
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMzD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IAEb,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAEhC,OAAO,CAAC,IAAI,EAAE;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACnC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;KAChE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAC1B;AAQD,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,aAAa,GACpB,YAAY,CAWd"}
@@ -0,0 +1,20 @@
1
+ import { ClaudeCodeAdapter } from "./claude-code.js";
2
+ import { CodexAdapter } from "./codex.js";
3
+ import { OpenCodeAdapter } from "./opencode.js";
4
+ import { CustomAdapter } from "./custom.js";
5
+ const BUILTIN_ADAPTERS = {
6
+ "claude-code": () => new ClaudeCodeAdapter(),
7
+ codex: () => new CodexAdapter(),
8
+ opencode: () => new OpenCodeAdapter(),
9
+ };
10
+ export function resolveAdapter(name, config) {
11
+ if (BUILTIN_ADAPTERS[name]) {
12
+ return BUILTIN_ADAPTERS[name]();
13
+ }
14
+ const agentConfig = config.agents[name];
15
+ if (!agentConfig) {
16
+ throw new Error(`Unknown agent: ${name}. Check your config.`);
17
+ }
18
+ return new CustomAdapter(name, agentConfig);
19
+ }
20
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/adapters/adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAsB5C,MAAM,gBAAgB,GAAuC;IAC3D,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,iBAAiB,EAAE;IAC5C,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,YAAY,EAAE;IAC/B,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,eAAe,EAAE;CACtC,CAAC;AAEF,MAAM,UAAU,cAAc,CAC5B,IAAY,EACZ,MAAqB;IAErB,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,OAAO,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IAClC,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,sBAAsB,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,IAAI,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { AgentAdapter, AgentResult } from "./adapter.js";
2
+ export declare class ClaudeCodeAdapter implements AgentAdapter {
3
+ name: string;
4
+ isAvailable(): Promise<boolean>;
5
+ execute(opts: {
6
+ prompt: string;
7
+ cwd: string;
8
+ timeout?: number;
9
+ onOutput?: (chunk: string) => void;
10
+ onInputNeeded?: (promptText: string) => Promise<string | null>;
11
+ }): Promise<AgentResult>;
12
+ }
13
+ //# sourceMappingURL=claude-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../src/adapters/claude-code.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA2B9D,qBAAa,iBAAkB,YAAW,YAAY;IACpD,IAAI,SAAiB;IAEf,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IASrC,OAAO,CAAC,IAAI,EAAE;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACnC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;KAChE,GAAG,OAAO,CAAC,WAAW,CAAC;CAuHzB"}