@shrkcrft/cli 0.1.0-alpha.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 (450) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -0
  3. package/dist/asset-preview/apply-action-hint-stub.d.ts +28 -0
  4. package/dist/asset-preview/apply-action-hint-stub.d.ts.map +1 -0
  5. package/dist/asset-preview/apply-action-hint-stub.js +170 -0
  6. package/dist/asset-preview/apply-asset-preview.d.ts +31 -0
  7. package/dist/asset-preview/apply-asset-preview.d.ts.map +1 -0
  8. package/dist/asset-preview/apply-asset-preview.js +210 -0
  9. package/dist/asset-preview/apply-knowledge-stale-fix.d.ts +37 -0
  10. package/dist/asset-preview/apply-knowledge-stale-fix.d.ts.map +1 -0
  11. package/dist/asset-preview/apply-knowledge-stale-fix.js +344 -0
  12. package/dist/asset-preview/apply-missing-barrel.d.ts +15 -0
  13. package/dist/asset-preview/apply-missing-barrel.d.ts.map +1 -0
  14. package/dist/asset-preview/apply-missing-barrel.js +65 -0
  15. package/dist/asset-preview/apply-template-drift-fix.d.ts +21 -0
  16. package/dist/asset-preview/apply-template-drift-fix.d.ts.map +1 -0
  17. package/dist/asset-preview/apply-template-drift-fix.js +125 -0
  18. package/dist/asset-preview/apply-template-update.d.ts +43 -0
  19. package/dist/asset-preview/apply-template-update.d.ts.map +1 -0
  20. package/dist/asset-preview/apply-template-update.js +257 -0
  21. package/dist/asset-preview/entry-mutator.d.ts +106 -0
  22. package/dist/asset-preview/entry-mutator.d.ts.map +1 -0
  23. package/dist/asset-preview/entry-mutator.js +428 -0
  24. package/dist/authoring/authoring-kit.d.ts +36 -0
  25. package/dist/authoring/authoring-kit.d.ts.map +1 -0
  26. package/dist/authoring/authoring-kit.js +106 -0
  27. package/dist/command-registry.d.ts +158 -0
  28. package/dist/command-registry.d.ts.map +1 -0
  29. package/dist/command-registry.js +348 -0
  30. package/dist/commands/apply.command.d.ts +3 -0
  31. package/dist/commands/apply.command.d.ts.map +1 -0
  32. package/dist/commands/apply.command.js +879 -0
  33. package/dist/commands/architecture.command.d.ts +5 -0
  34. package/dist/commands/architecture.command.d.ts.map +1 -0
  35. package/dist/commands/architecture.command.js +141 -0
  36. package/dist/commands/ask.command.d.ts +3 -0
  37. package/dist/commands/ask.command.d.ts.map +1 -0
  38. package/dist/commands/ask.command.js +58 -0
  39. package/dist/commands/audit.command.d.ts +3 -0
  40. package/dist/commands/audit.command.d.ts.map +1 -0
  41. package/dist/commands/audit.command.js +141 -0
  42. package/dist/commands/biome.command.d.ts +7 -0
  43. package/dist/commands/biome.command.d.ts.map +1 -0
  44. package/dist/commands/biome.command.js +350 -0
  45. package/dist/commands/boundaries.command.d.ts +9 -0
  46. package/dist/commands/boundaries.command.d.ts.map +1 -0
  47. package/dist/commands/boundaries.command.js +314 -0
  48. package/dist/commands/brief.command.d.ts +3 -0
  49. package/dist/commands/brief.command.d.ts.map +1 -0
  50. package/dist/commands/brief.command.js +206 -0
  51. package/dist/commands/bundle.command.d.ts +3 -0
  52. package/dist/commands/bundle.command.d.ts.map +1 -0
  53. package/dist/commands/bundle.command.js +1183 -0
  54. package/dist/commands/changes.command.d.ts +3 -0
  55. package/dist/commands/changes.command.d.ts.map +1 -0
  56. package/dist/commands/changes.command.js +155 -0
  57. package/dist/commands/check.command.d.ts +3 -0
  58. package/dist/commands/check.command.d.ts.map +1 -0
  59. package/dist/commands/check.command.js +553 -0
  60. package/dist/commands/checks.command.d.ts +29 -0
  61. package/dist/commands/checks.command.d.ts.map +1 -0
  62. package/dist/commands/checks.command.js +521 -0
  63. package/dist/commands/ci.command.d.ts +3 -0
  64. package/dist/commands/ci.command.d.ts.map +1 -0
  65. package/dist/commands/ci.command.js +680 -0
  66. package/dist/commands/codemod.command.d.ts +3 -0
  67. package/dist/commands/codemod.command.d.ts.map +1 -0
  68. package/dist/commands/codemod.command.js +130 -0
  69. package/dist/commands/command-catalog.d.ts +265 -0
  70. package/dist/commands/command-catalog.d.ts.map +1 -0
  71. package/dist/commands/command-catalog.js +3242 -0
  72. package/dist/commands/commands.command.d.ts +92 -0
  73. package/dist/commands/commands.command.d.ts.map +1 -0
  74. package/dist/commands/commands.command.js +1208 -0
  75. package/dist/commands/constructs.command.d.ts +15 -0
  76. package/dist/commands/constructs.command.d.ts.map +1 -0
  77. package/dist/commands/constructs.command.js +669 -0
  78. package/dist/commands/context.command.d.ts +3 -0
  79. package/dist/commands/context.command.d.ts.map +1 -0
  80. package/dist/commands/context.command.js +120 -0
  81. package/dist/commands/contract-gate.command.d.ts +5 -0
  82. package/dist/commands/contract-gate.command.d.ts.map +1 -0
  83. package/dist/commands/contract-gate.command.js +208 -0
  84. package/dist/commands/contract-templates.command.d.ts +8 -0
  85. package/dist/commands/contract-templates.command.d.ts.map +1 -0
  86. package/dist/commands/contract-templates.command.js +151 -0
  87. package/dist/commands/contract.command.d.ts +3 -0
  88. package/dist/commands/contract.command.d.ts.map +1 -0
  89. package/dist/commands/contract.command.js +105 -0
  90. package/dist/commands/conventions.command.d.ts +8 -0
  91. package/dist/commands/conventions.command.d.ts.map +1 -0
  92. package/dist/commands/conventions.command.js +169 -0
  93. package/dist/commands/coverage.command.d.ts +3 -0
  94. package/dist/commands/coverage.command.d.ts.map +1 -0
  95. package/dist/commands/coverage.command.js +56 -0
  96. package/dist/commands/daily.commands.d.ts +5 -0
  97. package/dist/commands/daily.commands.d.ts.map +1 -0
  98. package/dist/commands/daily.commands.js +224 -0
  99. package/dist/commands/dashboard-export.command.d.ts +4 -0
  100. package/dist/commands/dashboard-export.command.d.ts.map +1 -0
  101. package/dist/commands/dashboard-export.command.js +86 -0
  102. package/dist/commands/dashboard.command.d.ts +3 -0
  103. package/dist/commands/dashboard.command.d.ts.map +1 -0
  104. package/dist/commands/dashboard.command.js +106 -0
  105. package/dist/commands/dev.command.d.ts +3 -0
  106. package/dist/commands/dev.command.d.ts.map +1 -0
  107. package/dist/commands/dev.command.js +1392 -0
  108. package/dist/commands/diagnostics.command.d.ts +5 -0
  109. package/dist/commands/diagnostics.command.d.ts.map +1 -0
  110. package/dist/commands/diagnostics.command.js +97 -0
  111. package/dist/commands/docs.command.d.ts +4 -0
  112. package/dist/commands/docs.command.d.ts.map +1 -0
  113. package/dist/commands/docs.command.js +34 -0
  114. package/dist/commands/doctor.command.d.ts +7 -0
  115. package/dist/commands/doctor.command.d.ts.map +1 -0
  116. package/dist/commands/doctor.command.js +681 -0
  117. package/dist/commands/drift.command.d.ts +3 -0
  118. package/dist/commands/drift.command.d.ts.map +1 -0
  119. package/dist/commands/drift.command.js +124 -0
  120. package/dist/commands/eslint.command.d.ts +7 -0
  121. package/dist/commands/eslint.command.d.ts.map +1 -0
  122. package/dist/commands/eslint.command.js +423 -0
  123. package/dist/commands/explore.command.d.ts +3 -0
  124. package/dist/commands/explore.command.d.ts.map +1 -0
  125. package/dist/commands/explore.command.js +65 -0
  126. package/dist/commands/export-bundle.command.d.ts +6 -0
  127. package/dist/commands/export-bundle.command.d.ts.map +1 -0
  128. package/dist/commands/export-bundle.command.js +96 -0
  129. package/dist/commands/export.command.d.ts +3 -0
  130. package/dist/commands/export.command.d.ts.map +1 -0
  131. package/dist/commands/export.command.js +83 -0
  132. package/dist/commands/feedback-dispatch.command.d.ts +12 -0
  133. package/dist/commands/feedback-dispatch.command.d.ts.map +1 -0
  134. package/dist/commands/feedback-dispatch.command.js +63 -0
  135. package/dist/commands/feedback.command.d.ts +11 -0
  136. package/dist/commands/feedback.command.d.ts.map +1 -0
  137. package/dist/commands/feedback.command.js +336 -0
  138. package/dist/commands/fix.command.d.ts +3 -0
  139. package/dist/commands/fix.command.d.ts.map +1 -0
  140. package/dist/commands/fix.command.js +776 -0
  141. package/dist/commands/gen.command.d.ts +3 -0
  142. package/dist/commands/gen.command.d.ts.map +1 -0
  143. package/dist/commands/gen.command.js +136 -0
  144. package/dist/commands/git.command.d.ts +6 -0
  145. package/dist/commands/git.command.d.ts.map +1 -0
  146. package/dist/commands/git.command.js +81 -0
  147. package/dist/commands/graph.command.d.ts +3 -0
  148. package/dist/commands/graph.command.d.ts.map +1 -0
  149. package/dist/commands/graph.command.js +287 -0
  150. package/dist/commands/grounding.command.d.ts +7 -0
  151. package/dist/commands/grounding.command.d.ts.map +1 -0
  152. package/dist/commands/grounding.command.js +54 -0
  153. package/dist/commands/help.command.d.ts +20 -0
  154. package/dist/commands/help.command.d.ts.map +1 -0
  155. package/dist/commands/help.command.js +127 -0
  156. package/dist/commands/helper.command.d.ts +6 -0
  157. package/dist/commands/helper.command.d.ts.map +1 -0
  158. package/dist/commands/helper.command.js +170 -0
  159. package/dist/commands/ide.command.d.ts +6 -0
  160. package/dist/commands/ide.command.d.ts.map +1 -0
  161. package/dist/commands/ide.command.js +340 -0
  162. package/dist/commands/impact.command.d.ts +3 -0
  163. package/dist/commands/impact.command.d.ts.map +1 -0
  164. package/dist/commands/impact.command.js +819 -0
  165. package/dist/commands/import.command.d.ts +3 -0
  166. package/dist/commands/import.command.d.ts.map +1 -0
  167. package/dist/commands/import.command.js +115 -0
  168. package/dist/commands/infer.command.d.ts +3 -0
  169. package/dist/commands/infer.command.d.ts.map +1 -0
  170. package/dist/commands/infer.command.js +227 -0
  171. package/dist/commands/ingest.command.d.ts +6 -0
  172. package/dist/commands/ingest.command.d.ts.map +1 -0
  173. package/dist/commands/ingest.command.js +532 -0
  174. package/dist/commands/init.command.d.ts +3 -0
  175. package/dist/commands/init.command.d.ts.map +1 -0
  176. package/dist/commands/init.command.js +301 -0
  177. package/dist/commands/inspect.command.d.ts +3 -0
  178. package/dist/commands/inspect.command.d.ts.map +1 -0
  179. package/dist/commands/inspect.command.js +122 -0
  180. package/dist/commands/knowledge-author.command.d.ts +22 -0
  181. package/dist/commands/knowledge-author.command.d.ts.map +1 -0
  182. package/dist/commands/knowledge-author.command.js +366 -0
  183. package/dist/commands/knowledge-propose.command.d.ts +3 -0
  184. package/dist/commands/knowledge-propose.command.d.ts.map +1 -0
  185. package/dist/commands/knowledge-propose.command.js +125 -0
  186. package/dist/commands/knowledge.command.d.ts +18 -0
  187. package/dist/commands/knowledge.command.d.ts.map +1 -0
  188. package/dist/commands/knowledge.command.js +538 -0
  189. package/dist/commands/languages.command.d.ts +3 -0
  190. package/dist/commands/languages.command.d.ts.map +1 -0
  191. package/dist/commands/languages.command.js +300 -0
  192. package/dist/commands/lint.command.d.ts +15 -0
  193. package/dist/commands/lint.command.d.ts.map +1 -0
  194. package/dist/commands/lint.command.js +194 -0
  195. package/dist/commands/mcp.command.d.ts +3 -0
  196. package/dist/commands/mcp.command.d.ts.map +1 -0
  197. package/dist/commands/mcp.command.js +74 -0
  198. package/dist/commands/memory.command.d.ts +11 -0
  199. package/dist/commands/memory.command.d.ts.map +1 -0
  200. package/dist/commands/memory.command.js +264 -0
  201. package/dist/commands/onboard.command.d.ts +3 -0
  202. package/dist/commands/onboard.command.d.ts.map +1 -0
  203. package/dist/commands/onboard.command.js +650 -0
  204. package/dist/commands/orchestrate.command.d.ts +3 -0
  205. package/dist/commands/orchestrate.command.d.ts.map +1 -0
  206. package/dist/commands/orchestrate.command.js +49 -0
  207. package/dist/commands/owners.command.d.ts +5 -0
  208. package/dist/commands/owners.command.d.ts.map +1 -0
  209. package/dist/commands/owners.command.js +113 -0
  210. package/dist/commands/ownership.command.d.ts +5 -0
  211. package/dist/commands/ownership.command.d.ts.map +1 -0
  212. package/dist/commands/ownership.command.js +117 -0
  213. package/dist/commands/pack-author.command.d.ts +30 -0
  214. package/dist/commands/pack-author.command.d.ts.map +1 -0
  215. package/dist/commands/pack-author.command.js +242 -0
  216. package/dist/commands/packs-new.d.ts +27 -0
  217. package/dist/commands/packs-new.d.ts.map +1 -0
  218. package/dist/commands/packs-new.js +805 -0
  219. package/dist/commands/packs.command.d.ts +15 -0
  220. package/dist/commands/packs.command.d.ts.map +1 -0
  221. package/dist/commands/packs.command.js +958 -0
  222. package/dist/commands/paths.command.d.ts +6 -0
  223. package/dist/commands/paths.command.d.ts.map +1 -0
  224. package/dist/commands/paths.command.js +97 -0
  225. package/dist/commands/pipelines.command.d.ts +9 -0
  226. package/dist/commands/pipelines.command.d.ts.map +1 -0
  227. package/dist/commands/pipelines.command.js +308 -0
  228. package/dist/commands/plan-check.command.d.ts +27 -0
  229. package/dist/commands/plan-check.command.d.ts.map +1 -0
  230. package/dist/commands/plan-check.command.js +150 -0
  231. package/dist/commands/plan-simulate.command.d.ts +3 -0
  232. package/dist/commands/plan-simulate.command.d.ts.map +1 -0
  233. package/dist/commands/plan-simulate.command.js +60 -0
  234. package/dist/commands/plan.command.d.ts +8 -0
  235. package/dist/commands/plan.command.d.ts.map +1 -0
  236. package/dist/commands/plan.command.js +139 -0
  237. package/dist/commands/playbooks.command.d.ts +10 -0
  238. package/dist/commands/playbooks.command.d.ts.map +1 -0
  239. package/dist/commands/playbooks.command.js +296 -0
  240. package/dist/commands/plugin.command.d.ts +11 -0
  241. package/dist/commands/plugin.command.d.ts.map +1 -0
  242. package/dist/commands/plugin.command.js +394 -0
  243. package/dist/commands/policy.command.d.ts +8 -0
  244. package/dist/commands/policy.command.d.ts.map +1 -0
  245. package/dist/commands/policy.command.js +451 -0
  246. package/dist/commands/pr.command.d.ts +3 -0
  247. package/dist/commands/pr.command.d.ts.map +1 -0
  248. package/dist/commands/pr.command.js +132 -0
  249. package/dist/commands/preflight.command.d.ts +3 -0
  250. package/dist/commands/preflight.command.d.ts.map +1 -0
  251. package/dist/commands/preflight.command.js +102 -0
  252. package/dist/commands/presets.command.d.ts +17 -0
  253. package/dist/commands/presets.command.d.ts.map +1 -0
  254. package/dist/commands/presets.command.js +647 -0
  255. package/dist/commands/profiles.command.d.ts +7 -0
  256. package/dist/commands/profiles.command.d.ts.map +1 -0
  257. package/dist/commands/profiles.command.js +151 -0
  258. package/dist/commands/provenance.command.d.ts +26 -0
  259. package/dist/commands/provenance.command.d.ts.map +1 -0
  260. package/dist/commands/provenance.command.js +237 -0
  261. package/dist/commands/quality.command.d.ts +5 -0
  262. package/dist/commands/quality.command.d.ts.map +1 -0
  263. package/dist/commands/quality.command.js +69 -0
  264. package/dist/commands/recommend.command.d.ts +4 -0
  265. package/dist/commands/recommend.command.d.ts.map +1 -0
  266. package/dist/commands/recommend.command.js +270 -0
  267. package/dist/commands/registrations.command.d.ts +3 -0
  268. package/dist/commands/registrations.command.d.ts.map +1 -0
  269. package/dist/commands/registrations.command.js +300 -0
  270. package/dist/commands/registry.command.d.ts +4 -0
  271. package/dist/commands/registry.command.d.ts.map +1 -0
  272. package/dist/commands/registry.command.js +37 -0
  273. package/dist/commands/release.command.d.ts +4 -0
  274. package/dist/commands/release.command.d.ts.map +1 -0
  275. package/dist/commands/release.command.js +639 -0
  276. package/dist/commands/repo.command.d.ts +3 -0
  277. package/dist/commands/repo.command.d.ts.map +1 -0
  278. package/dist/commands/repo.command.js +24 -0
  279. package/dist/commands/report.command.d.ts +3 -0
  280. package/dist/commands/report.command.d.ts.map +1 -0
  281. package/dist/commands/report.command.js +511 -0
  282. package/dist/commands/reposet.command.d.ts +6 -0
  283. package/dist/commands/reposet.command.d.ts.map +1 -0
  284. package/dist/commands/reposet.command.js +120 -0
  285. package/dist/commands/review.command.d.ts +3 -0
  286. package/dist/commands/review.command.d.ts.map +1 -0
  287. package/dist/commands/review.command.js +354 -0
  288. package/dist/commands/risk.command.d.ts +3 -0
  289. package/dist/commands/risk.command.d.ts.map +1 -0
  290. package/dist/commands/risk.command.js +56 -0
  291. package/dist/commands/rounds.command.d.ts +8 -0
  292. package/dist/commands/rounds.command.d.ts.map +1 -0
  293. package/dist/commands/rounds.command.js +180 -0
  294. package/dist/commands/rules.command.d.ts +49 -0
  295. package/dist/commands/rules.command.d.ts.map +1 -0
  296. package/dist/commands/rules.command.js +435 -0
  297. package/dist/commands/runtime.command.d.ts +3 -0
  298. package/dist/commands/runtime.command.d.ts.map +1 -0
  299. package/dist/commands/runtime.command.js +56 -0
  300. package/dist/commands/safety.command.d.ts +3 -0
  301. package/dist/commands/safety.command.d.ts.map +1 -0
  302. package/dist/commands/safety.command.js +117 -0
  303. package/dist/commands/scaffolds.command.d.ts +5 -0
  304. package/dist/commands/scaffolds.command.d.ts.map +1 -0
  305. package/dist/commands/scaffolds.command.js +122 -0
  306. package/dist/commands/schemas.command.d.ts +21 -0
  307. package/dist/commands/schemas.command.d.ts.map +1 -0
  308. package/dist/commands/schemas.command.js +296 -0
  309. package/dist/commands/search.command.d.ts +12 -0
  310. package/dist/commands/search.command.d.ts.map +1 -0
  311. package/dist/commands/search.command.js +275 -0
  312. package/dist/commands/self-config.command.d.ts +7 -0
  313. package/dist/commands/self-config.command.d.ts.map +1 -0
  314. package/dist/commands/self-config.command.js +156 -0
  315. package/dist/commands/self.command.d.ts +3 -0
  316. package/dist/commands/self.command.d.ts.map +1 -0
  317. package/dist/commands/self.command.js +117 -0
  318. package/dist/commands/simulate.command.d.ts +3 -0
  319. package/dist/commands/simulate.command.d.ts.map +1 -0
  320. package/dist/commands/simulate.command.js +54 -0
  321. package/dist/commands/spec.command.d.ts +29 -0
  322. package/dist/commands/spec.command.d.ts.map +1 -0
  323. package/dist/commands/spec.command.js +985 -0
  324. package/dist/commands/start-here.command.d.ts +3 -0
  325. package/dist/commands/start-here.command.d.ts.map +1 -0
  326. package/dist/commands/start-here.command.js +35 -0
  327. package/dist/commands/stats.command.d.ts +3 -0
  328. package/dist/commands/stats.command.d.ts.map +1 -0
  329. package/dist/commands/stats.command.js +88 -0
  330. package/dist/commands/surface.command.d.ts +15 -0
  331. package/dist/commands/surface.command.d.ts.map +1 -0
  332. package/dist/commands/surface.command.js +328 -0
  333. package/dist/commands/task-context.command.d.ts +7 -0
  334. package/dist/commands/task-context.command.d.ts.map +1 -0
  335. package/dist/commands/task-context.command.js +646 -0
  336. package/dist/commands/task.command.d.ts +3 -0
  337. package/dist/commands/task.command.d.ts.map +1 -0
  338. package/dist/commands/task.command.js +301 -0
  339. package/dist/commands/template-quality.command.d.ts +5 -0
  340. package/dist/commands/template-quality.command.d.ts.map +1 -0
  341. package/dist/commands/template-quality.command.js +128 -0
  342. package/dist/commands/templates.command.d.ts +26 -0
  343. package/dist/commands/templates.command.d.ts.map +1 -0
  344. package/dist/commands/templates.command.js +964 -0
  345. package/dist/commands/test.command.d.ts +3 -0
  346. package/dist/commands/test.command.d.ts.map +1 -0
  347. package/dist/commands/test.command.js +262 -0
  348. package/dist/commands/tests.command.d.ts +5 -0
  349. package/dist/commands/tests.command.d.ts.map +1 -0
  350. package/dist/commands/tests.command.js +97 -0
  351. package/dist/commands/trace.command.d.ts +3 -0
  352. package/dist/commands/trace.command.d.ts.map +1 -0
  353. package/dist/commands/trace.command.js +121 -0
  354. package/dist/commands/upgrade.command.d.ts +4 -0
  355. package/dist/commands/upgrade.command.d.ts.map +1 -0
  356. package/dist/commands/upgrade.command.js +43 -0
  357. package/dist/commands/version.command.d.ts +3 -0
  358. package/dist/commands/version.command.d.ts.map +1 -0
  359. package/dist/commands/version.command.js +10 -0
  360. package/dist/commands/why.command.d.ts +24 -0
  361. package/dist/commands/why.command.d.ts.map +1 -0
  362. package/dist/commands/why.command.js +119 -0
  363. package/dist/dashboard/dashboard-api-server.d.ts +21 -0
  364. package/dist/dashboard/dashboard-api-server.d.ts.map +1 -0
  365. package/dist/dashboard/dashboard-api-server.js +410 -0
  366. package/dist/dashboard/live-session-server.d.ts +18 -0
  367. package/dist/dashboard/live-session-server.d.ts.map +1 -0
  368. package/dist/dashboard/live-session-server.js +133 -0
  369. package/dist/diff/collect-changed-paths.d.ts +27 -0
  370. package/dist/diff/collect-changed-paths.d.ts.map +1 -0
  371. package/dist/diff/collect-changed-paths.js +68 -0
  372. package/dist/doctor/doctor-tags.d.ts +63 -0
  373. package/dist/doctor/doctor-tags.d.ts.map +1 -0
  374. package/dist/doctor/doctor-tags.js +146 -0
  375. package/dist/export/export-formats.d.ts +22 -0
  376. package/dist/export/export-formats.d.ts.map +1 -0
  377. package/dist/export/export-formats.js +135 -0
  378. package/dist/index.d.ts +22 -0
  379. package/dist/index.d.ts.map +1 -0
  380. package/dist/index.js +21 -0
  381. package/dist/init/detected-block.d.ts +57 -0
  382. package/dist/init/detected-block.d.ts.map +1 -0
  383. package/dist/init/detected-block.js +197 -0
  384. package/dist/init/gitignore.d.ts +30 -0
  385. package/dist/init/gitignore.d.ts.map +1 -0
  386. package/dist/init/gitignore.js +110 -0
  387. package/dist/init/init-templates.d.ts +6 -0
  388. package/dist/init/init-templates.d.ts.map +1 -0
  389. package/dist/init/init-templates.js +413 -0
  390. package/dist/main.d.ts +18 -0
  391. package/dist/main.d.ts.map +1 -0
  392. package/dist/main.js +699 -0
  393. package/dist/output/failure-hints.d.ts +55 -0
  394. package/dist/output/failure-hints.d.ts.map +1 -0
  395. package/dist/output/failure-hints.js +159 -0
  396. package/dist/output/format-output.d.ts +9 -0
  397. package/dist/output/format-output.d.ts.map +1 -0
  398. package/dist/output/format-output.js +26 -0
  399. package/dist/output/print-error.d.ts +3 -0
  400. package/dist/output/print-error.d.ts.map +1 -0
  401. package/dist/output/print-error.js +14 -0
  402. package/dist/output/watch-loop.d.ts +37 -0
  403. package/dist/output/watch-loop.d.ts.map +1 -0
  404. package/dist/output/watch-loop.js +115 -0
  405. package/dist/schemas/json-schemas.d.ts +1630 -0
  406. package/dist/schemas/json-schemas.d.ts.map +1 -0
  407. package/dist/schemas/json-schemas.js +811 -0
  408. package/dist/surface/about.d.ts +10 -0
  409. package/dist/surface/about.d.ts.map +1 -0
  410. package/dist/surface/about.js +53 -0
  411. package/dist/surface/load-surface-context.d.ts +34 -0
  412. package/dist/surface/load-surface-context.d.ts.map +1 -0
  413. package/dist/surface/load-surface-context.js +100 -0
  414. package/dist/surface/no-args-landing.d.ts +7 -0
  415. package/dist/surface/no-args-landing.d.ts.map +1 -0
  416. package/dist/surface/no-args-landing.js +36 -0
  417. package/dist/surface/not-enabled-error.d.ts +24 -0
  418. package/dist/surface/not-enabled-error.d.ts.map +1 -0
  419. package/dist/surface/not-enabled-error.js +36 -0
  420. package/dist/surface/profiles.d.ts +37 -0
  421. package/dist/surface/profiles.d.ts.map +1 -0
  422. package/dist/surface/profiles.js +151 -0
  423. package/dist/surface/shape-defaults.d.ts +21 -0
  424. package/dist/surface/shape-defaults.d.ts.map +1 -0
  425. package/dist/surface/shape-defaults.js +50 -0
  426. package/dist/surface/spine-extractor.d.ts +38 -0
  427. package/dist/surface/spine-extractor.d.ts.map +1 -0
  428. package/dist/surface/spine-extractor.js +100 -0
  429. package/dist/surface/surface-config-writer.d.ts +59 -0
  430. package/dist/surface/surface-config-writer.d.ts.map +1 -0
  431. package/dist/surface/surface-config-writer.js +135 -0
  432. package/dist/surface/surface-summary.d.ts +66 -0
  433. package/dist/surface/surface-summary.d.ts.map +1 -0
  434. package/dist/surface/surface-summary.js +162 -0
  435. package/dist/surface/tier.d.ts +100 -0
  436. package/dist/surface/tier.d.ts.map +1 -0
  437. package/dist/surface/tier.js +172 -0
  438. package/dist/task-next/apply-batch-runner.d.ts +42 -0
  439. package/dist/task-next/apply-batch-runner.d.ts.map +1 -0
  440. package/dist/task-next/apply-batch-runner.js +192 -0
  441. package/dist/task-next/task-next-ranker.d.ts +75 -0
  442. package/dist/task-next/task-next-ranker.d.ts.map +1 -0
  443. package/dist/task-next/task-next-ranker.js +179 -0
  444. package/dist/usage/usage-log.d.ts +54 -0
  445. package/dist/usage/usage-log.d.ts.map +1 -0
  446. package/dist/usage/usage-log.js +105 -0
  447. package/dist/validation/run-validation-loop.d.ts +38 -0
  448. package/dist/validation/run-validation-loop.d.ts.map +1 -0
  449. package/dist/validation/run-validation-loop.js +100 -0
  450. package/package.json +73 -0
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Live session server v2: serves an HTML view for one dev session, optionally
3
+ * with SSE-based "updated" notifications. Read-only — GET/HEAD only, no
4
+ * source writes, no apply endpoints, no shell execution.
5
+ *
6
+ * Extracted from dev.command.ts so it can be tested directly.
7
+ */
8
+ import * as http from 'node:http';
9
+ import * as fs from 'node:fs';
10
+ import * as nodePath from 'node:path';
11
+ import { renderDevSessionHtml, scanDevSession } from '@shrkcrft/inspector';
12
+ const LIVE_SCRIPT = `<script>(function(){try{var es=new EventSource('/events');es.onmessage=function(){location.reload()};es.addEventListener('change',function(){location.reload()})}catch(e){}})();</script><meta http-equiv="refresh" content="30">`;
13
+ export async function startLiveSessionServer(opts) {
14
+ const host = opts.host ?? '127.0.0.1';
15
+ const port = opts.port ?? 0;
16
+ const live = opts.live === true;
17
+ if (host !== '127.0.0.1' && host !== 'localhost' && host !== '::1') {
18
+ process.stderr.write(`WARNING: --host ${host} exposes the session server beyond localhost. Press Ctrl+C to abort if unintended.\n`);
19
+ }
20
+ const subscribers = new Set();
21
+ let lastVersion = 0;
22
+ let debounceTimer = null;
23
+ const broadcast = (event) => {
24
+ for (const s of [...subscribers]) {
25
+ try {
26
+ s(event);
27
+ }
28
+ catch {
29
+ subscribers.delete(s);
30
+ }
31
+ }
32
+ };
33
+ const scheduleBroadcast = (event) => {
34
+ if (debounceTimer)
35
+ clearTimeout(debounceTimer);
36
+ debounceTimer = setTimeout(() => {
37
+ lastVersion += 1;
38
+ broadcast(event);
39
+ }, 200);
40
+ };
41
+ const watchers = [];
42
+ if (live) {
43
+ for (const sub of ['session.json', 'plans', 'reports']) {
44
+ const target = nodePath.join(opts.load.dir, sub);
45
+ if (fs.existsSync(target)) {
46
+ try {
47
+ const w = fs.watch(target, { recursive: true }, () => scheduleBroadcast(sub));
48
+ watchers.push(w);
49
+ }
50
+ catch {
51
+ try {
52
+ const w = fs.watch(target, () => scheduleBroadcast(sub));
53
+ watchers.push(w);
54
+ }
55
+ catch {
56
+ /* ignore */
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ const server = http.createServer((req, res) => {
63
+ try {
64
+ if (live && req.url === '/events') {
65
+ if (req.method !== 'GET') {
66
+ res.statusCode = 405;
67
+ res.setHeader('allow', 'GET');
68
+ res.end();
69
+ return;
70
+ }
71
+ res.writeHead(200, {
72
+ 'content-type': 'text/event-stream',
73
+ 'cache-control': 'no-store',
74
+ connection: 'keep-alive',
75
+ });
76
+ const send = (event) => res.write(`event: change\ndata: ${event}\nid: ${lastVersion}\n\n`);
77
+ subscribers.add(send);
78
+ send('hello');
79
+ req.on('close', () => {
80
+ subscribers.delete(send);
81
+ });
82
+ return;
83
+ }
84
+ if (req.method !== 'GET' && req.method !== 'HEAD') {
85
+ res.statusCode = 405;
86
+ res.setHeader('allow', 'GET, HEAD');
87
+ res.end('Method not allowed');
88
+ return;
89
+ }
90
+ const reload = scanDevSession(opts.cwd, opts.load.id) ?? opts.load;
91
+ let html = renderDevSessionHtml(reload, {
92
+ nextActionLine: reload.state?.nextAction ?? undefined,
93
+ });
94
+ if (live)
95
+ html = html.replace('</head>', LIVE_SCRIPT + '</head>');
96
+ res.statusCode = 200;
97
+ res.setHeader('content-type', 'text/html; charset=utf-8');
98
+ res.setHeader('cache-control', 'no-store');
99
+ if (req.method === 'HEAD') {
100
+ res.end();
101
+ return;
102
+ }
103
+ res.end(html);
104
+ }
105
+ catch (e) {
106
+ res.statusCode = 500;
107
+ res.end(`Error: ${e.message}`);
108
+ }
109
+ });
110
+ await new Promise((resolve) => server.listen(port, host, () => resolve()));
111
+ const addr = server.address();
112
+ const realPort = typeof addr === 'object' && addr ? addr.port : port;
113
+ return {
114
+ url: `http://${host}:${realPort}`,
115
+ host,
116
+ port: realPort,
117
+ triggerEvent: (event) => {
118
+ lastVersion += 1;
119
+ broadcast(event);
120
+ },
121
+ close: () => new Promise((resolve) => {
122
+ for (const w of watchers) {
123
+ try {
124
+ w.close();
125
+ }
126
+ catch {
127
+ /* ignore */
128
+ }
129
+ }
130
+ server.close(() => resolve());
131
+ }),
132
+ };
133
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * CLI-side `--since <ref>` helper. Thin wrapper over `git diff
3
+ * --name-status <ref>...HEAD` that returns the changed file set + a
4
+ * deleted file set + an `isAvailable` flag so callers can fall back
5
+ * to whole-tree mode cleanly.
6
+ *
7
+ * Default ref resolution when `--since` is passed without a value:
8
+ * - `origin/main` if it resolves,
9
+ * - else `main` if it resolves,
10
+ * - else `undefined` (caller errors out).
11
+ *
12
+ * The function NEVER throws — git failures degrade to
13
+ * `isAvailable: false` with an error message.
14
+ */
15
+ export interface IChangedPaths {
16
+ ref: string;
17
+ changed: readonly string[];
18
+ deleted: readonly string[];
19
+ isAvailable: boolean;
20
+ error?: string;
21
+ }
22
+ export declare function resolveDefaultSinceRef(cwd: string): string | undefined;
23
+ export declare function collectChangedPaths(opts: {
24
+ cwd: string;
25
+ ref?: string;
26
+ }): IChangedPaths;
27
+ //# sourceMappingURL=collect-changed-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collect-changed-paths.d.ts","sourceRoot":"","sources":["../../src/diff/collect-changed-paths.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYtE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,aAAa,CA+ChB"}
@@ -0,0 +1,68 @@
1
+ import { execSync } from 'node:child_process';
2
+ import * as nodePath from 'node:path';
3
+ const DEFAULT_REF_CANDIDATES = ['origin/main', 'main', 'origin/master', 'master'];
4
+ const PER_PROCESS_CACHE = new Map();
5
+ export function resolveDefaultSinceRef(cwd) {
6
+ for (const candidate of DEFAULT_REF_CANDIDATES) {
7
+ try {
8
+ execSync(`git -C "${cwd}" rev-parse --verify --quiet "${candidate}"`, {
9
+ stdio: 'pipe',
10
+ });
11
+ return candidate;
12
+ }
13
+ catch {
14
+ // try next
15
+ }
16
+ }
17
+ return undefined;
18
+ }
19
+ export function collectChangedPaths(opts) {
20
+ const ref = opts.ref ?? resolveDefaultSinceRef(opts.cwd);
21
+ if (!ref) {
22
+ return {
23
+ ref: '',
24
+ changed: [],
25
+ deleted: [],
26
+ isAvailable: false,
27
+ error: 'no resolvable default branch (tried origin/main, main, origin/master, master)',
28
+ };
29
+ }
30
+ const cacheKey = `${opts.cwd}::${ref}`;
31
+ const cached = PER_PROCESS_CACHE.get(cacheKey);
32
+ if (cached)
33
+ return cached;
34
+ try {
35
+ // Two-dot diff against the ref to match the inspector's
36
+ // `getChangedFiles({ since })` behavior — includes both committed
37
+ // changes and the working tree relative to <ref>.
38
+ const stdout = execSync(`git -C "${opts.cwd}" diff --name-status "${ref}"`, { stdio: ['ignore', 'pipe', 'pipe'], encoding: 'utf8' });
39
+ const changed = [];
40
+ const deleted = [];
41
+ for (const line of stdout.split('\n')) {
42
+ const trimmed = line.trim();
43
+ if (!trimmed)
44
+ continue;
45
+ const m = trimmed.match(/^(\w)\s+(.+)$/);
46
+ if (!m)
47
+ continue;
48
+ const [, status, path] = m;
49
+ const norm = nodePath.normalize(path).split(nodePath.sep).join('/');
50
+ if (status === 'D')
51
+ deleted.push(norm);
52
+ else
53
+ changed.push(norm);
54
+ }
55
+ const result = { ref, changed, deleted, isAvailable: true };
56
+ PER_PROCESS_CACHE.set(cacheKey, result);
57
+ return result;
58
+ }
59
+ catch (e) {
60
+ return {
61
+ ref,
62
+ changed: [],
63
+ deleted: [],
64
+ isAvailable: false,
65
+ error: e instanceof Error ? e.message : String(e),
66
+ };
67
+ }
68
+ }
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Doctor warning source + state tagging.
3
+ *
4
+ * The default `shrk doctor` render used to be a wall: every warning,
5
+ * advisory or not, listed inline. Doctor folds advisory + acknowledged
6
+ * warnings into a summary line so the default view shows only what's
7
+ * actionable. `--show-advisory` (or `--strict`) restores the full view.
8
+ *
9
+ * The classifier is derived from the check id and severity — no upstream
10
+ * inspector schema change. If a future inspector adds a real `source` /
11
+ * `state` field, the helper can read it preferentially.
12
+ */
13
+ import { type IDoctorCheck, type IDoctorSuppressionEntry } from '@shrkcrft/inspector';
14
+ export declare enum DoctorSource {
15
+ Local = "local",
16
+ Pack = "pack",
17
+ BuiltIn = "built-in",
18
+ Generated = "generated",
19
+ Legacy = "legacy",
20
+ Unknown = "unknown"
21
+ }
22
+ export declare enum DoctorState {
23
+ Blocker = "blocker",
24
+ Active = "active",
25
+ Advisory = "advisory",
26
+ Acknowledged = "acknowledged",
27
+ ExpiredAcknowledgement = "expired-acknowledgement"
28
+ }
29
+ export declare function classifySource(check: IDoctorCheck): DoctorSource;
30
+ export interface IClassifyStateInput {
31
+ /** Acknowledgement summary as produced by `summarizeAcknowledgements`. */
32
+ readonly acknowledgements: ReadonlyArray<IDoctorSuppressionEntry>;
33
+ /** Acknowledgements whose expiresAt is in the past. */
34
+ readonly expiredAcknowledgements: ReadonlyArray<IDoctorSuppressionEntry>;
35
+ }
36
+ export declare function classifyState(check: IDoctorCheck, ack: IClassifyStateInput): DoctorState;
37
+ export interface IDoctorTagged {
38
+ readonly check: IDoctorCheck;
39
+ readonly source: DoctorSource;
40
+ readonly state: DoctorState;
41
+ }
42
+ export interface IDoctorFoldedView {
43
+ /** Tagged checks in input order. */
44
+ readonly tagged: ReadonlyArray<IDoctorTagged>;
45
+ /** Checks the default render should show (blockers + active warnings). */
46
+ readonly visible: ReadonlyArray<IDoctorTagged>;
47
+ /** Checks folded into the summary line. */
48
+ readonly folded: ReadonlyArray<IDoctorTagged>;
49
+ /** Per-state counts for the summary line. */
50
+ readonly counts: Readonly<Record<DoctorState, number>>;
51
+ }
52
+ export interface IFoldOptions {
53
+ /** When true, every advisory/acknowledged check stays visible. Default false. */
54
+ readonly showAdvisory?: boolean;
55
+ /** When true, all checks regardless of state stay visible. Default false. */
56
+ readonly showAll?: boolean;
57
+ /** Acknowledgement payload for state classification. */
58
+ readonly ack: IClassifyStateInput;
59
+ }
60
+ export declare function foldDoctorChecks(checks: ReadonlyArray<IDoctorCheck>, options: IFoldOptions): IDoctorFoldedView;
61
+ /** Render the one-line fold summary for the default doctor view. */
62
+ export declare function renderFoldedSummary(view: IDoctorFoldedView): string;
63
+ //# sourceMappingURL=doctor-tags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-tags.d.ts","sourceRoot":"","sources":["../../src/doctor/doctor-tags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC7B,MAAM,qBAAqB,CAAC;AAE7B,oBAAY,YAAY;IACtB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,aAAa;IACpB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;IAC7B,sBAAsB,4BAA4B;CACnD;AAsBD,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAKhE;AAED,MAAM,WAAW,mBAAmB;IAClC,0EAA0E;IAC1E,QAAQ,CAAC,gBAAgB,EAAE,aAAa,CAAC,uBAAuB,CAAC,CAAC;IAClE,uDAAuD;IACvD,QAAQ,CAAC,uBAAuB,EAAE,aAAa,CAAC,uBAAuB,CAAC,CAAC;CAC1E;AAYD,wBAAgB,aAAa,CAC3B,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,mBAAmB,GACvB,WAAW,CAeb;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAC9C,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAC/C,2CAA2C;IAC3C,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAC9C,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;CACxD;AAED,MAAM,WAAW,YAAY;IAC3B,iFAAiF;IACjF,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,wDAAwD;IACxD,QAAQ,CAAC,GAAG,EAAE,mBAAmB,CAAC;CACnC;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC,EACnC,OAAO,EAAE,YAAY,GACpB,iBAAiB,CAiDnB;AAED,oEAAoE;AACpE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAenE"}
@@ -0,0 +1,146 @@
1
+ /**
2
+ * Doctor warning source + state tagging.
3
+ *
4
+ * The default `shrk doctor` render used to be a wall: every warning,
5
+ * advisory or not, listed inline. Doctor folds advisory + acknowledged
6
+ * warnings into a summary line so the default view shows only what's
7
+ * actionable. `--show-advisory` (or `--strict`) restores the full view.
8
+ *
9
+ * The classifier is derived from the check id and severity — no upstream
10
+ * inspector schema change. If a future inspector adds a real `source` /
11
+ * `state` field, the helper can read it preferentially.
12
+ */
13
+ import { DoctorSeverity, } from '@shrkcrft/inspector';
14
+ export var DoctorSource;
15
+ (function (DoctorSource) {
16
+ DoctorSource["Local"] = "local";
17
+ DoctorSource["Pack"] = "pack";
18
+ DoctorSource["BuiltIn"] = "built-in";
19
+ DoctorSource["Generated"] = "generated";
20
+ DoctorSource["Legacy"] = "legacy";
21
+ DoctorSource["Unknown"] = "unknown";
22
+ })(DoctorSource || (DoctorSource = {}));
23
+ export var DoctorState;
24
+ (function (DoctorState) {
25
+ DoctorState["Blocker"] = "blocker";
26
+ DoctorState["Active"] = "active";
27
+ DoctorState["Advisory"] = "advisory";
28
+ DoctorState["Acknowledged"] = "acknowledged";
29
+ DoctorState["ExpiredAcknowledgement"] = "expired-acknowledgement";
30
+ })(DoctorState || (DoctorState = {}));
31
+ const SOURCE_PREFIX_MAP = [
32
+ [/^pack-/i, DoctorSource.Pack],
33
+ [/^packs-/i, DoctorSource.Pack],
34
+ [/^stale-pack-signature/i, DoctorSource.Pack],
35
+ [/^generated-/i, DoctorSource.Generated],
36
+ [/^legacy-/i, DoctorSource.Legacy],
37
+ [/^config-/i, DoctorSource.BuiltIn],
38
+ [/^self-config/i, DoctorSource.BuiltIn],
39
+ [/^sharkcraft-folder/i, DoctorSource.BuiltIn],
40
+ [/^runtime-/i, DoctorSource.BuiltIn],
41
+ [/^actionhints-/i, DoctorSource.Local],
42
+ [/^action-hint/i, DoctorSource.Local],
43
+ [/^knowledge-/i, DoctorSource.Local],
44
+ [/^template-/i, DoctorSource.Local],
45
+ [/^rule(s)?-/i, DoctorSource.Local],
46
+ [/^path(s)?-/i, DoctorSource.Local],
47
+ [/^pipeline(s)?-/i, DoctorSource.Local],
48
+ [/^boundar(y|ies)/i, DoctorSource.Local],
49
+ ];
50
+ export function classifySource(check) {
51
+ for (const [re, src] of SOURCE_PREFIX_MAP) {
52
+ if (re.test(check.id))
53
+ return src;
54
+ }
55
+ return DoctorSource.Unknown;
56
+ }
57
+ function suppressionMatches(check, entry) {
58
+ if (entry.id && entry.id === check.id)
59
+ return true;
60
+ if (entry.code && entry.code === check.code)
61
+ return true;
62
+ if (entry.category && check.category && entry.category === check.category)
63
+ return true;
64
+ return false;
65
+ }
66
+ export function classifyState(check, ack) {
67
+ // Expired acknowledgements take priority over the advisory tag — they
68
+ // need attention.
69
+ for (const e of ack.expiredAcknowledgements) {
70
+ if (suppressionMatches(check, e))
71
+ return DoctorState.ExpiredAcknowledgement;
72
+ }
73
+ for (const a of ack.acknowledgements) {
74
+ if (suppressionMatches(check, a))
75
+ return DoctorState.Acknowledged;
76
+ }
77
+ if (check.advisory === true)
78
+ return DoctorState.Advisory;
79
+ if (check.severity === DoctorSeverity.Error)
80
+ return DoctorState.Blocker;
81
+ if (check.severity === DoctorSeverity.Warning)
82
+ return DoctorState.Active;
83
+ // Info / Ok stay as Active for the purpose of folding (they're not
84
+ // blockers but they're also not advisory).
85
+ return DoctorState.Active;
86
+ }
87
+ export function foldDoctorChecks(checks, options) {
88
+ const counts = {
89
+ [DoctorState.Blocker]: 0,
90
+ [DoctorState.Active]: 0,
91
+ [DoctorState.Advisory]: 0,
92
+ [DoctorState.Acknowledged]: 0,
93
+ [DoctorState.ExpiredAcknowledgement]: 0,
94
+ };
95
+ const tagged = [];
96
+ const visible = [];
97
+ const folded = [];
98
+ const okSeverities = new Set([
99
+ DoctorSeverity.Ok,
100
+ DoctorSeverity.Info,
101
+ ]);
102
+ for (const check of checks) {
103
+ const source = classifySource(check);
104
+ const state = classifyState(check, options.ack);
105
+ const entry = { check, source, state };
106
+ tagged.push(entry);
107
+ counts[state] += 1;
108
+ if (options.showAll) {
109
+ visible.push(entry);
110
+ continue;
111
+ }
112
+ // Always show OK / Info regardless of state (they're rendered as the
113
+ // header strip in doctor output).
114
+ if (okSeverities.has(check.severity)) {
115
+ visible.push(entry);
116
+ continue;
117
+ }
118
+ if (options.showAdvisory) {
119
+ visible.push(entry);
120
+ continue;
121
+ }
122
+ if (state === DoctorState.Advisory ||
123
+ state === DoctorState.Acknowledged) {
124
+ folded.push(entry);
125
+ continue;
126
+ }
127
+ visible.push(entry);
128
+ }
129
+ return { tagged, visible, folded, counts };
130
+ }
131
+ /** Render the one-line fold summary for the default doctor view. */
132
+ export function renderFoldedSummary(view) {
133
+ const parts = [];
134
+ if (view.counts[DoctorState.Advisory] > 0) {
135
+ parts.push(`${view.counts[DoctorState.Advisory]} advisory`);
136
+ }
137
+ if (view.counts[DoctorState.Acknowledged] > 0) {
138
+ parts.push(`${view.counts[DoctorState.Acknowledged]} acknowledged`);
139
+ }
140
+ if (view.counts[DoctorState.ExpiredAcknowledgement] > 0) {
141
+ parts.push(`${view.counts[DoctorState.ExpiredAcknowledgement]} expired-acknowledgement`);
142
+ }
143
+ if (parts.length === 0)
144
+ return '';
145
+ return `Folded: ${parts.join(', ')} (run with --show-advisory or --strict to expand)\n`;
146
+ }
@@ -0,0 +1,22 @@
1
+ import type { ISharkcraftInspection } from '@shrkcrft/inspector';
2
+ export type ExportFormat = 'agents-md' | 'claude-md' | 'cursor-rules' | 'copilot-instructions';
3
+ export interface ExportOptions {
4
+ format: ExportFormat;
5
+ /** Optional task to scope the export. */
6
+ task?: string;
7
+ /** Max number of rules to include. Default 12. */
8
+ maxRules?: number;
9
+ /** Max number of path conventions to include. Default 10. */
10
+ maxPaths?: number;
11
+ }
12
+ export interface ExportResult {
13
+ format: ExportFormat;
14
+ /** Suggested relative output path within the project. */
15
+ suggestedPath: string;
16
+ /** Rendered content. */
17
+ content: string;
18
+ }
19
+ export declare function renderExport(inspection: ISharkcraftInspection, options: ExportOptions): ExportResult;
20
+ export declare function isExportFormat(value: string): value is ExportFormat;
21
+ export declare const ALL_EXPORT_FORMATS: readonly ExportFormat[];
22
+ //# sourceMappingURL=export-formats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-formats.d.ts","sourceRoot":"","sources":["../../src/export/export-formats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAIjE,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,WAAW,GACX,cAAc,GACd,sBAAsB,CAAC;AAE3B,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,yDAAyD;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAqHD,wBAAgB,YAAY,CAC1B,UAAU,EAAE,qBAAqB,EACjC,OAAO,EAAE,aAAa,GACrB,YAAY,CAsBd;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,YAAY,CAOnE;AAED,eAAO,MAAM,kBAAkB,EAAE,SAAS,YAAY,EAKpD,CAAC"}
@@ -0,0 +1,135 @@
1
+ import { aggregateActionHints, KnowledgeType } from '@shrkcrft/knowledge';
2
+ import { priorityWeight } from '@shrkcrft/knowledge';
3
+ const DEFAULT_OUTPUT_PATH = {
4
+ 'agents-md': 'AGENTS.md',
5
+ 'claude-md': 'CLAUDE.md',
6
+ 'cursor-rules': '.cursor/rules/sharkcraft.mdc',
7
+ 'copilot-instructions': '.github/copilot-instructions.md',
8
+ };
9
+ function selectTopByPriority(entries, limit) {
10
+ return [...entries]
11
+ .sort((a, b) => priorityWeight(b.priority) - priorityWeight(a.priority))
12
+ .slice(0, limit);
13
+ }
14
+ function shortBullet(text, maxLen = 160) {
15
+ const single = text.replace(/\s+/g, ' ').trim();
16
+ if (single.length <= maxLen)
17
+ return single;
18
+ return single.slice(0, maxLen - 1) + '…';
19
+ }
20
+ function gatherRulesAndPaths(inspection, options) {
21
+ const allRules = inspection.knowledgeEntries.filter((e) => String(e.type) === KnowledgeType.Rule);
22
+ const allPaths = inspection.knowledgeEntries.filter((e) => String(e.type) === KnowledgeType.Path);
23
+ const rules = selectTopByPriority(allRules, options.maxRules ?? 12);
24
+ const paths = selectTopByPriority(allPaths, options.maxPaths ?? 10);
25
+ return { rules, paths };
26
+ }
27
+ function renderRulesSection(rules) {
28
+ if (rules.length === 0)
29
+ return '';
30
+ const lines = [];
31
+ for (const r of rules) {
32
+ lines.push(`- **${r.title}** (\`${r.id}\`, ${r.priority}) — ${shortBullet(r.summary ?? r.content)}`);
33
+ }
34
+ return lines.join('\n');
35
+ }
36
+ function renderPathsSection(paths) {
37
+ if (paths.length === 0)
38
+ return '';
39
+ const lines = [];
40
+ for (const p of paths) {
41
+ const path = p.metadata?.path ?? '';
42
+ lines.push(`- \`${p.id}\` → \`${path}\` — ${shortBullet(p.metadata?.description ?? p.title)}`);
43
+ }
44
+ return lines.join('\n');
45
+ }
46
+ function renderAgentActions(inspection) {
47
+ const agg = aggregateActionHints(inspection.knowledgeEntries);
48
+ const lines = [];
49
+ if (agg.commands.length) {
50
+ lines.push('Run these commands when relevant:');
51
+ for (const c of agg.commands.slice(0, 8)) {
52
+ const purpose = c.purpose ? ` — ${c.purpose}` : '';
53
+ lines.push(`- \`${c.command}\`${purpose}`);
54
+ }
55
+ lines.push('');
56
+ }
57
+ if (agg.mcpTools.length) {
58
+ lines.push('Prefer these MCP tools (when an MCP server is connected):');
59
+ for (const t of agg.mcpTools.slice(0, 8)) {
60
+ lines.push(`- \`${t.tool}\``);
61
+ }
62
+ lines.push('');
63
+ }
64
+ if (agg.forbiddenActions.length) {
65
+ lines.push('Do not:');
66
+ for (const f of agg.forbiddenActions.slice(0, 8))
67
+ lines.push(`- ${f}`);
68
+ lines.push('');
69
+ }
70
+ if (agg.verificationCommands.length) {
71
+ lines.push('Verify your work with:');
72
+ for (const c of agg.verificationCommands.slice(0, 6))
73
+ lines.push(`- \`${c}\``);
74
+ lines.push('');
75
+ }
76
+ return lines.join('\n').trim();
77
+ }
78
+ const PREAMBLE = `> Generated by \`shrk export\`. SharkCraft (structured knowledge + MCP) is the source of truth; this file is a compatibility shim for clients that read flat markdown.`;
79
+ function renderBody(inspection, options) {
80
+ const { rules, paths } = gatherRulesAndPaths(inspection, options);
81
+ const sections = [];
82
+ if (inspection.config?.projectName) {
83
+ sections.push(`## Project\n\n${inspection.config.projectName}${inspection.config.description ? ` — ${inspection.config.description}` : ''}`);
84
+ }
85
+ if (options.task) {
86
+ sections.push(`## Task focus\n\n_${options.task}_`);
87
+ }
88
+ const rulesBody = renderRulesSection(rules);
89
+ if (rulesBody)
90
+ sections.push(`## Rules to follow\n\n${rulesBody}`);
91
+ const pathsBody = renderPathsSection(paths);
92
+ if (pathsBody)
93
+ sections.push(`## Where files belong\n\n${pathsBody}`);
94
+ const actions = renderAgentActions(inspection);
95
+ if (actions)
96
+ sections.push(`## Agent actions\n\n${actions}`);
97
+ if (inspection.pipelines.length) {
98
+ const pipelines = inspection.pipelines.slice(0, 5).map((p) => `- \`${p.id}\` — ${p.description}`);
99
+ sections.push(`## Pipelines (declarative workflows)\n\n${pipelines.join('\n')}\n\nRun \`shrk pipelines get <id>\` for full step lists.`);
100
+ }
101
+ return sections.join('\n\n');
102
+ }
103
+ export function renderExport(inspection, options) {
104
+ const body = renderBody(inspection, options);
105
+ const suggestedPath = DEFAULT_OUTPUT_PATH[options.format];
106
+ let content = '';
107
+ switch (options.format) {
108
+ case 'agents-md':
109
+ content = `# Agents Guide\n\n${PREAMBLE}\n\n${body}\n`;
110
+ break;
111
+ case 'claude-md':
112
+ content = `# CLAUDE.md\n\n${PREAMBLE}\n\nThis file is read by Claude Code (claude.ai/code) at session start. Treat it as a compatibility view of the project's SharkCraft knowledge — use the MCP server (\`shrk mcp serve\`) for the live, queryable source of truth.\n\n${body}\n`;
113
+ break;
114
+ case 'cursor-rules':
115
+ // Cursor MDC frontmatter: leave alwaysApply off so the user can tune.
116
+ content = `---\ndescription: SharkCraft project rules (auto-generated)\nalwaysApply: false\n---\n\n${PREAMBLE}\n\n${body}\n`;
117
+ break;
118
+ case 'copilot-instructions':
119
+ content = `# Copilot instructions\n\n${PREAMBLE}\n\n${body}\n`;
120
+ break;
121
+ }
122
+ return { format: options.format, suggestedPath, content };
123
+ }
124
+ export function isExportFormat(value) {
125
+ return (value === 'agents-md' ||
126
+ value === 'claude-md' ||
127
+ value === 'cursor-rules' ||
128
+ value === 'copilot-instructions');
129
+ }
130
+ export const ALL_EXPORT_FORMATS = Object.freeze([
131
+ 'agents-md',
132
+ 'claude-md',
133
+ 'cursor-rules',
134
+ 'copilot-instructions',
135
+ ]);
@@ -0,0 +1,22 @@
1
+ export * from './command-registry.js';
2
+ export { initCommand } from './commands/init.command.js';
3
+ export { inspectCommand } from './commands/inspect.command.js';
4
+ export { doctorCommand } from './commands/doctor.command.js';
5
+ export { knowledgeListCommand, knowledgeGetCommand, knowledgeSearchCommand, } from './commands/knowledge.command.js';
6
+ export { rulesListCommand, rulesGetCommand, rulesRelevantCommand, } from './commands/rules.command.js';
7
+ export { pathsListCommand, pathsGetCommand, pathsSearchCommand, pathsBestCommand, } from './commands/paths.command.js';
8
+ export { templatesListCommand, templatesGetCommand, templatesSearchCommand, templatesPreviewCommand, } from './commands/templates.command.js';
9
+ export { contextCommand } from './commands/context.command.js';
10
+ export { genCommand } from './commands/gen.command.js';
11
+ export { applyCommand } from './commands/apply.command.js';
12
+ export { askCommand } from './commands/ask.command.js';
13
+ export { exportCommand } from './commands/export.command.js';
14
+ export { importCommand } from './commands/import.command.js';
15
+ export { mcpCommand } from './commands/mcp.command.js';
16
+ export { packsListCommand, packsGetCommand, packsInspectCommand, packsDoctorCommand, packsSignCommand, packsVerifyCommand, } from './commands/packs.command.js';
17
+ export { pipelinesListCommand, pipelinesGetCommand, pipelinesContextCommand, pipelinesPlanCommand, pipelinesScriptCommand, pipelinesNextCommand, } from './commands/pipelines.command.js';
18
+ export { schemasListCommand, schemasGetCommand, schemasWriteCommand, } from './commands/schemas.command.js';
19
+ export { versionCommand } from './commands/version.command.js';
20
+ export { makeHelpCommand } from './commands/help.command.js';
21
+ export { buildRegistry, runCli } from './main.js';
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ export * from "./command-registry.js";
2
+ export { initCommand } from "./commands/init.command.js";
3
+ export { inspectCommand } from "./commands/inspect.command.js";
4
+ export { doctorCommand } from "./commands/doctor.command.js";
5
+ export { knowledgeListCommand, knowledgeGetCommand, knowledgeSearchCommand, } from "./commands/knowledge.command.js";
6
+ export { rulesListCommand, rulesGetCommand, rulesRelevantCommand, } from "./commands/rules.command.js";
7
+ export { pathsListCommand, pathsGetCommand, pathsSearchCommand, pathsBestCommand, } from "./commands/paths.command.js";
8
+ export { templatesListCommand, templatesGetCommand, templatesSearchCommand, templatesPreviewCommand, } from "./commands/templates.command.js";
9
+ export { contextCommand } from "./commands/context.command.js";
10
+ export { genCommand } from "./commands/gen.command.js";
11
+ export { applyCommand } from "./commands/apply.command.js";
12
+ export { askCommand } from "./commands/ask.command.js";
13
+ export { exportCommand } from "./commands/export.command.js";
14
+ export { importCommand } from "./commands/import.command.js";
15
+ export { mcpCommand } from "./commands/mcp.command.js";
16
+ export { packsListCommand, packsGetCommand, packsInspectCommand, packsDoctorCommand, packsSignCommand, packsVerifyCommand, } from "./commands/packs.command.js";
17
+ export { pipelinesListCommand, pipelinesGetCommand, pipelinesContextCommand, pipelinesPlanCommand, pipelinesScriptCommand, pipelinesNextCommand, } from "./commands/pipelines.command.js";
18
+ export { schemasListCommand, schemasGetCommand, schemasWriteCommand, } from "./commands/schemas.command.js";
19
+ export { versionCommand } from "./commands/version.command.js";
20
+ export { makeHelpCommand } from "./commands/help.command.js";
21
+ export { buildRegistry, runCli } from "./main.js";