@scemoon/cdh 1.0.5 → 1.0.7

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 (551) hide show
  1. package/package.json +2 -2
  2. package/run.js +68 -14
  3. package/ai-dlc-skill/SKILL.md +0 -77
  4. package/ai-dlc-skill/agents/deliver-agent.md +0 -24
  5. package/ai-dlc-skill/agents/master.md +0 -50
  6. package/ai-dlc-skill/agents/plan-agent.md +0 -23
  7. package/ai-dlc-skill/agents/understand-agent.md +0 -23
  8. package/ai-dlc-skill/agents/verify-agent.md +0 -27
  9. package/ai-dlc-skill/architecture/project-structure.md +0 -78
  10. package/ai-dlc-skill/brownfield/README.md +0 -30
  11. package/ai-dlc-skill/brownfield/generate-context.sh +0 -64
  12. package/ai-dlc-skill/brownfield/scripts/deps.sh +0 -27
  13. package/ai-dlc-skill/brownfield/scripts/discover.sh +0 -34
  14. package/ai-dlc-skill/brownfield/scripts/extract-api.sh +0 -45
  15. package/ai-dlc-skill/components/backend.md +0 -34
  16. package/ai-dlc-skill/components/desktop.md +0 -30
  17. package/ai-dlc-skill/components/mya.md +0 -29
  18. package/ai-dlc-skill/components/native.md +0 -30
  19. package/ai-dlc-skill/components/tta.md +0 -29
  20. package/ai-dlc-skill/components/web.md +0 -31
  21. package/ai-dlc-skill/components/wxa.md +0 -29
  22. package/ai-dlc-skill/contracts/README.md +0 -25
  23. package/ai-dlc-skill/core/adaptive-flow.md +0 -36
  24. package/ai-dlc-skill/core/security.md +0 -29
  25. package/ai-dlc-skill/cross-tool/cline/export.sh +0 -31
  26. package/ai-dlc-skill/cross-tool/copilot/export.sh +0 -47
  27. package/ai-dlc-skill/cross-tool/cursor/export.sh +0 -32
  28. package/ai-dlc-skill/cross-tool/export.sh +0 -22
  29. package/ai-dlc-skill/cross-tool/onecode/config.yaml.tpl +0 -17
  30. package/ai-dlc-skill/cross-tool/onecode/export-skills.sh +0 -35
  31. package/ai-dlc-skill/cross-tool/onecode/export.sh +0 -54
  32. package/ai-dlc-skill/phases/deliver/entry.md +0 -26
  33. package/ai-dlc-skill/phases/deliver/lifecycle.md +0 -185
  34. package/ai-dlc-skill/phases/deliver/prompt.md +0 -40
  35. package/ai-dlc-skill/phases/deliver/rules.md +0 -61
  36. package/ai-dlc-skill/phases/plan/entry.md +0 -25
  37. package/ai-dlc-skill/phases/plan/lifecycle.md +0 -204
  38. package/ai-dlc-skill/phases/plan/prompt.md +0 -38
  39. package/ai-dlc-skill/phases/plan/rules.md +0 -25
  40. package/ai-dlc-skill/phases/understand/entry.md +0 -26
  41. package/ai-dlc-skill/phases/understand/lifecycle.md +0 -184
  42. package/ai-dlc-skill/phases/understand/prompt.md +0 -41
  43. package/ai-dlc-skill/phases/understand/rules.md +0 -37
  44. package/ai-dlc-skill/phases/verify/entry.md +0 -26
  45. package/ai-dlc-skill/phases/verify/lifecycle.md +0 -192
  46. package/ai-dlc-skill/phases/verify/prompt.md +0 -43
  47. package/ai-dlc-skill/phases/verify/rules.md +0 -73
  48. package/ai-dlc-skill/practices/bdd.md +0 -91
  49. package/ai-dlc-skill/practices/sdd.md +0 -84
  50. package/ai-dlc-skill/practices/tdd.md +0 -95
  51. package/ai-dlc-skill/providers/README.md +0 -114
  52. package/ai-dlc-skill/providers/aliyun/deployment.yaml +0 -66
  53. package/ai-dlc-skill/providers/aliyun/preview.yaml +0 -84
  54. package/ai-dlc-skill/providers/aliyun/provider.yaml +0 -160
  55. package/ai-dlc-skill/providers/tcb/deployment.yaml +0 -69
  56. package/ai-dlc-skill/providers/tcb/preview.yaml +0 -83
  57. package/ai-dlc-skill/providers/tcb/provider.yaml +0 -172
  58. package/ai-dlc-skill/requirements.md +0 -140
  59. package/ai-dlc-skill/skill.yaml +0 -147
  60. package/ai-dlc-skill/templates/integration/CHANGELOG.md +0 -41
  61. package/ai-dlc-skill/templates/integration/asyncapi.yaml +0 -43
  62. package/ai-dlc-skill/templates/integration/contract-diff.md +0 -63
  63. package/ai-dlc-skill/templates/integration/contract-spec.md +0 -49
  64. package/ai-dlc-skill/templates/integration/openapi.yaml +0 -18
  65. package/ai-dlc-skill/templates/integration/runtime-contract.yaml +0 -36
  66. package/ai-dlc-skill/templates/plan/design.md +0 -49
  67. package/ai-dlc-skill/templates/plan/task-list.md +0 -32
  68. package/ai-dlc-skill/templates/project/README.md +0 -126
  69. package/ai-dlc-skill/templates/project/template.md +0 -119
  70. package/ai-dlc-skill/templates/understand/feature.feature +0 -23
  71. package/ai-dlc-skill/templates/understand/intent.md +0 -29
  72. package/ai-dlc-skill/templates/understand/spec-delta.md +0 -47
  73. package/ai-dlc-skill/templates/verify/test-unit.py +0 -27
  74. package/ai-dlc-skill/walkthrough/collect.sh +0 -50
  75. package/ai-dlc-skill/walkthrough/template.md +0 -54
  76. package/ai-dlc-skill/workflows/ai-dlc.yaml +0 -110
  77. package/ai-dlc-skill/workflows/deployment.yaml +0 -199
  78. package/cdh/__init__.py +0 -0
  79. package/cdh/__main__.py +0 -4
  80. package/cdh/__pycache__/__init__.cpython-314.pyc +0 -0
  81. package/cdh/__pycache__/cdh_mcp_injector.cpython-314.pyc +0 -0
  82. package/cdh/__pycache__/cdh_mcp_loader.cpython-314.pyc +0 -0
  83. package/cdh/__pycache__/cdh_mcp_manager.cpython-314.pyc +0 -0
  84. package/cdh/__pycache__/cdh_session_aggregator.cpython-314.pyc +0 -0
  85. package/cdh/__pycache__/cdh_skill_loader.cpython-314.pyc +0 -0
  86. package/cdh/__pycache__/cdh_skill_manager.cpython-314.pyc +0 -0
  87. package/cdh/__pycache__/cli.cpython-313.pyc +0 -0
  88. package/cdh/__pycache__/cli.cpython-314.pyc +0 -0
  89. package/cdh/__pycache__/scaffold.cpython-314.pyc +0 -0
  90. package/cdh/cdh_mcp_injector.py +0 -115
  91. package/cdh/cdh_mcp_loader.py +0 -67
  92. package/cdh/cdh_mcp_manager.py +0 -73
  93. package/cdh/cdh_session_aggregator.py +0 -258
  94. package/cdh/cdh_skill_manager.py +0 -105
  95. package/cdh/cli.py +0 -758
  96. package/cdh/scaffold.py +0 -728
  97. package/onecode/__init__.py +0 -1
  98. package/onecode/__main__.py +0 -4
  99. package/onecode/__pycache__/__init__.cpython-314.pyc +0 -0
  100. package/onecode/__pycache__/cli.cpython-314.pyc +0 -0
  101. package/onecode/__pycache__/commands.cpython-314.pyc +0 -0
  102. package/onecode/__pycache__/config.cpython-314.pyc +0 -0
  103. package/onecode/__pycache__/config_screen.cpython-314.pyc +0 -0
  104. package/onecode/__pycache__/migrate.cpython-314.pyc +0 -0
  105. package/onecode/agent/__init__.py +0 -0
  106. package/onecode/agent/__pycache__/__init__.cpython-314.pyc +0 -0
  107. package/onecode/agent/__pycache__/cdh_loader.cpython-314.pyc +0 -0
  108. package/onecode/agent/__pycache__/context.cpython-314.pyc +0 -0
  109. package/onecode/agent/__pycache__/engine.cpython-314.pyc +0 -0
  110. package/onecode/agent/__pycache__/hooks.cpython-314.pyc +0 -0
  111. package/onecode/agent/__pycache__/onecode_agent_acp.cpython-314.pyc +0 -0
  112. package/onecode/agent/__pycache__/permissions.cpython-314.pyc +0 -0
  113. package/onecode/agent/__pycache__/permissions_store.cpython-314.pyc +0 -0
  114. package/onecode/agent/__pycache__/project_doc.cpython-314.pyc +0 -0
  115. package/onecode/agent/__pycache__/session.cpython-314.pyc +0 -0
  116. package/onecode/agent/agents/__init__.py +0 -29
  117. package/onecode/agent/agents/__pycache__/__init__.cpython-314.pyc +0 -0
  118. package/onecode/agent/agents/__pycache__/types.cpython-314.pyc +0 -0
  119. package/onecode/agent/agents/types.py +0 -589
  120. package/onecode/agent/attachments.py +0 -112
  121. package/onecode/agent/cdh_loader.py +0 -267
  122. package/onecode/agent/context.py +0 -343
  123. package/onecode/agent/engine.py +0 -2700
  124. package/onecode/agent/hooks.py +0 -86
  125. package/onecode/agent/onecode_agent_acp.py +0 -2743
  126. package/onecode/agent/onecode_agent_acp.py.bak +0 -2447
  127. package/onecode/agent/permissions.py +0 -150
  128. package/onecode/agent/permissions_store.py +0 -62
  129. package/onecode/agent/project_doc.py +0 -19
  130. package/onecode/agent/session.py +0 -195
  131. package/onecode/agent/snapshot.py +0 -144
  132. package/onecode/agent/tools/__init__.py +0 -17
  133. package/onecode/agent/tools/__pycache__/__init__.cpython-314.pyc +0 -0
  134. package/onecode/agent/tools/__pycache__/agent_tools.cpython-314.pyc +0 -0
  135. package/onecode/agent/tools/__pycache__/apply_patch_tool.cpython-314.pyc +0 -0
  136. package/onecode/agent/tools/__pycache__/bash_tool.cpython-314.pyc +0 -0
  137. package/onecode/agent/tools/__pycache__/communication_tools.cpython-314.pyc +0 -0
  138. package/onecode/agent/tools/__pycache__/config_tool.cpython-314.pyc +0 -0
  139. package/onecode/agent/tools/__pycache__/cron_tools.cpython-314.pyc +0 -0
  140. package/onecode/agent/tools/__pycache__/errors.cpython-314.pyc +0 -0
  141. package/onecode/agent/tools/__pycache__/file_ops.cpython-314.pyc +0 -0
  142. package/onecode/agent/tools/__pycache__/file_tools.cpython-314.pyc +0 -0
  143. package/onecode/agent/tools/__pycache__/git_tools.cpython-314.pyc +0 -0
  144. package/onecode/agent/tools/__pycache__/lsp_tools.cpython-314.pyc +0 -0
  145. package/onecode/agent/tools/__pycache__/mcp_tools.cpython-314.pyc +0 -0
  146. package/onecode/agent/tools/__pycache__/permission_handler.cpython-314.pyc +0 -0
  147. package/onecode/agent/tools/__pycache__/permissions.cpython-314.pyc +0 -0
  148. package/onecode/agent/tools/__pycache__/protocol.cpython-314.pyc +0 -0
  149. package/onecode/agent/tools/__pycache__/registry.cpython-314.pyc +0 -0
  150. package/onecode/agent/tools/__pycache__/sandbox.cpython-314.pyc +0 -0
  151. package/onecode/agent/tools/__pycache__/schema_validation.cpython-314.pyc +0 -0
  152. package/onecode/agent/tools/__pycache__/skill_tools.cpython-314.pyc +0 -0
  153. package/onecode/agent/tools/__pycache__/todo_tools.cpython-314.pyc +0 -0
  154. package/onecode/agent/tools/__pycache__/web_tools.cpython-314.pyc +0 -0
  155. package/onecode/agent/tools/agent_tools.py +0 -132
  156. package/onecode/agent/tools/apply_patch_tool.py +0 -138
  157. package/onecode/agent/tools/bash_tool.py +0 -111
  158. package/onecode/agent/tools/communication_tools.py +0 -148
  159. package/onecode/agent/tools/config_tool.py +0 -130
  160. package/onecode/agent/tools/cron_tools.py +0 -178
  161. package/onecode/agent/tools/errors.py +0 -17
  162. package/onecode/agent/tools/file_ops.py +0 -221
  163. package/onecode/agent/tools/file_tools.py +0 -225
  164. package/onecode/agent/tools/git_tools.py +0 -88
  165. package/onecode/agent/tools/lsp_tools.py +0 -404
  166. package/onecode/agent/tools/mcp_tools.py +0 -127
  167. package/onecode/agent/tools/permission_handler.py +0 -46
  168. package/onecode/agent/tools/permissions.py +0 -77
  169. package/onecode/agent/tools/protocol.py +0 -20
  170. package/onecode/agent/tools/registry.py +0 -201
  171. package/onecode/agent/tools/sandbox.py +0 -358
  172. package/onecode/agent/tools/schema_validation.py +0 -100
  173. package/onecode/agent/tools/skill_tools.py +0 -52
  174. package/onecode/agent/tools/todo_tools.py +0 -207
  175. package/onecode/agent/tools/web_tools.py +0 -169
  176. package/onecode/builtin_skills/agent-browser/SKILL.md +0 -212
  177. package/onecode/builtin_skills/agent-browser/skill.yaml +0 -8
  178. package/onecode/builtin_skills/git/SKILL.md +0 -64
  179. package/onecode/builtin_skills/git/skill.yaml +0 -7
  180. package/onecode/builtin_skills/shell/SKILL.md +0 -58
  181. package/onecode/builtin_skills/shell/skill.yaml +0 -8
  182. package/onecode/builtin_skills/skill-creator/SKILL.md +0 -106
  183. package/onecode/builtin_skills/skill-creator/skill.yaml +0 -8
  184. package/onecode/cli.py +0 -935
  185. package/onecode/cloud/__init__.py +0 -0
  186. package/onecode/cloud/base.py +0 -20
  187. package/onecode/codebase/__init__.py +0 -69
  188. package/onecode/codebase/__pycache__/__init__.cpython-314.pyc +0 -0
  189. package/onecode/codebase/__pycache__/chunker.cpython-314.pyc +0 -0
  190. package/onecode/codebase/__pycache__/indexer.cpython-314.pyc +0 -0
  191. package/onecode/codebase/__pycache__/retriever.cpython-314.pyc +0 -0
  192. package/onecode/codebase/__pycache__/storage.cpython-314.pyc +0 -0
  193. package/onecode/codebase/__pycache__/tools.cpython-314.pyc +0 -0
  194. package/onecode/codebase/chunker.py +0 -125
  195. package/onecode/codebase/indexer.py +0 -149
  196. package/onecode/codebase/retriever.py +0 -203
  197. package/onecode/codebase/storage.py +0 -131
  198. package/onecode/codebase/tools.py +0 -59
  199. package/onecode/commands.py +0 -596
  200. package/onecode/config.py +0 -314
  201. package/onecode/config_screen.py +0 -600
  202. package/onecode/cron/__init__.py +0 -3
  203. package/onecode/lsp/__init__.py +0 -3
  204. package/onecode/mcp/__init__.py +0 -4
  205. package/onecode/mcp/__pycache__/__init__.cpython-314.pyc +0 -0
  206. package/onecode/mcp/__pycache__/client.cpython-314.pyc +0 -0
  207. package/onecode/mcp/__pycache__/manager.cpython-314.pyc +0 -0
  208. package/onecode/mcp/client.py +0 -193
  209. package/onecode/mcp/manager.py +0 -190
  210. package/onecode/memory/__init__.py +0 -49
  211. package/onecode/memory/__pycache__/__init__.cpython-314.pyc +0 -0
  212. package/onecode/memory/__pycache__/backend.cpython-314.pyc +0 -0
  213. package/onecode/memory/__pycache__/offload.cpython-314.pyc +0 -0
  214. package/onecode/memory/__pycache__/pyramid.cpython-314.pyc +0 -0
  215. package/onecode/memory/__pycache__/recall.cpython-314.pyc +0 -0
  216. package/onecode/memory/__pycache__/symbolic.cpython-314.pyc +0 -0
  217. package/onecode/memory/backend.py +0 -159
  218. package/onecode/memory/pyramid.py +0 -133
  219. package/onecode/memory/recall.py +0 -203
  220. package/onecode/migrate.py +0 -122
  221. package/onecode/models/__init__.py +0 -4
  222. package/onecode/models/__pycache__/__init__.cpython-314.pyc +0 -0
  223. package/onecode/models/__pycache__/errors.cpython-314.pyc +0 -0
  224. package/onecode/models/__pycache__/messages.cpython-314.pyc +0 -0
  225. package/onecode/models/__pycache__/provider.cpython-314.pyc +0 -0
  226. package/onecode/models/__pycache__/registry.cpython-314.pyc +0 -0
  227. package/onecode/models/errors.py +0 -104
  228. package/onecode/models/messages.py +0 -739
  229. package/onecode/models/provider.py +0 -699
  230. package/onecode/models/providers/__init__.py +0 -17
  231. package/onecode/models/providers/__pycache__/__init__.cpython-314.pyc +0 -0
  232. package/onecode/models/providers/__pycache__/anthropic_provider.cpython-314.pyc +0 -0
  233. package/onecode/models/providers/__pycache__/deepseek_provider.cpython-314.pyc +0 -0
  234. package/onecode/models/providers/__pycache__/glm_provider.cpython-314.pyc +0 -0
  235. package/onecode/models/providers/__pycache__/minimax_provider.cpython-314.pyc +0 -0
  236. package/onecode/models/providers/__pycache__/minimaxi_provider.cpython-314.pyc +0 -0
  237. package/onecode/models/providers/__pycache__/ollama_provider.cpython-314.pyc +0 -0
  238. package/onecode/models/providers/__pycache__/openai_provider.cpython-314.pyc +0 -0
  239. package/onecode/models/providers/anthropic_provider.py +0 -273
  240. package/onecode/models/providers/deepseek_provider.py +0 -212
  241. package/onecode/models/providers/glm_provider.py +0 -195
  242. package/onecode/models/providers/minimax_provider.py +0 -158
  243. package/onecode/models/providers/minimaxi_provider.py +0 -417
  244. package/onecode/models/providers/ollama_provider.py +0 -100
  245. package/onecode/models/providers/openai_provider.py +0 -237
  246. package/onecode/models/registry.py +0 -212
  247. package/onecode/server/__init__.py +0 -3
  248. package/onecode/server/app.py +0 -224
  249. package/onecode/skills/__init__.py +0 -11
  250. package/onecode/skills/__pycache__/__init__.cpython-314.pyc +0 -0
  251. package/onecode/skills/__pycache__/argument_substitution.cpython-314.pyc +0 -0
  252. package/onecode/skills/__pycache__/bootstrap.cpython-314.pyc +0 -0
  253. package/onecode/skills/__pycache__/create.cpython-314.pyc +0 -0
  254. package/onecode/skills/__pycache__/frontmatter.cpython-314.pyc +0 -0
  255. package/onecode/skills/__pycache__/loader.cpython-314.pyc +0 -0
  256. package/onecode/skills/__pycache__/manager.cpython-314.pyc +0 -0
  257. package/onecode/skills/__pycache__/model.cpython-314.pyc +0 -0
  258. package/onecode/skills/argument_substitution.py +0 -38
  259. package/onecode/skills/bootstrap.py +0 -124
  260. package/onecode/skills/create.py +0 -56
  261. package/onecode/skills/frontmatter.py +0 -33
  262. package/onecode/skills/loader.py +0 -139
  263. package/onecode/skills/manager.py +0 -75
  264. package/onecode/skills/model.py +0 -43
  265. package/onecode/storage/__init__.py +0 -0
  266. package/onecode/storage/activity.py +0 -63
  267. package/onecode/storage/project.py +0 -54
  268. package/onecode/storage/session.py +0 -112
  269. package/onecode/tasks/__init__.py +0 -26
  270. package/onecode/tasks/manager.py +0 -232
  271. package/onecode/tasks/models.py +0 -240
  272. package/onecode/trace/__init__.py +0 -0
  273. package/onecode/trace/tracer.py +0 -173
  274. package/onecode/utils/__init__.py +0 -0
  275. package/onecode/utils/helpers.py +0 -20
  276. package/pyproject.toml +0 -74
  277. package/tui/__init__.py +0 -46
  278. package/tui/__main__.py +0 -4
  279. package/tui/__pycache__/__init__.cpython-314.pyc +0 -0
  280. package/tui/__pycache__/_loop.cpython-314.pyc +0 -0
  281. package/tui/__pycache__/_path_fuzzy_search.cpython-314.pyc +0 -0
  282. package/tui/__pycache__/_path_match.cpython-314.pyc +0 -0
  283. package/tui/__pycache__/about.cpython-314.pyc +0 -0
  284. package/tui/__pycache__/agent.cpython-314.pyc +0 -0
  285. package/tui/__pycache__/agent_schema.cpython-314.pyc +0 -0
  286. package/tui/__pycache__/agents.cpython-314.pyc +0 -0
  287. package/tui/__pycache__/answer.cpython-314.pyc +0 -0
  288. package/tui/__pycache__/app.cpython-313.pyc +0 -0
  289. package/tui/__pycache__/app.cpython-314.pyc +0 -0
  290. package/tui/__pycache__/atomic.cpython-314.pyc +0 -0
  291. package/tui/__pycache__/complete.cpython-314.pyc +0 -0
  292. package/tui/__pycache__/constants.cpython-314.pyc +0 -0
  293. package/tui/__pycache__/conversation_markdown.cpython-314.pyc +0 -0
  294. package/tui/__pycache__/danger.cpython-314.pyc +0 -0
  295. package/tui/__pycache__/db.cpython-314.pyc +0 -0
  296. package/tui/__pycache__/dec.cpython-314.pyc +0 -0
  297. package/tui/__pycache__/directory.cpython-314.pyc +0 -0
  298. package/tui/__pycache__/directory_suggester.cpython-314.pyc +0 -0
  299. package/tui/__pycache__/directory_watcher.cpython-314.pyc +0 -0
  300. package/tui/__pycache__/format_path.cpython-314.pyc +0 -0
  301. package/tui/__pycache__/fuzzy.cpython-314.pyc +0 -0
  302. package/tui/__pycache__/fuzzy_index.cpython-314.pyc +0 -0
  303. package/tui/__pycache__/history.cpython-314.pyc +0 -0
  304. package/tui/__pycache__/jsonrpc.cpython-314.pyc +0 -0
  305. package/tui/__pycache__/menus.cpython-314.pyc +0 -0
  306. package/tui/__pycache__/message_log.cpython-314.pyc +0 -0
  307. package/tui/__pycache__/messages.cpython-314.pyc +0 -0
  308. package/tui/__pycache__/path_complete.cpython-314.pyc +0 -0
  309. package/tui/__pycache__/path_filter.cpython-314.pyc +0 -0
  310. package/tui/__pycache__/paths.cpython-314.pyc +0 -0
  311. package/tui/__pycache__/pill.cpython-314.pyc +0 -0
  312. package/tui/__pycache__/platform_commands.cpython-314.pyc +0 -0
  313. package/tui/__pycache__/protocol.cpython-314.pyc +0 -0
  314. package/tui/__pycache__/session_tracker.cpython-314.pyc +0 -0
  315. package/tui/__pycache__/settings.cpython-314.pyc +0 -0
  316. package/tui/__pycache__/settings_schema.cpython-314.pyc +0 -0
  317. package/tui/__pycache__/shell.cpython-314.pyc +0 -0
  318. package/tui/__pycache__/shell_read.cpython-314.pyc +0 -0
  319. package/tui/__pycache__/slash_command.cpython-314.pyc +0 -0
  320. package/tui/__pycache__/version.cpython-314.pyc +0 -0
  321. package/tui/_loop.py +0 -86
  322. package/tui/_path_fuzzy_search.py +0 -48
  323. package/tui/_path_match.py +0 -141
  324. package/tui/about.py +0 -95
  325. package/tui/acp/__pycache__/agent.cpython-314.pyc +0 -0
  326. package/tui/acp/__pycache__/api.cpython-314.pyc +0 -0
  327. package/tui/acp/__pycache__/encode_tool_call_id.cpython-314.pyc +0 -0
  328. package/tui/acp/__pycache__/messages.cpython-314.pyc +0 -0
  329. package/tui/acp/__pycache__/prompt.cpython-314.pyc +0 -0
  330. package/tui/acp/__pycache__/protocol.cpython-314.pyc +0 -0
  331. package/tui/acp/agent.py +0 -1002
  332. package/tui/acp/api.py +0 -73
  333. package/tui/acp/encode_tool_call_id.py +0 -12
  334. package/tui/acp/messages.py +0 -203
  335. package/tui/acp/prompt.py +0 -53
  336. package/tui/acp/protocol.py +0 -499
  337. package/tui/agent.py +0 -70
  338. package/tui/agent_schema.py +0 -76
  339. package/tui/agents.py +0 -46
  340. package/tui/ansi/__init__.py +0 -1
  341. package/tui/ansi/__pycache__/__init__.cpython-314.pyc +0 -0
  342. package/tui/ansi/__pycache__/_ansi.cpython-314.pyc +0 -0
  343. package/tui/ansi/__pycache__/_ansi_colors.cpython-314.pyc +0 -0
  344. package/tui/ansi/__pycache__/_control_codes.cpython-314.pyc +0 -0
  345. package/tui/ansi/__pycache__/_keys.cpython-314.pyc +0 -0
  346. package/tui/ansi/__pycache__/_sgr_styles.cpython-314.pyc +0 -0
  347. package/tui/ansi/__pycache__/_stream_parser.cpython-314.pyc +0 -0
  348. package/tui/ansi/_ansi.py +0 -1689
  349. package/tui/ansi/_ansi_colors.py +0 -264
  350. package/tui/ansi/_control_codes.py +0 -37
  351. package/tui/ansi/_keys.py +0 -251
  352. package/tui/ansi/_sgr_styles.py +0 -64
  353. package/tui/ansi/_stream_parser.py +0 -418
  354. package/tui/answer.py +0 -12
  355. package/tui/app.py +0 -1266
  356. package/tui/atomic.py +0 -37
  357. package/tui/cli.py +0 -313
  358. package/tui/code_analyze.py +0 -27
  359. package/tui/complete.py +0 -38
  360. package/tui/constants.py +0 -61
  361. package/tui/conversation_markdown.py +0 -30
  362. package/tui/danger.py +0 -372
  363. package/tui/data/agents/ampcode.com.toml +0 -52
  364. package/tui/data/agents/augmentcode.com.toml +0 -41
  365. package/tui/data/agents/cdh.cloud-dev-harness.toml +0 -23
  366. package/tui/data/agents/claude.com.toml +0 -41
  367. package/tui/data/agents/copilot.github.com.toml +0 -29
  368. package/tui/data/agents/crowai.dev.toml +0 -36
  369. package/tui/data/agents/cursor.com.toml +0 -38
  370. package/tui/data/agents/deepagents.langchain.com +0 -34
  371. package/tui/data/agents/docker.com.toml +0 -60
  372. package/tui/data/agents/geminicli.com.toml +0 -28
  373. package/tui/data/agents/goose.ai.toml +0 -52
  374. package/tui/data/agents/inference.huggingface.co.toml +0 -41
  375. package/tui/data/agents/kimi.com.toml +0 -35
  376. package/tui/data/agents/kiro.dev.toml +0 -43
  377. package/tui/data/agents/onecode.dev.toml +0 -22
  378. package/tui/data/agents/openai.com.toml +0 -53
  379. package/tui/data/agents/openclaw.ai.toml +0 -37
  380. package/tui/data/agents/opencode.ai.toml +0 -39
  381. package/tui/data/agents/openhands.dev.toml +0 -46
  382. package/tui/data/agents/stakpak.dev.toml +0 -62
  383. package/tui/data/agents/vibe.mistral.ai.toml +0 -31
  384. package/tui/data/agents/vtcode.dev.toml +0 -63
  385. package/tui/data/images/frog.png +0 -0
  386. package/tui/data/sounds/question.wav +0 -0
  387. package/tui/data/sounds/turn-over.wav +0 -0
  388. package/tui/db.py +0 -213
  389. package/tui/dec.py +0 -332
  390. package/tui/directory.py +0 -234
  391. package/tui/directory_suggester.py +0 -93
  392. package/tui/directory_watcher.py +0 -231
  393. package/tui/format_path.py +0 -25
  394. package/tui/fuzzy.py +0 -140
  395. package/tui/fuzzy_index.py +0 -275
  396. package/tui/gist.py +0 -33
  397. package/tui/history.py +0 -138
  398. package/tui/jsonrpc.py +0 -578
  399. package/tui/menus.py +0 -14
  400. package/tui/message_log.py +0 -69
  401. package/tui/messages.py +0 -144
  402. package/tui/option_content.py +0 -51
  403. package/tui/os.py +0 -0
  404. package/tui/path_complete.py +0 -217
  405. package/tui/path_filter.py +0 -124
  406. package/tui/paths.py +0 -87
  407. package/tui/pill.py +0 -23
  408. package/tui/platform_commands.py +0 -52
  409. package/tui/prompt/__pycache__/extract.cpython-314.pyc +0 -0
  410. package/tui/prompt/__pycache__/resource.cpython-314.pyc +0 -0
  411. package/tui/prompt/extract.py +0 -19
  412. package/tui/prompt/resource.py +0 -68
  413. package/tui/protocol.py +0 -28
  414. package/tui/screens/__init__.py +0 -0
  415. package/tui/screens/__pycache__/__init__.cpython-314.pyc +0 -0
  416. package/tui/screens/__pycache__/agent_modal.cpython-314.pyc +0 -0
  417. package/tui/screens/__pycache__/component_picker.cpython-314.pyc +0 -0
  418. package/tui/screens/__pycache__/diff_screen.cpython-314.pyc +0 -0
  419. package/tui/screens/__pycache__/log.cpython-314.pyc +0 -0
  420. package/tui/screens/__pycache__/main.cpython-313.pyc +0 -0
  421. package/tui/screens/__pycache__/main.cpython-314.pyc +0 -0
  422. package/tui/screens/__pycache__/permissions.cpython-314.pyc +0 -0
  423. package/tui/screens/__pycache__/projects_app.cpython-314.pyc +0 -0
  424. package/tui/screens/__pycache__/projects_screen.cpython-314.pyc +0 -0
  425. package/tui/screens/__pycache__/sessions.cpython-314.pyc +0 -0
  426. package/tui/screens/__pycache__/store.cpython-314.pyc +0 -0
  427. package/tui/screens/__pycache__/tool_content_screen.cpython-314.pyc +0 -0
  428. package/tui/screens/action_modal.py +0 -94
  429. package/tui/screens/agent_modal.py +0 -175
  430. package/tui/screens/command_edit_modal.py +0 -74
  431. package/tui/screens/component_picker.py +0 -168
  432. package/tui/screens/diff_screen.py +0 -84
  433. package/tui/screens/log.py +0 -553
  434. package/tui/screens/main.py +0 -385
  435. package/tui/screens/main.tcss +0 -655
  436. package/tui/screens/permissions.py +0 -404
  437. package/tui/screens/permissions.tcss +0 -72
  438. package/tui/screens/projects.tcss +0 -80
  439. package/tui/screens/projects_app.py +0 -347
  440. package/tui/screens/projects_screen.py +0 -284
  441. package/tui/screens/session_resume_modal.py +0 -172
  442. package/tui/screens/session_resume_modal.tcss +0 -35
  443. package/tui/screens/sessions.py +0 -164
  444. package/tui/screens/sessions.tcss +0 -119
  445. package/tui/screens/settings.py +0 -254
  446. package/tui/screens/settings.tcss +0 -101
  447. package/tui/screens/store.py +0 -500
  448. package/tui/screens/store.tcss +0 -274
  449. package/tui/screens/tool_content_screen.py +0 -59
  450. package/tui/session_tracker.py +0 -123
  451. package/tui/settings.py +0 -353
  452. package/tui/settings_schema.py +0 -431
  453. package/tui/shell.py +0 -304
  454. package/tui/shell_read.py +0 -42
  455. package/tui/slash_command.py +0 -34
  456. package/tui/tui.tcss +0 -246
  457. package/tui/twitter.py +0 -38
  458. package/tui/version.py +0 -80
  459. package/tui/visuals/__init__.py +0 -0
  460. package/tui/visuals/__pycache__/__init__.cpython-314.pyc +0 -0
  461. package/tui/visuals/__pycache__/columns.cpython-314.pyc +0 -0
  462. package/tui/visuals/columns.py +0 -272
  463. package/tui/widgets/__init__.py +0 -0
  464. package/tui/widgets/__pycache__/__init__.cpython-314.pyc +0 -0
  465. package/tui/widgets/__pycache__/acp_content.cpython-314.pyc +0 -0
  466. package/tui/widgets/__pycache__/agent_response.cpython-314.pyc +0 -0
  467. package/tui/widgets/__pycache__/agent_thought.cpython-314.pyc +0 -0
  468. package/tui/widgets/__pycache__/ask_user.cpython-314.pyc +0 -0
  469. package/tui/widgets/__pycache__/condensed_path.cpython-314.pyc +0 -0
  470. package/tui/widgets/__pycache__/context_stats.cpython-314.pyc +0 -0
  471. package/tui/widgets/__pycache__/conversation.cpython-314.pyc +0 -0
  472. package/tui/widgets/__pycache__/diff_view.cpython-314.pyc +0 -0
  473. package/tui/widgets/__pycache__/directory_input.cpython-314.pyc +0 -0
  474. package/tui/widgets/__pycache__/flash.cpython-314.pyc +0 -0
  475. package/tui/widgets/__pycache__/future_text.cpython-314.pyc +0 -0
  476. package/tui/widgets/__pycache__/grid_select.cpython-314.pyc +0 -0
  477. package/tui/widgets/__pycache__/highlighted_textarea.cpython-314.pyc +0 -0
  478. package/tui/widgets/__pycache__/load_more.cpython-314.pyc +0 -0
  479. package/tui/widgets/__pycache__/mandelbrot.cpython-314.pyc +0 -0
  480. package/tui/widgets/__pycache__/markdown_note.cpython-314.pyc +0 -0
  481. package/tui/widgets/__pycache__/menu.cpython-314.pyc +0 -0
  482. package/tui/widgets/__pycache__/modified_files.cpython-314.pyc +0 -0
  483. package/tui/widgets/__pycache__/non_selectable_label.cpython-314.pyc +0 -0
  484. package/tui/widgets/__pycache__/note.cpython-314.pyc +0 -0
  485. package/tui/widgets/__pycache__/path_search.cpython-314.pyc +0 -0
  486. package/tui/widgets/__pycache__/plan.cpython-314.pyc +0 -0
  487. package/tui/widgets/__pycache__/project_directory_tree.cpython-314.pyc +0 -0
  488. package/tui/widgets/__pycache__/project_grid_select.cpython-314.pyc +0 -0
  489. package/tui/widgets/__pycache__/project_summary.cpython-314.pyc +0 -0
  490. package/tui/widgets/__pycache__/prompt.cpython-314.pyc +0 -0
  491. package/tui/widgets/__pycache__/question.cpython-314.pyc +0 -0
  492. package/tui/widgets/__pycache__/session_grid_select.cpython-314.pyc +0 -0
  493. package/tui/widgets/__pycache__/session_summary.cpython-314.pyc +0 -0
  494. package/tui/widgets/__pycache__/session_tabs.cpython-314.pyc +0 -0
  495. package/tui/widgets/__pycache__/shell_result.cpython-314.pyc +0 -0
  496. package/tui/widgets/__pycache__/shell_terminal.cpython-314.pyc +0 -0
  497. package/tui/widgets/__pycache__/side_bar.cpython-314.pyc +0 -0
  498. package/tui/widgets/__pycache__/slash_complete.cpython-314.pyc +0 -0
  499. package/tui/widgets/__pycache__/strike_text.cpython-314.pyc +0 -0
  500. package/tui/widgets/__pycache__/subagent.cpython-314.pyc +0 -0
  501. package/tui/widgets/__pycache__/subagent_screen.cpython-314.pyc +0 -0
  502. package/tui/widgets/__pycache__/terminal.cpython-314.pyc +0 -0
  503. package/tui/widgets/__pycache__/throbber.cpython-314.pyc +0 -0
  504. package/tui/widgets/__pycache__/tool_call.cpython-314.pyc +0 -0
  505. package/tui/widgets/__pycache__/user_input.cpython-314.pyc +0 -0
  506. package/tui/widgets/acp_content.py +0 -70
  507. package/tui/widgets/agent_response.py +0 -76
  508. package/tui/widgets/agent_thought.py +0 -167
  509. package/tui/widgets/ask_user.py +0 -264
  510. package/tui/widgets/command_pane.py +0 -223
  511. package/tui/widgets/condensed_path.py +0 -115
  512. package/tui/widgets/context_stats.py +0 -66
  513. package/tui/widgets/conversation.py +0 -2641
  514. package/tui/widgets/danger_warning.py +0 -65
  515. package/tui/widgets/diff_view.py +0 -69
  516. package/tui/widgets/directory_input.py +0 -8
  517. package/tui/widgets/flash.py +0 -81
  518. package/tui/widgets/future_text.py +0 -126
  519. package/tui/widgets/grid_select.py +0 -234
  520. package/tui/widgets/highlighted_textarea.py +0 -180
  521. package/tui/widgets/load_more.py +0 -24
  522. package/tui/widgets/mandelbrot.py +0 -294
  523. package/tui/widgets/markdown_note.py +0 -13
  524. package/tui/widgets/menu.py +0 -147
  525. package/tui/widgets/modified_files.py +0 -306
  526. package/tui/widgets/non_selectable_label.py +0 -5
  527. package/tui/widgets/note.py +0 -18
  528. package/tui/widgets/path_search.py +0 -492
  529. package/tui/widgets/plan.py +0 -285
  530. package/tui/widgets/project_directory_tree.py +0 -102
  531. package/tui/widgets/project_grid_select.py +0 -64
  532. package/tui/widgets/project_summary.py +0 -33
  533. package/tui/widgets/prompt.py +0 -795
  534. package/tui/widgets/question.py +0 -360
  535. package/tui/widgets/session_grid_select.py +0 -230
  536. package/tui/widgets/session_summary.py +0 -115
  537. package/tui/widgets/session_tabs.py +0 -188
  538. package/tui/widgets/shell_result.py +0 -35
  539. package/tui/widgets/shell_terminal.py +0 -40
  540. package/tui/widgets/side_bar.py +0 -124
  541. package/tui/widgets/slash_complete.py +0 -235
  542. package/tui/widgets/strike_text.py +0 -70
  543. package/tui/widgets/subagent.py +0 -287
  544. package/tui/widgets/subagent_screen.py +0 -709
  545. package/tui/widgets/terminal.py +0 -576
  546. package/tui/widgets/terminal_tool.py +0 -360
  547. package/tui/widgets/throbber.py +0 -100
  548. package/tui/widgets/tool_call.py +0 -398
  549. package/tui/widgets/user_input.py +0 -23
  550. package/tui/widgets/version.py +0 -5
  551. package/tui/widgets/welcome.py +0 -31
package/cdh/scaffold.py DELETED
@@ -1,728 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from dataclasses import dataclass
4
- from pathlib import Path
5
-
6
- import yaml
7
-
8
-
9
- SKILL_NAME = "ai-dlc-skill"
10
-
11
-
12
- @dataclass(frozen=True)
13
- class ComponentSpec:
14
- id: str
15
- kind: str
16
- owns: str
17
- fr_prefix: str
18
- tech: str
19
- label: str
20
- description: str
21
-
22
-
23
- @dataclass(frozen=True)
24
- class CrossCutSpec:
25
- id: str
26
- paths: tuple[str, ...]
27
- label: str
28
- description: str
29
-
30
-
31
- COMPONENTS: tuple[ComponentSpec, ...] = (
32
- ComponentSpec(
33
- id="native",
34
- kind="mobile",
35
- owns="apps/native",
36
- fr_prefix="NATIVE",
37
- tech="react-native | flutter",
38
- label="Mobile App",
39
- description="iOS/Android cross-platform (RN/Flutter)",
40
- ),
41
- ComponentSpec(
42
- id="desktop",
43
- kind="desktop",
44
- owns="apps/desktop",
45
- fr_prefix="DESKTOP",
46
- tech="electron | tauri",
47
- label="Desktop App",
48
- description="Cross-platform desktop (Electron/Tauri)",
49
- ),
50
- ComponentSpec(
51
- id="web",
52
- kind="frontend",
53
- owns="apps/web",
54
- fr_prefix="WEB",
55
- tech="react | vue | svelte",
56
- label="Web Frontend",
57
- description="Browser SPA/SSR (React/Vue/Svelte)",
58
- ),
59
- ComponentSpec(
60
- id="backend",
61
- kind="service",
62
- owns="apps/backend",
63
- fr_prefix="BE",
64
- tech="python | node | go",
65
- label="Backend Service",
66
- description="HTTP API/microservice (Python/Node/Go)",
67
- ),
68
- ComponentSpec(
69
- id="wxa",
70
- kind="mini-program",
71
- owns="apps/wxa",
72
- fr_prefix="WXA",
73
- tech="miniprogram",
74
- label="WeChat Mini-Program",
75
- description="WeChat ecosystem mini-program",
76
- ),
77
- ComponentSpec(
78
- id="mya",
79
- kind="mini-program",
80
- owns="apps/mya",
81
- fr_prefix="MYA",
82
- tech="miniprogram",
83
- label="Alipay Mini-Program",
84
- description="Alipay ecosystem mini-program",
85
- ),
86
- ComponentSpec(
87
- id="tta",
88
- kind="mini-program",
89
- owns="apps/tta",
90
- fr_prefix="TTA",
91
- tech="miniprogram",
92
- label="TikTok Mini-Program",
93
- description="TikTok/Douyin ecosystem mini-program",
94
- ),
95
- )
96
-
97
-
98
- COMPONENT_BY_ID: dict[str, ComponentSpec] = {c.id: c for c in COMPONENTS}
99
-
100
-
101
- CROSS_CUTTING: tuple[CrossCutSpec, ...] = (
102
- CrossCutSpec(
103
- id="contracts",
104
- paths=("aidlc/contracts/CHANGELOG.md",),
105
- label="Interface Contracts",
106
- description="API/event contracts and changelog",
107
- ),
108
- CrossCutSpec(
109
- id="shared",
110
- paths=("aidlc/packages/shared",),
111
- label="Shared Types",
112
- description="Cross-component shared types package",
113
- ),
114
- CrossCutSpec(
115
- id="openspec",
116
- paths=(),
117
- label="OpenSpec Changes",
118
- description="OpenSpec change proposals",
119
- ),
120
- CrossCutSpec(
121
- id="cross_stack_features",
122
- paths=(),
123
- label="Cross-Stack BDD",
124
- description="End-to-end BDD features across components",
125
- ),
126
- CrossCutSpec(
127
- id="cross_stack_tests",
128
- paths=("aidlc/tests/contract", "aidlc/tests/cross-stack"),
129
- label="Cross-Stack Tests",
130
- description="Contract tests and cross-stack integration tests",
131
- ),
132
- CrossCutSpec(
133
- id="provider",
134
- paths=(
135
- "aidlc/providers/tcb/provider.yaml",
136
- "aidlc/providers/tcb/deployment.yaml",
137
- "aidlc/providers/tcb/preview.yaml",
138
- ),
139
- label="Cloud Provider",
140
- description="TCB (Tencent CloudBase) provider config",
141
- ),
142
- CrossCutSpec(
143
- id="tools",
144
- paths=(
145
- "aidlc/tools/deploy_stack.py",
146
- "aidlc/tools/contract_diff.py",
147
- "aidlc/tools/generate_shared.py",
148
- ),
149
- label="Tooling Scripts",
150
- description="deploy_stack / contract_diff / generate_shared stubs",
151
- ),
152
- )
153
-
154
-
155
- CROSS_CUTTING_BY_ID: dict[str, CrossCutSpec] = {c.id: c for c in CROSS_CUTTING}
156
-
157
-
158
- TCB_PROVIDER_YAML = """provider:
159
- name: tcb
160
- display_name: Tencent CloudBase
161
- default: true
162
- version: 3.0.0
163
-
164
- storage:
165
- object_storage: cloudbase-storage
166
- document_db: docdb
167
- relational_db: mysql
168
- cdn: tencent-cloud-cdn
169
- """
170
-
171
- TCB_DEPLOYMENT_YAML = """environments:
172
- preview:
173
- orchestrator: deploy_stack
174
- strategy: unified
175
- ttl: 24h
176
- staging:
177
- orchestrator: deploy_stack
178
- production:
179
- orchestrator: deploy_stack
180
- pre_conditions:
181
- - human-approval-gate
182
- """
183
-
184
- TCB_PREVIEW_YAML = """preview:
185
- orchestrator: deploy_stack
186
- strategy: unified
187
- ttl: 24h
188
- auto_cleanup: true
189
- db_sandbox: true
190
- """
191
-
192
- TOOL_STUB = """#!/usr/bin/env python3
193
- \"\"\"Stub — auto-generated by cdh scaffold.\"\"\"
194
- import sys
195
-
196
-
197
- def main():
198
- print(f"{__file__}: not yet implemented")
199
- sys.exit(1)
200
-
201
-
202
- if __name__ == "__main__":
203
- main()
204
- """
205
-
206
- GITIGNORE_CONTENT = """# Python
207
- __pycache__/
208
- *.py[cod]
209
- *.egg-info/
210
- dist/
211
- build/
212
- .venv/
213
- venv/
214
- *.egg
215
-
216
- # Node
217
- node_modules/
218
- .next/
219
- dist/
220
- .nuxt/
221
- .cache/
222
-
223
- # IDE
224
- .vscode/
225
- .idea/
226
- *.swp
227
- *.swo
228
- *~
229
-
230
- # OS
231
- .DS_Store
232
- Thumbs.db
233
-
234
- # CDH
235
- .cdh/
236
- """
237
-
238
- CHANGELOG_MD = "# Changelog\n\n## [0.1.0] - Initial scaffold\n\n- Project created via cdh scaffold\n"
239
-
240
- AGENTS_MD_TEMPLATE = """# AGENTS.md — Project Constitution
241
-
242
- Hard rules every AI agent must follow when working in this repo.
243
- Read once per session; behavior is enforced by the agent runtime.
244
-
245
- ## Project Overview
246
-
247
- - **Name**: {project_name}
248
- - **Description**: {description}
249
- - **Type**: monorepo — AI-DLC multi-component stack
250
- {component_list}
251
-
252
- ## AI-DLC Core Cycle
253
-
254
- ```
255
- ① Understand (SDD+BDD) Intent → Spec Delta → BDD Feature Files
256
- ② Plan (SDD+TDD) Design Doc → Task DAG → Test Plan
257
- ③ Verify (BDD+TDD) Red → Green → Refactor per scenario
258
- ④ Deliver (SDD+Cloud) Stack Preview → e2e → Production + BVT
259
- ```
260
-
261
- Reference skill: `~/.cdh/skills/ai-dlc-skill/SKILL.md` (full AI-DLC methodology; installed by cdh platform bootstrap).
262
-
263
- ## Component Mapping
264
-
265
- Work is partitioned by component prefix. Place new code in the matching directory:
266
-
267
- | Prefix | Component | Directory |
268
- |--------|-----------|-----------|
269
- {component_table}
270
-
271
- > **Note**: FR namespaces are used in AI-DLC lifecycle only.
272
-
273
- ## Quality Gates
274
-
275
- Hard thresholds every agent must respect:
276
-
277
- | Gate | Threshold |
278
- |------|-----------|
279
- | Unit/integration coverage | >= 80% |
280
- | BDD scenarios pass | 100% |
281
- | Contract tests pass | 100% |
282
- | Cross-stack e2e pass | 100% |
283
- | Security vulns | 0 |
284
-
285
- ## File / Path Hygiene
286
-
287
- **Never read, write, or modify** any of these (they're local-only / secrets / build artifacts):
288
-
289
- - `.cdh/` — project-level runtime state (managed by CLI; never hand-edit)
290
- - `.opencode/`, `.claude/`, `.agents/` — tool configs (owned by user)
291
- - `.qwen/`, `.idea/` — IDE / tool caches
292
- - `dist/`, `*.egg-info/`, `__pycache__/`, `build/`, `.venv/`
293
- - `node_modules/`, `.next/`, `.nuxt/`
294
- - `.python-version`, `uv.lock` — Python toolchain pinning (user-managed)
295
- - `aidlc/contracts/CHANGELOG.md` — contract changelog (managed by CLI)
296
- - `aidlc/providers/` — provider config (managed by CLI)
297
-
298
- **Global state directories** (managed at runtime, do not hand-edit):
299
- - `~/.cdh/` — cdh platform global state (projects/, skills/, mcps/, state/, logs/, sessions/)
300
- - `~/.onecode/` — onecode engine private state (traces, memory, mcps, skills, config)
301
-
302
- ## Forbidden Actions
303
-
304
- - Commit secrets (API keys, tokens, passwords) — use env vars or vault
305
- - Force-push to `main` / `master`
306
- - Modify files outside the project root
307
- - Run `npm publish` / `pip upload` without explicit user approval
308
- - Hand-edit `.cdh/state.json`, `.cdh/todos.json`, `.cdh/last_session.json` — use CLI / slash commands
309
- - Delete tracked files outside `dist/`, `build/`, `__pycache__/` without confirmation
310
-
311
- ## Working Conventions
312
-
313
- This project follows the **AI-DLC (AI-Driven Lifecycle)** methodology shown above.
314
-
315
- - **Plan first**: Use task management (TodoCreate) for any non-trivial task (3+ steps)
316
- - **Route execution**:
317
- - Single-step (1 tool, 1 file) → direct tool call
318
- - Multi-step / multi-file / research → delegate to sub-agent
319
- - **Language**: Chinese for explanations to user, English for code / comments / commit messages
320
- - **Verification**: After non-trivial edits, run applicable lint/typecheck/test commands before declaring done
321
-
322
- ## Where to Find More
323
-
324
- - **AI-DLC methodology**: `~/.cdh/skills/ai-dlc-skill/SKILL.md` (load via Skill tool; installed by cdh bootstrap)
325
- - **Human-readable README**: `README.md`
326
- - **Architecture / practices**: `docs/` if present, or ask the user
327
- """
328
-
329
- REQUIREMENTS_MD = """# {project_name}
330
-
331
- ## Intent
332
-
333
- {description}
334
-
335
- ## Stack Topology
336
-
337
- Monorepo multi-component stack with the following components:
338
-
339
- | Component | FR Prefix | Default Language | Default UI Framework | Directory |
340
- |-----------|-----------|-----------------|---------------------|-----------|
341
- {component_table}
342
-
343
- ## Quality Gates
344
-
345
- | Gate | Threshold |
346
- |------|-----------|
347
- | Unit/integration coverage | >= 80% |
348
- | BDD scenarios pass | 100% |
349
- | Contract tests pass | 100% |
350
- | Cross-stack e2e pass | 100% |
351
- | Security vulns | 0 |
352
-
353
- Default cloud provider: TCB (Tencent CloudBase).
354
- """
355
-
356
-
357
- def _detect_dlc_skill(workspace_root: Path) -> bool:
358
- from cdh.cdh_skill_manager import CDH_PLATFORM_SKILLS_DIR
359
- return (CDH_PLATFORM_SKILLS_DIR / SKILL_NAME / "SKILL.md").exists()
360
-
361
-
362
- def _mkdir(path: Path) -> None:
363
- path.mkdir(parents=True, exist_ok=True)
364
-
365
-
366
- def _gitkeep(path: Path) -> None:
367
- keep = path / ".gitkeep"
368
- if not keep.exists():
369
- keep.write_text("", encoding="utf-8")
370
-
371
-
372
- def _write(path: Path, content: str) -> None:
373
- path.parent.mkdir(parents=True, exist_ok=True)
374
- path.write_text(content.lstrip("\n"), encoding="utf-8")
375
-
376
-
377
- def _build_agents_component_list(active: list[ComponentSpec]) -> str:
378
- if not active:
379
- return ""
380
- items = (f" - **{c.label}** (`{c.owns}`)" for c in active)
381
- return "- **Components**:\n" + "\n".join(items)
382
-
383
-
384
- def _build_agents_component_table(active: list[ComponentSpec]) -> str:
385
- rows = []
386
- for c in active:
387
- rows.append(f"| {c.fr_prefix:7s} | {c.label:14s} | {c.owns:20s} |")
388
- rows.append("| INT | Contracts, Shared | aidlc/contracts/, aidlc/packages/shared/ |")
389
- return "\n".join(rows)
390
-
391
-
392
- def _write_agents_and_claude_md(
393
- root: Path,
394
- project_name: str,
395
- description: str,
396
- active: list[ComponentSpec],
397
- ) -> None:
398
- content = AGENTS_MD_TEMPLATE.format(
399
- project_name=project_name,
400
- description=description or f"AI-DLC monorepo project: {project_name}",
401
- component_list=_build_agents_component_list(active),
402
- component_table=_build_agents_component_table(active),
403
- )
404
- _write(root / "AGENTS.md", content)
405
- _write(root / "CLAUDE.md", content)
406
-
407
-
408
- def _component_to_dict(c: ComponentSpec) -> dict:
409
- out = {
410
- "id": c.id,
411
- "kind": c.kind,
412
- "tech": c.tech,
413
- "owns": c.owns,
414
- "fr_prefix": c.fr_prefix,
415
- }
416
- return out
417
-
418
-
419
- def _build_project_yaml(
420
- active: list[ComponentSpec],
421
- cross_cutting_ids: list[str],
422
- name: str = "",
423
- description: str = "",
424
- ) -> dict:
425
- cross_cutting: dict = {"fr_prefix": "INT"}
426
- if "contracts" in cross_cutting_ids:
427
- cross_cutting["contracts"] = "aidlc/contracts/"
428
- if "shared" in cross_cutting_ids:
429
- cross_cutting["shared_types"] = "aidlc/packages/shared/"
430
- doc: dict = {
431
- "name": name,
432
- "description": description,
433
- "stack": {
434
- "topology": "monorepo",
435
- "components": [_component_to_dict(c) for c in active],
436
- "cross_cutting": cross_cutting,
437
- },
438
- }
439
- return doc
440
-
441
-
442
- def _build_component_table(active: list[ComponentSpec]) -> str:
443
- if not active:
444
- return "| (none) | - | - | - | - |"
445
- return "\n".join(
446
- f"| {c.id:8s} | {c.fr_prefix + '-FR-*':14s} | {'-':17s} | {'-':21s} | {c.owns:20s} |"
447
- for c in active
448
- )
449
-
450
-
451
- def _scaffold_component(c: ComponentSpec, root: Path) -> None:
452
- comp_dir = root / c.owns
453
- _mkdir(comp_dir / "src")
454
- _mkdir(comp_dir / "tests" / "unit")
455
- _mkdir(comp_dir / "tests" / "e2e")
456
- _mkdir(comp_dir / "features")
457
- _gitkeep(comp_dir / "src")
458
- _gitkeep(comp_dir / "tests" / "unit")
459
- _gitkeep(comp_dir / "tests" / "e2e")
460
- _gitkeep(comp_dir / "features")
461
- _gitkeep(comp_dir)
462
-
463
-
464
- def _scaffold_cross_cutting(cross_ids: list[str], root: Path) -> None:
465
- for cid in cross_ids:
466
- spec = CROSS_CUTTING_BY_ID.get(cid)
467
- if spec is None:
468
- continue
469
- for p in spec.paths:
470
- target = root / p
471
- if p.endswith((".yaml", ".py", ".md")):
472
- if p == "aidlc/contracts/CHANGELOG.md":
473
- _write(target, CHANGELOG_MD)
474
- elif p == "aidlc/providers/tcb/provider.yaml":
475
- _write(target, TCB_PROVIDER_YAML)
476
- elif p == "aidlc/providers/tcb/deployment.yaml":
477
- _write(target, TCB_DEPLOYMENT_YAML)
478
- elif p == "aidlc/providers/tcb/preview.yaml":
479
- _write(target, TCB_PREVIEW_YAML)
480
- elif p.startswith("aidlc/tools/") and p.endswith(".py"):
481
- _write(target, TOOL_STUB)
482
- target.chmod(0o755)
483
- else:
484
- _write(target, "")
485
- else:
486
- _mkdir(target)
487
- _gitkeep(target)
488
-
489
-
490
- def _write_project_yaml(
491
- root: Path,
492
- project_name: str,
493
- active: list[ComponentSpec],
494
- cross_cutting_ids: list[str],
495
- description: str,
496
- ) -> None:
497
- _write(
498
- root / "aidlc" / "project.yaml",
499
- yaml.dump(
500
- _build_project_yaml(active, cross_cutting_ids, name=project_name, description=description),
501
- default_flow_style=False,
502
- ),
503
- )
504
- _write(
505
- root / "aidlc" / "requirements.md",
506
- REQUIREMENTS_MD.format(
507
- project_name=project_name,
508
- description=description or f"AI-DLC monorepo project: {project_name}",
509
- component_table=_build_component_table(active),
510
- ),
511
- )
512
- _write(root / ".gitignore", GITIGNORE_CONTENT)
513
- _write(root / "aidlc" / "CHANGELOG.md", CHANGELOG_MD)
514
-
515
-
516
- def init_dlc_project(
517
- workspace_root: Path,
518
- project_name: str,
519
- description: str = "",
520
- ) -> bool:
521
- """Scaffold project metadata only (no apps/*, no cross-cutting dirs).
522
-
523
- Writes project.yaml (with empty components list), aidlc/requirements.md,
524
- .gitignore, and aidlc/CHANGELOG.md. The user is expected to add components
525
- and cross-cutting items later via add_component / add_cross_cutting.
526
-
527
- Returns True if scaffolding was performed.
528
-
529
- Raises RuntimeError if ai-dlc-skill is not available — the directory
530
- is left untouched in that case so callers don't end up with a
531
- half-initialized project (.cdh/ written but no aidlc/project.yaml).
532
- """
533
- if not _detect_dlc_skill(workspace_root):
534
- raise RuntimeError(
535
- "ai-dlc-skill is not available; install it before "
536
- "initializing a cdh project."
537
- )
538
-
539
- root = workspace_root.resolve()
540
- _write_project_yaml(
541
- root=root,
542
- project_name=project_name,
543
- active=[],
544
- cross_cutting_ids=[],
545
- description=description,
546
- )
547
- _write_agents_and_claude_md(root, project_name, description, [])
548
- return True
549
-
550
-
551
- def scaffold_dlc_project(
552
- workspace_root: Path,
553
- project_name: str,
554
- components: list[str],
555
- description: str = "",
556
- ) -> bool:
557
- """Scaffold a full ai-dlc-skill monorepo project structure.
558
-
559
- The user must explicitly select at least one application component.
560
- All cross-cutting items (contracts, shared types, openspec, etc.)
561
- are always created.
562
-
563
- Args:
564
- components: list of component ids (e.g. ["web", "backend"]).
565
- Must be non-empty.
566
-
567
- Returns True if scaffolding was performed, False if ai-dlc-skill
568
- is not available and the project was left untouched.
569
-
570
- Raises ValueError if components is empty or contains unknown ids.
571
- """
572
- if not components:
573
- raise ValueError(
574
- "At least one application component is required "
575
- "(e.g. 'web', 'backend', 'native')."
576
- )
577
-
578
- unknown = [c for c in components if c not in COMPONENT_BY_ID]
579
- if unknown:
580
- raise ValueError(
581
- f"Unknown component id(s): {', '.join(unknown)}. "
582
- f"Valid ids: {', '.join(COMPONENT_BY_ID)}."
583
- )
584
-
585
- if not _detect_dlc_skill(workspace_root):
586
- return False
587
-
588
- root = workspace_root.resolve()
589
- active = [COMPONENT_BY_ID[cid] for cid in components]
590
- all_cross_ids = [
591
- c.id for c in CROSS_CUTTING if c.id not in ("provider", "tools")
592
- ]
593
-
594
- _write_project_yaml(
595
- root=root,
596
- project_name=project_name,
597
- active=active,
598
- cross_cutting_ids=all_cross_ids,
599
- description=description,
600
- )
601
-
602
- for c in active:
603
- _scaffold_component(c, root)
604
-
605
- _scaffold_cross_cutting(all_cross_ids, root)
606
- _write_agents_and_claude_md(root, project_name, description, active)
607
-
608
- return True
609
-
610
-
611
- def _regenerate_agents_and_claude_md(root: Path) -> None:
612
- project_yaml = root / "aidlc" / "project.yaml"
613
- if not project_yaml.exists():
614
- return
615
- data = yaml.safe_load(project_yaml.read_text(encoding="utf-8")) or {}
616
- name = data.get("name", root.name)
617
- description = data.get("description", "")
618
- components = data.get("stack", {}).get("components", []) or []
619
- active = []
620
- for c in components:
621
- spec = COMPONENT_BY_ID.get(c.get("id", ""))
622
- if spec:
623
- active.append(spec)
624
- _write_agents_and_claude_md(root, name, description, active)
625
-
626
-
627
- def add_component(
628
- workspace_root: Path,
629
- component_id: str,
630
- ) -> bool:
631
- """Add a single application component to an existing project.
632
-
633
- Creates apps/<owns>/{src,tests/unit,tests/e2e,features} with
634
- .gitkeep files and updates aidlc/project.yaml's stack.components list.
635
-
636
- Returns True if the component was added, False if it was already
637
- present. Raises ValueError on unknown component id.
638
- """
639
- spec = COMPONENT_BY_ID.get(component_id)
640
- if spec is None:
641
- raise ValueError(
642
- f"Unknown component id: {component_id}. "
643
- f"Valid ids: {', '.join(COMPONENT_BY_ID)}."
644
- )
645
-
646
- root = workspace_root.resolve()
647
- project_yaml = root / "aidlc" / "project.yaml"
648
- if not project_yaml.exists():
649
- raise FileNotFoundError(
650
- f"aidlc/project.yaml not found at {root}. Run 'cdh project init' first."
651
- )
652
-
653
- data = yaml.safe_load(project_yaml.read_text(encoding="utf-8")) or {}
654
- components = data.get("stack", {}).get("components", []) or []
655
- if any(c.get("id") == component_id for c in components):
656
- return False
657
-
658
- _scaffold_component(spec, root)
659
-
660
- components.append(_component_to_dict(spec))
661
- data["stack"]["components"] = components
662
- project_yaml.write_text(
663
- yaml.dump(data, default_flow_style=False),
664
- encoding="utf-8",
665
- )
666
- _regenerate_agents_and_claude_md(root)
667
- return True
668
-
669
-
670
- def add_cross_cutting(
671
- workspace_root: Path,
672
- cross_id: str,
673
- ) -> bool:
674
- """Add a single cross-cutting item to an existing project.
675
-
676
- Creates the relevant directories/files and updates aidlc/project.yaml
677
- so that stack.cross_cutting references the new path.
678
-
679
- Returns True if the item was added, False if it was already present.
680
- Raises ValueError on unknown cross-cutting id.
681
- """
682
- spec = CROSS_CUTTING_BY_ID.get(cross_id)
683
- if spec is None:
684
- raise ValueError(
685
- f"Unknown cross-cutting id: {cross_id}. "
686
- f"Valid ids: {', '.join(CROSS_CUTTING_BY_ID)}."
687
- )
688
-
689
- root = workspace_root.resolve()
690
- project_yaml = root / "aidlc" / "project.yaml"
691
- if not project_yaml.exists():
692
- raise FileNotFoundError(
693
- f"aidlc/project.yaml not found at {root}. Run 'cdh project init' first."
694
- )
695
-
696
- cross_paths = [root / p for p in spec.paths]
697
- if all(p.exists() for p in cross_paths):
698
- return False
699
-
700
- _scaffold_cross_cutting([cross_id], root)
701
-
702
- data = yaml.safe_load(project_yaml.read_text(encoding="utf-8")) or {}
703
- cross_cutting = data.setdefault("stack", {}).setdefault("cross_cutting", {})
704
- if cross_id == "contracts":
705
- cross_cutting["contracts"] = "aidlc/contracts/"
706
- elif cross_id == "shared":
707
- cross_cutting["shared_types"] = "packages/shared/"
708
-
709
- project_yaml.write_text(
710
- yaml.dump(data, default_flow_style=False),
711
- encoding="utf-8",
712
- )
713
- _regenerate_agents_and_claude_md(root)
714
- return True
715
-
716
-
717
- __all__ = [
718
- "COMPONENTS",
719
- "COMPONENT_BY_ID",
720
- "CROSS_CUTTING",
721
- "CROSS_CUTTING_BY_ID",
722
- "ComponentSpec",
723
- "CrossCutSpec",
724
- "init_dlc_project",
725
- "scaffold_dlc_project",
726
- "add_component",
727
- "add_cross_cutting",
728
- ]