@kynetic-ai/spec 0.1.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (510) hide show
  1. package/README.md +250 -17
  2. package/dist/acp/client.d.ts +18 -4
  3. package/dist/acp/client.d.ts.map +1 -1
  4. package/dist/acp/client.js +44 -26
  5. package/dist/acp/client.js.map +1 -1
  6. package/dist/acp/framing.d.ts +2 -2
  7. package/dist/acp/framing.d.ts.map +1 -1
  8. package/dist/acp/framing.js +37 -29
  9. package/dist/acp/framing.js.map +1 -1
  10. package/dist/acp/index.d.ts +6 -7
  11. package/dist/acp/index.d.ts.map +1 -1
  12. package/dist/acp/index.js +3 -3
  13. package/dist/acp/index.js.map +1 -1
  14. package/dist/acp/types.d.ts +5 -5
  15. package/dist/acp/types.d.ts.map +1 -1
  16. package/dist/acp/types.js +18 -18
  17. package/dist/acp/types.js.map +1 -1
  18. package/dist/agents/adapters.d.ts.map +1 -1
  19. package/dist/agents/adapters.js +24 -13
  20. package/dist/agents/adapters.js.map +1 -1
  21. package/dist/agents/index.d.ts +2 -2
  22. package/dist/agents/index.js +2 -2
  23. package/dist/agents/spawner.d.ts +4 -4
  24. package/dist/agents/spawner.d.ts.map +1 -1
  25. package/dist/agents/spawner.js +6 -6
  26. package/dist/agents/spawner.js.map +1 -1
  27. package/dist/cli/batch-context.d.ts +43 -0
  28. package/dist/cli/batch-context.d.ts.map +1 -0
  29. package/dist/cli/batch-context.js +93 -0
  30. package/dist/cli/batch-context.js.map +1 -0
  31. package/dist/cli/batch-exec.d.ts +116 -0
  32. package/dist/cli/batch-exec.d.ts.map +1 -0
  33. package/dist/cli/batch-exec.js +694 -0
  34. package/dist/cli/batch-exec.js.map +1 -0
  35. package/dist/cli/batch.d.ts +4 -2
  36. package/dist/cli/batch.d.ts.map +1 -1
  37. package/dist/cli/batch.js +15 -14
  38. package/dist/cli/batch.js.map +1 -1
  39. package/dist/cli/command-annotations.d.ts +23 -0
  40. package/dist/cli/command-annotations.d.ts.map +1 -0
  41. package/dist/cli/command-annotations.js +27 -0
  42. package/dist/cli/command-annotations.js.map +1 -0
  43. package/dist/cli/commands/agents.d.ts +46 -0
  44. package/dist/cli/commands/agents.d.ts.map +1 -0
  45. package/dist/cli/commands/agents.js +377 -0
  46. package/dist/cli/commands/agents.js.map +1 -0
  47. package/dist/cli/commands/batch.d.ts +20 -0
  48. package/dist/cli/commands/batch.d.ts.map +1 -0
  49. package/dist/cli/commands/batch.js +214 -0
  50. package/dist/cli/commands/batch.js.map +1 -0
  51. package/dist/cli/commands/clone-for-testing.d.ts +1 -1
  52. package/dist/cli/commands/clone-for-testing.d.ts.map +1 -1
  53. package/dist/cli/commands/clone-for-testing.js +37 -47
  54. package/dist/cli/commands/clone-for-testing.js.map +1 -1
  55. package/dist/cli/commands/derive.d.ts +1 -1
  56. package/dist/cli/commands/derive.d.ts.map +1 -1
  57. package/dist/cli/commands/derive.js +140 -88
  58. package/dist/cli/commands/derive.js.map +1 -1
  59. package/dist/cli/commands/doctor.d.ts +11 -0
  60. package/dist/cli/commands/doctor.d.ts.map +1 -0
  61. package/dist/cli/commands/doctor.js +152 -0
  62. package/dist/cli/commands/doctor.js.map +1 -0
  63. package/dist/cli/commands/export.d.ts +12 -0
  64. package/dist/cli/commands/export.d.ts.map +1 -0
  65. package/dist/cli/commands/export.js +134 -0
  66. package/dist/cli/commands/export.js.map +1 -0
  67. package/dist/cli/commands/help.d.ts +1 -1
  68. package/dist/cli/commands/help.d.ts.map +1 -1
  69. package/dist/cli/commands/help.js +163 -37
  70. package/dist/cli/commands/help.js.map +1 -1
  71. package/dist/cli/commands/inbox.d.ts +1 -1
  72. package/dist/cli/commands/inbox.d.ts.map +1 -1
  73. package/dist/cli/commands/inbox.js +178 -56
  74. package/dist/cli/commands/inbox.js.map +1 -1
  75. package/dist/cli/commands/index.d.ts +31 -19
  76. package/dist/cli/commands/index.d.ts.map +1 -1
  77. package/dist/cli/commands/index.js +31 -19
  78. package/dist/cli/commands/index.js.map +1 -1
  79. package/dist/cli/commands/init.d.ts +5 -1
  80. package/dist/cli/commands/init.d.ts.map +1 -1
  81. package/dist/cli/commands/init.js +108 -57
  82. package/dist/cli/commands/init.js.map +1 -1
  83. package/dist/cli/commands/item.d.ts +1 -1
  84. package/dist/cli/commands/item.d.ts.map +1 -1
  85. package/dist/cli/commands/item.js +557 -274
  86. package/dist/cli/commands/item.js.map +1 -1
  87. package/dist/cli/commands/link.d.ts +1 -1
  88. package/dist/cli/commands/link.d.ts.map +1 -1
  89. package/dist/cli/commands/link.js +55 -46
  90. package/dist/cli/commands/link.js.map +1 -1
  91. package/dist/cli/commands/log.d.ts +1 -1
  92. package/dist/cli/commands/log.d.ts.map +1 -1
  93. package/dist/cli/commands/log.js +57 -51
  94. package/dist/cli/commands/log.js.map +1 -1
  95. package/dist/cli/commands/merge-driver.d.ts +19 -0
  96. package/dist/cli/commands/merge-driver.d.ts.map +1 -0
  97. package/dist/cli/commands/merge-driver.js +398 -0
  98. package/dist/cli/commands/merge-driver.js.map +1 -0
  99. package/dist/cli/commands/meta.d.ts +1 -1
  100. package/dist/cli/commands/meta.d.ts.map +1 -1
  101. package/dist/cli/commands/meta.js +533 -399
  102. package/dist/cli/commands/meta.js.map +1 -1
  103. package/dist/cli/commands/module.d.ts +1 -1
  104. package/dist/cli/commands/module.d.ts.map +1 -1
  105. package/dist/cli/commands/module.js +30 -25
  106. package/dist/cli/commands/module.js.map +1 -1
  107. package/dist/cli/commands/plan-import.d.ts +11 -0
  108. package/dist/cli/commands/plan-import.d.ts.map +1 -0
  109. package/dist/cli/commands/plan-import.js +516 -0
  110. package/dist/cli/commands/plan-import.js.map +1 -0
  111. package/dist/cli/commands/plan.d.ts +10 -0
  112. package/dist/cli/commands/plan.d.ts.map +1 -0
  113. package/dist/cli/commands/plan.js +421 -0
  114. package/dist/cli/commands/plan.js.map +1 -0
  115. package/dist/cli/commands/ralph.d.ts +1 -1
  116. package/dist/cli/commands/ralph.d.ts.map +1 -1
  117. package/dist/cli/commands/ralph.js +1097 -169
  118. package/dist/cli/commands/ralph.js.map +1 -1
  119. package/dist/cli/commands/refs.d.ts +13 -0
  120. package/dist/cli/commands/refs.d.ts.map +1 -0
  121. package/dist/cli/commands/refs.js +283 -0
  122. package/dist/cli/commands/refs.js.map +1 -0
  123. package/dist/cli/commands/search.d.ts +1 -1
  124. package/dist/cli/commands/search.d.ts.map +1 -1
  125. package/dist/cli/commands/search.js +199 -37
  126. package/dist/cli/commands/search.js.map +1 -1
  127. package/dist/cli/commands/serve.d.ts +10 -0
  128. package/dist/cli/commands/serve.d.ts.map +1 -0
  129. package/dist/cli/commands/serve.js +491 -0
  130. package/dist/cli/commands/serve.js.map +1 -0
  131. package/dist/cli/commands/session.d.ts +25 -6
  132. package/dist/cli/commands/session.d.ts.map +1 -1
  133. package/dist/cli/commands/session.js +811 -127
  134. package/dist/cli/commands/session.js.map +1 -1
  135. package/dist/cli/commands/setup-seeding.d.ts +81 -0
  136. package/dist/cli/commands/setup-seeding.d.ts.map +1 -0
  137. package/dist/cli/commands/setup-seeding.js +292 -0
  138. package/dist/cli/commands/setup-seeding.js.map +1 -0
  139. package/dist/cli/commands/setup.d.ts +77 -3
  140. package/dist/cli/commands/setup.d.ts.map +1 -1
  141. package/dist/cli/commands/setup.js +1233 -274
  142. package/dist/cli/commands/setup.js.map +1 -1
  143. package/dist/cli/commands/shadow.d.ts +1 -1
  144. package/dist/cli/commands/shadow.d.ts.map +1 -1
  145. package/dist/cli/commands/shadow.js +70 -50
  146. package/dist/cli/commands/shadow.js.map +1 -1
  147. package/dist/cli/commands/skill-crud.d.ts +58 -0
  148. package/dist/cli/commands/skill-crud.d.ts.map +1 -0
  149. package/dist/cli/commands/skill-crud.js +753 -0
  150. package/dist/cli/commands/skill-crud.js.map +1 -0
  151. package/dist/cli/commands/skill-diff.d.ts +27 -0
  152. package/dist/cli/commands/skill-diff.d.ts.map +1 -0
  153. package/dist/cli/commands/skill-diff.js +840 -0
  154. package/dist/cli/commands/skill-diff.js.map +1 -0
  155. package/dist/cli/commands/skill-install.d.ts +53 -0
  156. package/dist/cli/commands/skill-install.d.ts.map +1 -0
  157. package/dist/cli/commands/skill-install.js +452 -0
  158. package/dist/cli/commands/skill-install.js.map +1 -0
  159. package/dist/cli/commands/skill.d.ts +20 -0
  160. package/dist/cli/commands/skill.d.ts.map +1 -0
  161. package/dist/cli/commands/skill.js +36 -0
  162. package/dist/cli/commands/skill.js.map +1 -0
  163. package/dist/cli/commands/task.d.ts +1 -1
  164. package/dist/cli/commands/task.d.ts.map +1 -1
  165. package/dist/cli/commands/task.js +569 -346
  166. package/dist/cli/commands/task.js.map +1 -1
  167. package/dist/cli/commands/tasks.d.ts +26 -1
  168. package/dist/cli/commands/tasks.d.ts.map +1 -1
  169. package/dist/cli/commands/tasks.js +227 -122
  170. package/dist/cli/commands/tasks.js.map +1 -1
  171. package/dist/cli/commands/trait.d.ts +1 -1
  172. package/dist/cli/commands/trait.d.ts.map +1 -1
  173. package/dist/cli/commands/trait.js +166 -101
  174. package/dist/cli/commands/trait.js.map +1 -1
  175. package/dist/cli/commands/triage.d.ts +7 -0
  176. package/dist/cli/commands/triage.d.ts.map +1 -0
  177. package/dist/cli/commands/triage.js +569 -0
  178. package/dist/cli/commands/triage.js.map +1 -0
  179. package/dist/cli/commands/util.d.ts +7 -0
  180. package/dist/cli/commands/util.d.ts.map +1 -0
  181. package/dist/cli/commands/util.js +30 -0
  182. package/dist/cli/commands/util.js.map +1 -0
  183. package/dist/cli/commands/validate.d.ts +1 -1
  184. package/dist/cli/commands/validate.d.ts.map +1 -1
  185. package/dist/cli/commands/validate.js +264 -83
  186. package/dist/cli/commands/validate.js.map +1 -1
  187. package/dist/cli/commands/workflow.d.ts +16 -0
  188. package/dist/cli/commands/workflow.d.ts.map +1 -0
  189. package/dist/cli/commands/workflow.js +851 -0
  190. package/dist/cli/commands/workflow.js.map +1 -0
  191. package/dist/cli/exit-codes.d.ts +7 -0
  192. package/dist/cli/exit-codes.d.ts.map +1 -1
  193. package/dist/cli/exit-codes.js +26 -18
  194. package/dist/cli/exit-codes.js.map +1 -1
  195. package/dist/cli/help/content.d.ts.map +1 -1
  196. package/dist/cli/help/content.js +86 -71
  197. package/dist/cli/help/content.js.map +1 -1
  198. package/dist/cli/index.d.ts +1 -1
  199. package/dist/cli/index.d.ts.map +1 -1
  200. package/dist/cli/index.js +131 -19
  201. package/dist/cli/index.js.map +1 -1
  202. package/dist/cli/introspection.d.ts +6 -2
  203. package/dist/cli/introspection.d.ts.map +1 -1
  204. package/dist/cli/introspection.js +11 -8
  205. package/dist/cli/introspection.js.map +1 -1
  206. package/dist/cli/output.d.ts +64 -4
  207. package/dist/cli/output.d.ts.map +1 -1
  208. package/dist/cli/output.js +235 -85
  209. package/dist/cli/output.js.map +1 -1
  210. package/dist/cli/parse-utils.d.ts +21 -0
  211. package/dist/cli/parse-utils.d.ts.map +1 -0
  212. package/dist/cli/parse-utils.js +32 -0
  213. package/dist/cli/parse-utils.js.map +1 -0
  214. package/dist/cli/pid-utils.d.ts +72 -0
  215. package/dist/cli/pid-utils.d.ts.map +1 -0
  216. package/dist/cli/pid-utils.js +174 -0
  217. package/dist/cli/pid-utils.js.map +1 -0
  218. package/dist/cli/suggest.d.ts.map +1 -1
  219. package/dist/cli/suggest.js +1 -2
  220. package/dist/cli/suggest.js.map +1 -1
  221. package/dist/cli/validators.d.ts +43 -0
  222. package/dist/cli/validators.d.ts.map +1 -0
  223. package/dist/cli/validators.js +84 -0
  224. package/dist/cli/validators.js.map +1 -0
  225. package/dist/daemon/index.ts +52 -0
  226. package/dist/daemon/middleware/project-context.ts +126 -0
  227. package/dist/daemon/pid.ts +179 -0
  228. package/dist/daemon/project-context.ts +343 -0
  229. package/dist/daemon/routes/inbox.ts +164 -0
  230. package/dist/daemon/routes/items.ts +322 -0
  231. package/dist/daemon/routes/meta.ts +118 -0
  232. package/dist/daemon/routes/projects.ts +162 -0
  233. package/dist/daemon/routes/tasks.ts +327 -0
  234. package/dist/daemon/routes/triage.ts +468 -0
  235. package/dist/daemon/routes/validation.ts +248 -0
  236. package/dist/daemon/server.ts +408 -0
  237. package/dist/daemon/watcher.ts +195 -0
  238. package/dist/daemon/websocket/handler.ts +138 -0
  239. package/dist/daemon/websocket/heartbeat.ts +71 -0
  240. package/dist/daemon/websocket/pubsub.ts +125 -0
  241. package/dist/daemon/websocket/types.ts +66 -0
  242. package/dist/export/html.d.ts +19 -0
  243. package/dist/export/html.d.ts.map +1 -0
  244. package/dist/export/html.js +239 -0
  245. package/dist/export/html.js.map +1 -0
  246. package/dist/export/index.d.ts +10 -0
  247. package/dist/export/index.d.ts.map +1 -0
  248. package/dist/export/index.js +10 -0
  249. package/dist/export/index.js.map +1 -0
  250. package/dist/export/json.d.ts +24 -0
  251. package/dist/export/json.d.ts.map +1 -0
  252. package/dist/export/json.js +198 -0
  253. package/dist/export/json.js.map +1 -0
  254. package/dist/export/triage.d.ts +51 -0
  255. package/dist/export/triage.d.ts.map +1 -0
  256. package/dist/export/triage.js +83 -0
  257. package/dist/export/triage.js.map +1 -0
  258. package/dist/export/types.d.ts +122 -0
  259. package/dist/export/types.d.ts.map +1 -0
  260. package/dist/export/types.js +9 -0
  261. package/dist/export/types.js.map +1 -0
  262. package/dist/index.d.ts +2 -2
  263. package/dist/index.js +2 -2
  264. package/dist/lib/claude-plugin-registry.d.ts +66 -0
  265. package/dist/lib/claude-plugin-registry.d.ts.map +1 -0
  266. package/dist/lib/claude-plugin-registry.js +318 -0
  267. package/dist/lib/claude-plugin-registry.js.map +1 -0
  268. package/dist/merge/arrays.d.ts +87 -0
  269. package/dist/merge/arrays.d.ts.map +1 -0
  270. package/dist/merge/arrays.js +164 -0
  271. package/dist/merge/arrays.js.map +1 -0
  272. package/dist/merge/file-type.d.ts +32 -0
  273. package/dist/merge/file-type.d.ts.map +1 -0
  274. package/dist/merge/file-type.js +70 -0
  275. package/dist/merge/file-type.js.map +1 -0
  276. package/dist/merge/index.d.ts +14 -0
  277. package/dist/merge/index.d.ts.map +1 -0
  278. package/dist/merge/index.js +11 -0
  279. package/dist/merge/index.js.map +1 -0
  280. package/dist/merge/objects.d.ts +46 -0
  281. package/dist/merge/objects.d.ts.map +1 -0
  282. package/dist/merge/objects.js +193 -0
  283. package/dist/merge/objects.js.map +1 -0
  284. package/dist/merge/parse.d.ts +23 -0
  285. package/dist/merge/parse.d.ts.map +1 -0
  286. package/dist/merge/parse.js +78 -0
  287. package/dist/merge/parse.js.map +1 -0
  288. package/dist/merge/resolve.d.ts +66 -0
  289. package/dist/merge/resolve.d.ts.map +1 -0
  290. package/dist/merge/resolve.js +189 -0
  291. package/dist/merge/resolve.js.map +1 -0
  292. package/dist/merge/types.d.ts +82 -0
  293. package/dist/merge/types.d.ts.map +1 -0
  294. package/dist/merge/types.js +8 -0
  295. package/dist/merge/types.js.map +1 -0
  296. package/dist/parser/agent-data-sections.d.ts +53 -0
  297. package/dist/parser/agent-data-sections.d.ts.map +1 -0
  298. package/dist/parser/agent-data-sections.js +118 -0
  299. package/dist/parser/agent-data-sections.js.map +1 -0
  300. package/dist/parser/alignment.d.ts +4 -4
  301. package/dist/parser/alignment.d.ts.map +1 -1
  302. package/dist/parser/alignment.js +27 -22
  303. package/dist/parser/alignment.js.map +1 -1
  304. package/dist/parser/assess.d.ts +5 -5
  305. package/dist/parser/assess.d.ts.map +1 -1
  306. package/dist/parser/assess.js +36 -32
  307. package/dist/parser/assess.js.map +1 -1
  308. package/dist/parser/config.d.ts +351 -0
  309. package/dist/parser/config.d.ts.map +1 -0
  310. package/dist/parser/config.js +326 -0
  311. package/dist/parser/config.js.map +1 -0
  312. package/dist/parser/convention-validation.d.ts +1 -1
  313. package/dist/parser/convention-validation.d.ts.map +1 -1
  314. package/dist/parser/convention-validation.js +21 -16
  315. package/dist/parser/convention-validation.js.map +1 -1
  316. package/dist/parser/coverage-cache.d.ts +49 -0
  317. package/dist/parser/coverage-cache.d.ts.map +1 -0
  318. package/dist/parser/coverage-cache.js +123 -0
  319. package/dist/parser/coverage-cache.js.map +1 -0
  320. package/dist/parser/daemon-status.d.ts +37 -0
  321. package/dist/parser/daemon-status.d.ts.map +1 -0
  322. package/dist/parser/daemon-status.js +67 -0
  323. package/dist/parser/daemon-status.js.map +1 -0
  324. package/dist/parser/doctor.d.ts +107 -0
  325. package/dist/parser/doctor.d.ts.map +1 -0
  326. package/dist/parser/doctor.js +366 -0
  327. package/dist/parser/doctor.js.map +1 -0
  328. package/dist/parser/fix.d.ts +1 -1
  329. package/dist/parser/fix.d.ts.map +1 -1
  330. package/dist/parser/fix.js +31 -27
  331. package/dist/parser/fix.js.map +1 -1
  332. package/dist/parser/index.d.ts +16 -11
  333. package/dist/parser/index.d.ts.map +1 -1
  334. package/dist/parser/index.js +16 -11
  335. package/dist/parser/index.js.map +1 -1
  336. package/dist/parser/items.d.ts +8 -2
  337. package/dist/parser/items.d.ts.map +1 -1
  338. package/dist/parser/items.js +71 -35
  339. package/dist/parser/items.js.map +1 -1
  340. package/dist/parser/meta.d.ts +167 -9
  341. package/dist/parser/meta.d.ts.map +1 -1
  342. package/dist/parser/meta.js +379 -46
  343. package/dist/parser/meta.js.map +1 -1
  344. package/dist/parser/plan-document.d.ts +189 -0
  345. package/dist/parser/plan-document.d.ts.map +1 -0
  346. package/dist/parser/plan-document.js +340 -0
  347. package/dist/parser/plan-document.js.map +1 -0
  348. package/dist/parser/plans.d.ts +59 -0
  349. package/dist/parser/plans.d.ts.map +1 -0
  350. package/dist/parser/plans.js +239 -0
  351. package/dist/parser/plans.js.map +1 -0
  352. package/dist/parser/refs.d.ts +22 -9
  353. package/dist/parser/refs.d.ts.map +1 -1
  354. package/dist/parser/refs.js +102 -50
  355. package/dist/parser/refs.js.map +1 -1
  356. package/dist/parser/setup-status.d.ts +71 -0
  357. package/dist/parser/setup-status.d.ts.map +1 -0
  358. package/dist/parser/setup-status.js +269 -0
  359. package/dist/parser/setup-status.js.map +1 -0
  360. package/dist/parser/shadow.d.ts +150 -19
  361. package/dist/parser/shadow.d.ts.map +1 -1
  362. package/dist/parser/shadow.js +548 -187
  363. package/dist/parser/shadow.js.map +1 -1
  364. package/dist/parser/skill-render.d.ts +317 -0
  365. package/dist/parser/skill-render.d.ts.map +1 -0
  366. package/dist/parser/skill-render.js +943 -0
  367. package/dist/parser/skill-render.js.map +1 -0
  368. package/dist/parser/traits.d.ts +3 -3
  369. package/dist/parser/traits.d.ts.map +1 -1
  370. package/dist/parser/traits.js +2 -2
  371. package/dist/parser/traits.js.map +1 -1
  372. package/dist/parser/validate-skills.d.ts +32 -0
  373. package/dist/parser/validate-skills.d.ts.map +1 -0
  374. package/dist/parser/validate-skills.js +202 -0
  375. package/dist/parser/validate-skills.js.map +1 -0
  376. package/dist/parser/validate.d.ts +45 -3
  377. package/dist/parser/validate.d.ts.map +1 -1
  378. package/dist/parser/validate.js +622 -105
  379. package/dist/parser/validate.js.map +1 -1
  380. package/dist/parser/yaml.d.ts +83 -19
  381. package/dist/parser/yaml.d.ts.map +1 -1
  382. package/dist/parser/yaml.js +478 -173
  383. package/dist/parser/yaml.js.map +1 -1
  384. package/dist/ralph/cli-renderer.d.ts +8 -1
  385. package/dist/ralph/cli-renderer.d.ts.map +1 -1
  386. package/dist/ralph/cli-renderer.js +105 -34
  387. package/dist/ralph/cli-renderer.js.map +1 -1
  388. package/dist/ralph/events.d.ts +10 -10
  389. package/dist/ralph/events.d.ts.map +1 -1
  390. package/dist/ralph/events.js +277 -98
  391. package/dist/ralph/events.js.map +1 -1
  392. package/dist/ralph/index.d.ts +5 -2
  393. package/dist/ralph/index.d.ts.map +1 -1
  394. package/dist/ralph/index.js +9 -3
  395. package/dist/ralph/index.js.map +1 -1
  396. package/dist/ralph/loop-errors.d.ts +83 -0
  397. package/dist/ralph/loop-errors.d.ts.map +1 -0
  398. package/dist/ralph/loop-errors.js +150 -0
  399. package/dist/ralph/loop-errors.js.map +1 -0
  400. package/dist/ralph/subagent.d.ts +83 -0
  401. package/dist/ralph/subagent.d.ts.map +1 -0
  402. package/dist/ralph/subagent.js +174 -0
  403. package/dist/ralph/subagent.js.map +1 -0
  404. package/dist/ralph/wrap-up.d.ts +125 -0
  405. package/dist/ralph/wrap-up.d.ts.map +1 -0
  406. package/dist/ralph/wrap-up.js +270 -0
  407. package/dist/ralph/wrap-up.js.map +1 -0
  408. package/dist/schema/batch.d.ts +95 -0
  409. package/dist/schema/batch.d.ts.map +1 -0
  410. package/dist/schema/batch.js +24 -0
  411. package/dist/schema/batch.js.map +1 -0
  412. package/dist/schema/common.d.ts +2 -2
  413. package/dist/schema/common.d.ts.map +1 -1
  414. package/dist/schema/common.js +34 -31
  415. package/dist/schema/common.js.map +1 -1
  416. package/dist/schema/inbox.d.ts +12 -12
  417. package/dist/schema/inbox.js +4 -4
  418. package/dist/schema/inbox.js.map +1 -1
  419. package/dist/schema/index.d.ts +8 -5
  420. package/dist/schema/index.d.ts.map +1 -1
  421. package/dist/schema/index.js +8 -5
  422. package/dist/schema/index.js.map +1 -1
  423. package/dist/schema/meta.d.ts +1454 -27
  424. package/dist/schema/meta.d.ts.map +1 -1
  425. package/dist/schema/meta.js +198 -21
  426. package/dist/schema/meta.js.map +1 -1
  427. package/dist/schema/plan.d.ts +285 -0
  428. package/dist/schema/plan.d.ts.map +1 -0
  429. package/dist/schema/plan.js +81 -0
  430. package/dist/schema/plan.js.map +1 -0
  431. package/dist/schema/spec.d.ts +72 -33
  432. package/dist/schema/spec.d.ts.map +1 -1
  433. package/dist/schema/spec.js +22 -9
  434. package/dist/schema/spec.js.map +1 -1
  435. package/dist/schema/task.d.ts +172 -161
  436. package/dist/schema/task.d.ts.map +1 -1
  437. package/dist/schema/task.js +21 -12
  438. package/dist/schema/task.js.map +1 -1
  439. package/dist/schema/triage.d.ts +266 -0
  440. package/dist/schema/triage.d.ts.map +1 -0
  441. package/dist/schema/triage.js +134 -0
  442. package/dist/schema/triage.js.map +1 -0
  443. package/dist/sessions/index.d.ts +2 -2
  444. package/dist/sessions/index.d.ts.map +1 -1
  445. package/dist/sessions/index.js +3 -3
  446. package/dist/sessions/index.js.map +1 -1
  447. package/dist/sessions/store.d.ts +233 -1
  448. package/dist/sessions/store.d.ts.map +1 -1
  449. package/dist/sessions/store.js +628 -31
  450. package/dist/sessions/store.js.map +1 -1
  451. package/dist/sessions/types.d.ts +10 -10
  452. package/dist/sessions/types.d.ts.map +1 -1
  453. package/dist/sessions/types.js +10 -9
  454. package/dist/sessions/types.js.map +1 -1
  455. package/dist/strings/errors.d.ts +51 -0
  456. package/dist/strings/errors.d.ts.map +1 -1
  457. package/dist/strings/errors.js +136 -106
  458. package/dist/strings/errors.js.map +1 -1
  459. package/dist/strings/guidance.d.ts.map +1 -1
  460. package/dist/strings/guidance.js +16 -16
  461. package/dist/strings/guidance.js.map +1 -1
  462. package/dist/strings/index.d.ts +4 -4
  463. package/dist/strings/index.d.ts.map +1 -1
  464. package/dist/strings/index.js +4 -4
  465. package/dist/strings/index.js.map +1 -1
  466. package/dist/strings/labels.d.ts +4 -0
  467. package/dist/strings/labels.d.ts.map +1 -1
  468. package/dist/strings/labels.js +45 -41
  469. package/dist/strings/labels.js.map +1 -1
  470. package/dist/strings/validation.d.ts.map +1 -1
  471. package/dist/strings/validation.js +71 -71
  472. package/dist/strings/validation.js.map +1 -1
  473. package/dist/utils/commit.d.ts +1 -1
  474. package/dist/utils/commit.d.ts.map +1 -1
  475. package/dist/utils/commit.js +28 -26
  476. package/dist/utils/commit.js.map +1 -1
  477. package/dist/utils/git.d.ts +1 -1
  478. package/dist/utils/git.d.ts.map +1 -1
  479. package/dist/utils/git.js +40 -38
  480. package/dist/utils/git.js.map +1 -1
  481. package/dist/utils/grep.js +11 -11
  482. package/dist/utils/grep.js.map +1 -1
  483. package/dist/utils/index.d.ts +7 -7
  484. package/dist/utils/index.d.ts.map +1 -1
  485. package/dist/utils/index.js +4 -4
  486. package/dist/utils/index.js.map +1 -1
  487. package/dist/utils/time.d.ts.map +1 -1
  488. package/dist/utils/time.js +10 -10
  489. package/dist/utils/time.js.map +1 -1
  490. package/package.json +28 -5
  491. package/plugin/.claude-plugin/marketplace.json +17 -0
  492. package/plugin/.claude-plugin/plugin.json +5 -0
  493. package/plugin/plugins/kspec/skills/help/SKILL.md +42 -0
  494. package/plugin/plugins/kspec/skills/triage/SKILL.md +206 -0
  495. package/plugin/plugins/kspec/skills/triage/docs/automation.md +120 -0
  496. package/plugin/plugins/kspec/skills/triage/docs/inbox.md +144 -0
  497. package/plugin/plugins/kspec/skills/triage/docs/observations.md +85 -0
  498. package/templates/agents-sections/01-quick-start.md +22 -0
  499. package/templates/agents-sections/02-shadow-branch.md +34 -0
  500. package/templates/agents-sections/03-task-lifecycle.md +48 -0
  501. package/templates/agents-sections/04-pr-workflow.md +17 -0
  502. package/templates/agents-sections/05-commit-convention.md +27 -0
  503. package/templates/agents-sections/06-ralph-loop.md +45 -0
  504. package/templates/hooks/pre-commit +34 -0
  505. package/templates/skills/help/SKILL.md +37 -0
  506. package/templates/skills/manifest.yaml +15 -0
  507. package/templates/skills/triage/SKILL.md +199 -0
  508. package/templates/skills/triage/docs/automation.md +120 -0
  509. package/templates/skills/triage/docs/inbox.md +144 -0
  510. package/templates/skills/triage/docs/observations.md +85 -0
@@ -1,15 +1,90 @@
1
- import chalk from 'chalk';
2
- import { grepItem, formatMatchedFields } from '../utils/grep.js';
3
- import { fieldLabels, sectionHeaders, summaries } from '../strings/labels.js';
1
+ import chalk from "chalk";
2
+ import { stringify as yamlStringify } from "yaml";
3
+ import { fieldLabels, sectionHeaders, summaries } from "../strings/labels.js";
4
+ import { formatMatchedFields, grepItem } from "../utils/grep.js";
4
5
  /**
5
- * Global output format (set by --json flag)
6
+ * Check if a note has been superseded by another note.
7
+ * A note is superseded if its ULID appears in any other note's `supersedes` field.
8
+ */
9
+ export function isNoteSuperseded(note, allNotes) {
10
+ return allNotes.some((n) => n.supersedes === note._ulid);
11
+ }
12
+ /**
13
+ * Filter notes to exclude superseded ones.
14
+ * Returns only notes that have not been superseded.
15
+ */
16
+ export function filterSupersededNotes(notes) {
17
+ return notes.filter((note) => !isNoteSuperseded(note, notes));
18
+ }
19
+ /**
20
+ * Annotate notes with superseded status for JSON output.
21
+ * Adds a computed `superseded` field to each note.
22
+ */
23
+ export function annotateNotesWithSuperseded(notes) {
24
+ return notes.map((note) => ({
25
+ ...note,
26
+ superseded: isNoteSuperseded(note, notes),
27
+ }));
28
+ }
29
+ /**
30
+ * Valid format values for --format option
31
+ */
32
+ export const VALID_FORMATS = ["json", "yaml"];
33
+ /**
34
+ * Global output format (set by --json, --yaml, --raw, or --format flags)
35
+ * AC: @output-format-option ac-format-json, ac-format-yaml
36
+ */
37
+ let globalOutputFormat = "text";
38
+ export function setOutputFormat(format) {
39
+ globalOutputFormat = format;
40
+ }
41
+ export function getOutputFormat() {
42
+ return globalOutputFormat;
43
+ }
44
+ /**
45
+ * Set JSON mode (for backward compatibility)
46
+ * AC: @output-format-option ac-json-shorthand
6
47
  */
7
- let globalJsonMode = false;
8
48
  export function setJsonMode(enabled) {
9
- globalJsonMode = enabled;
49
+ if (enabled) {
50
+ globalOutputFormat = "json";
51
+ }
52
+ else if (globalOutputFormat === "json") {
53
+ globalOutputFormat = "text";
54
+ }
10
55
  }
56
+ /**
57
+ * Check if JSON mode is active
58
+ * AC: @output-format-option ac-json-shorthand
59
+ */
11
60
  export function isJsonMode() {
12
- return globalJsonMode;
61
+ return globalOutputFormat === "json";
62
+ }
63
+ /**
64
+ * Set YAML mode
65
+ * AC: @output-format-option ac-format-yaml, ac-yaml-shorthand
66
+ */
67
+ export function setYamlMode(enabled) {
68
+ if (enabled) {
69
+ globalOutputFormat = "yaml";
70
+ }
71
+ else if (globalOutputFormat === "yaml") {
72
+ globalOutputFormat = "text";
73
+ }
74
+ }
75
+ /**
76
+ * Check if YAML mode is active
77
+ * AC: @output-format-option ac-format-yaml
78
+ */
79
+ export function isYamlMode() {
80
+ return globalOutputFormat === "yaml";
81
+ }
82
+ /**
83
+ * Check if any structured output mode is active (JSON or YAML)
84
+ * AC: @output-format-option ac-yaml-no-ansi, ac-yaml-references
85
+ */
86
+ export function isStructuredMode() {
87
+ return globalOutputFormat === "json" || globalOutputFormat === "yaml";
13
88
  }
14
89
  /**
15
90
  * Global verbose mode (set by --verbose flag)
@@ -22,12 +97,16 @@ export function getVerboseMode() {
22
97
  return globalVerboseMode;
23
98
  }
24
99
  /**
25
- * Output data - JSON if --json flag, otherwise formatted
100
+ * Output data - JSON/YAML if structured mode, otherwise formatted
101
+ * AC: @output-format-option ac-format-json, ac-format-yaml
26
102
  */
27
103
  export function output(data, formatter) {
28
- if (globalJsonMode) {
104
+ if (globalOutputFormat === "json") {
29
105
  console.log(JSON.stringify(data, null, 2));
30
106
  }
107
+ else if (globalOutputFormat === "yaml") {
108
+ console.log(yamlStringify(data, { indent: 2 }));
109
+ }
31
110
  else if (formatter) {
32
111
  formatter();
33
112
  }
@@ -37,31 +116,39 @@ export function output(data, formatter) {
37
116
  }
38
117
  /**
39
118
  * Output success message
119
+ * AC: @output-format-option ac-format-json, ac-format-yaml
40
120
  */
41
121
  export function success(message, data) {
42
- if (globalJsonMode) {
122
+ if (globalOutputFormat === "json") {
43
123
  console.log(JSON.stringify({ success: true, message, ...data }));
44
124
  }
125
+ else if (globalOutputFormat === "yaml") {
126
+ console.log(yamlStringify({ success: true, message, ...data }, { indent: 2 }));
127
+ }
45
128
  else {
46
- console.log(chalk.green('OK'), message);
129
+ console.log(chalk.green("OK"), message);
47
130
  }
48
131
  }
49
132
  /**
50
133
  * Output error message
134
+ * AC: @output-format-option ac-format-json, ac-format-yaml
51
135
  */
52
136
  export function error(message, details) {
53
- if (globalJsonMode) {
137
+ if (globalOutputFormat === "json") {
54
138
  console.error(JSON.stringify({ success: false, error: message, details }));
55
139
  }
140
+ else if (globalOutputFormat === "yaml") {
141
+ console.error(yamlStringify({ success: false, error: message, details }, { indent: 2 }));
142
+ }
56
143
  else {
57
- console.error(chalk.red(''), message);
144
+ console.error(chalk.red(""), message);
58
145
  if (details) {
59
146
  console.error(chalk.gray(String(details)));
60
147
  // Show suggestion if it's a ShadowError with a suggestion
61
- if (details && typeof details === 'object' && 'suggestion' in details) {
148
+ if (details && typeof details === "object" && "suggestion" in details) {
62
149
  const suggestion = details.suggestion;
63
150
  if (suggestion) {
64
- console.error(chalk.yellow(' Suggestion:'), suggestion);
151
+ console.error(chalk.yellow(" Suggestion:"), suggestion);
65
152
  }
66
153
  }
67
154
  }
@@ -69,24 +156,26 @@ export function error(message, details) {
69
156
  }
70
157
  /**
71
158
  * Output warning message
159
+ * AC: @output-format-option ac-yaml-no-ansi
72
160
  */
73
161
  export function warn(message) {
74
- if (globalJsonMode) {
75
- // Warnings are suppressed in JSON mode
162
+ if (isStructuredMode()) {
163
+ // Warnings are suppressed in structured output modes
76
164
  }
77
165
  else {
78
- console.warn(chalk.yellow(''), message);
166
+ console.warn(chalk.yellow(""), message);
79
167
  }
80
168
  }
81
169
  /**
82
170
  * Output info message
171
+ * AC: @output-format-option ac-yaml-no-ansi
83
172
  */
84
173
  export function info(message) {
85
- if (globalJsonMode) {
86
- // Info messages suppressed in JSON mode
174
+ if (isStructuredMode()) {
175
+ // Info messages suppressed in structured output modes
87
176
  }
88
177
  else {
89
- console.log(chalk.blue(''), message);
178
+ console.log(chalk.blue(""), message);
90
179
  }
91
180
  }
92
181
  /**
@@ -94,15 +183,15 @@ export function info(message) {
94
183
  */
95
184
  function statusColor(status) {
96
185
  switch (status) {
97
- case 'pending':
186
+ case "pending":
98
187
  return (t) => chalk.gray(t);
99
- case 'in_progress':
188
+ case "in_progress":
100
189
  return (t) => chalk.blue(t);
101
- case 'blocked':
190
+ case "blocked":
102
191
  return (t) => chalk.red(t);
103
- case 'completed':
192
+ case "completed":
104
193
  return (t) => chalk.green(t);
105
- case 'cancelled':
194
+ case "cancelled":
106
195
  return (t) => chalk.strikethrough.gray(t);
107
196
  default:
108
197
  return (t) => chalk.white(t);
@@ -126,18 +215,20 @@ export function formatTaskRef(task, index) {
126
215
  export function formatTask(task, verbose = false, index, full = false) {
127
216
  const ref = formatTaskRef(task, index);
128
217
  const status = statusColor(task.status)(`[${task.status}]`);
129
- const priority = task.priority <= 2 ? chalk.red(`P${task.priority}`) : chalk.gray(`P${task.priority}`);
218
+ const priority = task.priority <= 2
219
+ ? chalk.red(`P${task.priority}`)
220
+ : chalk.gray(`P${task.priority}`);
130
221
  let line = `${ref} ${status} ${priority} ${task.title}`;
131
222
  if (verbose && !full) {
132
- // AC-2: Single verbose (-v) shows current behavior
223
+ // AC: @task-list-verbose ac-2 - Single verbose (-v) shows current behavior
133
224
  if (task.spec_ref) {
134
225
  line += chalk.gray(` (spec: ${task.spec_ref})`);
135
226
  }
136
227
  if (task.depends_on.length > 0) {
137
- line += chalk.gray(` deps: [${task.depends_on.join(', ')}]`);
228
+ line += chalk.gray(` deps: [${task.depends_on.join(", ")}]`);
138
229
  }
139
230
  if (task.tags.length > 0) {
140
- line += chalk.cyan(` #${task.tags.join(' #')}`);
231
+ line += chalk.cyan(` #${task.tags.join(" #")}`);
141
232
  }
142
233
  }
143
234
  return line;
@@ -148,16 +239,16 @@ export function formatTask(task, verbose = false, index, full = false) {
148
239
  function getFirstLine(text, maxLength = 70) {
149
240
  if (!text)
150
241
  return undefined;
151
- const firstLine = text.split('\n')[0].trim();
242
+ const firstLine = text.split("\n")[0].trim();
152
243
  if (firstLine.length <= maxLength)
153
244
  return firstLine;
154
- return firstLine.slice(0, maxLength - 3) + '...';
245
+ return `${firstLine.slice(0, maxLength - 3)}...`;
155
246
  }
156
247
  /**
157
248
  * Format full mode context for a task (AC-1, AC-3, AC-5)
158
249
  */
159
250
  function formatFullModeContext(task, index) {
160
- const indent = ' ';
251
+ const indent = " ";
161
252
  // Show timestamps (AC-1)
162
253
  console.log(chalk.gray(`${indent}Created: ${task.created_at}`));
163
254
  if (task.started_at) {
@@ -174,7 +265,7 @@ function formatFullModeContext(task, index) {
174
265
  }
175
266
  // Show pending todos count (AC-1, AC-3)
176
267
  if (task.todos && task.todos.length > 0) {
177
- const pendingCount = task.todos.filter(t => !t.done).length;
268
+ const pendingCount = task.todos.filter((t) => !t.done).length;
178
269
  if (pendingCount > 0) {
179
270
  console.log(chalk.gray(`${indent}Pending todos: ${pendingCount}`));
180
271
  }
@@ -184,22 +275,31 @@ function formatFullModeContext(task, index) {
184
275
  const result = index.resolve(task.spec_ref);
185
276
  if (result.ok) {
186
277
  const spec = result.item;
187
- const specName = 'title' in spec ? spec.title : ('name' in spec ? spec.name : ('id' in spec ? spec.id : task.spec_ref));
278
+ const specName = "title" in spec
279
+ ? spec.title
280
+ : "name" in spec
281
+ ? spec.name
282
+ : "id" in spec
283
+ ? spec.id
284
+ : task.spec_ref;
188
285
  console.log(chalk.gray(`${indent}Spec: ${task.spec_ref}`));
189
286
  console.log(chalk.cyan(`${indent} ${specName}`));
190
287
  // Show spec description if available
191
- if ('description' in spec && spec.description) {
288
+ if ("description" in spec && spec.description) {
192
289
  const descPreview = getFirstLine(spec.description, 70);
193
290
  console.log(chalk.gray(`${indent} ${descPreview}`));
194
291
  }
195
292
  // Show acceptance criteria if available
196
- if ('acceptance_criteria' in spec && Array.isArray(spec.acceptance_criteria)) {
293
+ if ("acceptance_criteria" in spec &&
294
+ Array.isArray(spec.acceptance_criteria)) {
197
295
  const ac = spec.acceptance_criteria;
198
296
  if (ac.length > 0) {
199
297
  console.log(chalk.gray(`${indent} Acceptance Criteria: ${ac.length}`));
200
298
  // Show first AC as preview
201
299
  const firstAC = ac[0];
202
- if (typeof firstAC === 'object' && firstAC !== null && 'id' in firstAC) {
300
+ if (typeof firstAC === "object" &&
301
+ firstAC !== null &&
302
+ "id" in firstAC) {
203
303
  console.log(chalk.gray(`${indent} [${firstAC.id}] ${firstAC.then}`));
204
304
  }
205
305
  }
@@ -208,10 +308,10 @@ function formatFullModeContext(task, index) {
208
308
  }
209
309
  // Show tags and dependencies if present
210
310
  if (task.tags && task.tags.length > 0) {
211
- console.log(chalk.gray(`${indent}Tags: ${task.tags.join(', ')}`));
311
+ console.log(chalk.gray(`${indent}Tags: ${task.tags.join(", ")}`));
212
312
  }
213
313
  if (task.depends_on && task.depends_on.length > 0) {
214
- console.log(chalk.gray(`${indent}Depends on: ${task.depends_on.join(', ')}`));
314
+ console.log(chalk.gray(`${indent}Depends on: ${task.depends_on.join(", ")}`));
215
315
  }
216
316
  }
217
317
  /**
@@ -220,15 +320,15 @@ function formatFullModeContext(task, index) {
220
320
  */
221
321
  function formatAutomationStatus(automation) {
222
322
  if (!automation) {
223
- return chalk.gray('[unassessed]');
323
+ return chalk.gray("[unassessed]");
224
324
  }
225
325
  switch (automation) {
226
- case 'eligible':
227
- return chalk.green('[eligible]');
228
- case 'needs_review':
229
- return chalk.yellow('[needs_review]');
230
- case 'manual_only':
231
- return chalk.red('[manual_only]');
326
+ case "eligible":
327
+ return chalk.green("[eligible]");
328
+ case "needs_review":
329
+ return chalk.yellow("[needs_review]");
330
+ case "manual_only":
331
+ return chalk.red("[manual_only]");
232
332
  default:
233
333
  return chalk.gray(`[${automation}]`);
234
334
  }
@@ -245,7 +345,9 @@ export function formatTaskListWithAutomation(tasks, verbose = false, index, grep
245
345
  for (const task of tasks) {
246
346
  const ref = formatTaskRef(task, index);
247
347
  const status = statusColor(task.status)(`[${task.status}]`);
248
- const priority = task.priority <= 2 ? chalk.red(`P${task.priority}`) : chalk.gray(`P${task.priority}`);
348
+ const priority = task.priority <= 2
349
+ ? chalk.red(`P${task.priority}`)
350
+ : chalk.gray(`P${task.priority}`);
249
351
  const automationLabel = formatAutomationStatus(task.automation);
250
352
  let line = `${ref} ${status} ${priority} ${automationLabel} ${task.title}`;
251
353
  if (verbose && !full) {
@@ -253,10 +355,10 @@ export function formatTaskListWithAutomation(tasks, verbose = false, index, grep
253
355
  line += chalk.gray(` (spec: ${task.spec_ref})`);
254
356
  }
255
357
  if (task.depends_on.length > 0) {
256
- line += chalk.gray(` deps: [${task.depends_on.join(', ')}]`);
358
+ line += chalk.gray(` deps: [${task.depends_on.join(", ")}]`);
257
359
  }
258
360
  if (task.tags.length > 0) {
259
- line += chalk.cyan(` #${task.tags.join(' #')}`);
361
+ line += chalk.cyan(` #${task.tags.join(" #")}`);
260
362
  }
261
363
  }
262
364
  console.log(line);
@@ -298,7 +400,7 @@ export function formatTaskList(tasks, verbose = false, index, grepPattern, full
298
400
  }
299
401
  }
300
402
  else if (full) {
301
- // AC-1: Full mode shows richer context
403
+ // AC: @task-list-verbose ac-1 - Full mode shows richer context
302
404
  formatFullModeContext(task, index);
303
405
  }
304
406
  else {
@@ -314,26 +416,40 @@ export function formatTaskList(tasks, verbose = false, index, grepPattern, full
314
416
  /**
315
417
  * Format task details
316
418
  */
317
- export function formatTaskDetails(task, index) {
419
+ export function formatTaskDetails(task, index, options = {}) {
318
420
  console.log(chalk.bold(task.title));
319
- console.log(chalk.gray(''.repeat(40)));
421
+ console.log(chalk.gray("".repeat(40)));
320
422
  console.log(`${fieldLabels.ulid} ${task._ulid}`);
321
423
  if (task.slugs.length > 0) {
322
- console.log(`${fieldLabels.slugs} ${task.slugs.join(', ')}`);
424
+ console.log(`${fieldLabels.slugs} ${task.slugs.join(", ")}`);
323
425
  }
324
426
  console.log(`${fieldLabels.type} ${task.type}`);
325
427
  console.log(`${fieldLabels.status} ${statusColor(task.status)(task.status)}`);
326
428
  console.log(`${fieldLabels.priority} ${task.priority}`);
327
429
  // AC: @task-automation-eligibility ac-17 - show automation status
328
- const automationDisplay = task.automation || 'unassessed';
329
- const automationColor = task.automation === 'eligible' ? chalk.green
330
- : task.automation === 'needs_review' ? chalk.yellow
331
- : task.automation === 'manual_only' ? chalk.red
430
+ const automationDisplay = task.automation || "unassessed";
431
+ const automationColor = task.automation === "eligible"
432
+ ? chalk.green
433
+ : task.automation === "needs_review"
434
+ ? chalk.yellow
435
+ : task.automation === "manual_only"
436
+ ? chalk.red
332
437
  : chalk.gray;
333
438
  console.log(`${fieldLabels.automation} ${automationColor(automationDisplay)}`);
439
+ if (task.description?.trim()) {
440
+ console.log(`\n${sectionHeaders.description}`);
441
+ const desc = task.description.trim();
442
+ for (const line of desc.split("\n")) {
443
+ console.log(` ${line}`);
444
+ }
445
+ }
334
446
  if (task.spec_ref) {
335
447
  console.log(`${fieldLabels.specRef} ${task.spec_ref}`);
336
448
  }
449
+ // AC: @plan-derive ac-6 - display plan_ref
450
+ if (task.plan_ref) {
451
+ console.log(`Plan ref: ${task.plan_ref}`);
452
+ }
337
453
  if (task.depends_on.length > 0) {
338
454
  if (index) {
339
455
  console.log(fieldLabels.depends);
@@ -341,27 +457,33 @@ export function formatTaskDetails(task, index) {
341
457
  const result = index.resolve(ref);
342
458
  if (result.ok) {
343
459
  const item = result.item;
344
- const status = 'status' in item && typeof item.status === 'string'
460
+ const status = "status" in item && typeof item.status === "string"
345
461
  ? statusColor(item.status)(`[${item.status}]`)
346
- : chalk.gray('[spec]');
462
+ : chalk.gray("[spec]");
347
463
  // Handle both spec items (with title) and meta items (with name or id)
348
- const itemName = 'title' in item ? item.title : ('name' in item ? item.name : ('id' in item ? item.id : ref));
349
- console.log(` ${ref} ${chalk.gray('→')} ${itemName} ${status}`);
464
+ const itemName = "title" in item
465
+ ? item.title
466
+ : "name" in item
467
+ ? item.name
468
+ : "id" in item
469
+ ? item.id
470
+ : ref;
471
+ console.log(` ${ref} ${chalk.gray("→")} ${itemName} ${status}`);
350
472
  }
351
473
  else {
352
- console.log(` ${ref} ${chalk.red('(unresolved)')}`);
474
+ console.log(` ${ref} ${chalk.red("(unresolved)")}`);
353
475
  }
354
476
  }
355
477
  }
356
478
  else {
357
- console.log(`${fieldLabels.depends} ${task.depends_on.join(', ')}`);
479
+ console.log(`${fieldLabels.depends} ${task.depends_on.join(", ")}`);
358
480
  }
359
481
  }
360
482
  if (task.blocked_by.length > 0) {
361
- console.log(chalk.red(`${fieldLabels.blocked} ${task.blocked_by.join(', ')}`));
483
+ console.log(chalk.red(`${fieldLabels.blocked} ${task.blocked_by.join(", ")}`));
362
484
  }
363
485
  if (task.tags.length > 0) {
364
- console.log(`${fieldLabels.tags} ${task.tags.join(', ')}`);
486
+ console.log(`${fieldLabels.tags} ${task.tags.join(", ")}`);
365
487
  }
366
488
  console.log(`${fieldLabels.created} ${task.created_at}`);
367
489
  if (task.started_at) {
@@ -377,34 +499,46 @@ export function formatTaskDetails(task, index) {
377
499
  const spec = result.item;
378
500
  console.log(`\n${sectionHeaders.specContext}`);
379
501
  // Handle both spec items (with title) and meta items (with name)
380
- const specName = 'title' in spec ? spec.title : ('name' in spec ? spec.name : ('id' in spec ? spec.id : task.spec_ref));
502
+ const specName = "title" in spec
503
+ ? spec.title
504
+ : "name" in spec
505
+ ? spec.name
506
+ : "id" in spec
507
+ ? spec.id
508
+ : task.spec_ref;
381
509
  console.log(chalk.cyan(specName));
382
- if ('type' in spec && spec.type) {
510
+ if ("type" in spec && spec.type) {
383
511
  console.log(chalk.gray(`${fieldLabels.type} ${spec.type}`));
384
512
  }
385
513
  // Show implementation status
386
- if ('status' in spec && spec.status && typeof spec.status === 'object') {
514
+ if ("status" in spec && spec.status && typeof spec.status === "object") {
387
515
  const status = spec.status;
388
516
  if (status.implementation) {
389
- const implColor = status.implementation === 'verified' ? chalk.green
390
- : status.implementation === 'implemented' ? chalk.cyan
391
- : status.implementation === 'in_progress' ? chalk.yellow
517
+ const implColor = status.implementation === "verified"
518
+ ? chalk.green
519
+ : status.implementation === "implemented"
520
+ ? chalk.cyan
521
+ : status.implementation === "in_progress"
522
+ ? chalk.yellow
392
523
  : chalk.gray;
393
- console.log(chalk.gray(fieldLabels.implementation) + implColor(status.implementation));
524
+ console.log(chalk.gray(fieldLabels.implementation) +
525
+ implColor(status.implementation));
394
526
  }
395
527
  }
396
- if ('description' in spec && spec.description) {
528
+ if ("description" in spec && spec.description) {
397
529
  console.log(chalk.gray(fieldLabels.description));
398
530
  // Indent description lines
399
531
  const desc = String(spec.description).trim();
400
- for (const line of desc.split('\n')) {
532
+ for (const line of desc.split("\n")) {
401
533
  console.log(chalk.gray(` ${line}`));
402
534
  }
403
535
  }
404
- if ('acceptance_criteria' in spec && Array.isArray(spec.acceptance_criteria) && spec.acceptance_criteria.length > 0) {
536
+ if ("acceptance_criteria" in spec &&
537
+ Array.isArray(spec.acceptance_criteria) &&
538
+ spec.acceptance_criteria.length > 0) {
405
539
  console.log(chalk.gray(fieldLabels.acceptanceCriteria));
406
540
  for (const ac of spec.acceptance_criteria) {
407
- if (ac && typeof ac === 'object' && 'id' in ac) {
541
+ if (ac && typeof ac === "object" && "id" in ac) {
408
542
  const acObj = ac;
409
543
  console.log(chalk.gray(` [${acObj.id}]`));
410
544
  if (acObj.given)
@@ -417,9 +551,14 @@ export function formatTaskDetails(task, index) {
417
551
  }
418
552
  }
419
553
  // Show traceability if present
420
- if ('traceability' in spec && spec.traceability && typeof spec.traceability === 'object') {
554
+ if ("traceability" in spec &&
555
+ spec.traceability &&
556
+ typeof spec.traceability === "object") {
421
557
  const trace = spec.traceability;
422
- const hasTrace = trace.implementation?.length || trace.tests?.length || trace.commits?.length || trace.issues?.length;
558
+ const hasTrace = trace.implementation?.length ||
559
+ trace.tests?.length ||
560
+ trace.commits?.length ||
561
+ trace.issues?.length;
423
562
  if (hasTrace) {
424
563
  console.log(chalk.gray(fieldLabels.traceability));
425
564
  if (trace.implementation?.length) {
@@ -438,27 +577,38 @@ export function formatTaskDetails(task, index) {
438
577
  }
439
578
  }
440
579
  if (trace.commits?.length) {
441
- console.log(chalk.gray(` Commits: ${trace.commits.join(', ')}`));
580
+ console.log(chalk.gray(` Commits: ${trace.commits.join(", ")}`));
442
581
  }
443
582
  if (trace.issues?.length) {
444
- console.log(chalk.gray(` Issues: ${trace.issues.join(', ')}`));
583
+ console.log(chalk.gray(` Issues: ${trace.issues.join(", ")}`));
445
584
  }
446
585
  }
447
586
  }
448
587
  }
449
588
  }
450
589
  if (task.notes.length > 0) {
590
+ // Filter superseded notes unless showAllNotes is true
591
+ const notesToShow = options.showAllNotes
592
+ ? task.notes
593
+ : filterSupersededNotes(task.notes);
594
+ const hiddenCount = task.notes.length - notesToShow.length;
451
595
  console.log(`\n${sectionHeaders.notes}`);
452
- for (const note of task.notes) {
453
- const author = note.author || 'unknown';
454
- console.log(chalk.gray(`[${note.created_at}] ${author}:`));
596
+ for (const note of notesToShow) {
597
+ const author = note.author || "unknown";
598
+ // Mark if this note supersedes another
599
+ const supersededLabel = note.supersedes ? chalk.gray(" (supersedes earlier note)") : "";
600
+ console.log(chalk.gray(`[${note.created_at}] ${author}:`) + supersededLabel);
455
601
  console.log(note.content);
456
602
  }
603
+ // Show count of hidden notes if any
604
+ if (hiddenCount > 0) {
605
+ console.log(chalk.gray(`\n(${hiddenCount} superseded note${hiddenCount > 1 ? "s" : ""} hidden - use --all to show)`));
606
+ }
457
607
  }
458
608
  if (task.todos.length > 0) {
459
609
  console.log(`\n${sectionHeaders.todos}`);
460
610
  for (const todo of task.todos) {
461
- const check = todo.done ? chalk.green('') : chalk.gray('');
611
+ const check = todo.done ? chalk.green("") : chalk.gray("");
462
612
  const text = todo.done ? chalk.strikethrough.gray(todo.text) : todo.text;
463
613
  console.log(`${check} [${todo.id}] ${text}`);
464
614
  }