create-hq 6.0.0 → 10.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.
Files changed (336) hide show
  1. package/dist/__tests__/deps.test.d.ts +2 -0
  2. package/dist/__tests__/deps.test.d.ts.map +1 -0
  3. package/dist/__tests__/deps.test.js +176 -0
  4. package/dist/__tests__/deps.test.js.map +1 -0
  5. package/dist/__tests__/platform.test.d.ts +2 -0
  6. package/dist/__tests__/platform.test.d.ts.map +1 -0
  7. package/dist/__tests__/platform.test.js +127 -0
  8. package/dist/__tests__/platform.test.js.map +1 -0
  9. package/dist/__tests__/scaffold.test.d.ts +2 -0
  10. package/dist/__tests__/scaffold.test.d.ts.map +1 -0
  11. package/dist/__tests__/scaffold.test.js +150 -0
  12. package/dist/__tests__/scaffold.test.js.map +1 -0
  13. package/dist/auth.d.ts +32 -0
  14. package/dist/auth.d.ts.map +1 -0
  15. package/dist/auth.js +156 -0
  16. package/dist/auth.js.map +1 -0
  17. package/dist/cloud-sync.d.ts +11 -0
  18. package/dist/cloud-sync.d.ts.map +1 -0
  19. package/dist/cloud-sync.js +25 -0
  20. package/dist/cloud-sync.js.map +1 -0
  21. package/dist/deps.d.ts +32 -2
  22. package/dist/deps.d.ts.map +1 -1
  23. package/dist/deps.js +182 -7
  24. package/dist/deps.js.map +1 -1
  25. package/dist/fetch-template.d.ts +14 -0
  26. package/dist/fetch-template.d.ts.map +1 -0
  27. package/dist/fetch-template.js +136 -0
  28. package/dist/fetch-template.js.map +1 -0
  29. package/dist/index.js +9 -7
  30. package/dist/index.js.map +1 -1
  31. package/dist/packages.d.ts +71 -0
  32. package/dist/packages.d.ts.map +1 -0
  33. package/dist/packages.js +332 -0
  34. package/dist/packages.js.map +1 -0
  35. package/dist/platform.d.ts +9 -0
  36. package/dist/platform.d.ts.map +1 -0
  37. package/dist/platform.js +69 -0
  38. package/dist/platform.js.map +1 -0
  39. package/dist/scaffold.d.ts +3 -2
  40. package/dist/scaffold.d.ts.map +1 -1
  41. package/dist/scaffold.js +109 -290
  42. package/dist/scaffold.js.map +1 -1
  43. package/dist/ui.d.ts +2 -3
  44. package/dist/ui.d.ts.map +1 -1
  45. package/dist/ui.js +90 -44
  46. package/dist/ui.js.map +1 -1
  47. package/package.json +49 -40
  48. package/template/.claude/CLAUDE.md +0 -202
  49. package/template/.claude/commands/checkpoint.md +0 -127
  50. package/template/.claude/commands/cleanup.md +0 -307
  51. package/template/.claude/commands/execute-task.md +0 -440
  52. package/template/.claude/commands/exit-plan.md +0 -41
  53. package/template/.claude/commands/handoff.md +0 -97
  54. package/template/.claude/commands/learn.md +0 -218
  55. package/template/.claude/commands/metrics.md +0 -118
  56. package/template/.claude/commands/newworker.md +0 -162
  57. package/template/.claude/commands/nexttask.md +0 -67
  58. package/template/.claude/commands/prd.md +0 -238
  59. package/template/.claude/commands/reanchor.md +0 -51
  60. package/template/.claude/commands/remember.md +0 -126
  61. package/template/.claude/commands/run-project.md +0 -348
  62. package/template/.claude/commands/run.md +0 -110
  63. package/template/.claude/commands/search-reindex.md +0 -62
  64. package/template/.claude/commands/search.md +0 -100
  65. package/template/.claude/commands/setup.md +0 -381
  66. package/template/.claude/scripts/pure-ralph-loop.ps1 +0 -312
  67. package/template/.claude/scripts/pure-ralph-loop.sh +0 -859
  68. package/template/CHANGELOG.md +0 -220
  69. package/template/LICENSE +0 -21
  70. package/template/MIGRATION.md +0 -259
  71. package/template/README.md +0 -368
  72. package/template/data/journal/.gitkeep +0 -0
  73. package/template/docs/images/ascii-banner-options.md +0 -122
  74. package/template/docs/images/hq-banner.svg +0 -105
  75. package/template/knowledge/Ralph/01-overview.md +0 -71
  76. package/template/knowledge/Ralph/02-core-concepts.md +0 -114
  77. package/template/knowledge/Ralph/03-how-ralph-works.md +0 -184
  78. package/template/knowledge/Ralph/04-back-pressure.md +0 -222
  79. package/template/knowledge/Ralph/05-specifications.md +0 -210
  80. package/template/knowledge/Ralph/06-agents-md.md +0 -222
  81. package/template/knowledge/Ralph/07-implementation.md +0 -316
  82. package/template/knowledge/Ralph/08-economics.md +0 -182
  83. package/template/knowledge/Ralph/09-resources.md +0 -145
  84. package/template/knowledge/Ralph/10-claude-code-workflow.md +0 -212
  85. package/template/knowledge/Ralph/11-team-training-guide.md +0 -383
  86. package/template/knowledge/Ralph/README.md +0 -40
  87. package/template/knowledge/ai-security-framework/CONTRIBUTING.md +0 -139
  88. package/template/knowledge/ai-security-framework/GLOSSARY.md +0 -176
  89. package/template/knowledge/ai-security-framework/LICENSE +0 -21
  90. package/template/knowledge/ai-security-framework/QUICK-START.md +0 -172
  91. package/template/knowledge/ai-security-framework/README.md +0 -232
  92. package/template/knowledge/ai-security-framework/checklists/browser-security.md +0 -301
  93. package/template/knowledge/ai-security-framework/checklists/credential-isolation.md +0 -322
  94. package/template/knowledge/ai-security-framework/checklists/incident-response.md +0 -288
  95. package/template/knowledge/ai-security-framework/checklists/pre-flight.md +0 -249
  96. package/template/knowledge/ai-security-framework/checklists/weekly-audit.md +0 -159
  97. package/template/knowledge/ai-security-framework/configs/audit-logging.md +0 -372
  98. package/template/knowledge/ai-security-framework/configs/kill-switches.md +0 -354
  99. package/template/knowledge/ai-security-framework/docs/01-core-principles.md +0 -256
  100. package/template/knowledge/ai-security-framework/docs/02-threat-landscape.md +0 -326
  101. package/template/knowledge/ai-security-framework/docs/03-security-posture.md +0 -250
  102. package/template/knowledge/ai-security-framework/templates/agents-security.md +0 -233
  103. package/template/knowledge/design-styles/README.md +0 -42
  104. package/template/knowledge/design-styles/american-industrial.md +0 -136
  105. package/template/knowledge/design-styles/ethereal-abstract.md +0 -133
  106. package/template/knowledge/design-styles/liminal-portal.md +0 -111
  107. package/template/knowledge/design-styles/swipes/american-industrial/G-3m4YPW0AADdu2.jpeg +0 -0
  108. package/template/knowledge/design-styles/swipes/american-industrial/G-JJlt5WwAABK3K.png +0 -0
  109. package/template/knowledge/design-styles/swipes/american-industrial/G-JJmj5W0AEbJ-7.png +0 -0
  110. package/template/knowledge/design-styles/swipes/american-industrial/G59fgNuXkAAKLJQ (1).jpeg +0 -0
  111. package/template/knowledge/design-styles/swipes/american-industrial/G59fgNuXkAAKLJQ.jpeg +0 -0
  112. package/template/knowledge/design-styles/swipes/american-industrial/G7fVkn3WEAAM-ST.jpeg +0 -0
  113. package/template/knowledge/design-styles/swipes/american-industrial/G8ECO5JWEAIksyn.png +0 -0
  114. package/template/knowledge/design-styles/swipes/american-industrial/G9-3GQSWoAA8eqZ.png +0 -0
  115. package/template/knowledge/design-styles/swipes/american-industrial/G9xEOqrXkAEZRcs.png +0 -0
  116. package/template/knowledge/design-styles/swipes/american-industrial/G_MVeJrXQAA8sx4.jpeg +0 -0
  117. package/template/knowledge/design-styles/swipes/american-industrial/G_RSkmGXkAAgAVZ.png +0 -0
  118. package/template/knowledge/design-styles/swipes/american-industrial/README.md +0 -31
  119. package/template/knowledge/design-styles/swipes/american-industrial/qyqtg7Dq.png +0 -0
  120. package/template/knowledge/dev-team/README.md +0 -35
  121. package/template/knowledge/dev-team/patterns/README.md +0 -34
  122. package/template/knowledge/dev-team/patterns/frontend/react-best-practices.md +0 -178
  123. package/template/knowledge/dev-team/troubleshooting/README.md +0 -31
  124. package/template/knowledge/dev-team/workflows/README.md +0 -49
  125. package/template/knowledge/hq/checkpoint-schema.json +0 -51
  126. package/template/knowledge/hq/index-md-spec.md +0 -74
  127. package/template/knowledge/hq/thread-schema.md +0 -153
  128. package/template/knowledge/hq-core/checkpoint-schema.json +0 -51
  129. package/template/knowledge/hq-core/index-md-spec.md +0 -74
  130. package/template/knowledge/hq-core/thread-schema.md +0 -153
  131. package/template/knowledge/loom/README.md +0 -51
  132. package/template/knowledge/loom/architecture.md +0 -125
  133. package/template/knowledge/loom/code-style.md +0 -169
  134. package/template/knowledge/loom/llm-proxy.md +0 -132
  135. package/template/knowledge/loom/state-machine.md +0 -131
  136. package/template/knowledge/loom/thread-system.md +0 -117
  137. package/template/knowledge/loom/tools.md +0 -94
  138. package/template/knowledge/loom/weaver.md +0 -96
  139. package/template/knowledge/loom/web-frontend.md +0 -131
  140. package/template/knowledge/projects/README.md +0 -72
  141. package/template/knowledge/projects/templates/README.template.md +0 -28
  142. package/template/knowledge/workers/README.md +0 -195
  143. package/template/knowledge/workers/ralph-loop-pattern.md +0 -157
  144. package/template/knowledge/workers/skill-schema.md +0 -182
  145. package/template/knowledge/workers/state-machine.md +0 -102
  146. package/template/knowledge/workers/templates/base-worker.yaml +0 -73
  147. package/template/knowledge/workers/templates/code-worker.yaml +0 -85
  148. package/template/knowledge/workers/templates/skill.yaml +0 -49
  149. package/template/knowledge/workers/templates/social-worker.yaml +0 -70
  150. package/template/modules/examples/full-manifest.yaml +0 -92
  151. package/template/modules/examples/minimal.yaml +0 -14
  152. package/template/modules/modules.yaml +0 -59
  153. package/template/projects/.gitkeep +0 -0
  154. package/template/projects/incorporate-workers-into-pure-ralph/prd.json +0 -88
  155. package/template/projects/pure-ralph-branch-isolation/README.md +0 -114
  156. package/template/projects/pure-ralph-branch-isolation/prd.json +0 -123
  157. package/template/projects/purist-ralph-loop/README.md +0 -148
  158. package/template/projects/purist-ralph-loop/prd.json +0 -135
  159. package/template/projects/ralph-test/prd.json +0 -50
  160. package/template/prompts/pure-ralph-base.md +0 -551
  161. package/template/settings/.gitkeep +0 -0
  162. package/template/settings/pure-ralph.json +0 -42
  163. package/template/social-content/drafts/INDEX.md +0 -21
  164. package/template/social-content/drafts/linkedin/.gitkeep +0 -1
  165. package/template/social-content/drafts/x/.gitkeep +0 -1
  166. package/template/social-content/images/.gitkeep +0 -1
  167. package/template/starter-projects/code-worker/README.md +0 -97
  168. package/template/starter-projects/code-worker/prd.json +0 -45
  169. package/template/starter-projects/personal-assistant/README.md +0 -42
  170. package/template/starter-projects/personal-assistant/prd.json +0 -43
  171. package/template/starter-projects/social-media/README.md +0 -60
  172. package/template/starter-projects/social-media/prd.json +0 -43
  173. package/template/workers/content-brand/README.md +0 -59
  174. package/template/workers/content-brand/skills/messaging-alignment.md +0 -91
  175. package/template/workers/content-brand/skills/tone-check.md +0 -76
  176. package/template/workers/content-brand/skills/voice-analysis.md +0 -68
  177. package/template/workers/content-brand/worker.yaml +0 -81
  178. package/template/workers/content-legal/README.md +0 -80
  179. package/template/workers/content-legal/skills/claim-substantiation.md +0 -150
  180. package/template/workers/content-legal/skills/compliance-scan.md +0 -123
  181. package/template/workers/content-legal/skills/disclaimer-check.md +0 -146
  182. package/template/workers/content-legal/worker.yaml +0 -118
  183. package/template/workers/content-product/README.md +0 -77
  184. package/template/workers/content-product/skills/claim-verification.md +0 -96
  185. package/template/workers/content-product/skills/feature-accuracy.md +0 -117
  186. package/template/workers/content-product/skills/stats-check.md +0 -128
  187. package/template/workers/content-product/worker.yaml +0 -97
  188. package/template/workers/content-sales/README.md +0 -70
  189. package/template/workers/content-sales/skills/conversion-analysis.md +0 -96
  190. package/template/workers/content-sales/skills/cta-audit.md +0 -107
  191. package/template/workers/content-sales/skills/value-prop-check.md +0 -114
  192. package/template/workers/content-sales/worker.yaml +0 -93
  193. package/template/workers/content-shared/cli.ts +0 -242
  194. package/template/workers/content-shared/index.ts +0 -234
  195. package/template/workers/content-shared/lib/accuracy-analyzer.ts +0 -661
  196. package/template/workers/content-shared/lib/analyze.ts +0 -370
  197. package/template/workers/content-shared/lib/brand-analyzer.ts +0 -526
  198. package/template/workers/content-shared/lib/cms-integration.ts +0 -446
  199. package/template/workers/content-shared/lib/compliance-analyzer.ts +0 -655
  200. package/template/workers/content-shared/lib/conversion-analyzer.ts +0 -555
  201. package/template/workers/content-shared/lib/github-integration.ts +0 -582
  202. package/template/workers/content-shared/lib/output.ts +0 -373
  203. package/template/workers/content-shared/lib/parser.ts +0 -771
  204. package/template/workers/content-shared/lib/priority.ts +0 -439
  205. package/template/workers/content-shared/lib/recommendations.ts +0 -512
  206. package/template/workers/content-shared/lib/reporter.ts +0 -749
  207. package/template/workers/content-shared/lib/restructure.ts +0 -664
  208. package/template/workers/content-shared/lib/scorer.ts +0 -140
  209. package/template/workers/content-shared/lib/types.ts +0 -227
  210. package/template/workers/content-shared/lib/variants.ts +0 -595
  211. package/template/workers/content-shared/package.json +0 -51
  212. package/template/workers/content-shared/pnpm-lock.yaml +0 -39
  213. package/template/workers/content-shared/test/sample-page.json +0 -115
  214. package/template/workers/content-shared/tsconfig.json +0 -20
  215. package/template/workers/dev-team/README.md +0 -166
  216. package/template/workers/dev-team/_template.yaml +0 -70
  217. package/template/workers/dev-team/architect/package.json +0 -27
  218. package/template/workers/dev-team/architect/skills/api-design.md +0 -89
  219. package/template/workers/dev-team/architect/skills/refactor-plan.md +0 -96
  220. package/template/workers/dev-team/architect/skills/system-design.md +0 -100
  221. package/template/workers/dev-team/architect/src/index.ts +0 -49
  222. package/template/workers/dev-team/architect/src/mcp-server.ts +0 -122
  223. package/template/workers/dev-team/architect/src/skills/api-design.ts +0 -316
  224. package/template/workers/dev-team/architect/src/skills/refactor-plan.ts +0 -264
  225. package/template/workers/dev-team/architect/src/skills/system-design.ts +0 -212
  226. package/template/workers/dev-team/architect/tsconfig.json +0 -19
  227. package/template/workers/dev-team/architect/worker.yaml +0 -128
  228. package/template/workers/dev-team/backend-dev/package-lock.json +0 -1252
  229. package/template/workers/dev-team/backend-dev/package.json +0 -27
  230. package/template/workers/dev-team/backend-dev/skills/implement-endpoint.md +0 -70
  231. package/template/workers/dev-team/backend-dev/skills/implement-service.md +0 -62
  232. package/template/workers/dev-team/backend-dev/src/index.ts +0 -51
  233. package/template/workers/dev-team/backend-dev/src/mcp-server.ts +0 -109
  234. package/template/workers/dev-team/backend-dev/src/skills/implement-endpoint.ts +0 -122
  235. package/template/workers/dev-team/backend-dev/src/skills/implement-service.ts +0 -126
  236. package/template/workers/dev-team/backend-dev/tsconfig.json +0 -19
  237. package/template/workers/dev-team/backend-dev/worker.yaml +0 -128
  238. package/template/workers/dev-team/code-reviewer/package-lock.json +0 -1080
  239. package/template/workers/dev-team/code-reviewer/package.json +0 -24
  240. package/template/workers/dev-team/code-reviewer/skills/merge-to-production.md +0 -61
  241. package/template/workers/dev-team/code-reviewer/skills/merge-to-staging.md +0 -54
  242. package/template/workers/dev-team/code-reviewer/skills/request-changes.md +0 -63
  243. package/template/workers/dev-team/code-reviewer/skills/review-pr.md +0 -77
  244. package/template/workers/dev-team/code-reviewer/src/index.ts +0 -56
  245. package/template/workers/dev-team/code-reviewer/src/mcp-server.ts +0 -101
  246. package/template/workers/dev-team/code-reviewer/tsconfig.json +0 -19
  247. package/template/workers/dev-team/code-reviewer/worker.yaml +0 -90
  248. package/template/workers/dev-team/database-dev/package.json +0 -22
  249. package/template/workers/dev-team/database-dev/skills/create-schema.md +0 -48
  250. package/template/workers/dev-team/database-dev/src/index.ts +0 -50
  251. package/template/workers/dev-team/database-dev/src/mcp-server.ts +0 -76
  252. package/template/workers/dev-team/database-dev/tsconfig.json +0 -18
  253. package/template/workers/dev-team/database-dev/worker.yaml +0 -90
  254. package/template/workers/dev-team/frontend-dev/package.json +0 -22
  255. package/template/workers/dev-team/frontend-dev/skills/create-component.md +0 -26
  256. package/template/workers/dev-team/frontend-dev/src/index.ts +0 -50
  257. package/template/workers/dev-team/frontend-dev/src/mcp-server.ts +0 -77
  258. package/template/workers/dev-team/frontend-dev/tsconfig.json +0 -18
  259. package/template/workers/dev-team/frontend-dev/worker.yaml +0 -132
  260. package/template/workers/dev-team/infra-dev/package.json +0 -24
  261. package/template/workers/dev-team/infra-dev/skills/add-monitoring.md +0 -73
  262. package/template/workers/dev-team/infra-dev/skills/configure-deployment.md +0 -80
  263. package/template/workers/dev-team/infra-dev/skills/create-dockerfile.md +0 -62
  264. package/template/workers/dev-team/infra-dev/skills/setup-cicd.md +0 -63
  265. package/template/workers/dev-team/infra-dev/src/index.ts +0 -55
  266. package/template/workers/dev-team/infra-dev/src/mcp-server.ts +0 -82
  267. package/template/workers/dev-team/infra-dev/tsconfig.json +0 -19
  268. package/template/workers/dev-team/infra-dev/worker.yaml +0 -92
  269. package/template/workers/dev-team/knowledge-curator/package.json +0 -24
  270. package/template/workers/dev-team/knowledge-curator/skills/curate-troubleshooting.md +0 -63
  271. package/template/workers/dev-team/knowledge-curator/skills/process-learnings.md +0 -61
  272. package/template/workers/dev-team/knowledge-curator/skills/sync-documentation.md +0 -76
  273. package/template/workers/dev-team/knowledge-curator/skills/update-patterns.md +0 -63
  274. package/template/workers/dev-team/knowledge-curator/src/index.ts +0 -53
  275. package/template/workers/dev-team/knowledge-curator/src/mcp-server.ts +0 -92
  276. package/template/workers/dev-team/knowledge-curator/tsconfig.json +0 -19
  277. package/template/workers/dev-team/knowledge-curator/worker.yaml +0 -80
  278. package/template/workers/dev-team/motion-designer/package.json +0 -22
  279. package/template/workers/dev-team/motion-designer/skills/add-animation.md +0 -25
  280. package/template/workers/dev-team/motion-designer/skills/generate-image.md +0 -36
  281. package/template/workers/dev-team/motion-designer/src/index.ts +0 -63
  282. package/template/workers/dev-team/motion-designer/src/mcp-server.ts +0 -79
  283. package/template/workers/dev-team/motion-designer/tsconfig.json +0 -18
  284. package/template/workers/dev-team/motion-designer/worker.yaml +0 -84
  285. package/template/workers/dev-team/product-planner/queue.json +0 -4
  286. package/template/workers/dev-team/product-planner/worker.yaml +0 -220
  287. package/template/workers/dev-team/project-manager/package-lock.json +0 -1252
  288. package/template/workers/dev-team/project-manager/package.json +0 -27
  289. package/template/workers/dev-team/project-manager/skills/create-prd.md +0 -66
  290. package/template/workers/dev-team/project-manager/skills/next-issue.md +0 -51
  291. package/template/workers/dev-team/project-manager/skills/project-status.md +0 -59
  292. package/template/workers/dev-team/project-manager/skills/update-learnings.md +0 -65
  293. package/template/workers/dev-team/project-manager/src/index.ts +0 -54
  294. package/template/workers/dev-team/project-manager/src/mcp-server.ts +0 -207
  295. package/template/workers/dev-team/project-manager/src/skills/create-prd.ts +0 -86
  296. package/template/workers/dev-team/project-manager/src/skills/next-issue.ts +0 -137
  297. package/template/workers/dev-team/project-manager/src/skills/project-status.ts +0 -131
  298. package/template/workers/dev-team/project-manager/src/skills/update-learnings.ts +0 -94
  299. package/template/workers/dev-team/project-manager/tsconfig.json +0 -19
  300. package/template/workers/dev-team/project-manager/worker.yaml +0 -96
  301. package/template/workers/dev-team/qa-tester/package.json +0 -24
  302. package/template/workers/dev-team/qa-tester/skills/create-demo-account.md +0 -36
  303. package/template/workers/dev-team/qa-tester/skills/run-tests.md +0 -36
  304. package/template/workers/dev-team/qa-tester/skills/write-test.md +0 -27
  305. package/template/workers/dev-team/qa-tester/src/index.ts +0 -61
  306. package/template/workers/dev-team/qa-tester/src/mcp-server.ts +0 -88
  307. package/template/workers/dev-team/qa-tester/tsconfig.json +0 -18
  308. package/template/workers/dev-team/qa-tester/worker.yaml +0 -116
  309. package/template/workers/dev-team/task-executor/package-lock.json +0 -1252
  310. package/template/workers/dev-team/task-executor/package.json +0 -27
  311. package/template/workers/dev-team/task-executor/skills/analyze-issue.md +0 -101
  312. package/template/workers/dev-team/task-executor/skills/execute.md +0 -133
  313. package/template/workers/dev-team/task-executor/skills/report-learnings.md +0 -106
  314. package/template/workers/dev-team/task-executor/skills/validate-completion.md +0 -121
  315. package/template/workers/dev-team/task-executor/src/index.ts +0 -54
  316. package/template/workers/dev-team/task-executor/src/mcp-server.ts +0 -139
  317. package/template/workers/dev-team/task-executor/src/skills/analyze-issue.ts +0 -219
  318. package/template/workers/dev-team/task-executor/src/skills/execute.ts +0 -132
  319. package/template/workers/dev-team/task-executor/src/skills/report-learnings.ts +0 -119
  320. package/template/workers/dev-team/task-executor/src/skills/validate-completion.ts +0 -142
  321. package/template/workers/dev-team/task-executor/tsconfig.json +0 -19
  322. package/template/workers/dev-team/task-executor/worker.yaml +0 -110
  323. package/template/workers/registry.yaml +0 -171
  324. package/template/workers/security-scanner/README.md +0 -73
  325. package/template/workers/security-scanner/skills/pre-deploy-check.md +0 -205
  326. package/template/workers/security-scanner/worker.yaml +0 -26
  327. package/template/workspace/checkpoints/.gitkeep +0 -0
  328. package/template/workspace/content-ideas/inbox.jsonl +0 -0
  329. package/template/workspace/drafts/.gitkeep +0 -0
  330. package/template/workspace/learnings/.gitkeep +0 -3
  331. package/template/workspace/orchestrator/.gitkeep +0 -0
  332. package/template/workspace/ralph-test/COMPLETE.md +0 -18
  333. package/template/workspace/ralph-test/hello.txt +0 -2
  334. package/template/workspace/reports/.gitkeep +0 -0
  335. package/template/workspace/scratch/.gitkeep +0 -0
  336. package/template/workspace/threads/.gitkeep +0 -3
@@ -1,169 +0,0 @@
1
- # Code Style & Conventions
2
-
3
- ## Rust Formatting
4
-
5
- ```toml
6
- # rustfmt.toml
7
- hard_tabs = true
8
- tab_spaces = 2
9
- max_width = 100
10
- ```
11
-
12
- ## Error Handling
13
-
14
- ```rust
15
- // Use thiserror for error enums
16
- use thiserror::Error;
17
-
18
- #[derive(Error, Debug)]
19
- pub enum MyError {
20
- #[error("failed to do X: {0}")]
21
- SomeFailure(String),
22
- }
23
-
24
- // Use anyhow for propagation
25
- use anyhow::Result;
26
-
27
- pub fn do_thing() -> Result<()> {
28
- // ...
29
- }
30
- ```
31
-
32
- ## Async
33
-
34
- - Runtime: Tokio
35
- - Trait methods: `async-trait`
36
-
37
- ```rust
38
- use async_trait::async_trait;
39
-
40
- #[async_trait]
41
- pub trait MyTrait: Send + Sync {
42
- async fn do_thing(&self) -> Result<()>;
43
- }
44
- ```
45
-
46
- ## HTTP Clients
47
-
48
- **Never use `reqwest::Client` directly.** Use `loom-http` wrapper:
49
-
50
- ```rust
51
- use loom_http::{new_client, builder};
52
-
53
- // Consistent User-Agent and retry logic
54
- let client = new_client()?;
55
- ```
56
-
57
- ## Secrets
58
-
59
- Use `loom-secret` for API keys, tokens, passwords:
60
-
61
- ```rust
62
- use loom_secret::{Secret, SecretString};
63
-
64
- let api_key: SecretString = SecretString::new("sk-xxx");
65
-
66
- // Access via expose()
67
- api_key.expose()
68
-
69
- // Auto-redacts in Debug/Display/Serialize/tracing
70
- ```
71
-
72
- ## Imports
73
-
74
- Group in order:
75
- 1. `std` crates
76
- 2. External crates
77
- 3. Internal `loom-*` crates
78
-
79
- ```rust
80
- use std::collections::HashMap;
81
-
82
- use serde::{Deserialize, Serialize};
83
- use tokio::sync::mpsc;
84
-
85
- use loom_common_core::Message;
86
- use loom_secret::SecretString;
87
- ```
88
-
89
- ## Naming
90
-
91
- | Category | Style |
92
- |----------|-------|
93
- | Functions/variables | `snake_case` |
94
- | Types | `PascalCase` |
95
- | Constants | `SCREAMING_CASE` |
96
-
97
- ## Comments
98
-
99
- **Minimal comments.** Only add when code is complex and requires context.
100
-
101
- **Copyright header required** on all files.
102
-
103
- ## Logging
104
-
105
- Use `tracing` with structured fields:
106
-
107
- ```rust
108
- use tracing::{info, instrument};
109
-
110
- #[instrument(skip(self, secrets, large_args), fields(id = %id))]
111
- async fn do_thing(&self, id: Uuid, secrets: SecretString) -> Result<()> {
112
- info!("doing thing");
113
- // ...
114
- }
115
- ```
116
-
117
- **Always skip secrets in instrument.**
118
-
119
- ## Testing
120
-
121
- | Type | Use Case |
122
- |------|----------|
123
- | `proptest` | Property-based tests (preferred for complex logic) |
124
- | Unit tests | Simple cases |
125
- | Integration tests | End-to-end flows |
126
-
127
- ```rust
128
- use proptest::prelude::*;
129
-
130
- proptest! {
131
- #[test]
132
- fn test_invariant(input in any::<u32>()) {
133
- prop_assert!(invariant_holds(input));
134
- }
135
- }
136
- ```
137
-
138
- ## i18n (Internationalization)
139
-
140
- Uses GNU gettext with `.po` files:
141
-
142
- ```rust
143
- use loom_i18n::{t, t_fmt, is_rtl, resolve_locale};
144
-
145
- // Simple translation
146
- let subject = t("es", "server.email.magic_link.subject");
147
-
148
- // With variables
149
- let body = t_fmt("es", "server.email.invitation.subject", &[
150
- ("org_name", "Acme Corp"),
151
- ]);
152
-
153
- // RTL support
154
- if is_rtl(locale) {
155
- // Use dir="rtl" in HTML
156
- }
157
- ```
158
-
159
- **String naming**: `{prefix}.{domain}.{component}.{element}`
160
- - Prefixes: `server.` (backend), `client.` (CLI)
161
- - Domains: `email`, `api`, `auth`, `org`
162
-
163
- **Supported locales**: `en`, `es`, `ar` (RTL)
164
-
165
- ## Svelte (Web)
166
-
167
- See [web-frontend.md](web-frontend.md) for Svelte 5 patterns.
168
-
169
- Key rule: **Always use Svelte 5 runes, never Svelte 4.**
@@ -1,132 +0,0 @@
1
- # LLM Proxy Architecture
2
-
3
- Loom uses a server-side proxy for all LLM interactions. API keys stay on the server; clients communicate through proxy endpoints.
4
-
5
- **Source**: `crates/loom-server-llm-proxy/`, `crates/loom-server-llm-service/`
6
-
7
- ## Architecture
8
-
9
- ```
10
- ┌─────────────┐ HTTP ┌─────────────┐ Provider API ┌─────────────┐
11
- │ loom-cli │ ───────────────▶│ loom-server │ ──────────────────▶ │ Anthropic │
12
- │ │ /proxy/{provider}│ │ │ OpenAI │
13
- │ ProxyLlm- │ /complete │ LlmService │ │ Vertex AI │
14
- │ Client │ /stream │ │ │ │
15
- └─────────────┘ ◀───────────── └─────────────┘ ◀────────────────── └─────────────┘
16
- SSE stream SSE stream
17
- ```
18
-
19
- ## Supported Providers
20
-
21
- | Provider | Crate | Endpoint |
22
- |----------|-------|----------|
23
- | Anthropic (Claude) | `loom-server-llm-anthropic` | `/proxy/anthropic/stream` |
24
- | OpenAI | `loom-server-llm-openai` | `/proxy/openai/stream` |
25
- | Vertex AI | `loom-server-llm-vertex` | `/proxy/vertex/stream` |
26
-
27
- ## LlmClient Trait
28
-
29
- ```rust
30
- pub trait LlmClient: Send + Sync {
31
- async fn complete(&self, request: LlmRequest) -> Result<LlmResponse, LlmError>;
32
- async fn complete_streaming(&self, request: LlmRequest) -> Result<LlmStream, LlmError>;
33
- }
34
- ```
35
-
36
- ## Request/Response Types
37
-
38
- ```rust
39
- pub struct LlmRequest {
40
- pub model: String,
41
- pub messages: Vec<Message>,
42
- pub tools: Vec<ToolDefinition>,
43
- pub max_tokens: Option<u32>,
44
- pub temperature: Option<f32>,
45
- }
46
-
47
- pub struct LlmResponse {
48
- pub message: Message,
49
- pub tool_calls: Vec<ToolCall>,
50
- pub usage: Option<Usage>,
51
- pub finish_reason: Option<String>,
52
- }
53
- ```
54
-
55
- ## Streaming Events
56
-
57
- SSE wire format uses `LlmStreamEvent`:
58
-
59
- ```rust
60
- pub enum LlmStreamEvent {
61
- TextDelta { content: String },
62
- ToolCallDelta { call_id: String, tool_name: String, arguments_fragment: String },
63
- ServerQuery(ServerQuery), // Phase 2: server→client queries
64
- Completed { response: LlmProxyResponse },
65
- Error { message: String },
66
- }
67
- ```
68
-
69
- SSE format:
70
- ```
71
- event: llm
72
- data: {"type":"text_delta","content":"Hello"}
73
-
74
- event: llm
75
- data: {"type":"completed","response":{...}}
76
- ```
77
-
78
- ## ProxyLlmClient (Client Side)
79
-
80
- ```rust
81
- pub struct ProxyLlmClient {
82
- base_url: String,
83
- provider: LlmProvider,
84
- http_client: reqwest::Client,
85
- auth_token: Option<SecretString>,
86
- }
87
-
88
- // Factory methods
89
- ProxyLlmClient::anthropic("http://loom.server")
90
- ProxyLlmClient::openai("http://loom.server")
91
- ProxyLlmClient::vertex("http://loom.server")
92
- ```
93
-
94
- ## Stream Parsing
95
-
96
- Client buffers SSE chunks until `\n\n` separator:
97
-
98
- ```rust
99
- pub struct ProxyLlmStream {
100
- inner: Pin<Box<dyn Stream<Item = Result<Bytes, reqwest::Error>> + Send>>,
101
- buffer: String,
102
- }
103
- ```
104
-
105
- Parsing flow:
106
- 1. Buffer bytes until `\n\n`
107
- 2. Extract `event: llm` and `data: {...}`
108
- 3. Parse JSON as `LlmStreamEvent`
109
- 4. Convert to `LlmEvent` for agent
110
-
111
- ## Server Query (Phase 2)
112
-
113
- Enables server to request client actions during streaming:
114
-
115
- ```rust
116
- pub enum ServerQueryKind {
117
- ReadFile { path: String },
118
- ExecuteCommand { command, args, timeout_secs },
119
- RequestUserInput { prompt, input_type, options },
120
- GetEnvironment { keys: Vec<String> },
121
- GetWorkspaceContext,
122
- Custom { name, payload },
123
- }
124
- ```
125
-
126
- Currently scaffolded but not fully implemented.
127
-
128
- ## Security
129
-
130
- - API keys stored server-side only
131
- - Clients authenticate via session token
132
- - No direct LLM API access from clients
@@ -1,131 +0,0 @@
1
- # Agent State Machine
2
-
3
- The core of Loom is an explicit, event-driven state machine that manages conversation flow and tool execution.
4
-
5
- **Source**: `crates/loom-common-core/src/state.rs`, `crates/loom-common-core/src/agent.rs`
6
-
7
- ## Design Principles
8
-
9
- 1. **Predictable** - All transitions are explicit and testable
10
- 2. **Self-contained** - Each state carries its required context
11
- 3. **Pure** - No async in state machine; caller drives I/O
12
- 4. **Deterministic** - Same events → same actions (enables replay)
13
-
14
- ## States
15
-
16
- | State | Description | Key Fields |
17
- |-------|-------------|------------|
18
- | `WaitingForUserInput` | Idle, ready for user message | `conversation` |
19
- | `CallingLlm` | LLM request in flight | `conversation`, `retries` |
20
- | `ProcessingLlmResponse` | Examining LLM response | `conversation`, `response` |
21
- | `ExecutingTools` | Running tool calls in parallel | `conversation`, `executions` |
22
- | `PostToolsHook` | Running post-tool hooks (auto-commit) | `conversation`, `pending_llm_request`, `completed_tools` |
23
- | `Error` | Recoverable error with retry | `conversation`, `error`, `retries`, `origin` |
24
- | `ShuttingDown` | Terminal state | (none) |
25
-
26
- ## Events
27
-
28
- | Event | Description |
29
- |-------|-------------|
30
- | `UserInput(Message)` | User submitted message |
31
- | `LlmEvent::TextDelta` | Streaming text from LLM |
32
- | `LlmEvent::ToolCallDelta` | Streaming tool call data |
33
- | `LlmEvent::Completed(LlmResponse)` | LLM finished |
34
- | `LlmEvent::Error(LlmError)` | LLM error |
35
- | `ToolCompleted { call_id, outcome }` | Tool execution finished |
36
- | `PostToolsHookCompleted` | Hooks finished |
37
- | `RetryTimeoutFired` | Retry backoff expired |
38
- | `ShutdownRequested` | Graceful shutdown |
39
-
40
- ## Actions
41
-
42
- Actions are returned to caller indicating what I/O to perform:
43
-
44
- | Action | Description |
45
- |--------|-------------|
46
- | `SendLlmRequest(LlmRequest)` | Call LLM provider |
47
- | `ExecuteTools(Vec<ToolCall>)` | Run tool calls |
48
- | `RunPostToolsHook { completed_tools }` | Run auto-commit |
49
- | `WaitForInput` | Idle |
50
- | `DisplayMessage(String)` | Show to user |
51
- | `DisplayError(String)` | Show error |
52
- | `Shutdown` | Terminate |
53
-
54
- ## Transition Table
55
-
56
- | Current State | Event | New State | Action |
57
- |---------------|-------|-----------|--------|
58
- | WaitingForUserInput | UserInput | CallingLlm | SendLlmRequest |
59
- | CallingLlm | TextDelta | CallingLlm | DisplayMessage |
60
- | CallingLlm | Completed | ProcessingLlmResponse | (internal) |
61
- | CallingLlm | Error (retries < max) | Error | WaitForInput |
62
- | CallingLlm | Error (retries >= max) | WaitingForUserInput | DisplayError |
63
- | ProcessingLlmResponse | (has tool calls) | ExecutingTools | ExecuteTools |
64
- | ProcessingLlmResponse | (no tools) | WaitingForUserInput | WaitForInput |
65
- | ExecutingTools | ToolCompleted (some pending) | ExecutingTools | WaitForInput |
66
- | ExecutingTools | ToolCompleted (all done, mutating) | PostToolsHook | RunPostToolsHook |
67
- | ExecutingTools | ToolCompleted (all done, non-mutating) | CallingLlm | SendLlmRequest |
68
- | PostToolsHook | PostToolsHookCompleted | CallingLlm | SendLlmRequest |
69
- | Error | RetryTimeoutFired | CallingLlm | SendLlmRequest |
70
- | *any* | ShutdownRequested | ShuttingDown | Shutdown |
71
-
72
- ## Flow Diagram
73
-
74
- ```mermaid
75
- stateDiagram-v2
76
- [*] --> WaitingForUserInput : Agent::new()
77
-
78
- WaitingForUserInput --> CallingLlm : UserInput
79
-
80
- CallingLlm --> CallingLlm : TextDelta / ToolCallDelta
81
- CallingLlm --> ProcessingLlmResponse : Completed
82
- CallingLlm --> Error : Error (retries < max)
83
- CallingLlm --> WaitingForUserInput : Error (retries >= max)
84
-
85
- ProcessingLlmResponse --> ExecutingTools : has tool calls
86
- ProcessingLlmResponse --> WaitingForUserInput : no tool calls
87
-
88
- ExecutingTools --> ExecutingTools : ToolCompleted (some pending)
89
- ExecutingTools --> PostToolsHook : ToolCompleted (all done, mutating)
90
- ExecutingTools --> CallingLlm : ToolCompleted (all done, no mutation)
91
-
92
- PostToolsHook --> CallingLlm : PostToolsHookCompleted
93
-
94
- Error --> CallingLlm : RetryTimeoutFired
95
-
96
- WaitingForUserInput --> ShuttingDown : ShutdownRequested
97
- CallingLlm --> ShuttingDown : ShutdownRequested
98
- ExecutingTools --> ShuttingDown : ShutdownRequested
99
-
100
- ShuttingDown --> [*]
101
- ```
102
-
103
- ## Mutating Tools
104
-
105
- Tools that modify files trigger `PostToolsHook` for auto-commit:
106
- - `edit_file`
107
- - `bash`
108
-
109
- Non-mutating tools skip hooks and go directly back to `CallingLlm`.
110
-
111
- ## Key Implementation Pattern
112
-
113
- ```rust
114
- // Agent is purely reactive - no async code
115
- pub fn handle_event(&mut self, event: AgentEvent) -> AgentResult<AgentAction> {
116
- match (&mut self.state, event) {
117
- (AgentState::WaitingForUserInput { conversation }, AgentEvent::UserInput(msg)) => {
118
- conversation.messages.push(msg);
119
- self.state = AgentState::CallingLlm { conversation: conversation.clone(), retries: 0 };
120
- Ok(AgentAction::SendLlmRequest(request))
121
- }
122
- // ... more transitions
123
- }
124
- }
125
- ```
126
-
127
- **Inversion of control**: Caller executes actions (LLM calls, tool runs) and feeds events back. Enables:
128
- - Offline operation
129
- - Different async runtimes
130
- - Comprehensive testing
131
- - Replay/debugging
@@ -1,117 +0,0 @@
1
- # Thread System
2
-
3
- Threads persist complete conversation snapshots including messages, agent state, and git context.
4
-
5
- **Source**: `crates/loom-common-thread/src/`
6
-
7
- ## Thread Structure
8
-
9
- ```rust
10
- pub struct Thread {
11
- pub id: ThreadId, // T-{uuid7}
12
- pub version: u64, // Optimistic locking
13
-
14
- // Timestamps
15
- pub created_at: String,
16
- pub updated_at: String,
17
- pub last_activity_at: String,
18
-
19
- // Environment snapshot
20
- pub workspace_root: Option<String>,
21
- pub cwd: Option<String>,
22
- pub loom_version: Option<String>,
23
-
24
- // Git context
25
- pub git_branch: Option<String>,
26
- pub git_remote_url: Option<String>,
27
- pub git_initial_branch: Option<String>,
28
- pub git_initial_commit_sha: Option<String>,
29
- pub git_current_commit_sha: Option<String>,
30
- pub git_start_dirty: Option<bool>,
31
- pub git_end_dirty: Option<bool>,
32
- pub git_commits: Vec<String>, // All commits observed
33
-
34
- // Conversation
35
- pub provider: Option<String>,
36
- pub model: Option<String>,
37
- pub conversation: ConversationSnapshot,
38
- pub agent_state: AgentStateSnapshot,
39
-
40
- // Metadata
41
- pub metadata: ThreadMetadata, // Title, tags, pinned
42
- pub visibility: ThreadVisibility, // Organization/Private/Public
43
- pub is_private: bool, // Local-only (no sync)
44
- pub is_shared_with_support: bool,
45
- }
46
- ```
47
-
48
- ## ThreadStore Trait
49
-
50
- ```rust
51
- pub trait ThreadStore: Send + Sync {
52
- async fn load(&self, id: &ThreadId) -> Result<Option<Thread>, ThreadStoreError>;
53
- async fn save(&self, thread: &Thread) -> Result<(), ThreadStoreError>;
54
- async fn list(&self, limit: u32) -> Result<Vec<ThreadSummary>, ThreadStoreError>;
55
- async fn delete(&self, id: &ThreadId) -> Result<(), ThreadStoreError>;
56
- async fn save_and_sync(&self, thread: &Thread) -> Result<(), ThreadStoreError>;
57
- }
58
- ```
59
-
60
- ## LocalThreadStore
61
-
62
- Default implementation for local persistence:
63
-
64
- - **Location**: `~/.local/share/loom/threads/{ThreadId}.json`
65
- - **Atomic writes**: temp file + rename
66
- - **Search**: FTS5 across title, branch, messages, tags, commit SHAs
67
-
68
- ## ConversationSnapshot
69
-
70
- ```rust
71
- pub struct ConversationSnapshot {
72
- pub messages: Vec<Message>,
73
- }
74
-
75
- pub struct Message {
76
- pub role: Role, // System, User, Assistant, Tool
77
- pub content: String,
78
- pub tool_call_id: Option<String>,
79
- pub name: Option<String>,
80
- pub tool_calls: Vec<ToolCall>,
81
- }
82
- ```
83
-
84
- ## ThreadMetadata
85
-
86
- ```rust
87
- pub struct ThreadMetadata {
88
- pub title: Option<String>,
89
- pub tags: Vec<String>,
90
- pub pinned: bool,
91
- }
92
- ```
93
-
94
- ## Visibility
95
-
96
- ```rust
97
- pub enum ThreadVisibility {
98
- Organization, // Visible to org members
99
- Private, // Only visible to owner
100
- Public, // Publicly shareable
101
- }
102
- ```
103
-
104
- ## Key Features
105
-
106
- 1. **Complete snapshot** - Full conversation + agent state + git context
107
- 2. **Optimistic locking** - Version numbers prevent conflicts
108
- 3. **FTS5 search** - Full-text across all thread content
109
- 4. **Local-first** - `is_private` keeps threads from syncing
110
- 5. **Git tracking** - Captures branch, commits, dirty state
111
-
112
- ## Persistence Flow
113
-
114
- 1. Agent processes events
115
- 2. Thread updated after each action
116
- 3. `save()` writes atomic JSON
117
- 4. Optional `save_and_sync()` for server sync
@@ -1,94 +0,0 @@
1
- # Tool System
2
-
3
- Tools extend the agent's capabilities to perform file operations, execute commands, and search the web.
4
-
5
- **Source**: `crates/loom-cli-tools/src/`
6
-
7
- ## Tool Trait
8
-
9
- ```rust
10
- #[async_trait]
11
- pub trait Tool: Send + Sync {
12
- fn name(&self) -> &str;
13
- fn description(&self) -> &str;
14
- fn input_schema(&self) -> serde_json::Value;
15
- async fn invoke(&self, args: serde_json::Value, ctx: &ToolContext) -> Result<serde_json::Value, ToolError>;
16
- }
17
- ```
18
-
19
- ## ToolRegistry
20
-
21
- HashMap-based dynamic dispatch for tool lookup:
22
-
23
- ```rust
24
- pub struct ToolRegistry {
25
- tools: HashMap<String, Arc<dyn Tool>>,
26
- }
27
-
28
- impl ToolRegistry {
29
- pub fn register(&mut self, tool: Arc<dyn Tool>);
30
- pub fn get(&self, name: &str) -> Option<Arc<dyn Tool>>;
31
- pub fn list(&self) -> Vec<&str>;
32
- }
33
- ```
34
-
35
- ## Built-in Tools
36
-
37
- ### File Operations
38
-
39
- | Tool | Purpose |
40
- |------|---------|
41
- | `ReadFileTool` | Read file contents (truncates large files) |
42
- | `ListFilesTool` | Directory listing with path validation |
43
- | `EditFileTool` | Snippet-based text replacement (atomic edits) |
44
-
45
- ### Command Execution
46
-
47
- | Tool | Purpose |
48
- |------|---------|
49
- | `BashTool` | Execute shell commands with timeout/truncation |
50
-
51
- **Note**: `BashTool` is a "mutating" tool that triggers `PostToolsHook` for auto-commit.
52
-
53
- ### LLM/Search
54
-
55
- | Tool | Purpose |
56
- |------|---------|
57
- | `OracleTool` | Consult secondary LLM via server proxy |
58
- | `WebSearchToolGoogle` | Web search via Google CSE |
59
- | `WebSearchToolSerper` | Web search via Serper API |
60
-
61
- ## Security
62
-
63
- All tools validate paths against workspace boundaries:
64
- - Prevents directory traversal (`../`)
65
- - Restricts to project root
66
- - Validates file existence
67
-
68
- ## Tool Execution Flow
69
-
70
- 1. LLM returns `tool_calls` in response
71
- 2. Agent transitions to `ExecutingTools` state
72
- 3. Caller invokes tools via `ToolRegistry.get(name).invoke(args, ctx)`
73
- 4. Each tool returns success/error outcome
74
- 5. Results collected in `ToolExecutionStatus`
75
- 6. When all complete → check if mutating → `PostToolsHook` or `CallingLlm`
76
-
77
- ## ToolContext
78
-
79
- Passed to every tool invocation:
80
-
81
- ```rust
82
- pub struct ToolContext {
83
- pub workspace_root: PathBuf,
84
- pub cwd: PathBuf,
85
- pub thread_id: Option<ThreadId>,
86
- }
87
- ```
88
-
89
- ## Adding a New Tool
90
-
91
- 1. Implement the `Tool` trait
92
- 2. Register with `ToolRegistry`
93
- 3. Add to tool definitions sent to LLM
94
- 4. If mutating, ensure it triggers `PostToolsHook`