@cluesmith/codev 3.0.0 → 3.0.2

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 (311) hide show
  1. package/LICENSE +201 -0
  2. package/bin/af.js +2 -2
  3. package/bin/afx.js +8 -0
  4. package/bin/consult.js +2 -1
  5. package/bin/team.js +2 -1
  6. package/{dashboard/dist/assets/index-nr0cXxtf.css → dashboard-dist/assets/index-BWYZtvwm.css} +1 -1
  7. package/dashboard-dist/assets/index-Dn9zmcKp.js +195 -0
  8. package/dashboard-dist/assets/index-Dn9zmcKp.js.map +1 -0
  9. package/{dashboard/dist → dashboard-dist}/index.html +2 -2
  10. package/dist/agent-farm/cli.d.ts.map +1 -1
  11. package/dist/agent-farm/cli.js +27 -19
  12. package/dist/agent-farm/cli.js.map +1 -1
  13. package/dist/agent-farm/commands/architect.d.ts +4 -4
  14. package/dist/agent-farm/commands/architect.d.ts.map +1 -1
  15. package/dist/agent-farm/commands/architect.js +23 -12
  16. package/dist/agent-farm/commands/architect.js.map +1 -1
  17. package/dist/agent-farm/commands/attach.d.ts.map +1 -1
  18. package/dist/agent-farm/commands/attach.js +101 -11
  19. package/dist/agent-farm/commands/attach.js.map +1 -1
  20. package/dist/agent-farm/commands/bench.d.ts +1 -1
  21. package/dist/agent-farm/commands/bench.js +1 -1
  22. package/dist/agent-farm/commands/cron.js +1 -1
  23. package/dist/agent-farm/commands/cron.js.map +1 -1
  24. package/dist/agent-farm/commands/db.d.ts +3 -3
  25. package/dist/agent-farm/commands/db.js +4 -4
  26. package/dist/agent-farm/commands/db.js.map +1 -1
  27. package/dist/agent-farm/commands/open.js +2 -2
  28. package/dist/agent-farm/commands/open.js.map +1 -1
  29. package/dist/agent-farm/commands/rename.js +1 -1
  30. package/dist/agent-farm/commands/rename.js.map +1 -1
  31. package/dist/agent-farm/commands/send.js +3 -3
  32. package/dist/agent-farm/commands/send.js.map +1 -1
  33. package/dist/agent-farm/commands/shell.js +3 -3
  34. package/dist/agent-farm/commands/shell.js.map +1 -1
  35. package/dist/agent-farm/commands/spawn-roles.d.ts +9 -5
  36. package/dist/agent-farm/commands/spawn-roles.d.ts.map +1 -1
  37. package/dist/agent-farm/commands/spawn-roles.js +48 -28
  38. package/dist/agent-farm/commands/spawn-roles.js.map +1 -1
  39. package/dist/agent-farm/commands/spawn-worktree.d.ts +5 -5
  40. package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
  41. package/dist/agent-farm/commands/spawn-worktree.js +80 -13
  42. package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
  43. package/dist/agent-farm/commands/spawn.d.ts +6 -6
  44. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  45. package/dist/agent-farm/commands/spawn.js +90 -53
  46. package/dist/agent-farm/commands/spawn.js.map +1 -1
  47. package/dist/agent-farm/commands/status.d.ts.map +1 -1
  48. package/dist/agent-farm/commands/status.js +48 -3
  49. package/dist/agent-farm/commands/status.js.map +1 -1
  50. package/dist/agent-farm/commands/team-update.d.ts +1 -1
  51. package/dist/agent-farm/commands/team-update.js +1 -1
  52. package/dist/agent-farm/commands/team.d.ts +1 -1
  53. package/dist/agent-farm/commands/team.js +1 -1
  54. package/dist/agent-farm/commands/tower-cloud.d.ts +2 -2
  55. package/dist/agent-farm/commands/tower-cloud.js +3 -3
  56. package/dist/agent-farm/commands/tower-cloud.js.map +1 -1
  57. package/dist/agent-farm/commands/tower.js +2 -2
  58. package/dist/agent-farm/commands/tower.js.map +1 -1
  59. package/dist/agent-farm/db/index.d.ts.map +1 -1
  60. package/dist/agent-farm/db/index.js +47 -0
  61. package/dist/agent-farm/db/index.js.map +1 -1
  62. package/dist/agent-farm/db/schema.d.ts +1 -1
  63. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  64. package/dist/agent-farm/db/schema.js +1 -1
  65. package/dist/agent-farm/db/types.d.ts +1 -1
  66. package/dist/agent-farm/lib/cloud-config.js +2 -2
  67. package/dist/agent-farm/lib/cloud-config.js.map +1 -1
  68. package/dist/agent-farm/lib/tower-client.d.ts +6 -230
  69. package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
  70. package/dist/agent-farm/lib/tower-client.js +6 -293
  71. package/dist/agent-farm/lib/tower-client.js.map +1 -1
  72. package/dist/agent-farm/lib/tunnel-client.js +1 -1
  73. package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
  74. package/dist/agent-farm/servers/message-write.d.ts +24 -0
  75. package/dist/agent-farm/servers/message-write.d.ts.map +1 -0
  76. package/dist/agent-farm/servers/message-write.js +63 -0
  77. package/dist/agent-farm/servers/message-write.js.map +1 -0
  78. package/dist/agent-farm/servers/overview.d.ts +4 -1
  79. package/dist/agent-farm/servers/overview.d.ts.map +1 -1
  80. package/dist/agent-farm/servers/overview.js +38 -5
  81. package/dist/agent-farm/servers/overview.js.map +1 -1
  82. package/dist/agent-farm/servers/send-buffer.d.ts +4 -3
  83. package/dist/agent-farm/servers/send-buffer.d.ts.map +1 -1
  84. package/dist/agent-farm/servers/send-buffer.js +7 -4
  85. package/dist/agent-farm/servers/send-buffer.js.map +1 -1
  86. package/dist/agent-farm/servers/tower-cron-parser.js +1 -1
  87. package/dist/agent-farm/servers/tower-cron-parser.js.map +1 -1
  88. package/dist/agent-farm/servers/tower-cron.d.ts.map +1 -1
  89. package/dist/agent-farm/servers/tower-cron.js +4 -5
  90. package/dist/agent-farm/servers/tower-cron.js.map +1 -1
  91. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
  92. package/dist/agent-farm/servers/tower-instances.js +6 -5
  93. package/dist/agent-farm/servers/tower-instances.js.map +1 -1
  94. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
  95. package/dist/agent-farm/servers/tower-routes.js +19 -16
  96. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  97. package/dist/agent-farm/servers/tower-server.js +19 -4
  98. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  99. package/dist/agent-farm/servers/tower-terminals.d.ts +2 -2
  100. package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
  101. package/dist/agent-farm/servers/tower-terminals.js +47 -18
  102. package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
  103. package/dist/agent-farm/servers/tower-tunnel.js +2 -2
  104. package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
  105. package/dist/agent-farm/servers/tower-utils.d.ts +9 -6
  106. package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
  107. package/dist/agent-farm/servers/tower-utils.js +12 -6
  108. package/dist/agent-farm/servers/tower-utils.js.map +1 -1
  109. package/dist/agent-farm/state.js +1 -1
  110. package/dist/agent-farm/state.js.map +1 -1
  111. package/dist/agent-farm/types.d.ts +11 -2
  112. package/dist/agent-farm/types.d.ts.map +1 -1
  113. package/dist/agent-farm/utils/config.d.ts +11 -0
  114. package/dist/agent-farm/utils/config.d.ts.map +1 -1
  115. package/dist/agent-farm/utils/config.js +21 -0
  116. package/dist/agent-farm/utils/config.js.map +1 -1
  117. package/dist/agent-farm/utils/harness.d.ts +85 -0
  118. package/dist/agent-farm/utils/harness.d.ts.map +1 -0
  119. package/dist/agent-farm/utils/harness.js +212 -0
  120. package/dist/agent-farm/utils/harness.js.map +1 -0
  121. package/dist/agent-farm/utils/server-utils.d.ts +13 -0
  122. package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
  123. package/dist/agent-farm/utils/server-utils.js +38 -0
  124. package/dist/agent-farm/utils/server-utils.js.map +1 -1
  125. package/dist/cli.d.ts +1 -1
  126. package/dist/cli.d.ts.map +1 -1
  127. package/dist/cli.js +19 -5
  128. package/dist/cli.js.map +1 -1
  129. package/dist/commands/adopt.js +2 -2
  130. package/dist/commands/adopt.js.map +1 -1
  131. package/dist/commands/consult/index.d.ts +37 -3
  132. package/dist/commands/consult/index.d.ts.map +1 -1
  133. package/dist/commands/consult/index.js +220 -150
  134. package/dist/commands/consult/index.js.map +1 -1
  135. package/dist/commands/doctor.d.ts.map +1 -1
  136. package/dist/commands/doctor.js +54 -8
  137. package/dist/commands/doctor.js.map +1 -1
  138. package/dist/commands/init.js +1 -1
  139. package/dist/commands/init.js.map +1 -1
  140. package/dist/commands/porch/artifacts.d.ts +69 -0
  141. package/dist/commands/porch/artifacts.d.ts.map +1 -0
  142. package/dist/commands/porch/artifacts.js +368 -0
  143. package/dist/commands/porch/artifacts.js.map +1 -0
  144. package/dist/commands/porch/checks.d.ts +8 -1
  145. package/dist/commands/porch/checks.d.ts.map +1 -1
  146. package/dist/commands/porch/checks.js +98 -1
  147. package/dist/commands/porch/checks.js.map +1 -1
  148. package/dist/commands/porch/index.d.ts +18 -7
  149. package/dist/commands/porch/index.d.ts.map +1 -1
  150. package/dist/commands/porch/index.js +299 -61
  151. package/dist/commands/porch/index.js.map +1 -1
  152. package/dist/commands/porch/next.d.ts.map +1 -1
  153. package/dist/commands/porch/next.js +72 -74
  154. package/dist/commands/porch/next.js.map +1 -1
  155. package/dist/commands/porch/notify.d.ts +2 -2
  156. package/dist/commands/porch/notify.js +5 -5
  157. package/dist/commands/porch/notify.js.map +1 -1
  158. package/dist/commands/porch/prompts.d.ts +2 -1
  159. package/dist/commands/porch/prompts.d.ts.map +1 -1
  160. package/dist/commands/porch/prompts.js +23 -14
  161. package/dist/commands/porch/prompts.js.map +1 -1
  162. package/dist/commands/porch/state.d.ts +27 -2
  163. package/dist/commands/porch/state.d.ts.map +1 -1
  164. package/dist/commands/porch/state.js +96 -9
  165. package/dist/commands/porch/state.js.map +1 -1
  166. package/dist/commands/porch/types.d.ts +8 -0
  167. package/dist/commands/porch/types.d.ts.map +1 -1
  168. package/dist/lib/config.d.ts +14 -0
  169. package/dist/lib/config.d.ts.map +1 -1
  170. package/dist/lib/config.js +7 -0
  171. package/dist/lib/config.js.map +1 -1
  172. package/dist/lib/forge-contracts.d.ts +10 -1
  173. package/dist/lib/forge-contracts.d.ts.map +1 -1
  174. package/dist/lib/forge-contracts.js.map +1 -1
  175. package/dist/lib/forge.d.ts.map +1 -1
  176. package/dist/lib/forge.js +25 -7
  177. package/dist/lib/forge.js.map +1 -1
  178. package/dist/lib/team-github.d.ts +49 -0
  179. package/dist/lib/team-github.d.ts.map +1 -1
  180. package/dist/lib/team-github.js +115 -6
  181. package/dist/lib/team-github.js.map +1 -1
  182. package/dist/terminal/pty-manager.d.ts.map +1 -1
  183. package/dist/terminal/pty-manager.js +2 -0
  184. package/dist/terminal/pty-manager.js.map +1 -1
  185. package/dist/terminal/ws-protocol.d.ts +10 -8
  186. package/dist/terminal/ws-protocol.d.ts.map +1 -1
  187. package/dist/terminal/ws-protocol.js +3 -0
  188. package/dist/terminal/ws-protocol.js.map +1 -1
  189. package/package.json +28 -25
  190. package/scripts/forge/gitea/auth-status.sh +0 -0
  191. package/scripts/forge/gitea/issue-comment.sh +0 -0
  192. package/scripts/forge/gitea/issue-list.sh +0 -0
  193. package/scripts/forge/gitea/issue-view.sh +0 -0
  194. package/scripts/forge/gitea/pr-exists.sh +4 -1
  195. package/scripts/forge/gitea/pr-list.sh +0 -0
  196. package/scripts/forge/gitea/pr-merge.sh +0 -0
  197. package/scripts/forge/gitea/pr-view.sh +0 -0
  198. package/scripts/forge/gitea/recently-closed.sh +0 -0
  199. package/scripts/forge/gitea/recently-merged.sh +0 -0
  200. package/scripts/forge/gitea/repo-archive.sh +0 -0
  201. package/scripts/forge/gitea/user-identity.sh +0 -0
  202. package/scripts/forge/github/auth-status.sh +0 -0
  203. package/scripts/forge/github/issue-comment.sh +0 -0
  204. package/scripts/forge/github/issue-list.sh +2 -2
  205. package/scripts/forge/github/issue-view.sh +0 -0
  206. package/scripts/forge/github/on-it-timestamps.sh +0 -0
  207. package/scripts/forge/github/pr-diff.sh +0 -0
  208. package/scripts/forge/github/pr-exists.sh +3 -1
  209. package/scripts/forge/github/pr-list.sh +2 -2
  210. package/scripts/forge/github/pr-merge.sh +0 -0
  211. package/scripts/forge/github/pr-search.sh +0 -0
  212. package/scripts/forge/github/pr-view.sh +0 -0
  213. package/scripts/forge/github/recently-closed.sh +0 -0
  214. package/scripts/forge/github/recently-merged.sh +0 -0
  215. package/scripts/forge/github/repo-archive.sh +0 -0
  216. package/scripts/forge/github/team-activity.sh +0 -0
  217. package/scripts/forge/github/user-identity.sh +0 -0
  218. package/scripts/forge/gitlab/auth-status.sh +0 -0
  219. package/scripts/forge/gitlab/issue-comment.sh +0 -0
  220. package/scripts/forge/gitlab/issue-list.sh +0 -0
  221. package/scripts/forge/gitlab/issue-view.sh +0 -0
  222. package/scripts/forge/gitlab/pr-diff.sh +0 -0
  223. package/scripts/forge/gitlab/pr-exists.sh +3 -1
  224. package/scripts/forge/gitlab/pr-list.sh +0 -0
  225. package/scripts/forge/gitlab/pr-merge.sh +0 -0
  226. package/scripts/forge/gitlab/pr-search.sh +0 -0
  227. package/scripts/forge/gitlab/pr-view.sh +0 -0
  228. package/scripts/forge/gitlab/recently-closed.sh +0 -0
  229. package/scripts/forge/gitlab/recently-merged.sh +0 -0
  230. package/scripts/forge/gitlab/repo-archive.sh +0 -0
  231. package/scripts/forge/gitlab/user-identity.sh +0 -0
  232. package/scripts/forge/linear/auth-status.sh +15 -0
  233. package/scripts/forge/linear/issue-comment.sh +38 -0
  234. package/scripts/forge/linear/issue-list.sh +35 -0
  235. package/scripts/forge/linear/issue-view.sh +37 -0
  236. package/scripts/forge/linear/recently-closed.sh +45 -0
  237. package/scripts/forge/linear/user-identity.sh +15 -0
  238. package/scripts/postinstall.mjs +51 -0
  239. package/skeleton/.claude/skills/afx/SKILL.md +144 -0
  240. package/skeleton/.claude/skills/codev/SKILL.md +3 -3
  241. package/skeleton/.claude/skills/consult/SKILL.md +1 -1
  242. package/skeleton/.claude/skills/porch/SKILL.md +2 -2
  243. package/skeleton/.claude/skills/update-arch-docs/SKILL.md +107 -0
  244. package/skeleton/DEPENDENCIES.md +1 -1
  245. package/skeleton/builders.md +4 -4
  246. package/skeleton/protocol-schema.json +2 -2
  247. package/skeleton/protocols/air/builder-prompt.md +6 -6
  248. package/skeleton/protocols/air/prompts/pr.md +17 -5
  249. package/skeleton/protocols/air/protocol.md +1 -2
  250. package/skeleton/protocols/aspir/builder-prompt.md +28 -6
  251. package/skeleton/protocols/aspir/prompts/review.md +11 -0
  252. package/skeleton/protocols/aspir/protocol.json +9 -1
  253. package/skeleton/protocols/aspir/protocol.md +1 -1
  254. package/skeleton/protocols/aspir/templates/plan.md +0 -20
  255. package/skeleton/protocols/aspir/templates/spec.md +0 -28
  256. package/skeleton/protocols/bugfix/builder-prompt.md +6 -6
  257. package/skeleton/protocols/bugfix/prompts/pr.md +16 -4
  258. package/skeleton/protocols/experiment/builder-prompt.md +15 -0
  259. package/skeleton/protocols/experiment/protocol.md +1 -6
  260. package/skeleton/protocols/maintain/builder-prompt.md +12 -11
  261. package/skeleton/protocols/maintain/prompts/maintain.md +88 -0
  262. package/skeleton/protocols/maintain/prompts/review.md +84 -0
  263. package/skeleton/protocols/maintain/protocol.json +14 -68
  264. package/skeleton/protocols/maintain/protocol.md +163 -394
  265. package/skeleton/protocols/maintain/templates/maintenance-run.md +18 -49
  266. package/skeleton/protocols/protocol-schema.json +1 -1
  267. package/skeleton/protocols/research/builder-prompt.md +85 -0
  268. package/skeleton/protocols/research/protocol.json +118 -0
  269. package/skeleton/protocols/research/protocol.md +169 -0
  270. package/skeleton/protocols/spike/builder-prompt.md +1 -1
  271. package/skeleton/protocols/spike/protocol.md +4 -4
  272. package/skeleton/protocols/spir/builder-prompt.md +28 -5
  273. package/skeleton/protocols/spir/prompts/review.md +11 -0
  274. package/skeleton/protocols/spir/protocol.json +9 -1
  275. package/skeleton/protocols/spir/protocol.md +6 -5
  276. package/skeleton/protocols/spir/templates/plan.md +0 -20
  277. package/skeleton/protocols/spir/templates/spec.md +0 -28
  278. package/skeleton/resources/commands/agent-farm.md +84 -84
  279. package/skeleton/resources/commands/codev.md +1 -1
  280. package/skeleton/resources/commands/consult.md +16 -7
  281. package/skeleton/resources/commands/overview.md +14 -15
  282. package/skeleton/resources/risk-triage.md +2 -2
  283. package/skeleton/resources/workflow-reference.md +14 -14
  284. package/skeleton/roles/architect.md +39 -39
  285. package/skeleton/roles/builder.md +22 -14
  286. package/skeleton/templates/AGENTS.md +5 -3
  287. package/skeleton/templates/CLAUDE.md +5 -3
  288. package/skeleton/templates/arch.md +100 -30
  289. package/skeleton/templates/cheatsheet.md +12 -12
  290. package/skeleton/templates/lessons-learned.md +45 -7
  291. package/templates/3d-viewer.html +16 -18
  292. package/templates/tower.html +1 -1
  293. package/dashboard/dist/assets/index-CTrlY11L.js +0 -194
  294. package/dashboard/dist/assets/index-CTrlY11L.js.map +0 -1
  295. package/skeleton/.claude/skills/af/SKILL.md +0 -146
  296. package/skeleton/porch/prompts/understand.md +0 -61
  297. package/skeleton/porch/prompts/verify.md +0 -58
  298. package/skeleton/protocols/maintain/prompts/audit.md +0 -111
  299. package/skeleton/protocols/maintain/prompts/clean.md +0 -91
  300. package/skeleton/protocols/maintain/prompts/sync.md +0 -113
  301. package/skeleton/protocols/maintain/prompts/verify.md +0 -110
  302. package/skeleton/protocols/tick/builder-prompt.md +0 -65
  303. package/skeleton/protocols/tick/consult-types/impl-review.md +0 -72
  304. package/skeleton/protocols/tick/consult-types/plan-review.md +0 -59
  305. package/skeleton/protocols/tick/consult-types/pr-review.md +0 -72
  306. package/skeleton/protocols/tick/consult-types/spec-review.md +0 -55
  307. package/skeleton/protocols/tick/protocol.json +0 -151
  308. package/skeleton/protocols/tick/protocol.md +0 -277
  309. package/skeleton/protocols/tick/templates/plan.md +0 -67
  310. package/skeleton/protocols/tick/templates/review.md +0 -89
  311. package/skeleton/protocols/tick/templates/spec.md +0 -61
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@cluesmith/codev",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Codev CLI - AI-assisted software development framework",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "codev": "./bin/codev.js",
8
8
  "porch": "./bin/porch.js",
9
+ "afx": "./bin/afx.js",
9
10
  "af": "./bin/af.js",
10
11
  "consult": "./bin/consult.js",
11
12
  "team": "./bin/team.js",
@@ -16,43 +17,28 @@
16
17
  "bin",
17
18
  "skeleton",
18
19
  "templates",
19
- "dashboard/dist",
20
- "scripts/forge"
20
+ "dashboard-dist",
21
+ "scripts/forge",
22
+ "scripts/postinstall.mjs"
21
23
  ],
22
- "scripts": {
23
- "clean": "rm -rf dist",
24
- "build": "npm run clean && tsc && npm run build:dashboard && npm run copy-skeleton",
25
- "build:dashboard": "cd dashboard && npm install && npm run build",
26
- "dev:dashboard": "cd dashboard && npm run dev",
27
- "copy-skeleton": "rm -rf skeleton && cp -r ../../codev-skeleton skeleton",
28
- "dev": "tsx src/cli.ts",
29
- "start": "node dist/cli.js",
30
- "test": "vitest",
31
- "test:e2e": "npm run build && vitest run --config vitest.e2e.config.ts",
32
- "test:e2e:watch": "vitest --config vitest.e2e.config.ts",
33
- "test:e2e:playwright": "npx playwright test",
34
- "test:e2e:cli": "npm run build && vitest run --config vitest.cli.config.ts",
35
- "postinstall": "node -e \"try{require('fs').chmodSync(require('path').join(require.resolve('node-pty'),'..','..','prebuilds',process.platform+'-'+process.arch,'spawn-helper'),0o755)}catch{}\"",
36
- "prepublishOnly": "npm run build"
37
- },
38
24
  "dependencies": {
39
25
  "@anthropic-ai/claude-agent-sdk": "^0.2.41",
40
26
  "@google/genai": "^1.0.0",
41
27
  "@openai/codex-sdk": "^0.101.0",
42
- "@types/http-proxy": "^1.17.17",
43
28
  "better-sqlite3": "^12.5.0",
44
29
  "chalk": "^5.3.0",
45
30
  "commander": "^12.1.0",
46
31
  "glob": "^11.0.0",
47
- "http-proxy": "^1.18.1",
48
32
  "js-yaml": "^4.1.0",
49
33
  "node-pty": "^1.1.0",
50
34
  "open": "^10.1.0",
51
35
  "tree-kill": "^1.2.2",
52
- "ws": "^8.18.0"
36
+ "ws": "^8.18.0",
37
+ "@cluesmith/codev-core": "0.0.3"
53
38
  },
54
39
  "devDependencies": {
55
40
  "@playwright/test": "^1.58.0",
41
+ "@xterm/xterm": "^5.5.0",
56
42
  "@types/better-sqlite3": "^7.6.13",
57
43
  "@types/js-yaml": "^4.0.9",
58
44
  "@types/node": "^22.10.1",
@@ -62,7 +48,9 @@
62
48
  "playwright": "^1.58.0",
63
49
  "tsx": "^4.19.2",
64
50
  "typescript": "^5.7.2",
65
- "vitest": "^4.0.15"
51
+ "vitest": "^4.0.15",
52
+ "@cluesmith/codev-dashboard": "0.0.0",
53
+ "@cluesmith/codev-types": "0.0.2"
66
54
  },
67
55
  "engines": {
68
56
  "node": ">=20.0.0"
@@ -77,9 +65,24 @@
77
65
  "multi-agent"
78
66
  ],
79
67
  "author": "Cluesmith",
80
- "license": "MIT",
68
+ "license": "Apache-2.0",
81
69
  "repository": {
82
70
  "type": "git",
83
71
  "url": "https://github.com/cluesmith/codev"
72
+ },
73
+ "scripts": {
74
+ "clean": "rm -rf dist",
75
+ "build": "pnpm clean && tsc && pnpm build:dashboard && pnpm copy-skeleton",
76
+ "build:dashboard": "cd ../dashboard && pnpm build && rm -rf ../../packages/codev/dashboard-dist && cp -r dist ../../packages/codev/dashboard-dist",
77
+ "dev:dashboard": "cd ../dashboard && pnpm dev",
78
+ "copy-skeleton": "rm -rf skeleton && cp -r ../../codev-skeleton skeleton",
79
+ "dev": "tsx src/cli.ts",
80
+ "start": "node dist/cli.js",
81
+ "test": "vitest",
82
+ "test:e2e": "pnpm build && vitest run --config vitest.e2e.config.ts",
83
+ "test:e2e:watch": "vitest --config vitest.e2e.config.ts",
84
+ "test:e2e:playwright": "pnpm exec playwright test",
85
+ "test:e2e:cli": "pnpm build && vitest run --config vitest.cli.config.ts",
86
+ "postinstall": "node ./scripts/postinstall.mjs"
84
87
  }
85
- }
88
+ }
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,6 @@
1
1
  #!/bin/sh
2
2
  # Forge concept: pr-exists (Gitea via tea CLI)
3
- tea pulls list --fields index --output json | jq "[.[] | select(.head.ref == \"$CODEV_BRANCH_NAME\")] | length > 0"
3
+ # Returns true for open or merged pulls only. Closed-not-merged pulls are excluded.
4
+ # --state all fetches pulls in all states; without it, only open pulls are returned.
5
+ # Gitea: merged PRs have state="closed" + merged=true; abandoned PRs have state="closed" + merged=false
6
+ tea pulls list --state all --fields index --output json | jq "[.[] | select(.head.ref == \"$CODEV_BRANCH_NAME\" and (.state == \"open\" or (.state == \"closed\" and .merged == true)))] | length > 0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,4 +1,4 @@
1
1
  #!/bin/sh
2
2
  # Forge concept: issue-list (GitHub via gh CLI)
3
- # Output: JSON [{number, title, url, labels, createdAt}]
4
- exec gh issue list --limit 200 --json number,title,url,labels,createdAt
3
+ # Output: JSON [{number, title, url, labels, createdAt, author, assignees}]
4
+ exec gh issue list --limit 200 --json number,title,url,labels,createdAt,author,assignees
File without changes
File without changes
File without changes
@@ -2,4 +2,6 @@
2
2
  # Forge concept: pr-exists (GitHub via gh CLI)
3
3
  # Input: CODEV_BRANCH_NAME
4
4
  # Output: "true" or "false"
5
- exec gh pr list --state all --head "$CODEV_BRANCH_NAME" --json number --jq "length > 0"
5
+ # Returns true for OPEN or MERGED PRs only. CLOSED-not-merged PRs are excluded.
6
+ # (bugfix #568: --state all is needed to catch merged PRs; #653: filter out CLOSED)
7
+ exec gh pr list --state all --head "$CODEV_BRANCH_NAME" --json number,state --jq '[.[] | select(.state == "OPEN" or .state == "MERGED")] | length > 0'
@@ -1,4 +1,4 @@
1
1
  #!/bin/sh
2
2
  # Forge concept: pr-list (GitHub via gh CLI)
3
- # Output: JSON [{number, title, url, reviewDecision, body, createdAt}]
4
- exec gh pr list --json number,title,url,reviewDecision,body,createdAt
3
+ # Output: JSON [{number, title, url, reviewDecision, body, createdAt, author}]
4
+ exec gh pr list --json number,title,url,reviewDecision,body,createdAt,author
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,5 @@
1
1
  #!/bin/sh
2
2
  # Forge concept: pr-exists (GitLab via glab CLI)
3
- glab mr list --source-branch "$CODEV_BRANCH_NAME" --output json | jq "length > 0"
3
+ # Returns true for open or merged MRs only. Closed-not-merged MRs are excluded.
4
+ # --all fetches MRs in all states (open, merged, closed); without it, only open MRs are returned.
5
+ glab mr list --all --source-branch "$CODEV_BRANCH_NAME" --output json | jq '[.[] | select(.state == "opened" or .state == "merged")] | length > 0'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,15 @@
1
+ #!/bin/sh
2
+ # Forge concept: auth-status (Linear via GraphQL API)
3
+ # Output: exit code (0 = authenticated)
4
+ set -e
5
+
6
+ if [ -z "$LINEAR_API_KEY" ]; then
7
+ echo "LINEAR_API_KEY is not set" >&2
8
+ exit 1
9
+ fi
10
+
11
+ curl -sf -X POST https://api.linear.app/graphql \
12
+ -H "Content-Type: application/json" \
13
+ -H "Authorization: $LINEAR_API_KEY" \
14
+ -d '{"query":"{ viewer { id } }"}' \
15
+ -o /dev/null
@@ -0,0 +1,38 @@
1
+ #!/bin/sh
2
+ # Forge concept: issue-comment (Linear via GraphQL API)
3
+ # Input: CODEV_ISSUE_ID, CODEV_COMMENT_BODY
4
+ # Output: exit code only
5
+ set -e
6
+
7
+ if [ -z "$LINEAR_API_KEY" ]; then
8
+ echo "LINEAR_API_KEY is not set" >&2
9
+ exit 1
10
+ fi
11
+
12
+ if [ -z "$CODEV_ISSUE_ID" ]; then
13
+ echo "CODEV_ISSUE_ID is not set" >&2
14
+ exit 1
15
+ fi
16
+
17
+ ISSUE_UUID=$(curl -sf -X POST https://api.linear.app/graphql \
18
+ -H "Content-Type: application/json" \
19
+ -H "Authorization: $LINEAR_API_KEY" \
20
+ -d "$(jq -n --arg id "$CODEV_ISSUE_ID" '{
21
+ query: "query($id: String!) { issues(filter: { identifier: { eq: $id } }) { nodes { id } } }",
22
+ variables: { id: $id }
23
+ }')" \
24
+ | jq -r '.data.issues.nodes[0].id')
25
+
26
+ if [ -z "$ISSUE_UUID" ] || [ "$ISSUE_UUID" = "null" ]; then
27
+ echo "Issue not found: $CODEV_ISSUE_ID" >&2
28
+ exit 1
29
+ fi
30
+
31
+ curl -sf -X POST https://api.linear.app/graphql \
32
+ -H "Content-Type: application/json" \
33
+ -H "Authorization: $LINEAR_API_KEY" \
34
+ -d "$(jq -n --arg issueId "$ISSUE_UUID" --arg body "$CODEV_COMMENT_BODY" '{
35
+ query: "mutation($issueId: String!, $body: String!) { commentCreate(input: { issueId: $issueId, body: $body }) { success } }",
36
+ variables: { issueId: $issueId, body: $body }
37
+ }')" \
38
+ -o /dev/null
@@ -0,0 +1,35 @@
1
+ #!/bin/sh
2
+ # Forge concept: issue-list (Linear via GraphQL API)
3
+ # Input: CODEV_LINEAR_TEAM (team key, e.g. "ENG")
4
+ # Output: JSON [{number, title, url, labels, createdAt, author, assignees}]
5
+ set -e
6
+
7
+ if [ -z "$LINEAR_API_KEY" ]; then
8
+ echo "LINEAR_API_KEY is not set" >&2
9
+ exit 1
10
+ fi
11
+
12
+ FILTER='{ state: { type: { nin: ["completed", "canceled"] } } }'
13
+ if [ -n "$CODEV_LINEAR_TEAM" ]; then
14
+ FILTER="$(jq -n --arg team "$CODEV_LINEAR_TEAM" '{
15
+ team: { key: { eq: $team } },
16
+ state: { type: { nin: ["completed", "canceled"] } }
17
+ }')"
18
+ fi
19
+
20
+ curl -sf -X POST https://api.linear.app/graphql \
21
+ -H "Content-Type: application/json" \
22
+ -H "Authorization: $LINEAR_API_KEY" \
23
+ -d "$(jq -n --argjson filter "$FILTER" '{
24
+ query: "query($filter: IssueFilter) { issues(filter: $filter, first: 200) { nodes { identifier title url labels { nodes { name } } createdAt assignee { displayName } creator { displayName } } } }",
25
+ variables: { filter: $filter }
26
+ }')" \
27
+ | jq '[.data.issues.nodes[] | {
28
+ number: .identifier,
29
+ title: .title,
30
+ url: .url,
31
+ labels: [.labels.nodes[] | { name: .name }],
32
+ createdAt: .createdAt,
33
+ author: (if .creator then { login: .creator.displayName } else null end),
34
+ assignees: (if .assignee then [{ login: .assignee.displayName }] else [] end)
35
+ }]'
@@ -0,0 +1,37 @@
1
+ #!/bin/sh
2
+ # Forge concept: issue-view (Linear via GraphQL API)
3
+ # Input: CODEV_ISSUE_ID (e.g. "ENG-123")
4
+ # Output: JSON {title, body, state, comments[]}
5
+ set -e
6
+
7
+ if [ -z "$LINEAR_API_KEY" ]; then
8
+ echo "LINEAR_API_KEY is not set" >&2
9
+ exit 1
10
+ fi
11
+
12
+ if [ -z "$CODEV_ISSUE_ID" ]; then
13
+ echo "CODEV_ISSUE_ID is not set" >&2
14
+ exit 1
15
+ fi
16
+
17
+ curl -sf -X POST https://api.linear.app/graphql \
18
+ -H "Content-Type: application/json" \
19
+ -H "Authorization: $LINEAR_API_KEY" \
20
+ -d "$(jq -n --arg id "$CODEV_ISSUE_ID" '{
21
+ query: "query($id: String!) { issueVcsByFilter: issues(filter: { identifier: { eq: $id } }) { nodes { title description state { name } comments { nodes { body createdAt user { displayName } } } } } }",
22
+ variables: { id: $id }
23
+ }')" \
24
+ | jq 'if (.data.issueVcsByFilter.nodes | length) == 0 then
25
+ error("issue not found: \(env.CODEV_ISSUE_ID)")
26
+ else
27
+ .data.issueVcsByFilter.nodes[0] | {
28
+ title: .title,
29
+ body: (.description // ""),
30
+ state: .state.name,
31
+ comments: [.comments.nodes[] | {
32
+ body: .body,
33
+ createdAt: .createdAt,
34
+ author: { login: .user.displayName }
35
+ }]
36
+ }
37
+ end'
@@ -0,0 +1,45 @@
1
+ #!/bin/sh
2
+ # Forge concept: recently-closed (Linear via GraphQL API)
3
+ # Input: CODEV_LINEAR_TEAM, CODEV_SINCE_DATE (optional, ISO date)
4
+ # Output: JSON [{number, title, url, labels, createdAt, closedAt}]
5
+ set -e
6
+
7
+ if [ -z "$LINEAR_API_KEY" ]; then
8
+ echo "LINEAR_API_KEY is not set" >&2
9
+ exit 1
10
+ fi
11
+
12
+ FILTER='{ state: { type: { in: ["completed", "canceled"] } } }'
13
+ if [ -n "$CODEV_LINEAR_TEAM" ] && [ -n "$CODEV_SINCE_DATE" ]; then
14
+ FILTER="$(jq -n --arg team "$CODEV_LINEAR_TEAM" --arg since "$CODEV_SINCE_DATE" '{
15
+ team: { key: { eq: $team } },
16
+ state: { type: { in: ["completed", "canceled"] } },
17
+ completedAt: { gte: $since }
18
+ }')"
19
+ elif [ -n "$CODEV_LINEAR_TEAM" ]; then
20
+ FILTER="$(jq -n --arg team "$CODEV_LINEAR_TEAM" '{
21
+ team: { key: { eq: $team } },
22
+ state: { type: { in: ["completed", "canceled"] } }
23
+ }')"
24
+ elif [ -n "$CODEV_SINCE_DATE" ]; then
25
+ FILTER="$(jq -n --arg since "$CODEV_SINCE_DATE" '{
26
+ state: { type: { in: ["completed", "canceled"] } },
27
+ completedAt: { gte: $since }
28
+ }')"
29
+ fi
30
+
31
+ curl -sf -X POST https://api.linear.app/graphql \
32
+ -H "Content-Type: application/json" \
33
+ -H "Authorization: $LINEAR_API_KEY" \
34
+ -d "$(jq -n --argjson filter "$FILTER" '{
35
+ query: "query($filter: IssueFilter) { issues(filter: $filter, first: 200, orderBy: updatedAt) { nodes { identifier title url labels { nodes { name } } createdAt completedAt } } }",
36
+ variables: { filter: $filter }
37
+ }')" \
38
+ | jq '[.data.issues.nodes[] | {
39
+ number: .identifier,
40
+ title: .title,
41
+ url: .url,
42
+ labels: [.labels.nodes[] | { name: .name }],
43
+ createdAt: .createdAt,
44
+ closedAt: .completedAt
45
+ }]'
@@ -0,0 +1,15 @@
1
+ #!/bin/sh
2
+ # Forge concept: user-identity (Linear via GraphQL API)
3
+ # Output: plain text display name
4
+ set -e
5
+
6
+ if [ -z "$LINEAR_API_KEY" ]; then
7
+ echo "LINEAR_API_KEY is not set" >&2
8
+ exit 1
9
+ fi
10
+
11
+ curl -sf -X POST https://api.linear.app/graphql \
12
+ -H "Content-Type: application/json" \
13
+ -H "Authorization: $LINEAR_API_KEY" \
14
+ -d '{"query":"{ viewer { displayName } }"}' \
15
+ | jq -r '.data.viewer.displayName'
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Restores executable bits that pnpm pack/publish strips from files outside
4
+ // the `bin` field. See issue #693 — without this, `afx spawn` fails with
5
+ // Permission denied when invoking forge concept scripts.
6
+
7
+ import { chmodSync, readdirSync } from 'node:fs';
8
+ import { createRequire } from 'node:module';
9
+ import { dirname, join } from 'node:path';
10
+ import { fileURLToPath } from 'node:url';
11
+
12
+ const here = dirname(fileURLToPath(import.meta.url));
13
+ const forgeRoot = join(here, 'forge');
14
+
15
+ function chmodForgeScripts(root) {
16
+ let providers;
17
+ try {
18
+ providers = readdirSync(root, { withFileTypes: true });
19
+ } catch {
20
+ return;
21
+ }
22
+ for (const provider of providers) {
23
+ if (!provider.isDirectory()) continue;
24
+ const providerDir = join(root, provider.name);
25
+ for (const entry of readdirSync(providerDir, { withFileTypes: true })) {
26
+ if (!entry.isFile() || !entry.name.endsWith('.sh')) continue;
27
+ chmodSync(join(providerDir, entry.name), 0o755);
28
+ }
29
+ }
30
+ }
31
+
32
+ function chmodNodePtySpawnHelper() {
33
+ try {
34
+ const require = createRequire(import.meta.url);
35
+ const ptyEntry = require.resolve('node-pty');
36
+ const helper = join(
37
+ ptyEntry,
38
+ '..',
39
+ '..',
40
+ 'prebuilds',
41
+ `${process.platform}-${process.arch}`,
42
+ 'spawn-helper'
43
+ );
44
+ chmodSync(helper, 0o755);
45
+ } catch {
46
+ // node-pty may not ship a prebuild for this platform; harmless.
47
+ }
48
+ }
49
+
50
+ chmodForgeScripts(forgeRoot);
51
+ chmodNodePtySpawnHelper();
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: afx
3
+ description: Agent Farm CLI — the tool for spawning builders, managing Tower, workspaces, and cron tasks. ALWAYS consult this skill BEFORE running any `afx` command to get the exact syntax. This prevents wasting time guessing flags that don't exist. Use this whenever you need to spawn a builder, check status, send messages, clean up worktrees, manage Tower, or run cron tasks. If you're about to type `afx` followed by anything, check here first.
4
+ ---
5
+
6
+ # Agent Farm CLI
7
+
8
+ ## afx spawn
9
+
10
+ Spawns a new builder in an isolated git worktree.
11
+
12
+ ```
13
+ afx spawn [number] [options]
14
+ ```
15
+
16
+ **The ONLY flags that exist:**
17
+
18
+ | Flag | Description |
19
+ |------|-------------|
20
+ | `--protocol <name>` | Protocol: spir, aspir, air, bugfix, maintain, experiment. **Required for numbered spawns.** |
21
+ | `--task <text>` | Ad-hoc task (no issue number needed) |
22
+ | `--shell` | Bare Claude session |
23
+ | `--worktree` | Bare worktree session |
24
+ | `--files <files>` | Context files, comma-separated. **Requires `--task`.** |
25
+ | `--no-comment` | Skip commenting on the GitHub issue |
26
+ | `--force` | Skip dirty-worktree and collision checks |
27
+ | `--soft` | Soft mode (AI follows protocol, you verify) |
28
+ | `--strict` | Strict mode (porch orchestrates) — this is the default |
29
+ | `--resume` | Resume builder in existing worktree |
30
+ | `--no-role` | Skip loading role prompt |
31
+
32
+ **There is NO `-t`, `--title`, `--name`, or `--branch` flag.** The branch name is auto-generated from the issue title.
33
+
34
+ **Examples:**
35
+ ```bash
36
+ afx spawn 42 --protocol spir # SPIR builder for issue #42
37
+ afx spawn 42 --protocol aspir # ASPIR (autonomous, no human gates)
38
+ afx spawn 42 --protocol air # AIR (small features)
39
+ afx spawn 42 --protocol bugfix # Bugfix
40
+ afx spawn 42 --protocol spir --soft # Soft mode
41
+ afx spawn 42 --resume # Resume existing builder
42
+ afx spawn --task "fix the flaky test" # Ad-hoc task (no issue)
43
+ afx spawn 42 --protocol spir --force # Skip dirty-worktree check
44
+ ```
45
+
46
+ **Pre-spawn checklist:**
47
+ 1. `git status` — worktree must be clean (or use `--force`)
48
+ 2. Commit specs/plans first — builders branch from HEAD and can't see uncommitted files
49
+ 3. `--protocol` is required for numbered spawns
50
+
51
+ ## afx send
52
+
53
+ Sends a message to a running builder.
54
+
55
+ ```
56
+ afx send [builder] [message]
57
+ ```
58
+
59
+ | Flag | Description |
60
+ |------|-------------|
61
+ | `--all` | Send to all builders |
62
+ | `--file <path>` | Include file content |
63
+ | `--interrupt` | Send Ctrl+C first |
64
+ | `--raw` | Skip structured formatting |
65
+ | `--no-enter` | Don't press Enter after message |
66
+
67
+ ```bash
68
+ afx send 0042 "PR approved, please merge"
69
+ afx send 0585 "check the test output" --file /tmp/test-results.txt
70
+ ```
71
+
72
+ ## afx cleanup
73
+
74
+ Removes a builder's worktree and branch after work is done.
75
+
76
+ ```
77
+ afx cleanup [options]
78
+ ```
79
+
80
+ | Flag | Description |
81
+ |------|-------------|
82
+ | `-p, --project <id>` | Builder project ID (no leading zeros: `585` not `0585`) |
83
+ | `-i, --issue <number>` | Cleanup bugfix builder by issue number |
84
+ | `-t, --task <id>` | Cleanup task builder (e.g., `task-bEPd`) |
85
+ | `-f, --force` | Force cleanup even if branch not merged |
86
+
87
+ ```bash
88
+ afx cleanup -p 585 # Clean up project 585
89
+ afx cleanup -p 585 -f # Force (unmerged branch)
90
+ ```
91
+
92
+ **Note:** `afx cleanup` uses plain numbers (`585`), not zero-padded (`0585`). But `afx send` uses zero-padded IDs (`0585`).
93
+
94
+ ## afx status
95
+
96
+ ```bash
97
+ afx status # Show all builders and workspace status
98
+ ```
99
+
100
+ No flags needed. Shows Tower status, workspace, and all active builders.
101
+
102
+ ## afx tower
103
+
104
+ ```bash
105
+ afx tower start # Start Tower on port 4100
106
+ afx tower stop # Stop Tower
107
+ afx tower log # Tail Tower logs
108
+ afx tower status # Check daemon and cloud connection status
109
+ afx tower connect # Connect to Codev Cloud
110
+ afx tower disconnect # Disconnect from Codev Cloud
111
+ ```
112
+
113
+ There is NO `afx tower restart` — use `afx tower stop && afx tower start`.
114
+
115
+ ## afx workspace
116
+
117
+ ```bash
118
+ afx workspace start # Start workspace for current project
119
+ afx workspace stop # Stop workspace processes
120
+ ```
121
+
122
+ `afx dash` is a deprecated alias — use `afx workspace` instead.
123
+
124
+ ## afx cron
125
+
126
+ ```bash
127
+ afx cron list # List all cron tasks
128
+ afx cron status <name> # Check task status
129
+ afx cron run <name> # Run immediately
130
+ afx cron enable <name> # Enable
131
+ afx cron disable <name> # Disable
132
+ ```
133
+
134
+ There is NO `afx cron add` — create YAML files in `.af-cron/` directly.
135
+
136
+ ## Other commands
137
+
138
+ ```bash
139
+ afx open <file> # Open file in annotation viewer (NOT system open)
140
+ afx shell # Spawn utility shell
141
+ afx attach # Attach to running builder terminal
142
+ afx rename <name> # Rename current shell session
143
+ afx architect # Start architect session in current terminal
144
+ ```
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: codev
3
- description: Codev project management CLI — init, adopt, update, and doctor commands. Check this skill before running any `codev` command (except `consult`, `porch`, or `af` which have their own skills). Use when setting up new projects, adding codev to existing repos, updating framework files, or diagnosing missing dependencies.
3
+ description: Codev project management CLI — init, adopt, update, and doctor commands. Check this skill before running any `codev` command (except `consult`, `porch`, or `afx` which have their own skills). Use when setting up new projects, adding codev to existing repos, updating framework files, or diagnosing missing dependencies.
4
4
  ---
5
5
 
6
6
  # codev - Project Management CLI
@@ -16,7 +16,7 @@ codev doctor Check system dependencies
16
16
 
17
17
  ## codev init
18
18
 
19
- Creates a **new directory** with the full codev structure: specs/, plans/, reviews/, protocols, CLAUDE.md, AGENTS.md, .claude/skills/, af-config.json, .gitignore.
19
+ Creates a **new directory** with the full codev structure: specs/, plans/, reviews/, protocols, CLAUDE.md, AGENTS.md, .claude/skills/, .codev/config.json, .gitignore.
20
20
 
21
21
  ```bash
22
22
  codev init my-app # Interactive setup
@@ -53,7 +53,7 @@ codev doctor
53
53
 
54
54
  ## Common mistakes
55
55
 
56
- - There is NO `codev tower` command — use `af tower start/stop`
56
+ - There is NO `codev tower` command — use `afx tower start/stop`
57
57
  - `codev init` creates a new directory — use `codev adopt` for existing projects
58
58
  - Always run `codev adopt` and `codev update` from the project root
59
59
  - `codev update` only updates framework files — it never touches specs/plans/reviews