@seanmars/tospec 0.19.0-beta.8 → 0.20.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 (421) hide show
  1. package/CHANGELOG.md +60 -310
  2. package/README.md +69 -82
  3. package/assets/dashboard/app.js +11 -0
  4. package/assets/dashboard/style.css +7 -0
  5. package/dist/cli/index.d.ts.map +1 -1
  6. package/dist/cli/index.js +89 -106
  7. package/dist/cli/index.js.map +1 -1
  8. package/dist/commands/config.d.ts +9 -17
  9. package/dist/commands/config.d.ts.map +1 -1
  10. package/dist/commands/config.js +293 -145
  11. package/dist/commands/config.js.map +1 -1
  12. package/dist/commands/dashboard.d.ts +57 -99
  13. package/dist/commands/dashboard.d.ts.map +1 -1
  14. package/dist/commands/dashboard.js +190 -313
  15. package/dist/commands/dashboard.js.map +1 -1
  16. package/dist/commands/decision.d.ts +38 -27
  17. package/dist/commands/decision.d.ts.map +1 -1
  18. package/dist/commands/decision.js +296 -128
  19. package/dist/commands/decision.js.map +1 -1
  20. package/dist/commands/metrics.d.ts +28 -51
  21. package/dist/commands/metrics.d.ts.map +1 -1
  22. package/dist/commands/metrics.js +62 -93
  23. package/dist/commands/metrics.js.map +1 -1
  24. package/dist/commands/shared-output.d.ts +12 -27
  25. package/dist/commands/shared-output.d.ts.map +1 -1
  26. package/dist/commands/shared-output.js +22 -45
  27. package/dist/commands/shared-output.js.map +1 -1
  28. package/dist/commands/show.d.ts +4 -7
  29. package/dist/commands/show.d.ts.map +1 -1
  30. package/dist/commands/show.js +23 -11
  31. package/dist/commands/show.js.map +1 -1
  32. package/dist/commands/validate.d.ts +34 -58
  33. package/dist/commands/validate.d.ts.map +1 -1
  34. package/dist/commands/validate.js +225 -141
  35. package/dist/commands/validate.js.map +1 -1
  36. package/dist/commands/workflow/index.d.ts +1 -5
  37. package/dist/commands/workflow/index.d.ts.map +1 -1
  38. package/dist/commands/workflow/index.js +1 -5
  39. package/dist/commands/workflow/index.js.map +1 -1
  40. package/dist/commands/workflow/instructions.d.ts +14 -24
  41. package/dist/commands/workflow/instructions.d.ts.map +1 -1
  42. package/dist/commands/workflow/instructions.js +219 -128
  43. package/dist/commands/workflow/instructions.js.map +1 -1
  44. package/dist/commands/workflow/new-change.d.ts +2 -5
  45. package/dist/commands/workflow/new-change.d.ts.map +1 -1
  46. package/dist/commands/workflow/new-change.js +69 -32
  47. package/dist/commands/workflow/new-change.js.map +1 -1
  48. package/dist/commands/workflow/schemas.d.ts +1 -5
  49. package/dist/commands/workflow/schemas.d.ts.map +1 -1
  50. package/dist/commands/workflow/schemas.js +6 -17
  51. package/dist/commands/workflow/schemas.js.map +1 -1
  52. package/dist/commands/workflow/shared.d.ts +37 -42
  53. package/dist/commands/workflow/shared.d.ts.map +1 -1
  54. package/dist/commands/workflow/shared.js +23 -54
  55. package/dist/commands/workflow/shared.js.map +1 -1
  56. package/dist/commands/workflow/status.d.ts +7 -17
  57. package/dist/commands/workflow/status.d.ts.map +1 -1
  58. package/dist/commands/workflow/status.js +57 -72
  59. package/dist/commands/workflow/status.js.map +1 -1
  60. package/dist/commands/workflow/templates.d.ts +8 -8
  61. package/dist/commands/workflow/templates.d.ts.map +1 -1
  62. package/dist/commands/workflow/templates.js +32 -46
  63. package/dist/commands/workflow/templates.js.map +1 -1
  64. package/dist/core/archive.d.ts +22 -31
  65. package/dist/core/archive.d.ts.map +1 -1
  66. package/dist/core/archive.js +296 -283
  67. package/dist/core/archive.js.map +1 -1
  68. package/dist/core/artifact-graph/graph.d.ts +25 -42
  69. package/dist/core/artifact-graph/graph.d.ts.map +1 -1
  70. package/dist/core/artifact-graph/graph.js +45 -63
  71. package/dist/core/artifact-graph/graph.js.map +1 -1
  72. package/dist/core/artifact-graph/index.d.ts +1 -1
  73. package/dist/core/artifact-graph/index.d.ts.map +1 -1
  74. package/dist/core/artifact-graph/index.js +1 -1
  75. package/dist/core/artifact-graph/index.js.map +1 -1
  76. package/dist/core/artifact-graph/instruction-loader.d.ts +54 -120
  77. package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -1
  78. package/dist/core/artifact-graph/instruction-loader.js +129 -111
  79. package/dist/core/artifact-graph/instruction-loader.js.map +1 -1
  80. package/dist/core/artifact-graph/outputs.d.ts +9 -23
  81. package/dist/core/artifact-graph/outputs.d.ts.map +1 -1
  82. package/dist/core/artifact-graph/outputs.js +45 -38
  83. package/dist/core/artifact-graph/outputs.js.map +1 -1
  84. package/dist/core/artifact-graph/resolver.d.ts +36 -81
  85. package/dist/core/artifact-graph/resolver.d.ts.map +1 -1
  86. package/dist/core/artifact-graph/resolver.js +60 -101
  87. package/dist/core/artifact-graph/resolver.js.map +1 -1
  88. package/dist/core/artifact-graph/schema.d.ts +0 -6
  89. package/dist/core/artifact-graph/schema.d.ts.map +1 -1
  90. package/dist/core/artifact-graph/schema.js +7 -32
  91. package/dist/core/artifact-graph/schema.js.map +1 -1
  92. package/dist/core/artifact-graph/state.d.ts +1 -8
  93. package/dist/core/artifact-graph/state.d.ts.map +1 -1
  94. package/dist/core/artifact-graph/state.js +2 -17
  95. package/dist/core/artifact-graph/state.js.map +1 -1
  96. package/dist/core/artifact-graph/stub-detection.d.ts +6 -14
  97. package/dist/core/artifact-graph/stub-detection.d.ts.map +1 -1
  98. package/dist/core/artifact-graph/stub-detection.js +13 -16
  99. package/dist/core/artifact-graph/stub-detection.js.map +1 -1
  100. package/dist/core/artifact-graph/types.d.ts +4 -0
  101. package/dist/core/artifact-graph/types.d.ts.map +1 -1
  102. package/dist/core/artifact-graph/types.js +30 -10
  103. package/dist/core/artifact-graph/types.js.map +1 -1
  104. package/dist/core/available-tools.d.ts +3 -12
  105. package/dist/core/available-tools.d.ts.map +1 -1
  106. package/dist/core/available-tools.js +4 -13
  107. package/dist/core/available-tools.js.map +1 -1
  108. package/dist/core/change-metadata/schema.d.ts +1 -1
  109. package/dist/core/change-metadata/schema.d.ts.map +1 -1
  110. package/dist/core/change-metadata/schema.js +10 -7
  111. package/dist/core/change-metadata/schema.js.map +1 -1
  112. package/dist/core/change-presenter.d.ts +16 -27
  113. package/dist/core/change-presenter.d.ts.map +1 -1
  114. package/dist/core/change-presenter.js +53 -53
  115. package/dist/core/change-presenter.js.map +1 -1
  116. package/dist/core/change-status-policy.d.ts +4 -8
  117. package/dist/core/change-status-policy.d.ts.map +1 -1
  118. package/dist/core/change-status-policy.js +9 -17
  119. package/dist/core/change-status-policy.js.map +1 -1
  120. package/dist/core/codex-metrics.d.ts +25 -45
  121. package/dist/core/codex-metrics.d.ts.map +1 -1
  122. package/dist/core/codex-metrics.js +44 -88
  123. package/dist/core/codex-metrics.js.map +1 -1
  124. package/dist/core/codex-residue.d.ts +14 -15
  125. package/dist/core/codex-residue.d.ts.map +1 -1
  126. package/dist/core/codex-residue.js +18 -22
  127. package/dist/core/codex-residue.js.map +1 -1
  128. package/dist/core/command-generation/adapters/claude.d.ts +2 -9
  129. package/dist/core/command-generation/adapters/claude.d.ts.map +1 -1
  130. package/dist/core/command-generation/adapters/claude.js +2 -12
  131. package/dist/core/command-generation/adapters/claude.js.map +1 -1
  132. package/dist/core/command-generation/adapters/index.d.ts +1 -9
  133. package/dist/core/command-generation/adapters/index.d.ts.map +1 -1
  134. package/dist/core/command-generation/adapters/index.js +1 -9
  135. package/dist/core/command-generation/adapters/index.js.map +1 -1
  136. package/dist/core/command-generation/generator.d.ts +0 -17
  137. package/dist/core/command-generation/generator.d.ts.map +1 -1
  138. package/dist/core/command-generation/generator.js +0 -17
  139. package/dist/core/command-generation/generator.js.map +1 -1
  140. package/dist/core/command-generation/index.d.ts +2 -5
  141. package/dist/core/command-generation/index.d.ts.map +1 -1
  142. package/dist/core/command-generation/index.js +0 -9
  143. package/dist/core/command-generation/index.js.map +1 -1
  144. package/dist/core/command-generation/types.d.ts +10 -36
  145. package/dist/core/command-generation/types.d.ts.map +1 -1
  146. package/dist/core/command-generation/types.js +0 -6
  147. package/dist/core/command-generation/types.js.map +1 -1
  148. package/dist/core/command-generation/yaml.d.ts +3 -18
  149. package/dist/core/command-generation/yaml.d.ts.map +1 -1
  150. package/dist/core/command-generation/yaml.js +5 -23
  151. package/dist/core/command-generation/yaml.js.map +1 -1
  152. package/dist/core/config-prompts.d.ts +2 -4
  153. package/dist/core/config-prompts.d.ts.map +1 -1
  154. package/dist/core/config-prompts.js +2 -7
  155. package/dist/core/config-prompts.js.map +1 -1
  156. package/dist/core/config-schema.d.ts +7 -41
  157. package/dist/core/config-schema.d.ts.map +1 -1
  158. package/dist/core/config-schema.js +35 -74
  159. package/dist/core/config-schema.js.map +1 -1
  160. package/dist/core/config.d.ts +25 -49
  161. package/dist/core/config.d.ts.map +1 -1
  162. package/dist/core/config.js +22 -45
  163. package/dist/core/config.js.map +1 -1
  164. package/dist/core/dashboard-activity.d.ts +7 -9
  165. package/dist/core/dashboard-activity.d.ts.map +1 -1
  166. package/dist/core/dashboard-activity.js +26 -24
  167. package/dist/core/dashboard-activity.js.map +1 -1
  168. package/dist/core/dashboard-data.d.ts +35 -22
  169. package/dist/core/dashboard-data.d.ts.map +1 -1
  170. package/dist/core/dashboard-data.js +57 -72
  171. package/dist/core/dashboard-data.js.map +1 -1
  172. package/dist/core/global-config.d.ts +24 -53
  173. package/dist/core/global-config.d.ts.map +1 -1
  174. package/dist/core/global-config.js +38 -67
  175. package/dist/core/global-config.js.map +1 -1
  176. package/dist/core/init.d.ts +12 -28
  177. package/dist/core/init.d.ts.map +1 -1
  178. package/dist/core/init.js +90 -168
  179. package/dist/core/init.js.map +1 -1
  180. package/dist/core/list.d.ts.map +1 -1
  181. package/dist/core/list.js +80 -38
  182. package/dist/core/list.js.map +1 -1
  183. package/dist/core/local-server.d.ts +41 -83
  184. package/dist/core/local-server.d.ts.map +1 -1
  185. package/dist/core/local-server.js +53 -98
  186. package/dist/core/local-server.js.map +1 -1
  187. package/dist/core/markdown-render.d.ts +15 -23
  188. package/dist/core/markdown-render.d.ts.map +1 -1
  189. package/dist/core/markdown-render.js +25 -34
  190. package/dist/core/markdown-render.js.map +1 -1
  191. package/dist/core/migrate.d.ts +19 -16
  192. package/dist/core/migrate.d.ts.map +1 -1
  193. package/dist/core/migrate.js +151 -135
  194. package/dist/core/migrate.js.map +1 -1
  195. package/dist/core/parsers/change-parser.d.ts +7 -10
  196. package/dist/core/parsers/change-parser.d.ts.map +1 -1
  197. package/dist/core/parsers/change-parser.js +48 -56
  198. package/dist/core/parsers/change-parser.js.map +1 -1
  199. package/dist/core/parsers/markdown-parser.d.ts +8 -9
  200. package/dist/core/parsers/markdown-parser.d.ts.map +1 -1
  201. package/dist/core/parsers/markdown-parser.js +23 -30
  202. package/dist/core/parsers/markdown-parser.js.map +1 -1
  203. package/dist/core/parsers/requirement-blocks.d.ts +43 -15
  204. package/dist/core/parsers/requirement-blocks.d.ts.map +1 -1
  205. package/dist/core/parsers/requirement-blocks.js +142 -70
  206. package/dist/core/parsers/requirement-blocks.js.map +1 -1
  207. package/dist/core/parsers/requirement-text.d.ts +73 -79
  208. package/dist/core/parsers/requirement-text.d.ts.map +1 -1
  209. package/dist/core/parsers/requirement-text.js +137 -79
  210. package/dist/core/parsers/requirement-text.js.map +1 -1
  211. package/dist/core/parsers/spec-structure.d.ts.map +1 -1
  212. package/dist/core/parsers/spec-structure.js +10 -6
  213. package/dist/core/parsers/spec-structure.js.map +1 -1
  214. package/dist/core/profiles.d.ts +3 -10
  215. package/dist/core/profiles.d.ts.map +1 -1
  216. package/dist/core/profiles.js +5 -12
  217. package/dist/core/profiles.js.map +1 -1
  218. package/dist/core/project-config.d.ts +43 -44
  219. package/dist/core/project-config.d.ts.map +1 -1
  220. package/dist/core/project-config.js +107 -82
  221. package/dist/core/project-config.js.map +1 -1
  222. package/dist/core/project-layout.d.ts +9 -17
  223. package/dist/core/project-layout.d.ts.map +1 -1
  224. package/dist/core/project-layout.js +16 -26
  225. package/dist/core/project-layout.js.map +1 -1
  226. package/dist/core/root-selection.d.ts +8 -14
  227. package/dist/core/root-selection.d.ts.map +1 -1
  228. package/dist/core/root-selection.js +3 -6
  229. package/dist/core/root-selection.js.map +1 -1
  230. package/dist/core/rules.d.ts.map +1 -1
  231. package/dist/core/rules.js +2 -3
  232. package/dist/core/rules.js.map +1 -1
  233. package/dist/core/schema-names.d.ts +16 -0
  234. package/dist/core/schema-names.d.ts.map +1 -0
  235. package/dist/core/schema-names.js +16 -0
  236. package/dist/core/schema-names.js.map +1 -0
  237. package/dist/core/schemas/base.schema.d.ts.map +1 -1
  238. package/dist/core/schemas/base.schema.js +6 -12
  239. package/dist/core/schemas/base.schema.js.map +1 -1
  240. package/dist/core/schemas/change.schema.d.ts +8 -0
  241. package/dist/core/schemas/change.schema.d.ts.map +1 -1
  242. package/dist/core/schemas/change.schema.js +41 -10
  243. package/dist/core/schemas/change.schema.js.map +1 -1
  244. package/dist/core/shared/index.d.ts +2 -7
  245. package/dist/core/shared/index.d.ts.map +1 -1
  246. package/dist/core/shared/index.js +2 -7
  247. package/dist/core/shared/index.js.map +1 -1
  248. package/dist/core/shared/rules-generation.d.ts +5 -15
  249. package/dist/core/shared/rules-generation.d.ts.map +1 -1
  250. package/dist/core/shared/rules-generation.js +33 -37
  251. package/dist/core/shared/rules-generation.js.map +1 -1
  252. package/dist/core/shared/skill-generation.d.ts +28 -43
  253. package/dist/core/shared/skill-generation.d.ts.map +1 -1
  254. package/dist/core/shared/skill-generation.js +82 -51
  255. package/dist/core/shared/skill-generation.js.map +1 -1
  256. package/dist/core/shared/tool-detection.d.ts +35 -76
  257. package/dist/core/shared/tool-detection.d.ts.map +1 -1
  258. package/dist/core/shared/tool-detection.js +73 -93
  259. package/dist/core/shared/tool-detection.js.map +1 -1
  260. package/dist/core/skill-metrics.d.ts +36 -63
  261. package/dist/core/skill-metrics.d.ts.map +1 -1
  262. package/dist/core/skill-metrics.js +34 -73
  263. package/dist/core/skill-metrics.js.map +1 -1
  264. package/dist/core/spec-presenter.d.ts.map +1 -1
  265. package/dist/core/spec-presenter.js +5 -10
  266. package/dist/core/spec-presenter.js.map +1 -1
  267. package/dist/core/specs-apply.d.ts +16 -31
  268. package/dist/core/specs-apply.d.ts.map +1 -1
  269. package/dist/core/specs-apply.js +146 -195
  270. package/dist/core/specs-apply.js.map +1 -1
  271. package/dist/core/templates/fragments/interview.d.ts +2 -6
  272. package/dist/core/templates/fragments/interview.d.ts.map +1 -1
  273. package/dist/core/templates/fragments/interview.js +2 -6
  274. package/dist/core/templates/fragments/interview.js.map +1 -1
  275. package/dist/core/templates/fragments/next-step.d.ts +4 -8
  276. package/dist/core/templates/fragments/next-step.d.ts.map +1 -1
  277. package/dist/core/templates/fragments/next-step.js +4 -8
  278. package/dist/core/templates/fragments/next-step.js.map +1 -1
  279. package/dist/core/templates/fragments/validate.d.ts +13 -0
  280. package/dist/core/templates/fragments/validate.d.ts.map +1 -0
  281. package/dist/core/templates/fragments/validate.js +13 -0
  282. package/dist/core/templates/fragments/validate.js.map +1 -0
  283. package/dist/core/templates/fragments/verify.d.ts +9 -12
  284. package/dist/core/templates/fragments/verify.d.ts.map +1 -1
  285. package/dist/core/templates/fragments/verify.js +9 -12
  286. package/dist/core/templates/fragments/verify.js.map +1 -1
  287. package/dist/core/templates/index.d.ts +0 -6
  288. package/dist/core/templates/index.d.ts.map +1 -1
  289. package/dist/core/templates/index.js +0 -7
  290. package/dist/core/templates/index.js.map +1 -1
  291. package/dist/core/templates/skill-templates.d.ts +1 -5
  292. package/dist/core/templates/skill-templates.d.ts.map +1 -1
  293. package/dist/core/templates/skill-templates.js +0 -5
  294. package/dist/core/templates/skill-templates.js.map +1 -1
  295. package/dist/core/templates/types.d.ts +3 -7
  296. package/dist/core/templates/types.d.ts.map +1 -1
  297. package/dist/core/templates/types.js +0 -3
  298. package/dist/core/templates/types.js.map +1 -1
  299. package/dist/core/templates/workflows/apply.d.ts +3 -9
  300. package/dist/core/templates/workflows/apply.d.ts.map +1 -1
  301. package/dist/core/templates/workflows/apply.js +11 -13
  302. package/dist/core/templates/workflows/apply.js.map +1 -1
  303. package/dist/core/templates/workflows/archive.d.ts +0 -6
  304. package/dist/core/templates/workflows/archive.d.ts.map +1 -1
  305. package/dist/core/templates/workflows/archive.js +16 -5
  306. package/dist/core/templates/workflows/archive.js.map +1 -1
  307. package/dist/core/templates/workflows/decision.js +3 -3
  308. package/dist/core/templates/workflows/decision.js.map +1 -1
  309. package/dist/core/templates/workflows/explore.js +1 -1
  310. package/dist/core/templates/workflows/grill.d.ts.map +1 -1
  311. package/dist/core/templates/workflows/grill.js +0 -2
  312. package/dist/core/templates/workflows/grill.js.map +1 -1
  313. package/dist/core/templates/workflows/issue.d.ts +0 -6
  314. package/dist/core/templates/workflows/issue.d.ts.map +1 -1
  315. package/dist/core/templates/workflows/issue.js +3 -2
  316. package/dist/core/templates/workflows/issue.js.map +1 -1
  317. package/dist/core/templates/workflows/propose.d.ts +0 -6
  318. package/dist/core/templates/workflows/propose.d.ts.map +1 -1
  319. package/dist/core/templates/workflows/propose.js +2 -2
  320. package/dist/core/templates/workflows/propose.js.map +1 -1
  321. package/dist/core/templates/workflows/sync.d.ts +2 -8
  322. package/dist/core/templates/workflows/sync.d.ts.map +1 -1
  323. package/dist/core/templates/workflows/sync.js +4 -3
  324. package/dist/core/templates/workflows/sync.js.map +1 -1
  325. package/dist/core/templates/workflows/update.d.ts +0 -6
  326. package/dist/core/templates/workflows/update.d.ts.map +1 -1
  327. package/dist/core/templates/workflows/update.js +9 -2
  328. package/dist/core/templates/workflows/update.js.map +1 -1
  329. package/dist/core/update.d.ts +10 -36
  330. package/dist/core/update.d.ts.map +1 -1
  331. package/dist/core/update.js +59 -126
  332. package/dist/core/update.js.map +1 -1
  333. package/dist/core/user-state-migration.d.ts +13 -15
  334. package/dist/core/user-state-migration.d.ts.map +1 -1
  335. package/dist/core/user-state-migration.js +16 -20
  336. package/dist/core/user-state-migration.js.map +1 -1
  337. package/dist/core/validation/constants.d.ts +4 -10
  338. package/dist/core/validation/constants.d.ts.map +1 -1
  339. package/dist/core/validation/constants.js +25 -25
  340. package/dist/core/validation/constants.js.map +1 -1
  341. package/dist/core/validation/prose-length.d.ts +15 -0
  342. package/dist/core/validation/prose-length.d.ts.map +1 -0
  343. package/dist/core/validation/prose-length.js +29 -0
  344. package/dist/core/validation/prose-length.js.map +1 -0
  345. package/dist/core/validation/purpose-placeholder.d.ts +9 -16
  346. package/dist/core/validation/purpose-placeholder.d.ts.map +1 -1
  347. package/dist/core/validation/purpose-placeholder.js +30 -44
  348. package/dist/core/validation/purpose-placeholder.js.map +1 -1
  349. package/dist/core/validation/section-validator.d.ts +4 -4
  350. package/dist/core/validation/section-validator.d.ts.map +1 -1
  351. package/dist/core/validation/section-validator.js +30 -12
  352. package/dist/core/validation/section-validator.js.map +1 -1
  353. package/dist/core/validation/task-numbering.d.ts +6 -3
  354. package/dist/core/validation/task-numbering.d.ts.map +1 -1
  355. package/dist/core/validation/task-numbering.js +23 -11
  356. package/dist/core/validation/task-numbering.js.map +1 -1
  357. package/dist/core/validation/types.d.ts +18 -0
  358. package/dist/core/validation/types.d.ts.map +1 -1
  359. package/dist/core/validation/types.js +12 -1
  360. package/dist/core/validation/types.js.map +1 -1
  361. package/dist/core/validation/validator.d.ts +42 -68
  362. package/dist/core/validation/validator.d.ts.map +1 -1
  363. package/dist/core/validation/validator.js +468 -285
  364. package/dist/core/validation/validator.js.map +1 -1
  365. package/dist/prompts/searchable-multi-select.d.ts +3 -8
  366. package/dist/prompts/searchable-multi-select.d.ts.map +1 -1
  367. package/dist/prompts/searchable-multi-select.js +16 -39
  368. package/dist/prompts/searchable-multi-select.js.map +1 -1
  369. package/dist/utils/change-metadata.d.ts +11 -50
  370. package/dist/utils/change-metadata.d.ts.map +1 -1
  371. package/dist/utils/change-metadata.js +48 -67
  372. package/dist/utils/change-metadata.js.map +1 -1
  373. package/dist/utils/change-utils.d.ts +24 -76
  374. package/dist/utils/change-utils.d.ts.map +1 -1
  375. package/dist/utils/change-utils.js +95 -142
  376. package/dist/utils/change-utils.js.map +1 -1
  377. package/dist/utils/file-lock.d.ts +39 -0
  378. package/dist/utils/file-lock.d.ts.map +1 -0
  379. package/dist/utils/file-lock.js +149 -0
  380. package/dist/utils/file-lock.js.map +1 -0
  381. package/dist/utils/file-system.d.ts +12 -32
  382. package/dist/utils/file-system.d.ts.map +1 -1
  383. package/dist/utils/file-system.js +16 -40
  384. package/dist/utils/file-system.js.map +1 -1
  385. package/dist/utils/frontmatter.d.ts +7 -11
  386. package/dist/utils/frontmatter.d.ts.map +1 -1
  387. package/dist/utils/frontmatter.js +11 -11
  388. package/dist/utils/frontmatter.js.map +1 -1
  389. package/dist/utils/interactive.d.ts +4 -9
  390. package/dist/utils/interactive.d.ts.map +1 -1
  391. package/dist/utils/interactive.js +2 -4
  392. package/dist/utils/interactive.js.map +1 -1
  393. package/dist/utils/item-discovery.d.ts +10 -20
  394. package/dist/utils/item-discovery.d.ts.map +1 -1
  395. package/dist/utils/item-discovery.js +31 -55
  396. package/dist/utils/item-discovery.js.map +1 -1
  397. package/dist/utils/link.d.ts +9 -18
  398. package/dist/utils/link.d.ts.map +1 -1
  399. package/dist/utils/link.js +9 -18
  400. package/dist/utils/link.js.map +1 -1
  401. package/dist/utils/requirement-diff.d.ts +13 -23
  402. package/dist/utils/requirement-diff.d.ts.map +1 -1
  403. package/dist/utils/requirement-diff.js +13 -23
  404. package/dist/utils/requirement-diff.js.map +1 -1
  405. package/dist/utils/spec-files.d.ts +7 -20
  406. package/dist/utils/spec-files.d.ts.map +1 -1
  407. package/dist/utils/spec-files.js +26 -51
  408. package/dist/utils/spec-files.js.map +1 -1
  409. package/dist/utils/task-progress.d.ts +11 -9
  410. package/dist/utils/task-progress.d.ts.map +1 -1
  411. package/dist/utils/task-progress.js +53 -32
  412. package/dist/utils/task-progress.js.map +1 -1
  413. package/dist/utils/timestamp.d.ts +5 -8
  414. package/dist/utils/timestamp.d.ts.map +1 -1
  415. package/dist/utils/timestamp.js +5 -8
  416. package/dist/utils/timestamp.js.map +1 -1
  417. package/package.json +2 -3
  418. package/schemas/issue/schema.yaml +8 -1
  419. package/schemas/issue/templates/spec.md +20 -3
  420. package/schemas/sdd/schema.yaml +20 -1
  421. package/schemas/sdd/templates/spec.md +20 -3
@@ -1,8 +1,5 @@
1
1
  import { z } from 'zod';
2
- /**
3
- * Zod schema for global Tospec configuration.
4
- * Uses passthrough() to preserve unknown fields for forward compatibility.
5
- */
2
+ /** passthrough() preserves unknown fields, for forward compatibility. */
6
3
  export const GlobalConfigSchema = z
7
4
  .object({
8
5
  profile: z
@@ -14,9 +11,6 @@ export const GlobalConfigSchema = z
14
11
  .optional(),
15
12
  })
16
13
  .passthrough();
17
- /**
18
- * Default configuration values.
19
- */
20
14
  export const DEFAULT_CONFIG = {
21
15
  profile: 'core',
22
16
  };
@@ -31,16 +25,12 @@ function hasUnsafeSegment(keys) {
31
25
  }
32
26
  /**
33
27
  * True when a dot-notation key path contains a prototype-reaching segment.
34
- * Callers that bypass key validation (e.g. --allow-unknown) still must not
35
- * bypass this.
28
+ * `--allow-unknown` relaxes key validation, never this.
36
29
  */
37
30
  export function hasUnsafeKeySegment(path) {
38
31
  return hasUnsafeSegment(path.split('.'));
39
32
  }
40
- /**
41
- * Validate a config key path for CLI set operations.
42
- * Unknown top-level keys are rejected unless explicitly allowed by the caller.
43
- */
33
+ /** Unknown top-level keys are rejected unless the caller allows them. */
44
34
  export function validateConfigKeyPath(path) {
45
35
  const rawKeys = path.split('.');
46
36
  if (rawKeys.length === 0 || rawKeys.some((key) => key.trim() === '')) {
@@ -59,13 +49,7 @@ export function validateConfigKeyPath(path) {
59
49
  }
60
50
  return { valid: true };
61
51
  }
62
- /**
63
- * Get a nested value from an object using dot notation.
64
- *
65
- * @param obj - The object to access
66
- * @param path - Dot-separated path (e.g., "featureFlags.someFlag")
67
- * @returns The value at the path, or undefined if not found
68
- */
52
+ /** Reads `obj` at a dot-separated path, e.g. "featureFlags.someFlag". */
69
53
  export function getNestedValue(obj, path) {
70
54
  const keys = path.split('.');
71
55
  if (hasUnsafeSegment(keys)) {
@@ -83,19 +67,12 @@ export function getNestedValue(obj, path) {
83
67
  }
84
68
  return current;
85
69
  }
86
- /**
87
- * Set a nested value in an object using dot notation.
88
- * Creates intermediate objects as needed.
89
- *
90
- * @param obj - The object to modify (mutated in place)
91
- * @param path - Dot-separated path (e.g., "featureFlags.someFlag")
92
- * @param value - The value to set
93
- */
70
+ /** Writes `obj` at a dot-separated path, creating intermediate objects. */
94
71
  export function setNestedValue(obj, path, value) {
95
72
  const keys = path.split('.');
96
- // Compared literally rather than through a helper, so the guard is plain to a
97
- // reader and to static analysis. Checked for the whole path before anything is
98
- // written, so a rejected key never leaves half-created objects behind.
73
+ // Compared literally rather than through a helper, so the guard is plain to
74
+ // static analysis. Checked for the whole path before anything is written, so
75
+ // a rejected key leaves no half-created objects.
99
76
  for (const key of keys) {
100
77
  if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
101
78
  return;
@@ -112,13 +89,7 @@ export function setNestedValue(obj, path, value) {
112
89
  const lastKey = keys[keys.length - 1];
113
90
  current[lastKey] = value;
114
91
  }
115
- /**
116
- * Delete a nested value from an object using dot notation.
117
- *
118
- * @param obj - The object to modify (mutated in place)
119
- * @param path - Dot-separated path (e.g., "featureFlags.someFlag")
120
- * @returns true if the key existed and was deleted, false otherwise
121
- */
92
+ /** Deletes `obj`'s value at a dot-separated path; false when it was absent. */
122
93
  export function deleteNestedValue(obj, path) {
123
94
  const keys = path.split('.');
124
95
  for (const key of keys) {
@@ -127,38 +98,37 @@ export function deleteNestedValue(obj, path) {
127
98
  }
128
99
  }
129
100
  let current = obj;
101
+ // Every container on the way down, so emptied parents can be pruned after
102
+ // the leaf goes: `unset foo.bar` used to leave `foo: {}` behind, a key
103
+ // `config list` then showed as if the user had set it.
104
+ const trail = [];
130
105
  for (let i = 0; i < keys.length - 1; i++) {
131
106
  const key = keys[i];
132
107
  if (current[key] === undefined || current[key] === null || typeof current[key] !== 'object') {
133
108
  return false;
134
109
  }
110
+ trail.push({ parent: current, key });
135
111
  current = current[key];
136
112
  }
137
113
  const lastKey = keys[keys.length - 1];
138
- if (lastKey in current) {
139
- delete current[lastKey];
140
- return true;
114
+ if (!(lastKey in current)) {
115
+ return false;
116
+ }
117
+ delete current[lastKey];
118
+ for (let i = trail.length - 1; i >= 0; i--) {
119
+ const { parent, key } = trail[i];
120
+ const container = parent[key];
121
+ if (Object.keys(container).length > 0)
122
+ break;
123
+ delete parent[key];
141
124
  }
142
- return false;
125
+ return true;
143
126
  }
144
127
  /**
145
- * Coerce a string value to its appropriate type.
146
- * - "true" / "false" -> boolean
147
- * - Numeric strings -> number
148
- * - JSON arrays/objects -> parsed containers
149
- * - Everything else -> string
150
- *
151
- * @param value - The string value to coerce
152
- * @param forceString - If true, always return the value as a string
153
- * @returns The coerced value
154
- */
155
- /**
156
- * Config keys whose value is a list.
157
- *
158
- * Splitting on commas cannot be decided from the value alone: a string key such
159
- * as `context` may legitimately contain commas, and turning that into an array
160
- * would corrupt it. So the decision is keyed on the field, from the same schema
161
- * that validates the result.
128
+ * Config keys whose value is a list. Splitting on commas cannot be decided from
129
+ * the value alone — a string key such as `context` may legitimately contain
130
+ * them — so the decision is keyed on the field, read from the same schema that
131
+ * validates the result.
162
132
  */
163
133
  const ARRAY_VALUED_KEYS = new Set(Object.entries(GlobalConfigSchema.shape)
164
134
  .filter(([, field]) => {
@@ -167,18 +137,18 @@ const ARRAY_VALUED_KEYS = new Set(Object.entries(GlobalConfigSchema.shape)
167
137
  return inner instanceof z.ZodArray;
168
138
  })
169
139
  .map(([name]) => name));
140
+ /** Reads a CLI string as a boolean, number, JSON container, list, or string. */
170
141
  export function coerceValue(value, forceString = false, key) {
171
142
  if (forceString) {
172
143
  return value;
173
144
  }
174
- // Boolean coercion
175
145
  if (value === 'true') {
176
146
  return true;
177
147
  }
178
148
  if (value === 'false') {
179
149
  return false;
180
150
  }
181
- // Number coercion - must be a valid finite number
151
+ // Finite numbers only; `''`, `'NaN'` and `'Infinity'` stay strings.
182
152
  const num = Number(value);
183
153
  if (!isNaN(num) && isFinite(num) && value.trim() !== '') {
184
154
  return num;
@@ -187,11 +157,9 @@ export function coerceValue(value, forceString = false, key) {
187
157
  if (jsonContainer !== undefined) {
188
158
  return jsonContainer;
189
159
  }
190
- // A comma-separated list for a list-valued key. `--tools a,b,c` already reads
191
- // this way, so requiring a JSON array here made the one syntax the CLI teaches
192
- // elsewhere fail with a type error that named neither the key nor the
193
- // accepted form. JSON is tried first (above), so an explicit array literal
194
- // still wins and `--string` still opts out entirely.
160
+ // `--tools a,b,c` already reads this way, so requiring a JSON array would make
161
+ // the syntax the CLI teaches elsewhere fail with a type error. JSON is tried
162
+ // first, so an explicit array literal still wins and `--string` opts out.
195
163
  if (key !== undefined && ARRAY_VALUED_KEYS.has(key)) {
196
164
  return value
197
165
  .split(',')
@@ -221,12 +189,6 @@ function parseJsonContainer(value) {
221
189
  }
222
190
  return undefined;
223
191
  }
224
- /**
225
- * Validate a configuration object against the schema.
226
- *
227
- * @param config - The configuration to validate
228
- * @returns Validation result with success status and optional error message
229
- */
230
192
  export function validateConfig(config) {
231
193
  try {
232
194
  GlobalConfigSchema.parse(config);
@@ -234,8 +196,7 @@ export function validateConfig(config) {
234
196
  }
235
197
  catch (error) {
236
198
  if (error instanceof z.ZodError) {
237
- const zodError = error;
238
- const messages = zodError.issues.map((e) => `${e.path.join('.')}: ${e.message}`);
199
+ const messages = error.issues.map((e) => `${e.path.join('.')}: ${e.message}`);
239
200
  return { success: false, error: messages.join('; ') };
240
201
  }
241
202
  return { success: false, error: 'Unknown validation error' };
@@ -1 +1 @@
1
- {"version":3,"file":"config-schema.js","sourceRoot":"","sources":["../../src/core/config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,OAAO,EAAE,CAAC;SACP,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;SACxB,Q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,OAAO,MAAiC,CAAC;QAC3C,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAe;IAC5C,IAAI,CAAC;QACH,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;YAChC,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YAC9E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACxD,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC;IAC/D,CAAC;AACH,CAAC"}
@@ -5,35 +5,22 @@ export declare const TOSPEC_DIR_NAME = "tospec";
5
5
  */
6
6
  export declare const TOOL_RULES_SUBDIR: readonly ['rules', 'tospec'];
7
7
  /**
8
- * The workflow rule document, written for every configured tool by init, update
9
- * and rules, and removed by none of them.
10
- *
11
- * Shared rather than spelled out at each use because it is two things at once:
12
- * the write target for rules-generation, and the durable proof that tospec
13
- * currently manages a tool dir (`isToolInstalled`). Specifically this file and
14
- * not the `rules/tospec/` directory: that directory also holds `decision.md`,
15
- * which an older tospec wrote from init only — its presence says tospec touched
16
- * the dir once, not that it manages it now. The two readings only agree while
17
- * both sides read the name from here.
8
+ * The workflow rule document: both the write target for rules-generation and the
9
+ * proof that tospec currently manages a tool dir (`isToolInstalled`). This file,
10
+ * not the `rules/tospec/` directory, whose other contents only prove tospec
11
+ * touched the dir once.
18
12
  */
19
13
  export declare const WORKFLOW_RULE_FILENAME = "single-source-of-truth.md";
20
14
  /**
21
- * The same document under its previous, misspelled name (`sourc`).
22
- *
23
- * Kept so init/update/rules can retire a copy an older tospec wrote instead of
24
- * leaving it beside the corrected one, where two rule files with the same body
25
- * would both be loaded. Detection accepts it too, so a project that has not been
26
- * updated yet still reads as installed.
15
+ * The same document under its previous, misspelled name. Kept so init/update can
16
+ * retire an older copy instead of loading two rule files with the same body;
17
+ * detection accepts it, so a not-yet-updated project still reads as installed.
27
18
  */
28
19
  export declare const LEGACY_WORKFLOW_RULE_FILENAME = "single-sourc-of-truth.md";
29
20
  /**
30
- * The decision rule document, written beside the workflow rule for every
31
- * configured tool.
32
- *
33
- * Deliberately not usable as proof that tospec manages a tool dir: an older
34
- * tospec wrote this file from init only, so a project can hold an untouched copy
35
- * left by a version that no longer maintains it. `isToolInstalled` reads
36
- * WORKFLOW_RULE_FILENAME for that reason.
21
+ * Written beside the workflow rule, but not proof that tospec manages a tool
22
+ * dir: an older tospec wrote it from init only, so a project can hold an
23
+ * untouched copy. `isToolInstalled` reads WORKFLOW_RULE_FILENAME.
37
24
  */
38
25
  export declare const DECISION_RULE_FILENAME = "decision.md";
39
26
  export interface TospecConfig {
@@ -47,36 +34,27 @@ export interface AIToolOption {
47
34
  skillsDir?: string;
48
35
  detectionPaths?: string[];
49
36
  /**
50
- * Tool ids this target is built out of. A dependent's skill dirs are links
51
- * into its dependency's, so selecting the dependent alone would name links
52
- * with no target. Selection expands along this edge instead of the menu
53
- * hiding the relationship: every row stays a real, clearable choice, and the
54
- * reason a row arrives uninvited is something the user can see.
37
+ * Tool ids this target is built out of. Selection expands along this edge
38
+ * instead of the menu hiding the relationship, so every row stays a real,
39
+ * clearable choice and the reason a row arrives uninvited is visible.
55
40
  */
56
41
  requires?: string[];
57
42
  /**
58
- * Used when nothing was selected and nothing was detected. This is not
59
- * "always written" — clearing every checkbox writes nothing. It only decides
60
- * what a non-interactive run with no information at all falls back to, where
61
- * the alternative is producing nothing on first setup.
43
+ * Used when nothing was selected and nothing was detected. Not "always
44
+ * written": clearing every checkbox writes nothing. This only decides what a
45
+ * non-interactive run with no information falls back to.
62
46
  */
63
47
  fallback?: boolean;
64
48
  }
65
49
  export declare const AI_TOOLS: AIToolOption[];
66
50
  /**
67
- * Expands a selection along `requires`, dependencies first.
68
- *
69
- * Order is part of the contract, not a side effect: the canonical directory has
70
- * to exist before anything links into it, and callers process the returned list
71
- * in order. Unknown ids are passed through untouched so the caller's own
72
- * "unknown tool" error still fires instead of being silently dropped here.
51
+ * Expands a selection along `requires`, dependencies first. Order is part of the
52
+ * contract: callers write targets in the returned order, and the canonical
53
+ * directory must exist before anything is copied from it. Unknown ids pass
54
+ * through untouched so the caller's own "unknown tool" error still fires.
73
55
  *
74
- * Which is why a cycle throws rather than being absorbed. Returning early on a
75
- * revisit would still produce a list — one with a dependent ahead of its
76
- * dependency, since the inner call pushes first — and the caller would then
77
- * link into a directory nothing had written yet. There is no ordering that
78
- * satisfies a cycle, so the table is wrong and has to say so at the point the
79
- * edit is made.
56
+ * A cycle throws rather than resolving: no ordering satisfies one, so the table
57
+ * is wrong and has to say so.
80
58
  */
81
59
  export declare function resolveToolSelection(toolIds: readonly string[]): string[];
82
60
  /** Ids at least one other target is built from, so refreshing them fans out. */
@@ -84,11 +62,9 @@ export declare function dependencyToolIds(): string[];
84
62
  /** Ids used when a non-interactive run detects nothing and names nothing. */
85
63
  export declare function fallbackToolIds(): string[];
86
64
  /**
87
- * The target Codex reads from, which is why it has no row of its own. Named
88
- * rather than derived: the loading notice is about Codex specifically, and
89
- * every derived predicate that currently selects this row (dependency, fallback)
90
- * matches it by coincidence and would drift the notice onto the wrong target
91
- * the moment another row gained that property.
65
+ * The target Codex reads from. Named rather than derived: the predicates that
66
+ * select this row (dependency, fallback) match by coincidence, and would drift
67
+ * the Codex notice onto the wrong target once another row gained one.
92
68
  */
93
69
  export declare const CODEX_TARGET_ID = "agents";
94
70
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,WAAW,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAAI,OAAO,EAAE,QAAQ,CAAU,CAAC;AAE9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,8BAA8B,CAAC;AAElE;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,6BAA6B,CAAC;AAExE;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,QAAQ,EAAE,YAAY,EAQlC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAsBzE;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAE5C;AAED,6EAA6E;AAC7E,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAE1C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,WAAW,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAAI,OAAO,EAAE,QAAQ,CAAU,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,8BAA8B,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,6BAA6B,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,QAAQ,EAAE,YAAY,EAMlC,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAsBzE;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAE5C;AAED,6EAA6E;AAC7E,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAE1C;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,WAAW,CAAC"}
@@ -5,60 +5,39 @@ export const TOSPEC_DIR_NAME = 'tospec';
5
5
  */
6
6
  export const TOOL_RULES_SUBDIR = ['rules', 'tospec'];
7
7
  /**
8
- * The workflow rule document, written for every configured tool by init, update
9
- * and rules, and removed by none of them.
10
- *
11
- * Shared rather than spelled out at each use because it is two things at once:
12
- * the write target for rules-generation, and the durable proof that tospec
13
- * currently manages a tool dir (`isToolInstalled`). Specifically this file and
14
- * not the `rules/tospec/` directory: that directory also holds `decision.md`,
15
- * which an older tospec wrote from init only — its presence says tospec touched
16
- * the dir once, not that it manages it now. The two readings only agree while
17
- * both sides read the name from here.
8
+ * The workflow rule document: both the write target for rules-generation and the
9
+ * proof that tospec currently manages a tool dir (`isToolInstalled`). This file,
10
+ * not the `rules/tospec/` directory, whose other contents only prove tospec
11
+ * touched the dir once.
18
12
  */
19
13
  export const WORKFLOW_RULE_FILENAME = 'single-source-of-truth.md';
20
14
  /**
21
- * The same document under its previous, misspelled name (`sourc`).
22
- *
23
- * Kept so init/update/rules can retire a copy an older tospec wrote instead of
24
- * leaving it beside the corrected one, where two rule files with the same body
25
- * would both be loaded. Detection accepts it too, so a project that has not been
26
- * updated yet still reads as installed.
15
+ * The same document under its previous, misspelled name. Kept so init/update can
16
+ * retire an older copy instead of loading two rule files with the same body;
17
+ * detection accepts it, so a not-yet-updated project still reads as installed.
27
18
  */
28
19
  export const LEGACY_WORKFLOW_RULE_FILENAME = 'single-sourc-of-truth.md';
29
20
  /**
30
- * The decision rule document, written beside the workflow rule for every
31
- * configured tool.
32
- *
33
- * Deliberately not usable as proof that tospec manages a tool dir: an older
34
- * tospec wrote this file from init only, so a project can hold an untouched copy
35
- * left by a version that no longer maintains it. `isToolInstalled` reads
36
- * WORKFLOW_RULE_FILENAME for that reason.
21
+ * Written beside the workflow rule, but not proof that tospec manages a tool
22
+ * dir: an older tospec wrote it from init only, so a project can hold an
23
+ * untouched copy. `isToolInstalled` reads WORKFLOW_RULE_FILENAME.
37
24
  */
38
25
  export const DECISION_RULE_FILENAME = 'decision.md';
39
26
  export const AI_TOOLS = [
40
- // `.agents` is the directory Codex actually reads skills from, and it holds
41
- // the canonical copy every other target links into.
42
- //
43
- // Codex is deliberately absent as a row of its own: it reads skills from
44
- // `.agents`, so a `.codex` target was a second copy nothing ever loaded.
27
+ // `.agents` holds the canonical copy every other target is built from, and is
28
+ // where Codex reads skills, so Codex has no row of its own: a `.codex` target
29
+ // would be a second copy nothing loads.
45
30
  { name: 'Agents', value: 'agents', available: true, successLabel: 'Agents', skillsDir: '.agents', fallback: true },
46
31
  { name: 'Claude Code', value: 'claude', available: true, successLabel: 'Claude Code', skillsDir: '.claude', requires: ['agents'] }
47
32
  ];
48
33
  /**
49
- * Expands a selection along `requires`, dependencies first.
50
- *
51
- * Order is part of the contract, not a side effect: the canonical directory has
52
- * to exist before anything links into it, and callers process the returned list
53
- * in order. Unknown ids are passed through untouched so the caller's own
54
- * "unknown tool" error still fires instead of being silently dropped here.
34
+ * Expands a selection along `requires`, dependencies first. Order is part of the
35
+ * contract: callers write targets in the returned order, and the canonical
36
+ * directory must exist before anything is copied from it. Unknown ids pass
37
+ * through untouched so the caller's own "unknown tool" error still fires.
55
38
  *
56
- * Which is why a cycle throws rather than being absorbed. Returning early on a
57
- * revisit would still produce a list — one with a dependent ahead of its
58
- * dependency, since the inner call pushes first — and the caller would then
59
- * link into a directory nothing had written yet. There is no ordering that
60
- * satisfies a cycle, so the table is wrong and has to say so at the point the
61
- * edit is made.
39
+ * A cycle throws rather than resolving: no ordering satisfies one, so the table
40
+ * is wrong and has to say so.
62
41
  */
63
42
  export function resolveToolSelection(toolIds) {
64
43
  const resolved = [];
@@ -90,11 +69,9 @@ export function fallbackToolIds() {
90
69
  return AI_TOOLS.filter((tool) => tool.fallback && tool.skillsDir).map((tool) => tool.value);
91
70
  }
92
71
  /**
93
- * The target Codex reads from, which is why it has no row of its own. Named
94
- * rather than derived: the loading notice is about Codex specifically, and
95
- * every derived predicate that currently selects this row (dependency, fallback)
96
- * matches it by coincidence and would drift the notice onto the wrong target
97
- * the moment another row gained that property.
72
+ * The target Codex reads from. Named rather than derived: the predicates that
73
+ * select this row (dependency, fallback) match by coincidence, and would drift
74
+ * the Codex notice onto the wrong target once another row gained one.
98
75
  */
99
76
  export const CODEX_TARGET_ID = 'agents';
100
77
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC;AAExC;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAC;AAE9D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;AAElE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,0BAA0B,CAAC;AAExE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAC;AA8BpD,MAAM,CAAC,MAAM,QAAQ,GAAmB;IACtC,4EAA4E;IAC5E,oDAAoD;IACpD,EAAE;IACF,yEAAyE;IACzE,yEAAyE;IACzE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;IAClH,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE;CACnI,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA0B;IAC7D,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IAEnC,MAAM,KAAK,GAAG,CAAC,EAAU,EAAQ,EAAE;QACjC,IAAI,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAAE,OAAO;QAClC,IAAI,QA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AAI,CAAC,MAAM,CAAC,IAAI;gBACpF,sFAAsF,CACzF,CAAC;QACJ,CAAC;QACD,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACjB,KAAK,MAAM,UAAU,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC,EAAE,QAAQ,IAAI,EAAE,EAAE,CAAC;YACpF,KAAK,CAAC,UAAU,CAAC,CAAC;QACpB,CAAC;QACD,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpB,CAAC,CAAC;IAEF,KAAK,MAAM,EAAE,IAAI,OAAO;QAAE,KAAK,CAAC,EAAE,CAAC,CAAC;IACpC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,iBAAiB;IAC/B,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACvE,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,eAAe;IAC7B,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9F,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC"}
@@ -1,10 +1,9 @@
1
1
  /**
2
2
  * Dashboard git activity + health signals (ADR 001, D4-D7, D12, D16).
3
3
  *
4
- * Two `git log` runs produce a 30-day daily series: commits repo-wide vs
5
- * commits touching `tospec/`. The gap between the two is the spec-drift
6
- * signal. Pure aggregation is split from the git-spawning wrapper so vitest
7
- * can exercise it without a repo.
4
+ * Two `git log` runs produce a 30-day daily series: commits repo-wide vs commits
5
+ * touching `tospec/`. The gap between the two is the spec-drift signal. Pure
6
+ * aggregation is split from the git-spawning wrapper so tests need no repo.
8
7
  */
9
8
  export declare const DEFAULT_STALE_DAYS = 14;
10
9
  /** Series window: trailing day count, or 'all' for the full git history. */
@@ -40,11 +39,10 @@ export declare function historySpanDays(repoDates: string[], tospecDates: string
40
39
  /** Stale-change threshold from tospec/config.yaml, defaulting to 14 days. */
41
40
  export declare function resolveStaleDays(projectRoot: string): number;
42
41
  /**
43
- * Collects the activity payload. `changeName` narrows the tospec series to
44
- * that change's directory (detail view); the repo series stays repo-wide.
45
- * `window` is the trailing day count (default 30) or 'all' for full history.
46
- * Git being unavailable degrades to `{available: false}` (D6) — staleDays is
47
- * config, not git, so it is always populated.
42
+ * The activity payload. `changeName` narrows the tospec series to that change's
43
+ * directory; the repo series stays repo-wide. `window` is the trailing day count
44
+ * (default 30) or 'all'. Git being unavailable degrades to `{available: false}`
45
+ * (D6) — staleDays comes from config, so it is always populated.
48
46
  */
49
47
  export declare function collectActivity(projectRoot: string, changeName?: string, window?: ActivityWindow): Promise<DashboardActivity>;
50
48
  //# sourceMappingURL=dashboard-activity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-activity.d.ts","sourceRoot":"","sources":["../../src/core/dashboard-activity.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAIrC,4EAA4E;AAC5E,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,CAAC;AAE5C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,E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AAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,WAAW,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EAAE,EACnB,WAAW,EAAE,MAAM,EAAE,EACrB,IAAI,GAAE,MAAsB,EAC5B,KAAK,GAAE,IAAiB,GACvB,WAAW,EAAE,CAaf;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,WAAW,EAAE,EACnB,iBAAiB,EAAE,MAAM,EACzB,UAAU,GAAE,MAA0B,GACrC,OAAO,CAMT;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EAAE,EACnB,WAAW,EAAE,MAAM,EAAE,EACrB,OAAO,GAAE,MAAsB,EAC/B,KAAK,GAAE,IAAiB,GACvB,MAAM,CAWR;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAM5D;AAsCD;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,EACnB,MAAM,GAAE,cAA8B,GACrC,OAAO,CAAC,iBAAiB,CAAC,CA+B5B"}
@@ -1,10 +1,9 @@
1
1
  /**
2
2
  * Dashboard git activity + health signals (ADR 001, D4-D7, D12, D16).
3
3
  *
4
- * Two `git log` runs produce a 30-day daily series: commits repo-wide vs
5
- * commits touching `tospec/`. The gap between the two is the spec-drift
6
- * signal. Pure aggregation is split from the git-spawning wrapper so vitest
7
- * can exercise it without a repo.
4
+ * Two `git log` runs produce a 30-day daily series: commits repo-wide vs commits
5
+ * touching `tospec/`. The gap between the two is the spec-drift signal. Pure
6
+ * aggregation is split from the git-spawning wrapper so tests need no repo.
8
7
  */
9
8
  import { execFile } from 'node:child_process';
10
9
  import { promisify } from 'node:util';
@@ -15,9 +14,6 @@ const execFileAsync = promisify(execFile);
15
14
  export const DEFAULT_STALE_DAYS = 14;
16
15
  const ACTIVITY_DAYS = 30;
17
16
  const DRIFT_WINDOW_DAYS = 7;
18
- // -----------------------------------------------------------------------------
19
- // Pure aggregation (unit-testable)
20
- // -----------------------------------------------------------------------------
21
17
  /**
22
18
  * Buckets two lists of commit dates (yyyy-mm-dd, from `git log --date=short`)
23
19
  * into a zero-filled daily series covering the last `days` days ending `today`.
@@ -77,9 +73,6 @@ export function resolveStaleDays(projectRoot) {
77
73
  return DEFAULT_STALE_DAYS;
78
74
  }
79
75
  }
80
- // -----------------------------------------------------------------------------
81
- // Git wrapper
82
- // -----------------------------------------------------------------------------
83
76
  /** Commit dates (yyyy-mm-dd, one per commit), newest first. */
84
77
  async function gitLogDates(projectRoot, window, pathFilters) {
85
78
  const args = ['log', '--format=%cd', '--date=short'];
@@ -87,8 +80,8 @@ async function gitLogDates(projectRoot, window, pathFilters) {
87
80
  args.splice(1, 0, `--since=${window} days ago`);
88
81
  if (pathFilters)
89
82
  args.push('--', ...pathFilters);
90
- // windowsHide: git is a console app; without this each call flashes a window
91
- // on Windows — and the dashboard runs several per activity refresh.
83
+ // windowsHide: git is a console app, and the dashboard runs several of these
84
+ // per activity refresh — each would flash a window on Windows.
92
85
  const { stdout } = await execFileAsync('git', args, { cwd: projectRoot, windowsHide: true });
93
86
  return stdout.split(/\r?\n/).filter((line) => /^\d{4}-\d{2}-\d{2}$/.test(line));
94
87
  }
@@ -96,19 +89,29 @@ async function gitLogDates(projectRoot, window, pathFilters) {
96
89
  async function gitUnavailableReason(projectRoot) {
97
90
  try {
98
91
  await execFileAsync('git', ['rev-parse', '--is-inside-work-tree'], { cwd: projectRoot, windowsHide: true });
99
- return null;
100
92
  }
101
93
  catch (err) {
102
94
  const code = err.code;
103
95
  return code === 'ENOENT' ? 'git not found' : 'not a git repository';
104
96
  }
97
+ // A freshly `git init`ed repo passes the work-tree check but has no HEAD, and
98
+ // `git log` there exits non-zero ("does not have any commits yet") — which
99
+ // surfaced as a 500 from /api/activity on exactly the project a first-time
100
+ // dashboard user has. Unborn HEAD is the same "nothing to chart" case as no
101
+ // repo at all, so it degrades the same way.
102
+ try {
103
+ await execFileAsync('git', ['rev-parse', '--verify', '--quiet', 'HEAD'], { cwd: projectRoot, windowsHide: true });
104
+ return null;
105
+ }
106
+ catch {
107
+ return 'no commits yet';
108
+ }
105
109
  }
106
110
  /**
107
- * Collects the activity payload. `changeName` narrows the tospec series to
108
- * that change's directory (detail view); the repo series stays repo-wide.
109
- * `window` is the trailing day count (default 30) or 'all' for full history.
110
- * Git being unavailable degrades to `{available: false}` (D6) — staleDays is
111
- * config, not git, so it is always populated.
111
+ * The activity payload. `changeName` narrows the tospec series to that change's
112
+ * directory; the repo series stays repo-wide. `window` is the trailing day count
113
+ * (default 30) or 'all'. Git being unavailable degrades to `{available: false}`
114
+ * (D6) — staleDays comes from config, so it is always populated.
112
115
  */
113
116
  export async function collectActivity(projectRoot, changeName, window = ACTIVITY_DAYS) {
114
117
  const staleDays = resolveStaleDays(projectRoot);
@@ -117,10 +120,9 @@ export async function collectActivity(projectRoot, changeName, window = ACTIVITY
117
120
  return { available: false, reason, days: [], specDrift: false, staleDays };
118
121
  }
119
122
  // `tospec migrate` copies openspec/ into tospec/, so commit history for
120
- // migrated changes lives under openspec/ paths. A pathspec that matches
121
- // nothing is harmless, so always include the legacy prefix.
122
- // Limitation: only covers the default `openspec` source dir; record custom
123
- // migrate source dirs in config if anyone needs them counted.
123
+ // migrated changes lives under openspec/ paths. A pathspec matching nothing
124
+ // is harmless, so the legacy prefix is always included.
125
+ // Limitation: only the default `openspec` source dir.
124
126
  const pathFilters = changeName
125
127
  ? [`tospec/changes/${changeName}/`, `openspec/changes/${changeName}/`]
126
128
  : ['tospec/', 'openspec/'];
@@ -128,8 +130,8 @@ export async function collectActivity(projectRoot, changeName, window = ACTIVITY
128
130
  gitLogDates(projectRoot, window),
129
131
  gitLogDates(projectRoot, window, pathFilters),
130
132
  ]);
131
- // Limitation: 'all' zero-fills one entry per day since the first commit; a
132
- // decade-old repo means a few thousand points, coarser buckets if that hurts.
133
+ // Limitation: 'all' zero-fills one entry per day since the first commit, so a
134
+ // decade-old repo yields a few thousand points.
133
135
  const spanDays = window === 'all' ? historySpanDays(repoDates, tospecDates) : window;
134
136
  const days = aggregateDaily(repoDates, tospecDates, spanDays);
135
137
  // Drift only makes sense repo-wide, not for a single change's series.