@seanmars/tospec 0.19.0-beta.8 → 0.21.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 (423) hide show
  1. package/CHANGELOG.md +89 -296
  2. package/README.md +69 -82
  3. package/assets/dashboard/app.js +11 -0
  4. package/assets/dashboard/style.css +7 -0
  5. package/bin/tospec.js +1 -1
  6. package/dist/cli/index.d.ts +6 -1
  7. package/dist/cli/index.d.ts.map +1 -1
  8. package/dist/cli/index.js +120 -112
  9. package/dist/cli/index.js.map +1 -1
  10. package/dist/commands/config.d.ts +9 -17
  11. package/dist/commands/config.d.ts.map +1 -1
  12. package/dist/commands/config.js +300 -145
  13. package/dist/commands/config.js.map +1 -1
  14. package/dist/commands/dashboard.d.ts +57 -99
  15. package/dist/commands/dashboard.d.ts.map +1 -1
  16. package/dist/commands/dashboard.js +252 -330
  17. package/dist/commands/dashboard.js.map +1 -1
  18. package/dist/commands/decision.d.ts +38 -27
  19. package/dist/commands/decision.d.ts.map +1 -1
  20. package/dist/commands/decision.js +301 -131
  21. package/dist/commands/decision.js.map +1 -1
  22. package/dist/commands/metrics.d.ts +28 -51
  23. package/dist/commands/metrics.d.ts.map +1 -1
  24. package/dist/commands/metrics.js +62 -93
  25. package/dist/commands/metrics.js.map +1 -1
  26. package/dist/commands/shared-output.d.ts +12 -27
  27. package/dist/commands/shared-output.d.ts.map +1 -1
  28. package/dist/commands/shared-output.js +22 -45
  29. package/dist/commands/shared-output.js.map +1 -1
  30. package/dist/commands/show.d.ts +4 -7
  31. package/dist/commands/show.d.ts.map +1 -1
  32. package/dist/commands/show.js +23 -11
  33. package/dist/commands/show.js.map +1 -1
  34. package/dist/commands/validate.d.ts +34 -58
  35. package/dist/commands/validate.d.ts.map +1 -1
  36. package/dist/commands/validate.js +228 -142
  37. package/dist/commands/validate.js.map +1 -1
  38. package/dist/commands/workflow/index.d.ts +1 -5
  39. package/dist/commands/workflow/index.d.ts.map +1 -1
  40. package/dist/commands/workflow/index.js +1 -5
  41. package/dist/commands/workflow/index.js.map +1 -1
  42. package/dist/commands/workflow/instructions.d.ts +14 -24
  43. package/dist/commands/workflow/instructions.d.ts.map +1 -1
  44. package/dist/commands/workflow/instructions.js +230 -132
  45. package/dist/commands/workflow/instructions.js.map +1 -1
  46. package/dist/commands/workflow/new-change.d.ts +2 -5
  47. package/dist/commands/workflow/new-change.d.ts.map +1 -1
  48. package/dist/commands/workflow/new-change.js +75 -34
  49. package/dist/commands/workflow/new-change.js.map +1 -1
  50. package/dist/commands/workflow/schemas.d.ts +1 -5
  51. package/dist/commands/workflow/schemas.d.ts.map +1 -1
  52. package/dist/commands/workflow/schemas.js +6 -17
  53. package/dist/commands/workflow/schemas.js.map +1 -1
  54. package/dist/commands/workflow/shared.d.ts +37 -42
  55. package/dist/commands/workflow/shared.d.ts.map +1 -1
  56. package/dist/commands/workflow/shared.js +23 -54
  57. package/dist/commands/workflow/shared.js.map +1 -1
  58. package/dist/commands/workflow/status.d.ts +7 -17
  59. package/dist/commands/workflow/status.d.ts.map +1 -1
  60. package/dist/commands/workflow/status.js +57 -72
  61. package/dist/commands/workflow/status.js.map +1 -1
  62. package/dist/commands/workflow/templates.d.ts +8 -8
  63. package/dist/commands/workflow/templates.d.ts.map +1 -1
  64. package/dist/commands/workflow/templates.js +32 -46
  65. package/dist/commands/workflow/templates.js.map +1 -1
  66. package/dist/core/archive.d.ts +33 -31
  67. package/dist/core/archive.d.ts.map +1 -1
  68. package/dist/core/archive.js +322 -284
  69. package/dist/core/archive.js.map +1 -1
  70. package/dist/core/artifact-graph/graph.d.ts +25 -42
  71. package/dist/core/artifact-graph/graph.d.ts.map +1 -1
  72. package/dist/core/artifact-graph/graph.js +45 -63
  73. package/dist/core/artifact-graph/graph.js.map +1 -1
  74. package/dist/core/artifact-graph/index.d.ts +1 -1
  75. package/dist/core/artifact-graph/index.d.ts.map +1 -1
  76. package/dist/core/artifact-graph/index.js +1 -1
  77. package/dist/core/artifact-graph/index.js.map +1 -1
  78. package/dist/core/artifact-graph/instruction-loader.d.ts +54 -120
  79. package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -1
  80. package/dist/core/artifact-graph/instruction-loader.js +129 -111
  81. package/dist/core/artifact-graph/instruction-loader.js.map +1 -1
  82. package/dist/core/artifact-graph/outputs.d.ts +9 -23
  83. package/dist/core/artifact-graph/outputs.d.ts.map +1 -1
  84. package/dist/core/artifact-graph/outputs.js +45 -38
  85. package/dist/core/artifact-graph/outputs.js.map +1 -1
  86. package/dist/core/artifact-graph/resolver.d.ts +36 -81
  87. package/dist/core/artifact-graph/resolver.d.ts.map +1 -1
  88. package/dist/core/artifact-graph/resolver.js +60 -101
  89. package/dist/core/artifact-graph/resolver.js.map +1 -1
  90. package/dist/core/artifact-graph/schema.d.ts +0 -6
  91. package/dist/core/artifact-graph/schema.d.ts.map +1 -1
  92. package/dist/core/artifact-graph/schema.js +7 -32
  93. package/dist/core/artifact-graph/schema.js.map +1 -1
  94. package/dist/core/artifact-graph/state.d.ts +1 -8
  95. package/dist/core/artifact-graph/state.d.ts.map +1 -1
  96. package/dist/core/artifact-graph/state.js +2 -17
  97. package/dist/core/artifact-graph/state.js.map +1 -1
  98. package/dist/core/artifact-graph/stub-detection.d.ts +6 -14
  99. package/dist/core/artifact-graph/stub-detection.d.ts.map +1 -1
  100. package/dist/core/artifact-graph/stub-detection.js +13 -16
  101. package/dist/core/artifact-graph/stub-detection.js.map +1 -1
  102. package/dist/core/artifact-graph/types.d.ts +4 -0
  103. package/dist/core/artifact-graph/types.d.ts.map +1 -1
  104. package/dist/core/artifact-graph/types.js +46 -11
  105. package/dist/core/artifact-graph/types.js.map +1 -1
  106. package/dist/core/available-tools.d.ts +3 -12
  107. package/dist/core/available-tools.d.ts.map +1 -1
  108. package/dist/core/available-tools.js +4 -13
  109. package/dist/core/available-tools.js.map +1 -1
  110. package/dist/core/change-metadata/schema.d.ts +1 -1
  111. package/dist/core/change-metadata/schema.d.ts.map +1 -1
  112. package/dist/core/change-metadata/schema.js +10 -7
  113. package/dist/core/change-metadata/schema.js.map +1 -1
  114. package/dist/core/change-presenter.d.ts +16 -27
  115. package/dist/core/change-presenter.d.ts.map +1 -1
  116. package/dist/core/change-presenter.js +53 -53
  117. package/dist/core/change-presenter.js.map +1 -1
  118. package/dist/core/change-status-policy.d.ts +4 -8
  119. package/dist/core/change-status-policy.d.ts.map +1 -1
  120. package/dist/core/change-status-policy.js +9 -17
  121. package/dist/core/change-status-policy.js.map +1 -1
  122. package/dist/core/codex-metrics.d.ts +25 -45
  123. package/dist/core/codex-metrics.d.ts.map +1 -1
  124. package/dist/core/codex-metrics.js +44 -88
  125. package/dist/core/codex-metrics.js.map +1 -1
  126. package/dist/core/codex-residue.d.ts +14 -15
  127. package/dist/core/codex-residue.d.ts.map +1 -1
  128. package/dist/core/codex-residue.js +18 -22
  129. package/dist/core/codex-residue.js.map +1 -1
  130. package/dist/core/command-generation/adapters/claude.d.ts +2 -9
  131. package/dist/core/command-generation/adapters/claude.d.ts.map +1 -1
  132. package/dist/core/command-generation/adapters/claude.js +2 -12
  133. package/dist/core/command-generation/adapters/claude.js.map +1 -1
  134. package/dist/core/command-generation/adapters/index.d.ts +1 -9
  135. package/dist/core/command-generation/adapters/index.d.ts.map +1 -1
  136. package/dist/core/command-generation/adapters/index.js +1 -9
  137. package/dist/core/command-generation/adapters/index.js.map +1 -1
  138. package/dist/core/command-generation/generator.d.ts +0 -17
  139. package/dist/core/command-generation/generator.d.ts.map +1 -1
  140. package/dist/core/command-generation/generator.js +0 -17
  141. package/dist/core/command-generation/generator.js.map +1 -1
  142. package/dist/core/command-generation/index.d.ts +2 -5
  143. package/dist/core/command-generation/index.d.ts.map +1 -1
  144. package/dist/core/command-generation/index.js +0 -9
  145. package/dist/core/command-generation/index.js.map +1 -1
  146. package/dist/core/command-generation/types.d.ts +10 -36
  147. package/dist/core/command-generation/types.d.ts.map +1 -1
  148. package/dist/core/command-generation/types.js +0 -6
  149. package/dist/core/command-generation/types.js.map +1 -1
  150. package/dist/core/command-generation/yaml.d.ts +3 -18
  151. package/dist/core/command-generation/yaml.d.ts.map +1 -1
  152. package/dist/core/command-generation/yaml.js +5 -23
  153. package/dist/core/command-generation/yaml.js.map +1 -1
  154. package/dist/core/config-prompts.d.ts +2 -4
  155. package/dist/core/config-prompts.d.ts.map +1 -1
  156. package/dist/core/config-prompts.js +2 -7
  157. package/dist/core/config-prompts.js.map +1 -1
  158. package/dist/core/config-schema.d.ts +7 -41
  159. package/dist/core/config-schema.d.ts.map +1 -1
  160. package/dist/core/config-schema.js +35 -74
  161. package/dist/core/config-schema.js.map +1 -1
  162. package/dist/core/config.d.ts +25 -49
  163. package/dist/core/config.d.ts.map +1 -1
  164. package/dist/core/config.js +22 -45
  165. package/dist/core/config.js.map +1 -1
  166. package/dist/core/dashboard-activity.d.ts +7 -9
  167. package/dist/core/dashboard-activity.d.ts.map +1 -1
  168. package/dist/core/dashboard-activity.js +34 -25
  169. package/dist/core/dashboard-activity.js.map +1 -1
  170. package/dist/core/dashboard-data.d.ts +35 -22
  171. package/dist/core/dashboard-data.d.ts.map +1 -1
  172. package/dist/core/dashboard-data.js +57 -72
  173. package/dist/core/dashboard-data.js.map +1 -1
  174. package/dist/core/global-config.d.ts +24 -53
  175. package/dist/core/global-config.d.ts.map +1 -1
  176. package/dist/core/global-config.js +38 -67
  177. package/dist/core/global-config.js.map +1 -1
  178. package/dist/core/init.d.ts +12 -28
  179. package/dist/core/init.d.ts.map +1 -1
  180. package/dist/core/init.js +93 -169
  181. package/dist/core/init.js.map +1 -1
  182. package/dist/core/list.d.ts.map +1 -1
  183. package/dist/core/list.js +95 -41
  184. package/dist/core/list.js.map +1 -1
  185. package/dist/core/local-server.d.ts +41 -83
  186. package/dist/core/local-server.d.ts.map +1 -1
  187. package/dist/core/local-server.js +53 -98
  188. package/dist/core/local-server.js.map +1 -1
  189. package/dist/core/markdown-render.d.ts +15 -23
  190. package/dist/core/markdown-render.d.ts.map +1 -1
  191. package/dist/core/markdown-render.js +25 -34
  192. package/dist/core/markdown-render.js.map +1 -1
  193. package/dist/core/migrate.d.ts +19 -16
  194. package/dist/core/migrate.d.ts.map +1 -1
  195. package/dist/core/migrate.js +162 -136
  196. package/dist/core/migrate.js.map +1 -1
  197. package/dist/core/parsers/change-parser.d.ts +7 -10
  198. package/dist/core/parsers/change-parser.d.ts.map +1 -1
  199. package/dist/core/parsers/change-parser.js +48 -56
  200. package/dist/core/parsers/change-parser.js.map +1 -1
  201. package/dist/core/parsers/markdown-parser.d.ts +8 -9
  202. package/dist/core/parsers/markdown-parser.d.ts.map +1 -1
  203. package/dist/core/parsers/markdown-parser.js +23 -30
  204. package/dist/core/parsers/markdown-parser.js.map +1 -1
  205. package/dist/core/parsers/requirement-blocks.d.ts +43 -15
  206. package/dist/core/parsers/requirement-blocks.d.ts.map +1 -1
  207. package/dist/core/parsers/requirement-blocks.js +142 -70
  208. package/dist/core/parsers/requirement-blocks.js.map +1 -1
  209. package/dist/core/parsers/requirement-text.d.ts +73 -79
  210. package/dist/core/parsers/requirement-text.d.ts.map +1 -1
  211. package/dist/core/parsers/requirement-text.js +137 -79
  212. package/dist/core/parsers/requirement-text.js.map +1 -1
  213. package/dist/core/parsers/spec-structure.d.ts.map +1 -1
  214. package/dist/core/parsers/spec-structure.js +10 -6
  215. package/dist/core/parsers/spec-structure.js.map +1 -1
  216. package/dist/core/profiles.d.ts +3 -10
  217. package/dist/core/profiles.d.ts.map +1 -1
  218. package/dist/core/profiles.js +5 -12
  219. package/dist/core/profiles.js.map +1 -1
  220. package/dist/core/project-config.d.ts +43 -44
  221. package/dist/core/project-config.d.ts.map +1 -1
  222. package/dist/core/project-config.js +107 -82
  223. package/dist/core/project-config.js.map +1 -1
  224. package/dist/core/project-layout.d.ts +9 -17
  225. package/dist/core/project-layout.d.ts.map +1 -1
  226. package/dist/core/project-layout.js +16 -26
  227. package/dist/core/project-layout.js.map +1 -1
  228. package/dist/core/root-selection.d.ts +8 -14
  229. package/dist/core/root-selection.d.ts.map +1 -1
  230. package/dist/core/root-selection.js +3 -6
  231. package/dist/core/root-selection.js.map +1 -1
  232. package/dist/core/rules.d.ts.map +1 -1
  233. package/dist/core/rules.js +2 -3
  234. package/dist/core/rules.js.map +1 -1
  235. package/dist/core/schema-names.d.ts +16 -0
  236. package/dist/core/schema-names.d.ts.map +1 -0
  237. package/dist/core/schema-names.js +16 -0
  238. package/dist/core/schema-names.js.map +1 -0
  239. package/dist/core/schemas/base.schema.d.ts.map +1 -1
  240. package/dist/core/schemas/base.schema.js +6 -12
  241. package/dist/core/schemas/base.schema.js.map +1 -1
  242. package/dist/core/schemas/change.schema.d.ts +8 -0
  243. package/dist/core/schemas/change.schema.d.ts.map +1 -1
  244. package/dist/core/schemas/change.schema.js +41 -10
  245. package/dist/core/schemas/change.schema.js.map +1 -1
  246. package/dist/core/shared/index.d.ts +2 -7
  247. package/dist/core/shared/index.d.ts.map +1 -1
  248. package/dist/core/shared/index.js +2 -7
  249. package/dist/core/shared/index.js.map +1 -1
  250. package/dist/core/shared/rules-generation.d.ts +5 -15
  251. package/dist/core/shared/rules-generation.d.ts.map +1 -1
  252. package/dist/core/shared/rules-generation.js +33 -37
  253. package/dist/core/shared/rules-generation.js.map +1 -1
  254. package/dist/core/shared/skill-generation.d.ts +28 -43
  255. package/dist/core/shared/skill-generation.d.ts.map +1 -1
  256. package/dist/core/shared/skill-generation.js +82 -51
  257. package/dist/core/shared/skill-generation.js.map +1 -1
  258. package/dist/core/shared/tool-detection.d.ts +35 -76
  259. package/dist/core/shared/tool-detection.d.ts.map +1 -1
  260. package/dist/core/shared/tool-detection.js +73 -93
  261. package/dist/core/shared/tool-detection.js.map +1 -1
  262. package/dist/core/skill-metrics.d.ts +36 -63
  263. package/dist/core/skill-metrics.d.ts.map +1 -1
  264. package/dist/core/skill-metrics.js +34 -73
  265. package/dist/core/skill-metrics.js.map +1 -1
  266. package/dist/core/spec-presenter.d.ts.map +1 -1
  267. package/dist/core/spec-presenter.js +5 -10
  268. package/dist/core/spec-presenter.js.map +1 -1
  269. package/dist/core/specs-apply.d.ts +16 -31
  270. package/dist/core/specs-apply.d.ts.map +1 -1
  271. package/dist/core/specs-apply.js +146 -195
  272. package/dist/core/specs-apply.js.map +1 -1
  273. package/dist/core/templates/fragments/interview.d.ts +2 -6
  274. package/dist/core/templates/fragments/interview.d.ts.map +1 -1
  275. package/dist/core/templates/fragments/interview.js +2 -6
  276. package/dist/core/templates/fragments/interview.js.map +1 -1
  277. package/dist/core/templates/fragments/next-step.d.ts +4 -8
  278. package/dist/core/templates/fragments/next-step.d.ts.map +1 -1
  279. package/dist/core/templates/fragments/next-step.js +4 -8
  280. package/dist/core/templates/fragments/next-step.js.map +1 -1
  281. package/dist/core/templates/fragments/validate.d.ts +13 -0
  282. package/dist/core/templates/fragments/validate.d.ts.map +1 -0
  283. package/dist/core/templates/fragments/validate.js +13 -0
  284. package/dist/core/templates/fragments/validate.js.map +1 -0
  285. package/dist/core/templates/fragments/verify.d.ts +9 -12
  286. package/dist/core/templates/fragments/verify.d.ts.map +1 -1
  287. package/dist/core/templates/fragments/verify.js +9 -12
  288. package/dist/core/templates/fragments/verify.js.map +1 -1
  289. package/dist/core/templates/index.d.ts +0 -6
  290. package/dist/core/templates/index.d.ts.map +1 -1
  291. package/dist/core/templates/index.js +0 -7
  292. package/dist/core/templates/index.js.map +1 -1
  293. package/dist/core/templates/skill-templates.d.ts +1 -5
  294. package/dist/core/templates/skill-templates.d.ts.map +1 -1
  295. package/dist/core/templates/skill-templates.js +0 -5
  296. package/dist/core/templates/skill-templates.js.map +1 -1
  297. package/dist/core/templates/types.d.ts +3 -7
  298. package/dist/core/templates/types.d.ts.map +1 -1
  299. package/dist/core/templates/types.js +0 -3
  300. package/dist/core/templates/types.js.map +1 -1
  301. package/dist/core/templates/workflows/apply.d.ts +3 -9
  302. package/dist/core/templates/workflows/apply.d.ts.map +1 -1
  303. package/dist/core/templates/workflows/apply.js +11 -13
  304. package/dist/core/templates/workflows/apply.js.map +1 -1
  305. package/dist/core/templates/workflows/archive.d.ts +0 -6
  306. package/dist/core/templates/workflows/archive.d.ts.map +1 -1
  307. package/dist/core/templates/workflows/archive.js +16 -5
  308. package/dist/core/templates/workflows/archive.js.map +1 -1
  309. package/dist/core/templates/workflows/decision.js +3 -3
  310. package/dist/core/templates/workflows/decision.js.map +1 -1
  311. package/dist/core/templates/workflows/explore.js +1 -1
  312. package/dist/core/templates/workflows/grill.d.ts.map +1 -1
  313. package/dist/core/templates/workflows/grill.js +0 -2
  314. package/dist/core/templates/workflows/grill.js.map +1 -1
  315. package/dist/core/templates/workflows/issue.d.ts +0 -6
  316. package/dist/core/templates/workflows/issue.d.ts.map +1 -1
  317. package/dist/core/templates/workflows/issue.js +3 -2
  318. package/dist/core/templates/workflows/issue.js.map +1 -1
  319. package/dist/core/templates/workflows/propose.d.ts +0 -6
  320. package/dist/core/templates/workflows/propose.d.ts.map +1 -1
  321. package/dist/core/templates/workflows/propose.js +2 -2
  322. package/dist/core/templates/workflows/propose.js.map +1 -1
  323. package/dist/core/templates/workflows/sync.d.ts +2 -8
  324. package/dist/core/templates/workflows/sync.d.ts.map +1 -1
  325. package/dist/core/templates/workflows/sync.js +4 -3
  326. package/dist/core/templates/workflows/sync.js.map +1 -1
  327. package/dist/core/templates/workflows/update.d.ts +0 -6
  328. package/dist/core/templates/workflows/update.d.ts.map +1 -1
  329. package/dist/core/templates/workflows/update.js +9 -2
  330. package/dist/core/templates/workflows/update.js.map +1 -1
  331. package/dist/core/update.d.ts +10 -36
  332. package/dist/core/update.d.ts.map +1 -1
  333. package/dist/core/update.js +59 -126
  334. package/dist/core/update.js.map +1 -1
  335. package/dist/core/user-state-migration.d.ts +13 -15
  336. package/dist/core/user-state-migration.d.ts.map +1 -1
  337. package/dist/core/user-state-migration.js +30 -23
  338. package/dist/core/user-state-migration.js.map +1 -1
  339. package/dist/core/validation/constants.d.ts +4 -10
  340. package/dist/core/validation/constants.d.ts.map +1 -1
  341. package/dist/core/validation/constants.js +25 -25
  342. package/dist/core/validation/constants.js.map +1 -1
  343. package/dist/core/validation/prose-length.d.ts +15 -0
  344. package/dist/core/validation/prose-length.d.ts.map +1 -0
  345. package/dist/core/validation/prose-length.js +29 -0
  346. package/dist/core/validation/prose-length.js.map +1 -0
  347. package/dist/core/validation/purpose-placeholder.d.ts +9 -16
  348. package/dist/core/validation/purpose-placeholder.d.ts.map +1 -1
  349. package/dist/core/validation/purpose-placeholder.js +30 -44
  350. package/dist/core/validation/purpose-placeholder.js.map +1 -1
  351. package/dist/core/validation/section-validator.d.ts +4 -4
  352. package/dist/core/validation/section-validator.d.ts.map +1 -1
  353. package/dist/core/validation/section-validator.js +30 -12
  354. package/dist/core/validation/section-validator.js.map +1 -1
  355. package/dist/core/validation/task-numbering.d.ts +6 -3
  356. package/dist/core/validation/task-numbering.d.ts.map +1 -1
  357. package/dist/core/validation/task-numbering.js +23 -11
  358. package/dist/core/validation/task-numbering.js.map +1 -1
  359. package/dist/core/validation/types.d.ts +18 -0
  360. package/dist/core/validation/types.d.ts.map +1 -1
  361. package/dist/core/validation/types.js +12 -1
  362. package/dist/core/validation/types.js.map +1 -1
  363. package/dist/core/validation/validator.d.ts +42 -68
  364. package/dist/core/validation/validator.d.ts.map +1 -1
  365. package/dist/core/validation/validator.js +474 -285
  366. package/dist/core/validation/validator.js.map +1 -1
  367. package/dist/prompts/searchable-multi-select.d.ts +3 -8
  368. package/dist/prompts/searchable-multi-select.d.ts.map +1 -1
  369. package/dist/prompts/searchable-multi-select.js +16 -39
  370. package/dist/prompts/searchable-multi-select.js.map +1 -1
  371. package/dist/utils/change-metadata.d.ts +11 -50
  372. package/dist/utils/change-metadata.d.ts.map +1 -1
  373. package/dist/utils/change-metadata.js +48 -67
  374. package/dist/utils/change-metadata.js.map +1 -1
  375. package/dist/utils/change-utils.d.ts +24 -76
  376. package/dist/utils/change-utils.d.ts.map +1 -1
  377. package/dist/utils/change-utils.js +95 -142
  378. package/dist/utils/change-utils.js.map +1 -1
  379. package/dist/utils/file-lock.d.ts +39 -0
  380. package/dist/utils/file-lock.d.ts.map +1 -0
  381. package/dist/utils/file-lock.js +149 -0
  382. package/dist/utils/file-lock.js.map +1 -0
  383. package/dist/utils/file-system.d.ts +12 -32
  384. package/dist/utils/file-system.d.ts.map +1 -1
  385. package/dist/utils/file-system.js +41 -45
  386. package/dist/utils/file-system.js.map +1 -1
  387. package/dist/utils/frontmatter.d.ts +7 -11
  388. package/dist/utils/frontmatter.d.ts.map +1 -1
  389. package/dist/utils/frontmatter.js +11 -11
  390. package/dist/utils/frontmatter.js.map +1 -1
  391. package/dist/utils/interactive.d.ts +4 -9
  392. package/dist/utils/interactive.d.ts.map +1 -1
  393. package/dist/utils/interactive.js +2 -4
  394. package/dist/utils/interactive.js.map +1 -1
  395. package/dist/utils/item-discovery.d.ts +10 -20
  396. package/dist/utils/item-discovery.d.ts.map +1 -1
  397. package/dist/utils/item-discovery.js +31 -55
  398. package/dist/utils/item-discovery.js.map +1 -1
  399. package/dist/utils/link.d.ts +9 -18
  400. package/dist/utils/link.d.ts.map +1 -1
  401. package/dist/utils/link.js +9 -18
  402. package/dist/utils/link.js.map +1 -1
  403. package/dist/utils/requirement-diff.d.ts +13 -23
  404. package/dist/utils/requirement-diff.d.ts.map +1 -1
  405. package/dist/utils/requirement-diff.js +13 -23
  406. package/dist/utils/requirement-diff.js.map +1 -1
  407. package/dist/utils/spec-files.d.ts +7 -20
  408. package/dist/utils/spec-files.d.ts.map +1 -1
  409. package/dist/utils/spec-files.js +26 -51
  410. package/dist/utils/spec-files.js.map +1 -1
  411. package/dist/utils/task-progress.d.ts +11 -9
  412. package/dist/utils/task-progress.d.ts.map +1 -1
  413. package/dist/utils/task-progress.js +53 -32
  414. package/dist/utils/task-progress.js.map +1 -1
  415. package/dist/utils/timestamp.d.ts +5 -8
  416. package/dist/utils/timestamp.d.ts.map +1 -1
  417. package/dist/utils/timestamp.js +5 -8
  418. package/dist/utils/timestamp.js.map +1 -1
  419. package/package.json +2 -3
  420. package/schemas/issue/schema.yaml +8 -1
  421. package/schemas/issue/templates/spec.md +20 -3
  422. package/schemas/sdd/schema.yaml +20 -1
  423. package/schemas/sdd/templates/spec.md +20 -3
@@ -1,40 +1,29 @@
1
- /**
2
- * Tool Detection Utilities
3
- *
4
- * Shared utilities for detecting tool configurations and version status.
5
- */
6
1
  import path from 'path';
7
2
  import * as fs from 'fs';
8
3
  import { AI_TOOLS, LEGACY_WORKFLOW_RULE_FILENAME, TOOL_RULES_SUBDIR, WORKFLOW_RULE_FILENAME, } from '../config.js';
9
4
  import { ALL_WORKFLOWS, workflowSkillDirName } from './skill-generation.js';
10
5
  /**
11
- * Names of skill directories created by tospec init, derived from the one
12
- * workflow registry. Project-scope skills can't be nested, so they live flat
13
- * and prefixed at `<tool.skillsDir>/skills/tospec-<workflow>/SKILL.md`.
6
+ * Skill directories `tospec init` creates, derived from the one workflow registry.
7
+ * Project-scope skills can't be nested, so they live flat and prefixed at
8
+ * `<tool.skillsDir>/skills/tospec-<workflow>/SKILL.md`.
14
9
  */
15
10
  export const SKILL_NAMES = ALL_WORKFLOWS.map(workflowSkillDirName);
16
11
  /**
17
- * Canonical skill directory names tospec used to create but no longer does.
18
- * Cleaned up on init/update so an upgrade leaves no orphan dirs behind in
19
- * `.agents/skills/`. verify was folded into apply; reconcile was renamed back
20
- * to sync, so its dir must go rather than sit beside the new one.
12
+ * Skill directories tospec used to create but no longer does; removed on
13
+ * init/update so an upgrade leaves no orphans.
21
14
  *
22
- * A name generated by WORKFLOW_DEFS must never appear here: removeLegacySkillDirs
23
- * runs on every init/update, so an overlap would delete the skill the same run
24
- * just wrote — silently, surfacing later as a missing skill rather than an error.
25
- * That is why `tospec-sync` came out of this list when the reconcile rename was
26
- * reverted, instead of `tospec-reconcile` simply being appended.
15
+ * A name WORKFLOW_DEFS generates must never appear here: removeLegacySkillDirs
16
+ * runs on every init/update, so an overlap deletes the skill the run just wrote.
27
17
  */
28
18
  export const LEGACY_SKILL_DIRS = ['tospec-verify', 'tospec-reconcile'];
29
19
  /**
30
- * Removes any legacy skill directories (see LEGACY_SKILL_DIRS) from the given
31
- * skills directory. Idempotent — safe to call when they don't exist. Used by
32
- * init/update so upgrades leave no orphan verify/sync dirs behind.
20
+ * Removes each directory that exists and reports how many went. Errors are
21
+ * swallowed per directory: one that cannot be removed must not abort an init
22
+ * that has otherwise succeeded.
33
23
  */
34
- export async function removeLegacySkillDirs(skillsDir) {
24
+ async function removeDirs(dirs) {
35
25
  let removed = 0;
36
- for (const dirName of LEGACY_SKILL_DIRS) {
37
- const dir = path.join(skillsDir, dirName);
26
+ for (const dir of dirs) {
38
27
  try {
39
28
  if (fs.existsSync(dir)) {
40
29
  await fs.promises.rm(dir, { recursive: true, force: true });
@@ -42,49 +31,69 @@ export async function removeLegacySkillDirs(skillsDir) {
42
31
  }
43
32
  }
44
33
  catch {
45
- // Ignore errors
34
+ // Best effort, per the note above.
46
35
  }
47
36
  }
48
37
  return removed;
49
38
  }
39
+ /** Idempotent: safe when the legacy dirs do not exist. */
40
+ export async function removeLegacySkillDirs(skillsDir) {
41
+ return removeDirs(LEGACY_SKILL_DIRS.map((dirName) => path.join(skillsDir, dirName)));
42
+ }
50
43
  /**
51
- * Removes the intermediate grouped skill layouts from earlier builds so an
52
- * upgrade lands cleanly at the current flat `<toolBaseDir>/skills/tospec-<workflow>/`
53
- * location (project-scope skills can't be nested in a sub-folder). Removes:
54
- * 1. the grouped layout `<toolBaseDir>/skills/tospec/<workflow>/`
55
- * 2. the no-`skills/`-layer layout `<toolBaseDir>/tospec/<workflow>/`
56
- * The current flat `skills/tospec-<workflow>/` dirs are left alone (they're
57
- * refreshed by the link loop; a retired one like tospec-verify is handled by
58
- * removeLegacySkillDirs).
44
+ * Removes the skill directories for workflows the active profile does not select.
45
+ *
46
+ * Shared by `init` and `update`: agents load skills from the skill directory, so
47
+ * a run that prunes only `.claude/commands/tosx/` leaves excluded workflows
48
+ * loadable.
49
+ *
50
+ * ALL_WORKFLOWS and the directory naming are derived here rather than passed in,
51
+ * since a caller supplying either is a copy that can fall behind WORKFLOW_DEFS.
59
52
  */
60
- export async function removeLegacyToolSkillLayout(toolBaseDir) {
61
- let removed = 0;
62
- const legacyDirs = [
63
- path.join(toolBaseDir, 'skills', 'tospec'), // grouped: <tool>/skills/tospec/<workflow>
64
- path.join(toolBaseDir, 'tospec'), // bare: <tool>/tospec/<workflow>
65
- ];
66
- for (const dir of legacyDirs) {
67
- try {
68
- if (fs.existsSync(dir)) {
69
- await fs.promises.rm(dir, { recursive: true, force: true });
70
- removed++;
71
- }
72
- }
73
- catch {
74
- // Ignore errors
75
- }
53
+ export async function removeUnselectedSkillDirs(skillsDir, desiredWorkflows) {
54
+ const desiredSet = new Set(desiredWorkflows);
55
+ const unselected = ALL_WORKFLOWS
56
+ .filter((workflow) => !desiredSet.has(workflow))
57
+ .map(workflowSkillDirName)
58
+ .filter((dirName) => dirName)
59
+ .map((dirName) => path.join(skillsDir, dirName));
60
+ return removeDirs([...unselected, ...staleGeneratedSkillDirs(skillsDir)]);
61
+ }
62
+ /**
63
+ * `tospec-*` skill directories this version does not generate but an earlier
64
+ * one did — a workflow renamed or dropped since. Recognised by the
65
+ * `generatedBy` frontmatter: a hand-written skill carries none and is left
66
+ * alone, because nothing else would ever restore it.
67
+ */
68
+ function staleGeneratedSkillDirs(skillsDir) {
69
+ let entries;
70
+ try {
71
+ entries = fs.readdirSync(skillsDir, { withFileTypes: true });
76
72
  }
77
- return removed;
73
+ catch {
74
+ return [];
75
+ }
76
+ const known = new Set([...SKILL_NAMES, ...LEGACY_SKILL_DIRS]);
77
+ return entries
78
+ .filter((entry) => entry.isDirectory() && entry.name.startsWith('tospec-') && !known.has(entry.name))
79
+ .map((entry) => path.join(skillsDir, entry.name))
80
+ .filter((dir) => extractGeneratedByVersion(path.join(dir, 'SKILL.md')) !== null);
78
81
  }
79
82
  /**
80
- * Gets the list of tools with skillsDir configured.
83
+ * Removes the grouped skill layouts earlier builds wrote, so an upgrade lands at
84
+ * the current flat `<toolBaseDir>/skills/tospec-<workflow>/`. The flat dirs are
85
+ * left alone: the copy loop refreshes them, and retired ones go via
86
+ * removeLegacySkillDirs.
81
87
  */
88
+ export async function removeLegacyToolSkillLayout(toolBaseDir) {
89
+ return removeDirs([
90
+ path.join(toolBaseDir, 'skills', 'tospec'), // grouped: <tool>/skills/tospec/<workflow>
91
+ path.join(toolBaseDir, 'tospec'), // bare: <tool>/tospec/<workflow>
92
+ ]);
93
+ }
82
94
  export function getToolsWithSkillsDir() {
83
95
  return AI_TOOLS.filter((t) => t.skillsDir).map((t) => t.value);
84
96
  }
85
- /**
86
- * Checks which skill files exist for a tool.
87
- */
88
97
  export function getToolSkillStatus(projectRoot, toolId) {
89
98
  const tool = AI_TOOLS.find((t) => t.value === toolId);
90
99
  if (!tool?.skillsDir) {
@@ -104,36 +113,20 @@ export function getToolSkillStatus(projectRoot, toolId) {
104
113
  skillCount,
105
114
  };
106
115
  }
107
- /**
108
- * Gets the skill status for all tools with skillsDir configured.
109
- */
110
116
  export function getToolStates(projectRoot) {
111
117
  const states = new Map();
112
- const toolIds = AI_TOOLS.filter((t) => t.skillsDir).map((t) => t.value);
113
- for (const toolId of toolIds) {
118
+ for (const toolId of getToolsWithSkillsDir()) {
114
119
  states.set(toolId, getToolSkillStatus(projectRoot, toolId));
115
120
  }
116
121
  return states;
117
122
  }
118
- /**
119
- * Extracts the generatedBy version from a skill file's YAML frontmatter.
120
- * Returns null if the field is not found or the file doesn't exist.
121
- */
123
+ /** Null when the field is absent or the file cannot be read. */
122
124
  export function extractGeneratedByVersion(skillFilePath) {
123
125
  try {
124
126
  if (!fs.existsSync(skillFilePath)) {
125
127
  return null;
126
128
  }
127
129
  const content = fs.readFileSync(skillFilePath, 'utf-8');
128
- // Look for generatedBy in the YAML frontmatter
129
- // The file format is:
130
- // ---
131
- // ...
132
- // metadata:
133
- // author: tospec
134
- // version: "1.0"
135
- // generatedBy: "0.23.0"
136
- // ---
137
130
  const generatedByMatch = content.match(/^\s*generatedBy:\s*["']?([^"'\n]+)["']?\s*$/m);
138
131
  if (generatedByMatch && generatedByMatch[1]) {
139
132
  return generatedByMatch[1].trim();
@@ -144,9 +137,7 @@ export function extractGeneratedByVersion(skillFilePath) {
144
137
  return null;
145
138
  }
146
139
  }
147
- /**
148
- * Gets version status for a tool by reading the first available skill file.
149
- */
140
+ /** Reads the version from the first skill file the tool has. */
150
141
  export function getToolVersionStatus(projectRoot, toolId, currentVersion) {
151
142
  const tool = AI_TOOLS.find((t) => t.value === toolId);
152
143
  if (!tool?.skillsDir) {
@@ -160,7 +151,6 @@ export function getToolVersionStatus(projectRoot, toolId, currentVersion) {
160
151
  }
161
152
  const skillsDir = path.join(projectRoot, tool.skillsDir, 'skills');
162
153
  let generatedByVersion = null;
163
- // Find the first skill file that exists and read its version
164
154
  for (const skillName of SKILL_NAMES) {
165
155
  const skillFile = path.join(skillsDir, skillName, 'SKILL.md');
166
156
  if (fs.existsSync(skillFile)) {
@@ -178,9 +168,6 @@ export function getToolVersionStatus(projectRoot, toolId, currentVersion) {
178
168
  needsUpdate,
179
169
  };
180
170
  }
181
- /**
182
- * Gets all configured tools in the project.
183
- */
184
171
  export function getConfiguredTools(projectRoot) {
185
172
  return AI_TOOLS
186
173
  .filter((t) => t.skillsDir && isToolInstalled(projectRoot, t.value))
@@ -188,21 +175,14 @@ export function getConfiguredTools(projectRoot) {
188
175
  }
189
176
  /**
190
177
  * Whether tospec has been installed into this tool dir, independent of how many
191
- * skills currently sit there.
192
- *
193
- * Distinct from `getToolSkillStatus().configured`, which answers "does this tool
194
- * have skills right now" — the right question for the init menu's pre-selection,
195
- * and the wrong one for `update`/`rules`. A profile that selects no workflows
196
- * makes `update` remove every `tospec-<workflow>` dir, and while installation was
197
- * inferred from that same directory count, the run that emptied the dir also
198
- * erased the only evidence the tool was ever set up: the next `update` reported
199
- * "No configured tools found" and only `init` could recover. See
200
- * tospec/decisions/20260916_152000-tool-install-marker-not-skill-count.md
178
+ * skills sit there — the right question for `update`/`rules`, where
179
+ * `getToolSkillStatus().configured` is wrong: a profile selecting no workflows
180
+ * makes `update` remove every skill dir, erasing the evidence the tool was set
181
+ * up. tospec/decisions/20260916_152000-tool-install-marker-not-skill-count.md
201
182
  *
202
- * The workflow rule document is the durable marker: written for every configured
203
- * tool on every init/update/rules, and removed by none of them. The legacy
204
- * `rules/tospec/decision.md` deliberately does not count — it is written by init
205
- * only, so it proves tospec once touched the dir, not that it still manages it.
183
+ * The workflow rule document is the durable marker: written on every
184
+ * init/update/rules, removed by none. The legacy `rules/tospec/decision.md` is
185
+ * init-only, so it proves tospec once touched the dir, not that it manages it.
206
186
  */
207
187
  export function isToolInstalled(projectRoot, toolId) {
208
188
  const tool = AI_TOOLS.find((t) => t.value === toolId);
@@ -211,7 +191,7 @@ export function isToolInstalled(projectRoot, toolId) {
211
191
  if (getToolSkillStatus(projectRoot, toolId).configured)
212
192
  return true;
213
193
  // Either spelling: a project last touched before the filename typo was fixed
214
- // still holds the legacy name, and it is just as much proof of an install.
194
+ // holds the legacy name, which is just as much proof of an install.
215
195
  return [WORKFLOW_RULE_FILENAME, LEGACY_WORKFLOW_RULE_FILENAME].some((name) => fs.existsSync(path.join(projectRoot, tool.skillsDir, ...TOOL_RULES_SUBDIR, name)));
216
196
  }
217
197
  //# sourceMappingURL=tool-detection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-detection.js","sourceRoot":"","sources":["../../../src/core/shared/tool-detection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EACL,QAAQ,EACR,6BAA6B,EAC7B,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE5E;;;;GAIG;AACH,MAAM,CAAC,MAAM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AC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAC3E,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,SAAU,EAAE,GAAG,iBAAiB,EAAE,IAAI,CAAC,CAAC,CACnF,CAAC;AACJ,CAAC"}
@@ -1,31 +1,21 @@
1
1
  /**
2
2
  * Skill duration metrics, derived from Claude Code transcripts.
3
3
  *
4
- * There is no tospec-side event to measure. The CLI is stateless by design
5
- * (status comes from file existence), so it never learns when a workflow
6
- * starts or ends — and CLI-call telemetry would miss the workflows that
7
- * barely touch the CLI at all: `grill` only ever runs `tospec list`, and
8
- * `explore` only an optional `tospec decision new`.
4
+ * There is no tospec-side event to measure: the CLI is stateless, so it never
5
+ * learns when a workflow starts or ends, and CLI-call telemetry would miss the
6
+ * workflows that barely touch it. Every transcript entry in
7
+ * `<config>/projects/<encoded-cwd>/<session>.jsonl` already carries an
8
+ * `attributionSkill`, so this is a read-only analysis of existing data. The
9
+ * field is recent, so older sessions yield no runs — reported, not hidden.
9
10
  *
10
- * Claude Code already records what we need. Every transcript entry in
11
- * `<config>/projects/<encoded-cwd>/<session>.jsonl` carries an
12
- * `attributionSkill` field naming the skill that entry belongs to, so skill
13
- * timing is a read-only analysis of data that already exists — retroactively,
14
- * with nothing to install. The cost is that the field is recent: sessions
15
- * predating it yield no runs, which is reported rather than hidden.
16
- *
17
- * Two durations are reported per run because they answer different questions
18
- * and diverge sharply in conversational workflows:
11
+ * Two durations per run, because they diverge sharply in conversational
12
+ * workflows:
19
13
  *
20
14
  * - `span` — wall clock, first to last entry. "How long did this take?"
21
15
  * - `engaged` — span minus gaps over `idleGapMs`. "How much of that was work?"
22
16
  *
23
- * An interview loop like `grill` idles while the user thinks, so its span runs
24
- * well above its engaged time; a continuous `apply` pass has the two nearly
25
- * equal. Reporting only one of them would silently answer the other question.
26
- *
27
- * Pure parsing/aggregation is split from the directory-reading wrapper so
28
- * vitest can exercise it without a transcript store on disk.
17
+ * Pure parsing/aggregation is split from the directory-reading wrapper so tests
18
+ * can exercise it without a transcript store on disk.
29
19
  */
30
20
  /** Gap above which the user is considered away, excluded from `engaged`. */
31
21
  export declare const DEFAULT_IDLE_GAP_MS: number;
@@ -42,10 +32,9 @@ export interface TranscriptEntry {
42
32
  skill: string | null;
43
33
  }
44
34
  /**
45
- * Which tool a run's timing was derived from. Claude Code's `attributionSkill`
46
- * is read directly from recorded data; Codex's is inferred by a heuristic
47
- * (see codex-metrics.ts) — the two are never combined into one figure because
48
- * they carry different confidence.
35
+ * Which tool a run's timing came from. Claude Code's `attributionSkill` is read
36
+ * directly; Codex's is inferred by a heuristic (codex-metrics.ts), so the two
37
+ * carry different confidence and are never combined into one figure.
49
38
  */
50
39
  export type MetricsSourceKind = 'claude-code' | 'codex';
51
40
  export interface SkillRun {
@@ -103,8 +92,8 @@ export interface RunGroupingOptions {
103
92
  /**
104
93
  * Claude Code's per-project transcript directory name: the absolute cwd with
105
94
  * every non-alphanumeric character replaced by `-`. `D:\workspace\a.b` becomes
106
- * `D--workspace-a-b` (the drive colon and the separator each contribute a dash,
107
- * which is why the doubled dash is correct and not a bug).
95
+ * `D--workspace-a-b` — the drive colon and the separator each contribute a dash,
96
+ * so the doubled dash is correct.
108
97
  */
109
98
  export declare function encodeProjectDirName(rootPath: string): string;
110
99
  export interface TranscriptDirOptions {
@@ -112,57 +101,46 @@ export interface TranscriptDirOptions {
112
101
  homedir?: string;
113
102
  }
114
103
  /**
115
- * Locates the transcript directory for a project root. `CLAUDE_CONFIG_DIR` is
116
- * honoured because Claude Code itself does; without it the default is
117
- * `~/.claude`. Injectable env/homedir follows global-config.ts so path
118
- * resolution stays testable.
104
+ * The transcript directory for a project root. `CLAUDE_CONFIG_DIR` is honoured
105
+ * because Claude Code itself does; without it the default is `~/.claude`.
119
106
  */
120
107
  export declare function resolveTranscriptDir(rootPath: string, options?: TranscriptDirOptions): string;
121
108
  /**
122
109
  * Collapses the two names one workflow is recorded under — the slash command
123
- * (`tosx:apply`) and the skill (`tospec-apply`) — onto the workflow id. Without
124
- * this every workflow's history is split across two unrelated-looking rows.
110
+ * (`tosx:apply`) and the skill (`tospec-apply`) — onto the workflow id, so its
111
+ * history is one row rather than two.
125
112
  */
126
113
  export declare function normalizeSkillName(raw: string): string;
127
114
  export declare function isWorkflowSkill(skill: string): boolean;
128
115
  /**
129
116
  * Parses one `.jsonl` transcript into timestamped entries, sorted by time.
130
117
  * Malformed lines are skipped rather than fatal: transcripts are an append-only
131
- * log written by another process and can be torn at the tail while a session
132
- * is live.
118
+ * log written by another process and can be torn at the tail.
133
119
  */
134
120
  export declare function parseTranscript(text: string): TranscriptEntry[];
135
121
  /**
136
- * Groups one session's entries into runs.
122
+ * Groups one session's entries into runs. Two rules carry the design:
137
123
  *
138
- * Two rules carry the whole design:
139
- *
140
- * - An **unattributed** entry does not end a run. Tool results and the user's
141
- * own messages carry no `attributionSkill`, so treating them as boundaries
142
- * shatters a single 30-minute `apply` into a hundred two-entry fragments.
143
- * They are folded into the open run instead, because they are its work.
144
- * - A **different skill** does end a run. Grouping all of one skill's entries
145
- * by min/max instead would make an A → B → A sequence count B's elapsed time
146
- * inside A's engaged total. Splitting keeps run windows disjoint, at the cost
147
- * of reporting a re-entered skill as several runs.
124
+ * - An **unattributed** entry does not end a run. Tool results and user messages
125
+ * carry no `attributionSkill`, so treating them as boundaries shatters a
126
+ * 30-minute `apply` into fragments.
127
+ * - A **different skill** does end a run. Grouping by min/max instead would
128
+ * count B's elapsed time inside A's engaged total for an A → B → A sequence.
129
+ * The cost is reporting a re-entered skill as several runs.
148
130
  *
149
131
  * A run is additionally split at any internal gap over `splitGapMs`.
150
132
  */
151
133
  export declare function buildRuns(entries: TranscriptEntry[], session: string, options?: RunGroupingOptions): SkillRun[];
152
134
  /**
153
- * The composite key identifying one report row: a skill under one source.
154
- * Shared by aggregation, the daily/weekly/monthly series, and the frontend
155
- * (which reproduces this exact format in JS, since it cannot import a TS
156
- * module) — one definition of "row" everywhere a skill and its source must
157
- * be kept apart rather than merged.
135
+ * The composite key for one report row: a skill under one source. The frontend
136
+ * reproduces this format in JS (it cannot import a TS module), so keep the two
137
+ * in step.
158
138
  */
159
139
  export declare function skillRowKey(skill: string, source: MetricsSourceKind): string;
160
140
  /**
161
- * Aggregates runs per skill-and-source pair, ordered by total engaged time
162
- * (descending). Grouping by source too, not by skill alone, is what keeps a
163
- * skill run under both tools from being summed into one figure — Claude
164
- * Code's attribution and Codex's heuristic one carry different confidence and
165
- * must stay distinguishable everywhere a skill is reported.
141
+ * Aggregates runs per skill-and-source pair, by total engaged time descending.
142
+ * Grouping by source keeps a skill run under both tools from summing into one
143
+ * figure, since the two carry different confidence.
166
144
  */
167
145
  export declare function aggregateRuns(runs: SkillRun[]): SkillAggregate[];
168
146
  export interface CollectMetricsOptions extends RunGroupingOptions, TranscriptDirOptions {
@@ -172,14 +150,9 @@ export interface CollectMetricsOptions extends RunGroupingOptions, TranscriptDir
172
150
  /**
173
151
  * Reads every transcript for a project root and derives skill timings.
174
152
  *
175
- * Every skill found is reported, tospec's own workflows and unrelated ones
176
- * alike — there is deliberately no filtering by skill name. `workflow` on each
177
- * aggregate labels which is which, so a caller that cares can tell them apart
178
- * without this function deciding for it.
179
- *
180
- * A missing transcript directory is a reportable state (`available: false`),
181
- * not an error: the project may simply never have been opened in Claude Code,
182
- * and the caller renders that far better than a stack trace.
153
+ * No filtering by skill name: every skill found is reported, and `workflow` on
154
+ * each aggregate labels tospec's own. A missing transcript directory is a
155
+ * reportable state (`available: false`), not an error.
183
156
  */
184
157
  export declare function collectSkillMetrics(rootPath: string, options?: CollectMetricsOptions): Promise<SkillMetrics>;
185
158
  //# sourceMappingURL=skill-metrics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-metrics.d.ts","sourceRoot":"","sources":["../../src/core/skill-metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAQH,4EAA4E;AA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