@seanmars/tospec 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (402) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +114 -0
  3. package/assets/dashboard/app.js +1032 -0
  4. package/assets/dashboard/chart.umd.js +14 -0
  5. package/assets/dashboard/index.html +30 -0
  6. package/assets/dashboard/style.css +675 -0
  7. package/bin/tospec.js +5 -0
  8. package/dist/cli/index.d.ts +5 -0
  9. package/dist/cli/index.d.ts.map +1 -0
  10. package/dist/cli/index.js +330 -0
  11. package/dist/cli/index.js.map +1 -0
  12. package/dist/commands/config.d.ts +36 -0
  13. package/dist/commands/config.d.ts.map +1 -0
  14. package/dist/commands/config.js +486 -0
  15. package/dist/commands/config.js.map +1 -0
  16. package/dist/commands/dashboard.d.ts +40 -0
  17. package/dist/commands/dashboard.d.ts.map +1 -0
  18. package/dist/commands/dashboard.js +385 -0
  19. package/dist/commands/dashboard.js.map +1 -0
  20. package/dist/commands/shared-output.d.ts +24 -0
  21. package/dist/commands/shared-output.d.ts.map +1 -0
  22. package/dist/commands/shared-output.js +51 -0
  23. package/dist/commands/shared-output.js.map +1 -0
  24. package/dist/commands/show.d.ts +17 -0
  25. package/dist/commands/show.d.ts.map +1 -0
  26. package/dist/commands/show.js +164 -0
  27. package/dist/commands/show.js.map +1 -0
  28. package/dist/commands/validate.d.ts +51 -0
  29. package/dist/commands/validate.d.ts.map +1 -0
  30. package/dist/commands/validate.js +416 -0
  31. package/dist/commands/validate.js.map +1 -0
  32. package/dist/commands/workflow/index.d.ts +17 -0
  33. package/dist/commands/workflow/index.d.ts.map +1 -0
  34. package/dist/commands/workflow/index.js +12 -0
  35. package/dist/commands/workflow/index.js.map +1 -0
  36. package/dist/commands/workflow/instructions.d.ts +35 -0
  37. package/dist/commands/workflow/instructions.d.ts.map +1 -0
  38. package/dist/commands/workflow/instructions.js +359 -0
  39. package/dist/commands/workflow/instructions.js.map +1 -0
  40. package/dist/commands/workflow/new-change.d.ts +17 -0
  41. package/dist/commands/workflow/new-change.d.ts.map +1 -0
  42. package/dist/commands/workflow/new-change.js +97 -0
  43. package/dist/commands/workflow/new-change.js.map +1 -0
  44. package/dist/commands/workflow/schemas.d.ts +10 -0
  45. package/dist/commands/workflow/schemas.d.ts.map +1 -0
  46. package/dist/commands/workflow/schemas.js +33 -0
  47. package/dist/commands/workflow/schemas.js.map +1 -0
  48. package/dist/commands/workflow/shared.d.ts +63 -0
  49. package/dist/commands/workflow/shared.d.ts.map +1 -0
  50. package/dist/commands/workflow/shared.js +111 -0
  51. package/dist/commands/workflow/shared.js.map +1 -0
  52. package/dist/commands/workflow/status.d.ts +14 -0
  53. package/dist/commands/workflow/status.d.ts.map +1 -0
  54. package/dist/commands/workflow/status.js +77 -0
  55. package/dist/commands/workflow/status.js.map +1 -0
  56. package/dist/commands/workflow/templates.d.ts +16 -0
  57. package/dist/commands/workflow/templates.d.ts.map +1 -0
  58. package/dist/commands/workflow/templates.js +60 -0
  59. package/dist/commands/workflow/templates.js.map +1 -0
  60. package/dist/core/archive.d.ts +33 -0
  61. package/dist/core/archive.d.ts.map +1 -0
  62. package/dist/core/archive.js +585 -0
  63. package/dist/core/archive.js.map +1 -0
  64. package/dist/core/artifact-graph/graph.d.ts +56 -0
  65. package/dist/core/artifact-graph/graph.d.ts.map +1 -0
  66. package/dist/core/artifact-graph/graph.js +141 -0
  67. package/dist/core/artifact-graph/graph.js.map +1 -0
  68. package/dist/core/artifact-graph/index.d.ts +9 -0
  69. package/dist/core/artifact-graph/index.d.ts.map +1 -0
  70. package/dist/core/artifact-graph/index.js +14 -0
  71. package/dist/core/artifact-graph/index.js.map +1 -0
  72. package/dist/core/artifact-graph/instruction-loader.d.ts +188 -0
  73. package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -0
  74. package/dist/core/artifact-graph/instruction-loader.js +243 -0
  75. package/dist/core/artifact-graph/instruction-loader.js.map +1 -0
  76. package/dist/core/artifact-graph/outputs.d.ts +14 -0
  77. package/dist/core/artifact-graph/outputs.d.ts.map +1 -0
  78. package/dist/core/artifact-graph/outputs.js +39 -0
  79. package/dist/core/artifact-graph/outputs.js.map +1 -0
  80. package/dist/core/artifact-graph/resolver.d.ts +81 -0
  81. package/dist/core/artifact-graph/resolver.d.ts.map +1 -0
  82. package/dist/core/artifact-graph/resolver.js +257 -0
  83. package/dist/core/artifact-graph/resolver.js.map +1 -0
  84. package/dist/core/artifact-graph/schema.d.ts +13 -0
  85. package/dist/core/artifact-graph/schema.d.ts.map +1 -0
  86. package/dist/core/artifact-graph/schema.js +108 -0
  87. package/dist/core/artifact-graph/schema.js.map +1 -0
  88. package/dist/core/artifact-graph/state.d.ts +12 -0
  89. package/dist/core/artifact-graph/state.d.ts.map +1 -0
  90. package/dist/core/artifact-graph/state.js +31 -0
  91. package/dist/core/artifact-graph/state.js.map +1 -0
  92. package/dist/core/artifact-graph/types.d.ts +55 -0
  93. package/dist/core/artifact-graph/types.d.ts.map +1 -0
  94. package/dist/core/artifact-graph/types.js +38 -0
  95. package/dist/core/artifact-graph/types.js.map +1 -0
  96. package/dist/core/available-tools.d.ts +17 -0
  97. package/dist/core/available-tools.d.ts.map +1 -0
  98. package/dist/core/available-tools.js +43 -0
  99. package/dist/core/available-tools.js.map +1 -0
  100. package/dist/core/change-metadata/index.d.ts +2 -0
  101. package/dist/core/change-metadata/index.d.ts.map +1 -0
  102. package/dist/core/change-metadata/index.js +2 -0
  103. package/dist/core/change-metadata/index.js.map +1 -0
  104. package/dist/core/change-metadata/schema.d.ts +12 -0
  105. package/dist/core/change-metadata/schema.d.ts.map +1 -0
  106. package/dist/core/change-metadata/schema.js +15 -0
  107. package/dist/core/change-metadata/schema.js.map +1 -0
  108. package/dist/core/change-presenter.d.ts +24 -0
  109. package/dist/core/change-presenter.d.ts.map +1 -0
  110. package/dist/core/change-presenter.js +135 -0
  111. package/dist/core/change-presenter.js.map +1 -0
  112. package/dist/core/change-status-policy.d.ts +35 -0
  113. package/dist/core/change-status-policy.d.ts.map +1 -0
  114. package/dist/core/change-status-policy.js +34 -0
  115. package/dist/core/change-status-policy.js.map +1 -0
  116. package/dist/core/command-generation/adapters/claude.d.ts +14 -0
  117. package/dist/core/command-generation/adapters/claude.d.ts.map +1 -0
  118. package/dist/core/command-generation/adapters/claude.js +38 -0
  119. package/dist/core/command-generation/adapters/claude.js.map +1 -0
  120. package/dist/core/command-generation/adapters/cursor.d.ts +14 -0
  121. package/dist/core/command-generation/adapters/cursor.d.ts.map +1 -0
  122. package/dist/core/command-generation/adapters/cursor.js +31 -0
  123. package/dist/core/command-generation/adapters/cursor.js.map +1 -0
  124. package/dist/core/command-generation/adapters/index.d.ts +8 -0
  125. package/dist/core/command-generation/adapters/index.d.ts.map +1 -0
  126. package/dist/core/command-generation/adapters/index.js +8 -0
  127. package/dist/core/command-generation/adapters/index.js.map +1 -0
  128. package/dist/core/command-generation/generator.d.ts +21 -0
  129. package/dist/core/command-generation/generator.d.ts.map +1 -0
  130. package/dist/core/command-generation/generator.js +27 -0
  131. package/dist/core/command-generation/generator.js.map +1 -0
  132. package/dist/core/command-generation/index.d.ts +22 -0
  133. package/dist/core/command-generation/index.d.ts.map +1 -0
  134. package/dist/core/command-generation/index.js +24 -0
  135. package/dist/core/command-generation/index.js.map +1 -0
  136. package/dist/core/command-generation/registry.d.ts +24 -0
  137. package/dist/core/command-generation/registry.d.ts.map +1 -0
  138. package/dist/core/command-generation/registry.js +38 -0
  139. package/dist/core/command-generation/registry.js.map +1 -0
  140. package/dist/core/command-generation/types.d.ts +56 -0
  141. package/dist/core/command-generation/types.d.ts.map +1 -0
  142. package/dist/core/command-generation/types.js +8 -0
  143. package/dist/core/command-generation/types.js.map +1 -0
  144. package/dist/core/command-generation/yaml.d.ts +22 -0
  145. package/dist/core/command-generation/yaml.d.ts.map +1 -0
  146. package/dist/core/command-generation/yaml.js +38 -0
  147. package/dist/core/command-generation/yaml.js.map +1 -0
  148. package/dist/core/config-prompts.d.ts +9 -0
  149. package/dist/core/config-prompts.d.ts.map +1 -0
  150. package/dist/core/config-prompts.js +34 -0
  151. package/dist/core/config-prompts.js.map +1 -0
  152. package/dist/core/config-schema.d.ts +87 -0
  153. package/dist/core/config-schema.d.ts.map +1 -0
  154. package/dist/core/config-schema.js +239 -0
  155. package/dist/core/config-schema.js.map +1 -0
  156. package/dist/core/config.d.ts +19 -0
  157. package/dist/core/config.d.ts.map +1 -0
  158. package/dist/core/config.js +14 -0
  159. package/dist/core/config.js.map +1 -0
  160. package/dist/core/converters/json-converter.d.ts +6 -0
  161. package/dist/core/converters/json-converter.d.ts.map +1 -0
  162. package/dist/core/converters/json-converter.js +51 -0
  163. package/dist/core/converters/json-converter.js.map +1 -0
  164. package/dist/core/dashboard-activity.d.ts +50 -0
  165. package/dist/core/dashboard-activity.d.ts.map +1 -0
  166. package/dist/core/dashboard-activity.js +147 -0
  167. package/dist/core/dashboard-activity.js.map +1 -0
  168. package/dist/core/dashboard-data.d.ts +100 -0
  169. package/dist/core/dashboard-data.d.ts.map +1 -0
  170. package/dist/core/dashboard-data.js +368 -0
  171. package/dist/core/dashboard-data.js.map +1 -0
  172. package/dist/core/global-config.d.ts +51 -0
  173. package/dist/core/global-config.d.ts.map +1 -0
  174. package/dist/core/global-config.js +124 -0
  175. package/dist/core/global-config.js.map +1 -0
  176. package/dist/core/id.d.ts +17 -0
  177. package/dist/core/id.d.ts.map +1 -0
  178. package/dist/core/id.js +30 -0
  179. package/dist/core/id.js.map +1 -0
  180. package/dist/core/init.d.ts +34 -0
  181. package/dist/core/init.d.ts.map +1 -0
  182. package/dist/core/init.js +495 -0
  183. package/dist/core/init.js.map +1 -0
  184. package/dist/core/list.d.ts +12 -0
  185. package/dist/core/list.d.ts.map +1 -0
  186. package/dist/core/list.js +192 -0
  187. package/dist/core/list.js.map +1 -0
  188. package/dist/core/migrate.d.ts +52 -0
  189. package/dist/core/migrate.d.ts.map +1 -0
  190. package/dist/core/migrate.js +300 -0
  191. package/dist/core/migrate.js.map +1 -0
  192. package/dist/core/parsers/change-parser.d.ts +19 -0
  193. package/dist/core/parsers/change-parser.d.ts.map +1 -0
  194. package/dist/core/parsers/change-parser.js +204 -0
  195. package/dist/core/parsers/change-parser.js.map +1 -0
  196. package/dist/core/parsers/markdown-parser.d.ts +29 -0
  197. package/dist/core/parsers/markdown-parser.d.ts.map +1 -0
  198. package/dist/core/parsers/markdown-parser.js +181 -0
  199. package/dist/core/parsers/markdown-parser.js.map +1 -0
  200. package/dist/core/parsers/requirement-blocks.d.ts +37 -0
  201. package/dist/core/parsers/requirement-blocks.d.ts.map +1 -0
  202. package/dist/core/parsers/requirement-blocks.js +201 -0
  203. package/dist/core/parsers/requirement-blocks.js.map +1 -0
  204. package/dist/core/parsers/requirement-text.d.ts +55 -0
  205. package/dist/core/parsers/requirement-text.d.ts.map +1 -0
  206. package/dist/core/parsers/requirement-text.js +136 -0
  207. package/dist/core/parsers/requirement-text.js.map +1 -0
  208. package/dist/core/parsers/spec-structure.d.ts +9 -0
  209. package/dist/core/parsers/spec-structure.d.ts.map +1 -0
  210. package/dist/core/parsers/spec-structure.js +88 -0
  211. package/dist/core/parsers/spec-structure.js.map +1 -0
  212. package/dist/core/planning-home.d.ts +16 -0
  213. package/dist/core/planning-home.d.ts.map +1 -0
  214. package/dist/core/planning-home.js +67 -0
  215. package/dist/core/planning-home.js.map +1 -0
  216. package/dist/core/profiles.d.ts +24 -0
  217. package/dist/core/profiles.d.ts.map +1 -0
  218. package/dist/core/profiles.js +27 -0
  219. package/dist/core/profiles.js.map +1 -0
  220. package/dist/core/project-config.d.ts +100 -0
  221. package/dist/core/project-config.d.ts.map +1 -0
  222. package/dist/core/project-config.js +389 -0
  223. package/dist/core/project-config.js.map +1 -0
  224. package/dist/core/references.d.ts +40 -0
  225. package/dist/core/references.d.ts.map +1 -0
  226. package/dist/core/references.js +11 -0
  227. package/dist/core/references.js.map +1 -0
  228. package/dist/core/root-selection.d.ts +57 -0
  229. package/dist/core/root-selection.d.ts.map +1 -0
  230. package/dist/core/root-selection.js +98 -0
  231. package/dist/core/root-selection.js.map +1 -0
  232. package/dist/core/schemas/base.schema.d.ts +13 -0
  233. package/dist/core/schemas/base.schema.d.ts.map +1 -0
  234. package/dist/core/schemas/base.schema.js +18 -0
  235. package/dist/core/schemas/base.schema.js.map +1 -0
  236. package/dist/core/schemas/change.schema.d.ts +73 -0
  237. package/dist/core/schemas/change.schema.d.ts.map +1 -0
  238. package/dist/core/schemas/change.schema.js +31 -0
  239. package/dist/core/schemas/change.schema.js.map +1 -0
  240. package/dist/core/schemas/index.d.ts +4 -0
  241. package/dist/core/schemas/index.d.ts.map +1 -0
  242. package/dist/core/schemas/index.js +4 -0
  243. package/dist/core/schemas/index.js.map +1 -0
  244. package/dist/core/schemas/spec.schema.d.ts +18 -0
  245. package/dist/core/schemas/spec.schema.d.ts.map +1 -0
  246. package/dist/core/schemas/spec.schema.js +15 -0
  247. package/dist/core/schemas/spec.schema.js.map +1 -0
  248. package/dist/core/shared/index.d.ts +8 -0
  249. package/dist/core/shared/index.d.ts.map +1 -0
  250. package/dist/core/shared/index.js +8 -0
  251. package/dist/core/shared/index.js.map +1 -0
  252. package/dist/core/shared/skill-generation.d.ts +63 -0
  253. package/dist/core/shared/skill-generation.d.ts.map +1 -0
  254. package/dist/core/shared/skill-generation.js +125 -0
  255. package/dist/core/shared/skill-generation.js.map +1 -0
  256. package/dist/core/shared/tool-detection.d.ts +96 -0
  257. package/dist/core/shared/tool-detection.d.ts.map +1 -0
  258. package/dist/core/shared/tool-detection.js +207 -0
  259. package/dist/core/shared/tool-detection.js.map +1 -0
  260. package/dist/core/spec-presenter.d.ts +17 -0
  261. package/dist/core/spec-presenter.d.ts.map +1 -0
  262. package/dist/core/spec-presenter.js +98 -0
  263. package/dist/core/spec-presenter.js.map +1 -0
  264. package/dist/core/specs-apply.d.ts +78 -0
  265. package/dist/core/specs-apply.d.ts.map +1 -0
  266. package/dist/core/specs-apply.js +429 -0
  267. package/dist/core/specs-apply.js.map +1 -0
  268. package/dist/core/templates/index.d.ts +8 -0
  269. package/dist/core/templates/index.d.ts.map +1 -0
  270. package/dist/core/templates/index.js +9 -0
  271. package/dist/core/templates/index.js.map +1 -0
  272. package/dist/core/templates/skill-templates.d.ts +14 -0
  273. package/dist/core/templates/skill-templates.d.ts.map +1 -0
  274. package/dist/core/templates/skill-templates.js +13 -0
  275. package/dist/core/templates/skill-templates.js.map +1 -0
  276. package/dist/core/templates/types.d.ts +20 -0
  277. package/dist/core/templates/types.d.ts.map +1 -0
  278. package/dist/core/templates/types.js +5 -0
  279. package/dist/core/templates/types.js.map +1 -0
  280. package/dist/core/templates/workflows/apply.d.ts +10 -0
  281. package/dist/core/templates/workflows/apply.d.ts.map +1 -0
  282. package/dist/core/templates/workflows/apply.js +81 -0
  283. package/dist/core/templates/workflows/apply.js.map +1 -0
  284. package/dist/core/templates/workflows/archive.d.ts +10 -0
  285. package/dist/core/templates/workflows/archive.d.ts.map +1 -0
  286. package/dist/core/templates/workflows/archive.js +75 -0
  287. package/dist/core/templates/workflows/archive.js.map +1 -0
  288. package/dist/core/templates/workflows/explore.d.ts +10 -0
  289. package/dist/core/templates/workflows/explore.d.ts.map +1 -0
  290. package/dist/core/templates/workflows/explore.js +75 -0
  291. package/dist/core/templates/workflows/explore.js.map +1 -0
  292. package/dist/core/templates/workflows/issue.d.ts +10 -0
  293. package/dist/core/templates/workflows/issue.d.ts.map +1 -0
  294. package/dist/core/templates/workflows/issue.js +89 -0
  295. package/dist/core/templates/workflows/issue.js.map +1 -0
  296. package/dist/core/templates/workflows/propose.d.ts +10 -0
  297. package/dist/core/templates/workflows/propose.d.ts.map +1 -0
  298. package/dist/core/templates/workflows/propose.js +77 -0
  299. package/dist/core/templates/workflows/propose.js.map +1 -0
  300. package/dist/core/templates/workflows/sync.d.ts +14 -0
  301. package/dist/core/templates/workflows/sync.d.ts.map +1 -0
  302. package/dist/core/templates/workflows/sync.js +86 -0
  303. package/dist/core/templates/workflows/sync.js.map +1 -0
  304. package/dist/core/templates/workflows/update.d.ts +10 -0
  305. package/dist/core/templates/workflows/update.d.ts.map +1 -0
  306. package/dist/core/templates/workflows/update.js +99 -0
  307. package/dist/core/templates/workflows/update.js.map +1 -0
  308. package/dist/core/templates/workflows/verify.d.ts +9 -0
  309. package/dist/core/templates/workflows/verify.d.ts.map +1 -0
  310. package/dist/core/templates/workflows/verify.js +44 -0
  311. package/dist/core/templates/workflows/verify.js.map +1 -0
  312. package/dist/core/update.d.ts +46 -0
  313. package/dist/core/update.d.ts.map +1 -0
  314. package/dist/core/update.js +296 -0
  315. package/dist/core/update.js.map +1 -0
  316. package/dist/core/validation/constants.d.ts +34 -0
  317. package/dist/core/validation/constants.d.ts.map +1 -0
  318. package/dist/core/validation/constants.js +40 -0
  319. package/dist/core/validation/constants.js.map +1 -0
  320. package/dist/core/validation/section-validator.d.ts +19 -0
  321. package/dist/core/validation/section-validator.d.ts.map +1 -0
  322. package/dist/core/validation/section-validator.js +59 -0
  323. package/dist/core/validation/section-validator.js.map +1 -0
  324. package/dist/core/validation/types.d.ts +18 -0
  325. package/dist/core/validation/types.d.ts.map +1 -0
  326. package/dist/core/validation/types.js +2 -0
  327. package/dist/core/validation/types.js.map +1 -0
  328. package/dist/core/validation/validator.d.ts +51 -0
  329. package/dist/core/validation/validator.d.ts.map +1 -0
  330. package/dist/core/validation/validator.js +469 -0
  331. package/dist/core/validation/validator.js.map +1 -0
  332. package/dist/index.d.ts +2 -0
  333. package/dist/index.d.ts.map +1 -0
  334. package/dist/index.js +2 -0
  335. package/dist/index.js.map +1 -0
  336. package/dist/prompts/searchable-multi-select.d.ts +28 -0
  337. package/dist/prompts/searchable-multi-select.d.ts.map +1 -0
  338. package/dist/prompts/searchable-multi-select.js +158 -0
  339. package/dist/prompts/searchable-multi-select.js.map +1 -0
  340. package/dist/ui/welcome-screen.d.ts +5 -0
  341. package/dist/ui/welcome-screen.d.ts.map +1 -0
  342. package/dist/ui/welcome-screen.js +22 -0
  343. package/dist/ui/welcome-screen.js.map +1 -0
  344. package/dist/utils/change-metadata.d.ts +55 -0
  345. package/dist/utils/change-metadata.d.ts.map +1 -0
  346. package/dist/utils/change-metadata.js +141 -0
  347. package/dist/utils/change-metadata.js.map +1 -0
  348. package/dist/utils/change-utils.d.ts +73 -0
  349. package/dist/utils/change-utils.d.ts.map +1 -0
  350. package/dist/utils/change-utils.js +194 -0
  351. package/dist/utils/change-utils.js.map +1 -0
  352. package/dist/utils/command-references.d.ts +18 -0
  353. package/dist/utils/command-references.d.ts.map +1 -0
  354. package/dist/utils/command-references.js +20 -0
  355. package/dist/utils/command-references.js.map +1 -0
  356. package/dist/utils/file-system.d.ts +41 -0
  357. package/dist/utils/file-system.d.ts.map +1 -0
  358. package/dist/utils/file-system.js +320 -0
  359. package/dist/utils/file-system.js.map +1 -0
  360. package/dist/utils/index.d.ts +6 -0
  361. package/dist/utils/index.d.ts.map +1 -0
  362. package/dist/utils/index.js +9 -0
  363. package/dist/utils/index.js.map +1 -0
  364. package/dist/utils/interactive.d.ts +18 -0
  365. package/dist/utils/interactive.d.ts.map +1 -0
  366. package/dist/utils/interactive.js +21 -0
  367. package/dist/utils/interactive.js.map +1 -0
  368. package/dist/utils/item-discovery.d.ts +14 -0
  369. package/dist/utils/item-discovery.d.ts.map +1 -0
  370. package/dist/utils/item-discovery.js +104 -0
  371. package/dist/utils/item-discovery.js.map +1 -0
  372. package/dist/utils/link.d.ts +22 -0
  373. package/dist/utils/link.d.ts.map +1 -0
  374. package/dist/utils/link.js +85 -0
  375. package/dist/utils/link.js.map +1 -0
  376. package/dist/utils/match.d.ts +3 -0
  377. package/dist/utils/match.d.ts.map +1 -0
  378. package/dist/utils/match.js +22 -0
  379. package/dist/utils/match.js.map +1 -0
  380. package/dist/utils/shell-detection.d.ts +20 -0
  381. package/dist/utils/shell-detection.d.ts.map +1 -0
  382. package/dist/utils/shell-detection.js +41 -0
  383. package/dist/utils/shell-detection.js.map +1 -0
  384. package/dist/utils/task-progress.d.ts +32 -0
  385. package/dist/utils/task-progress.d.ts.map +1 -0
  386. package/dist/utils/task-progress.js +129 -0
  387. package/dist/utils/task-progress.js.map +1 -0
  388. package/dist/utils/timestamp.d.ts +9 -0
  389. package/dist/utils/timestamp.d.ts.map +1 -0
  390. package/dist/utils/timestamp.js +18 -0
  391. package/dist/utils/timestamp.js.map +1 -0
  392. package/package.json +55 -0
  393. package/schemas/issue/schema.yaml +34 -0
  394. package/schemas/issue/templates/spec.md +13 -0
  395. package/schemas/issue/templates/task.md +21 -0
  396. package/schemas/issue/templates/ticket.md +2 -0
  397. package/schemas/sdd/schema.yaml +55 -0
  398. package/schemas/sdd/templates/design.md +15 -0
  399. package/schemas/sdd/templates/proposal.md +15 -0
  400. package/schemas/sdd/templates/spec.md +13 -0
  401. package/schemas/sdd/templates/tasks.md +11 -0
  402. package/schemas/sdd/templates/ticket.md +2 -0
@@ -0,0 +1,35 @@
1
+ import type { PlanningHome } from './planning-home.js';
2
+ export interface PlanningHomeSummary {
3
+ kind: 'repo';
4
+ root: string;
5
+ changesDir: string;
6
+ defaultSchema: string;
7
+ }
8
+ export interface ActionContext {
9
+ mode: 'repo-local';
10
+ sourceOfTruth: 'repo';
11
+ planningArtifacts: string[];
12
+ linkedContext: Array<{
13
+ name: string;
14
+ }>;
15
+ allowedEditRoots: string[];
16
+ requiresAffectedAreaSelection: boolean;
17
+ constraints: string[];
18
+ }
19
+ export interface ChangeStatusPolicyArtifact {
20
+ id: string;
21
+ status: 'done' | 'ready' | 'blocked' | 'skipped';
22
+ }
23
+ export interface ChangeNextStepsInput {
24
+ changeName: string;
25
+ artifactStatuses: ChangeStatusPolicyArtifact[];
26
+ allArtifactsComplete: boolean;
27
+ }
28
+ export interface ActionContextInput {
29
+ projectRoot: string;
30
+ artifactIds: string[];
31
+ }
32
+ export declare function summarizePlanningHome(planningHome: PlanningHome | undefined): PlanningHomeSummary | undefined;
33
+ export declare function buildActionContext(input: ActionContextInput): ActionContext;
34
+ export declare function buildNextSteps(input: ChangeNextStepsInput): string[];
35
+ //# sourceMappingURL=change-status-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-status-policy.d.ts","sourceRoot":"","sources":["../../src/core/change-status-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,aAAa,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,6BAA6B,EAAE,OAAO,CAAC;IACvC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;CAClD;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,0BAA0B,EAAE,CAAC;IAC/C,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,YAAY,GAAG,SAAS,GACrC,mBAAmB,GAAG,SAAS,CAWjC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAU3E;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAapE"}
@@ -0,0 +1,34 @@
1
+ export function summarizePlanningHome(planningHome) {
2
+ if (!planningHome) {
3
+ return undefined;
4
+ }
5
+ return {
6
+ kind: planningHome.kind,
7
+ root: planningHome.root,
8
+ changesDir: planningHome.changesDir,
9
+ defaultSchema: planningHome.defaultSchema,
10
+ };
11
+ }
12
+ export function buildActionContext(input) {
13
+ return {
14
+ mode: 'repo-local',
15
+ sourceOfTruth: 'repo',
16
+ planningArtifacts: input.artifactIds,
17
+ linkedContext: [],
18
+ allowedEditRoots: [input.projectRoot],
19
+ requiresAffectedAreaSelection: false,
20
+ constraints: ['Repo-local change artifacts and implementation edits are scoped to this project.'],
21
+ };
22
+ }
23
+ export function buildNextSteps(input) {
24
+ const readyArtifact = input.artifactStatuses.find((artifact) => artifact.status === 'ready');
25
+ const steps = [];
26
+ if (readyArtifact) {
27
+ steps.push(`Run tospec instructions ${readyArtifact.id} --change "${input.changeName}" --json before writing that artifact.`);
28
+ }
29
+ else if (input.allArtifactsComplete) {
30
+ steps.push('All planning artifacts are complete; review tasks before implementation.');
31
+ }
32
+ return steps;
33
+ }
34
+ //# sourceMappingURL=change-status-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-status-policy.js","sourceRoot":"","sources":["../../src/core/change-status-policy.ts"],"names":[],"mappings":"AAmCA,MAAM,UAAU,qBAAqB,CACnC,YAAsC;IAEtC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,UAAU,EAAE,YAAY,CAAC,UAAU;QACnC,aAAa,EAAE,YAAY,CAAC,aAAa;KAC1C,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAyB;IAC1D,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,aAAa,EAAE,MAAM;QACrB,iBAAiB,EAAE,KAAK,CAAC,WAAW;QACpC,aAAa,EAAE,EAAE;QACjB,gBAAgB,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC;QACrC,6BAA6B,EAAE,KAAK;QACpC,WAAW,EAAE,CAAC,kFAAkF,CAAC;KAClG,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAA2B;IACxD,MAAM,aAAa,GAAG,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC;IAC7F,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,aAAa,EAAE,CAAC;QAClB,KAAK,CAAC,IAAI,CACR,2BAA2B,aAAa,CAAC,EAAE,cAAc,KAAK,CAAC,UAAU,wCAAwC,CAClH,CAAC;IACJ,CAAC;SAAM,IAAI,KAAK,CAAC,oBAAoB,EAAE,CAAC;QACtC,KAAK,CAAC,IAAI,CAAC,0EAA0E,CAAC,CAAC;IACzF,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Claude Code Command Adapter
3
+ *
4
+ * Formats commands for Claude Code following its frontmatter specification.
5
+ */
6
+ import type { ToolCommandAdapter } from '../types.js';
7
+ /**
8
+ * Claude Code adapter for command generation.
9
+ * File path: .claude/commands/tosx/<id>.md — the `tosx` sub-folder becomes the
10
+ * command namespace, so commands are invoked as `/tosx:<id>`.
11
+ * Frontmatter: name, description, category, tags
12
+ */
13
+ export declare const claudeAdapter: ToolCommandAdapter;
14
+ //# sourceMappingURL=claude.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../../src/core/command-generation/adapters/claude.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAkB,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAWtE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,kBAkB3B,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Claude Code Command Adapter
3
+ *
4
+ * Formats commands for Claude Code following its frontmatter specification.
5
+ */
6
+ import path from 'path';
7
+ import { escapeYamlValue } from '../yaml.js';
8
+ /**
9
+ * Formats a tags array as a YAML array with proper escaping.
10
+ */
11
+ function formatTagsArray(tags) {
12
+ const escapedTags = tags.map((tag) => escapeYamlValue(tag));
13
+ return `[${escapedTags.join(', ')}]`;
14
+ }
15
+ /**
16
+ * Claude Code adapter for command generation.
17
+ * File path: .claude/commands/tosx/<id>.md — the `tosx` sub-folder becomes the
18
+ * command namespace, so commands are invoked as `/tosx:<id>`.
19
+ * Frontmatter: name, description, category, tags
20
+ */
21
+ export const claudeAdapter = {
22
+ toolId: 'claude',
23
+ getFilePath(commandId) {
24
+ return path.join('.claude', 'commands', 'tosx', `${commandId}.md`);
25
+ },
26
+ formatFile(content) {
27
+ return `---
28
+ name: ${escapeYamlValue(content.name)}
29
+ description: ${escapeYamlValue(content.description)}
30
+ category: ${escapeYamlValue(content.category)}
31
+ tags: ${formatTagsArray(content.tags)}
32
+ ---
33
+
34
+ ${content.body}
35
+ `;
36
+ },
37
+ };
38
+ //# sourceMappingURL=claude.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude.js","sourceRoot":"","sources":["../../../../src/core/command-generation/adapters/claude.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH,SAAS,eAAe,CAAC,IAAc;IACrC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5D,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAuB;IAC/C,MAAM,EAAE,QAAQ;IAEhB,WAAW,CAAC,SAAiB;QAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,KAAK,CAAC,CAAC;IACrE,CAAC;IAED,UAAU,CAAC,OAAuB;QAChC,OAAO;QACH,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC;eACtB,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC;YACvC,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC;QACrC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC;;;EAGnC,OAAO,CAAC,IAAI;CACb,CAAC;IACA,CAAC;CACF,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Cursor Command Adapter
3
+ *
4
+ * Formats commands for Cursor following its frontmatter specification.
5
+ * Cursor uses a different frontmatter format and file naming convention.
6
+ */
7
+ import type { ToolCommandAdapter } from '../types.js';
8
+ /**
9
+ * Cursor adapter for command generation.
10
+ * File path: .cursor/commands/tospec-<id>.md
11
+ * Frontmatter: name (as /tospec-<id>), id, category, description
12
+ */
13
+ export declare const cursorAdapter: ToolCommandAdapter;
14
+ //# sourceMappingURL=cursor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../../src/core/command-generation/adapters/cursor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAkB,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtE;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,kBAkB3B,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Cursor Command Adapter
3
+ *
4
+ * Formats commands for Cursor following its frontmatter specification.
5
+ * Cursor uses a different frontmatter format and file naming convention.
6
+ */
7
+ import path from 'path';
8
+ import { escapeYamlValue } from '../yaml.js';
9
+ /**
10
+ * Cursor adapter for command generation.
11
+ * File path: .cursor/commands/tospec-<id>.md
12
+ * Frontmatter: name (as /tospec-<id>), id, category, description
13
+ */
14
+ export const cursorAdapter = {
15
+ toolId: 'cursor',
16
+ getFilePath(commandId) {
17
+ return path.join('.cursor', 'commands', `tospec-${commandId}.md`);
18
+ },
19
+ formatFile(content) {
20
+ return `---
21
+ name: /tospec-${content.id}
22
+ id: tospec-${content.id}
23
+ category: ${escapeYamlValue(content.category)}
24
+ description: ${escapeYamlValue(content.description)}
25
+ ---
26
+
27
+ ${content.body}
28
+ `;
29
+ },
30
+ };
31
+ //# sourceMappingURL=cursor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../../src/core/command-generation/adapters/cursor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAuB;IAC/C,MAAM,EAAE,QAAQ;IAEhB,WAAW,CAAC,SAAiB;QAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,SAAS,KAAK,CAAC,CAAC;IACpE,CAAC;IAED,UAAU,CAAC,OAAuB;QAChC,OAAO;gBACK,OAAO,CAAC,EAAE;aACb,OAAO,CAAC,EAAE;YACX,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC;eAC9B,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC;;;EAGjD,OAAO,CAAC,IAAI;CACb,CAAC;IACA,CAAC;CACF,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Command Adapters Index
3
+ *
4
+ * Re-exports the tool command adapters tospec ships (claude, cursor).
5
+ */
6
+ export { claudeAdapter } from './claude.js';
7
+ export { cursorAdapter } from './cursor.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/command-generation/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Command Adapters Index
3
+ *
4
+ * Re-exports the tool command adapters tospec ships (claude, cursor).
5
+ */
6
+ export { claudeAdapter } from './claude.js';
7
+ export { cursorAdapter } from './cursor.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/command-generation/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Command Generator
3
+ *
4
+ * Functions for generating command files using tool adapters.
5
+ */
6
+ import type { CommandContent, ToolCommandAdapter, GeneratedCommand } from './types.js';
7
+ /**
8
+ * Generate a single command file using the provided adapter.
9
+ * @param content - The tool-agnostic command content
10
+ * @param adapter - The tool-specific adapter
11
+ * @returns Generated command with path and file content
12
+ */
13
+ export declare function generateCommand(content: CommandContent, adapter: ToolCommandAdapter): GeneratedCommand;
14
+ /**
15
+ * Generate multiple command files using the provided adapter.
16
+ * @param contents - Array of tool-agnostic command contents
17
+ * @param adapter - The tool-specific adapter
18
+ * @returns Array of generated commands with paths and file contents
19
+ */
20
+ export declare function generateCommands(contents: CommandContent[], adapter: ToolCommandAdapter): GeneratedCommand[];
21
+ //# sourceMappingURL=generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/core/command-generation/generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEvF;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,kBAAkB,GAC1B,gBAAgB,CAKlB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,cAAc,EAAE,EAC1B,OAAO,EAAE,kBAAkB,GAC1B,gBAAgB,EAAE,CAEpB"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Command Generator
3
+ *
4
+ * Functions for generating command files using tool adapters.
5
+ */
6
+ /**
7
+ * Generate a single command file using the provided adapter.
8
+ * @param content - The tool-agnostic command content
9
+ * @param adapter - The tool-specific adapter
10
+ * @returns Generated command with path and file content
11
+ */
12
+ export function generateCommand(content, adapter) {
13
+ return {
14
+ path: adapter.getFilePath(content.id),
15
+ fileContent: adapter.formatFile(content),
16
+ };
17
+ }
18
+ /**
19
+ * Generate multiple command files using the provided adapter.
20
+ * @param contents - Array of tool-agnostic command contents
21
+ * @param adapter - The tool-specific adapter
22
+ * @returns Array of generated commands with paths and file contents
23
+ */
24
+ export function generateCommands(contents, adapter) {
25
+ return contents.map((content) => generateCommand(content, adapter));
26
+ }
27
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../src/core/command-generation/generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAuB,EACvB,OAA2B;IAE3B,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;QACrC,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;KACzC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAA0B,EAC1B,OAA2B;IAE3B,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AACtE,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Command Generation Module
3
+ *
4
+ * Generic command generation system with tool-specific adapters.
5
+ *
6
+ * Usage:
7
+ * ```typescript
8
+ * import { generateCommands, CommandAdapterRegistry, type CommandContent } from './command-generation/index.js';
9
+ *
10
+ * const contents: CommandContent[] = [...];
11
+ * const adapter = CommandAdapterRegistry.get('cursor');
12
+ * if (adapter) {
13
+ * const commands = generateCommands(contents, adapter);
14
+ * // Write commands to disk
15
+ * }
16
+ * ```
17
+ */
18
+ export type { CommandContent, ToolCommandAdapter, GeneratedCommand, } from './types.js';
19
+ export { CommandAdapterRegistry } from './registry.js';
20
+ export { generateCommand, generateCommands } from './generator.js';
21
+ export { claudeAdapter, cursorAdapter } from './adapters/index.js';
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/command-generation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAGvD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Command Generation Module
3
+ *
4
+ * Generic command generation system with tool-specific adapters.
5
+ *
6
+ * Usage:
7
+ * ```typescript
8
+ * import { generateCommands, CommandAdapterRegistry, type CommandContent } from './command-generation/index.js';
9
+ *
10
+ * const contents: CommandContent[] = [...];
11
+ * const adapter = CommandAdapterRegistry.get('cursor');
12
+ * if (adapter) {
13
+ * const commands = generateCommands(contents, adapter);
14
+ * // Write commands to disk
15
+ * }
16
+ * ```
17
+ */
18
+ // Registry
19
+ export { CommandAdapterRegistry } from './registry.js';
20
+ // Generator functions
21
+ export { generateCommand, generateCommands } from './generator.js';
22
+ // Adapters (for direct access if needed)
23
+ export { claudeAdapter, cursorAdapter } from './adapters/index.js';
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/command-generation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AASH,WAAW;AACX,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,sBAAsB;AACtB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEnE,yCAAyC;AACzC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Command Adapter Registry
3
+ *
4
+ * Centralized registry for tool command adapters. tospec ships adapters for
5
+ * the team's tools only (claude, cursor). Add a tool by writing an adapter in
6
+ * adapters/, exporting it from adapters/index.ts, and registering one line
7
+ * below.
8
+ */
9
+ import type { ToolCommandAdapter } from './types.js';
10
+ /**
11
+ * Registry for looking up tool command adapters.
12
+ */
13
+ export declare class CommandAdapterRegistry {
14
+ private static adapters;
15
+ /** Register a tool command adapter. */
16
+ static register(adapter: ToolCommandAdapter): void;
17
+ /** Get an adapter by tool ID. */
18
+ static get(toolId: string): ToolCommandAdapter | undefined;
19
+ /** Get all registered adapters. */
20
+ static getAll(): ToolCommandAdapter[];
21
+ /** Check if an adapter is registered for a tool. */
22
+ static has(toolId: string): boolean;
23
+ }
24
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/core/command-generation/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAIrD;;GAEG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA8C;IAQrE,uCAAuC;IACvC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI;IAIlD,iCAAiC;IACjC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAI1D,mCAAmC;IACnC,MAAM,CAAC,MAAM,IAAI,kBAAkB,EAAE;IAIrC,oDAAoD;IACpD,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;CAGpC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Command Adapter Registry
3
+ *
4
+ * Centralized registry for tool command adapters. tospec ships adapters for
5
+ * the team's tools only (claude, cursor). Add a tool by writing an adapter in
6
+ * adapters/, exporting it from adapters/index.ts, and registering one line
7
+ * below.
8
+ */
9
+ import { claudeAdapter } from './adapters/claude.js';
10
+ import { cursorAdapter } from './adapters/cursor.js';
11
+ /**
12
+ * Registry for looking up tool command adapters.
13
+ */
14
+ export class CommandAdapterRegistry {
15
+ static adapters = new Map();
16
+ // Static initializer - register built-in adapters
17
+ static {
18
+ CommandAdapterRegistry.register(claudeAdapter);
19
+ CommandAdapterRegistry.register(cursorAdapter);
20
+ }
21
+ /** Register a tool command adapter. */
22
+ static register(adapter) {
23
+ CommandAdapterRegistry.adapters.set(adapter.toolId, adapter);
24
+ }
25
+ /** Get an adapter by tool ID. */
26
+ static get(toolId) {
27
+ return CommandAdapterRegistry.adapters.get(toolId);
28
+ }
29
+ /** Get all registered adapters. */
30
+ static getAll() {
31
+ return Array.from(CommandAdapterRegistry.adapters.values());
32
+ }
33
+ /** Check if an adapter is registered for a tool. */
34
+ static has(toolId) {
35
+ return CommandAdapterRegistry.adapters.has(toolId);
36
+ }
37
+ }
38
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/core/command-generation/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,sBAAsB;IACzB,MAAM,CAAC,QAAQ,GAAoC,IAAI,GAAG,EAAE,CAAC;IAErE,kDAAkD;IAClD;QACE,sBAAsB,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QAC/C,sBAAsB,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IACjD,CAAC;IAED,uCAAuC;IACvC,MAAM,CAAC,QAAQ,CAAC,OAA2B;QACzC,sBAAsB,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED,iCAAiC;IACjC,MAAM,CAAC,GAAG,CAAC,MAAc;QACvB,OAAO,sBAAsB,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;IAED,mCAAmC;IACnC,MAAM,CAAC,MAAM;QACX,OAAO,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,oDAAoD;IACpD,MAAM,CAAC,GAAG,CAAC,MAAc;QACvB,OAAO,sBAAsB,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Command Generation Types
3
+ *
4
+ * Tool-agnostic interfaces for command generation.
5
+ * These types separate "what to generate" from "how to format it".
6
+ */
7
+ /**
8
+ * Tool-agnostic command data.
9
+ * Represents the content of a command without any tool-specific formatting.
10
+ */
11
+ export interface CommandContent {
12
+ /** Command identifier (e.g., 'explore', 'apply', 'new') */
13
+ id: string;
14
+ /** Human-readable name (e.g., 'Tospec Explore') */
15
+ name: string;
16
+ /** Brief description of command purpose */
17
+ description: string;
18
+ /** Grouping category (e.g., 'Workflow') */
19
+ category: string;
20
+ /** Array of tag strings */
21
+ tags: string[];
22
+ /** The command instruction content (body text) */
23
+ body: string;
24
+ }
25
+ /**
26
+ * Per-tool formatting strategy.
27
+ * Each AI tool implements this interface to handle its specific file path
28
+ * and frontmatter format requirements.
29
+ */
30
+ export interface ToolCommandAdapter {
31
+ /** Tool identifier matching AIToolOption.value (e.g., 'claude', 'cursor') */
32
+ toolId: string;
33
+ /**
34
+ * Returns the file path for a command.
35
+ * @param commandId - The command identifier (e.g., 'explore')
36
+ * @returns Path from project root (e.g., '.claude/commands/tosx/explore.md').
37
+ * May be absolute for tools with global-scoped prompts (e.g., Codex).
38
+ */
39
+ getFilePath(commandId: string): string;
40
+ /**
41
+ * Formats the complete file content including frontmatter.
42
+ * @param content - The tool-agnostic command content
43
+ * @returns Complete file content ready to write
44
+ */
45
+ formatFile(content: CommandContent): string;
46
+ }
47
+ /**
48
+ * Result of generating a command file.
49
+ */
50
+ export interface GeneratedCommand {
51
+ /** File path from project root, or absolute for global-scoped tools */
52
+ path: string;
53
+ /** Complete file content (frontmatter + body) */
54
+ fileContent: string;
55
+ }
56
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/command-generation/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,2DAA2D;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IACvC;;;;OAIG;IACH,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Command Generation Types
3
+ *
4
+ * Tool-agnostic interfaces for command generation.
5
+ * These types separate "what to generate" from "how to format it".
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/command-generation/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Shared YAML frontmatter helpers for command adapters.
3
+ *
4
+ * Several tool adapters emit YAML frontmatter and need to escape
5
+ * user-facing strings (name, description, category, tags) so the
6
+ * generated file stays valid YAML. This module centralizes that logic
7
+ * so the behavior is identical across adapters and fixed in one place.
8
+ */
9
+ /**
10
+ * Escapes a string value for safe YAML output.
11
+ *
12
+ * Quotes the value with double quotes when it contains characters that
13
+ * carry special meaning in YAML (or leading/trailing whitespace), and
14
+ * escapes the characters that are not representable verbatim inside a
15
+ * double-quoted scalar: backslash, double quote, line feed and carriage
16
+ * return. Values without special characters are returned unquoted.
17
+ *
18
+ * @param value - The raw string to embed in YAML frontmatter.
19
+ * @returns The value, double-quoted and escaped when necessary.
20
+ */
21
+ export declare function escapeYamlValue(value: string): string;
22
+ //# sourceMappingURL=yaml.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../../../src/core/command-generation/yaml.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAgBrD"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Shared YAML frontmatter helpers for command adapters.
3
+ *
4
+ * Several tool adapters emit YAML frontmatter and need to escape
5
+ * user-facing strings (name, description, category, tags) so the
6
+ * generated file stays valid YAML. This module centralizes that logic
7
+ * so the behavior is identical across adapters and fixed in one place.
8
+ */
9
+ /**
10
+ * Escapes a string value for safe YAML output.
11
+ *
12
+ * Quotes the value with double quotes when it contains characters that
13
+ * carry special meaning in YAML (or leading/trailing whitespace), and
14
+ * escapes the characters that are not representable verbatim inside a
15
+ * double-quoted scalar: backslash, double quote, line feed and carriage
16
+ * return. Values without special characters are returned unquoted.
17
+ *
18
+ * @param value - The raw string to embed in YAML frontmatter.
19
+ * @returns The value, double-quoted and escaped when necessary.
20
+ */
21
+ export function escapeYamlValue(value) {
22
+ // Check if value needs quoting (contains special YAML characters or starts/ends with whitespace)
23
+ const needsQuoting = /[:\n\r#{}[\],&*!|>'"%@`]|^\s|\s$/.test(value);
24
+ if (needsQuoting) {
25
+ // Use double quotes and escape characters that are not safe to emit
26
+ // verbatim inside a double-quoted YAML scalar. Carriage returns must be
27
+ // escaped too: a literal CR inside double quotes is subject to YAML line
28
+ // folding/normalization and would silently corrupt the round-tripped value.
29
+ const escaped = value
30
+ .replace(/\\/g, '\\\\')
31
+ .replace(/"/g, '\\"')
32
+ .replace(/\n/g, '\\n')
33
+ .replace(/\r/g, '\\r');
34
+ return `"${escaped}"`;
35
+ }
36
+ return value;
37
+ }
38
+ //# sourceMappingURL=yaml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yaml.js","sourceRoot":"","sources":["../../../src/core/command-generation/yaml.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,iGAAiG;IACjG,MAAM,YAAY,GAAG,kCAAkC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpE,IAAI,YAAY,EAAE,CAAC;QACjB,oEAAoE;QACpE,wEAAwE;QACxE,yEAAyE;QACzE,4EAA4E;QAC5E,MAAM,OAAO,GAAG,KAAK;aAClB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;aACtB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;aACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;aACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACzB,OAAO,IAAI,OAAO,GAAG,CAAC;IACxB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ProjectConfig } from './project-config.js';
2
+ /**
3
+ * Serialize config to YAML string with helpful comments.
4
+ *
5
+ * @param config - Partial config object (schema required, context/rules optional)
6
+ * @returns YAML string ready to write to file
7
+ */
8
+ export declare function serializeConfig(config: Partial<ProjectConfig>): string;
9
+ //# sourceMappingURL=config-prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-prompts.d.ts","sourceRoot":"","sources":["../../src/core/config-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,MAAM,CA8BtE"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Serialize config to YAML string with helpful comments.
3
+ *
4
+ * @param config - Partial config object (schema required, context/rules optional)
5
+ * @returns YAML string ready to write to file
6
+ */
7
+ export function serializeConfig(config) {
8
+ const lines = [];
9
+ // Schema (required)
10
+ lines.push(`schema: ${config.schema}`);
11
+ lines.push('');
12
+ // Context section with comments
13
+ lines.push('# Project context (optional)');
14
+ lines.push('# This is shown to AI when creating artifacts.');
15
+ lines.push('# Add your tech stack, conventions, style guides, domain knowledge, etc.');
16
+ lines.push('# Example:');
17
+ lines.push('# context: |');
18
+ lines.push('# Tech stack: TypeScript, React, Node.js');
19
+ lines.push('# We use conventional commits');
20
+ lines.push('# Domain: e-commerce platform');
21
+ lines.push('');
22
+ // Rules section with comments
23
+ lines.push('# Per-artifact rules (optional)');
24
+ lines.push('# Add custom rules for specific artifacts.');
25
+ lines.push('# Example:');
26
+ lines.push('# rules:');
27
+ lines.push('# proposal:');
28
+ lines.push('# - Keep proposals under 500 words');
29
+ lines.push('# - Always include a "Non-goals" section');
30
+ lines.push('# tasks:');
31
+ lines.push('# - Break tasks into chunks of max 2 hours');
32
+ return lines.join('\n') + '\n';
33
+ }
34
+ //# sourceMappingURL=config-prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-prompts.js","sourceRoot":"","sources":["../../src/core/config-prompts.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAA8B;IAC5D,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,oBAAoB;IACpB,KAAK,CAAC,IAAI,CAAC,WAAW,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IACvC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,gCAAgC;IAChC,KAAK,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;IAC3C,KAAK,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;IAC7D,KAAK,CAAC,IAAI,CAAC,0EAA0E,CAAC,CAAC;IACvF,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC7B,KAAK,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;IAC3D,KAAK,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;IAChD,KAAK,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;IAChD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,8BAA8B;IAC9B,KAAK,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;IAC9C,KAAK,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;IACzD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC9B,KAAK,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;IACvD,KAAK,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;IAC7D,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;IAE/D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACjC,CAAC"}