@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
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Array merging algorithms for semantic YAML merge.
3
+ *
4
+ * Handles different types of arrays:
5
+ * - ULID-based entity arrays (tasks, notes, inbox items)
6
+ * - Set-like arrays (tags, depends_on)
7
+ * - Append-only arrays (notes, todos)
8
+ */
9
+ /**
10
+ * Merge arrays that contain entities with _ulid fields.
11
+ *
12
+ * AC: @yaml-merge-driver ac-2
13
+ * Union merge: both additions included, identified by ULID.
14
+ *
15
+ * AC: @yaml-merge-driver ac-5
16
+ * Append-only arrays (notes, todos) are union merged by ULID.
17
+ *
18
+ * Strategy:
19
+ * 1. Start with all items from base (common ancestor)
20
+ * 2. Add items from ours that aren't in base (new in our branch)
21
+ * 3. Add items from theirs that aren't in base (new in their branch)
22
+ * 4. For items in base that were modified, prefer the modified version
23
+ *
24
+ * @param base Array from common ancestor
25
+ * @param ours Array from current branch
26
+ * @param theirs Array from incoming branch
27
+ * @returns Merged array with all items
28
+ */
29
+ export function mergeUlidArrays(base, ours, theirs) {
30
+ const baseArr = base ?? [];
31
+ const oursArr = ours ?? [];
32
+ const theirsArr = theirs ?? [];
33
+ // Build lookup maps by ULID
34
+ const baseMap = new Map(baseArr.map((item) => [item._ulid, item]));
35
+ const oursMap = new Map(oursArr.map((item) => [item._ulid, item]));
36
+ const theirsMap = new Map(theirsArr.map((item) => [item._ulid, item]));
37
+ // Result map - track all unique ULIDs
38
+ const resultMap = new Map();
39
+ // Add all items from ours (includes base items that may be modified)
40
+ for (const item of oursArr) {
41
+ resultMap.set(item._ulid, item);
42
+ }
43
+ // Add items from theirs that aren't in ours
44
+ for (const item of theirsArr) {
45
+ if (!oursMap.has(item._ulid)) {
46
+ // Item was added in theirs - include it
47
+ resultMap.set(item._ulid, item);
48
+ }
49
+ // If item exists in both ours and theirs but differs, we have a conflict
50
+ // That will be handled by field-level merge (separate function)
51
+ }
52
+ // Convert back to array, preserving order (ours first, then theirs additions)
53
+ const result = [];
54
+ // Add all items from ours in original order
55
+ for (const item of oursArr) {
56
+ result.push(resultMap.get(item._ulid));
57
+ }
58
+ // Add new items from theirs that weren't in ours
59
+ for (const item of theirsArr) {
60
+ if (!oursMap.has(item._ulid)) {
61
+ result.push(resultMap.get(item._ulid));
62
+ }
63
+ }
64
+ return result;
65
+ }
66
+ /**
67
+ * Normalize a kspec reference to its canonical ULID form if possible.
68
+ * Returns the original value if not a ref or resolution fails.
69
+ *
70
+ * AC: @merge-ref-normalization ac-2
71
+ * Graceful degradation: unresolvable refs kept as-is.
72
+ *
73
+ * @param value The value to potentially normalize
74
+ * @param refIndex Optional reference index for resolution
75
+ * @returns Canonical form (@ULID) or original value
76
+ */
77
+ export function normalizeRef(value, refIndex) {
78
+ // Only process strings that look like refs
79
+ if (typeof value !== "string" || !value.startsWith("@")) {
80
+ return value;
81
+ }
82
+ // No index available - keep as-is
83
+ if (!refIndex) {
84
+ return value;
85
+ }
86
+ // Try to resolve
87
+ const result = refIndex.resolve(value);
88
+ if (result.ok) {
89
+ // Return canonical ULID form with @ prefix
90
+ return `@${result.ulid}`;
91
+ }
92
+ // AC: @merge-ref-normalization ac-2 - Resolution failed, keep original
93
+ return value;
94
+ }
95
+ /**
96
+ * Merge set-like arrays (tags, depends_on, etc).
97
+ *
98
+ * AC: @yaml-merge-driver ac-6
99
+ * Set union: combine both arrays, remove duplicates.
100
+ *
101
+ * AC: @merge-ref-normalization ac-1
102
+ * For arrays containing kspec refs (depends_on, blocked_by, etc),
103
+ * normalizes refs to canonical ULID form before comparison to
104
+ * prevent duplicates when same item is referenced differently.
105
+ *
106
+ * Strategy:
107
+ * 1. Start with items from ours
108
+ * 2. Add items from theirs that aren't in ours
109
+ * 3. Remove duplicates (using normalized form for refs)
110
+ * 4. Preserve original representation (ours takes precedence)
111
+ *
112
+ * @param base Array from common ancestor (not used for set merge)
113
+ * @param ours Array from current branch
114
+ * @param theirs Array from incoming branch
115
+ * @param refIndex Optional reference index for normalizing refs
116
+ * @returns Merged array with unique items
117
+ */
118
+ export function mergeSetArray(base, ours, theirs, refIndex) {
119
+ const oursArr = ours ?? [];
120
+ const theirsArr = theirs ?? [];
121
+ // Build a map from normalized form -> original value
122
+ // This preserves the original form while deduplicating by canonical meaning
123
+ // AC: @merge-ref-normalization ac-1
124
+ const normalizedToOriginal = new Map();
125
+ // Add ours first (ours takes precedence for representation)
126
+ for (const item of oursArr) {
127
+ const normalized = normalizeRef(item, refIndex);
128
+ if (!normalizedToOriginal.has(normalized)) {
129
+ normalizedToOriginal.set(normalized, item);
130
+ }
131
+ }
132
+ // Add theirs (only if not already present in normalized form)
133
+ for (const item of theirsArr) {
134
+ const normalized = normalizeRef(item, refIndex);
135
+ if (!normalizedToOriginal.has(normalized)) {
136
+ normalizedToOriginal.set(normalized, item);
137
+ }
138
+ }
139
+ return Array.from(normalizedToOriginal.values());
140
+ }
141
+ /**
142
+ * Detect if an item was deleted in one branch.
143
+ *
144
+ * Helper for AC: @yaml-merge-driver ac-8
145
+ * Detect when one version deletes an item while other modifies it.
146
+ *
147
+ * @param ulid ULID to check
148
+ * @param base Base version map
149
+ * @param ours Ours version map
150
+ * @param theirs Theirs version map
151
+ * @returns Whether item was deleted in ours or theirs
152
+ */
153
+ export function detectDeletion(ulid, base, ours, theirs) {
154
+ const inBase = base.has(ulid);
155
+ const inOurs = ours.has(ulid);
156
+ const inTheirs = theirs.has(ulid);
157
+ return {
158
+ deletedInOurs: inBase && !inOurs && inTheirs,
159
+ deletedInTheirs: inBase && inOurs && !inTheirs,
160
+ modifiedInOurs: inBase && inOurs,
161
+ modifiedInTheirs: inBase && inTheirs,
162
+ };
163
+ }
164
+ //# sourceMappingURL=arrays.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrays.js","sourceRoot":"","sources":["../../src/merge/arrays.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAqB,EACrB,IAAqB,EACrB,MAAuB;IAEvB,MAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;IAC3B,MAAM,SAAS,GAAG,MAAM,IAAI,EAAE,CAAC;IAE/B,4BAA4B;IAC5B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACnE,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACnE,M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,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YAC1C,oBAAoB,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,cAAc,CAC5B,IAAY,EACZ,IAA0B,EAC1B,IAA0B,EAC1B,MAA4B;IAO5B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAElC,OAAO;QACL,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,IAAI,QAAQ;QAC5C,eAAe,EAAE,MAAM,IAAI,MAAM,IAAI,CAAC,QAAQ;QAC9C,cAAc,EAAE,MAAM,IAAI,MAAM;QAChC,gBAAgB,EAAE,MAAM,IAAI,QAAQ;KACrC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * File type detection for kspec merge driver.
3
+ *
4
+ * Determines which merge strategy to apply based on file path patterns.
5
+ */
6
+ /**
7
+ * Types of kspec files that require different merge strategies
8
+ */
9
+ export declare enum FileType {
10
+ /** Task files: *.tasks.yaml */
11
+ Tasks = "tasks",
12
+ /** Inbox files: *.inbox.yaml */
13
+ Inbox = "inbox",
14
+ /** Spec module files: modules/*.yaml */
15
+ SpecModules = "spec_modules",
16
+ /** Manifest file: kynetic.yaml */
17
+ Manifest = "manifest",
18
+ /** Meta file: kynetic.meta.yaml */
19
+ Meta = "meta",
20
+ /** Unrecognized files (fallback to default behavior) */
21
+ Unknown = "unknown"
22
+ }
23
+ /**
24
+ * Detect the type of a kspec file based on its path.
25
+ *
26
+ * Supports both explicit names (kynetic.yaml) and slug-based names ({slug}.yaml).
27
+ *
28
+ * @param filePath - Path to the file (can be relative or absolute)
29
+ * @returns The detected file type
30
+ */
31
+ export declare function detectFileType(filePath: string): FileType;
32
+ //# sourceMappingURL=file-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-type.d.ts","sourceRoot":"","sources":["../../src/merge/file-type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,oBAAY,QAAQ;IAClB,+BAA+B;IAC/B,KAAK,UAAU;IACf,gCAAgC;IAChC,KAAK,UAAU;IACf,wCAAwC;IACxC,WAAW,iBAAiB;IAC5B,kCAAkC;IAClC,QAAQ,aAAa;IACrB,mCAAmC;IACnC,IAAI,SAAS;IACb,wDAAwD;IACxD,OAAO,YAAY;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CA+CzD"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * File type detection for kspec merge driver.
3
+ *
4
+ * Determines which merge strategy to apply based on file path patterns.
5
+ */
6
+ /**
7
+ * Types of kspec files that require different merge strategies
8
+ */
9
+ export var FileType;
10
+ (function (FileType) {
11
+ /** Task files: *.tasks.yaml */
12
+ FileType["Tasks"] = "tasks";
13
+ /** Inbox files: *.inbox.yaml */
14
+ FileType["Inbox"] = "inbox";
15
+ /** Spec module files: modules/*.yaml */
16
+ FileType["SpecModules"] = "spec_modules";
17
+ /** Manifest file: kynetic.yaml */
18
+ FileType["Manifest"] = "manifest";
19
+ /** Meta file: kynetic.meta.yaml */
20
+ FileType["Meta"] = "meta";
21
+ /** Unrecognized files (fallback to default behavior) */
22
+ FileType["Unknown"] = "unknown";
23
+ })(FileType || (FileType = {}));
24
+ /**
25
+ * Detect the type of a kspec file based on its path.
26
+ *
27
+ * Supports both explicit names (kynetic.yaml) and slug-based names ({slug}.yaml).
28
+ *
29
+ * @param filePath - Path to the file (can be relative or absolute)
30
+ * @returns The detected file type
31
+ */
32
+ export function detectFileType(filePath) {
33
+ // Normalize path separators for cross-platform compatibility
34
+ const normalizedPath = filePath.replace(/\\/g, "/");
35
+ // Extract just the filename for pattern matching
36
+ const parts = normalizedPath.split("/");
37
+ const fileName = parts[parts.length - 1];
38
+ // Check for task files (*.tasks.yaml pattern) - must be before manifest check
39
+ if (fileName.endsWith(".tasks.yaml")) {
40
+ return FileType.Tasks;
41
+ }
42
+ // Check for inbox files (*.inbox.yaml pattern)
43
+ if (fileName.endsWith(".inbox.yaml")) {
44
+ return FileType.Inbox;
45
+ }
46
+ // Check for meta file (*.meta.yaml pattern - supports slug-based naming)
47
+ if (fileName.endsWith(".meta.yaml")) {
48
+ return FileType.Meta;
49
+ }
50
+ // Check for workflow runs files (*.runs.yaml pattern)
51
+ if (fileName.endsWith(".runs.yaml")) {
52
+ return FileType.Unknown; // Runs files don't need special merge handling
53
+ }
54
+ // Check for spec modules (in modules/ directory)
55
+ // Match both "/modules/" and "modules/" at start of path
56
+ if ((normalizedPath.includes("/modules/") ||
57
+ normalizedPath.startsWith("modules/")) &&
58
+ fileName.endsWith(".yaml")) {
59
+ return FileType.SpecModules;
60
+ }
61
+ // Check for manifest - explicit names only for merge driver safety
62
+ // Slug-based manifests ({slug}.yaml) are handled at discovery time, not merge time
63
+ // The merge driver only needs to handle files that are definitely kspec files
64
+ if (fileName === "kynetic.yaml" || fileName === "kynetic.spec.yaml") {
65
+ return FileType.Manifest;
66
+ }
67
+ // Fallback for unrecognized files
68
+ return FileType.Unknown;
69
+ }
70
+ //# sourceMappingURL=file-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-type.js","sourceRoot":"","sources":["../../src/merge/file-type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,QAaX;AAbD,WAAY,QAAQ;IAClB,+BAA+B;IAC/B,2BAAe,CAAA;IACf,gCAAgC;IAChC,2BAAe,CAAA;IACf,wCA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C9B,CAAC;IAED,mEAAmE;IACnE,mFAAmF;IACnF,8EAA8E;IAC9E,IAAI,QAAQ,KAAK,cAAc,IAAI,QAAQ,KAAK,mBAAmB,EAAE,CAAC;QACpE,OAAO,QAAQ,CAAC,QAAQ,CAAC;IAC3B,CAAC;IAED,kCAAkC;IAClC,OAAO,QAAQ,CAAC,OAAO,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Semantic YAML merge driver for kspec files.
3
+ *
4
+ * Public API exports for the merge module.
5
+ */
6
+ export type { MergeResult, ConflictInfo, ConflictType, MergeOptions, ParsedVersions, ParseResult, } from "./types.js";
7
+ export { parseYamlVersions } from "./parse.js";
8
+ export { mergeUlidArrays, mergeSetArray, normalizeRef, detectDeletion, } from "./arrays.js";
9
+ export { mergeObjects } from "./objects.js";
10
+ export type { ObjectMergeResult } from "./objects.js";
11
+ export { promptScalarConflict, promptDeleteModifyConflict, resolveConflictsInteractive, formatConflictComment, } from "./resolve.js";
12
+ export type { ResolutionChoice, ConflictResolution } from "./resolve.js";
13
+ export { detectFileType, FileType } from "./file-type.js";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/merge/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EACL,eAAe,EACf,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Semantic YAML merge driver for kspec files.
3
+ *
4
+ * Public API exports for the merge module.
5
+ */
6
+ export { parseYamlVersions } from "./parse.js";
7
+ export { mergeUlidArrays, mergeSetArray, normalizeRef, detectDeletion, } from "./arrays.js";
8
+ export { mergeObjects } from "./objects.js";
9
+ export { promptScalarConflict, promptDeleteModifyConflict, resolveConflictsInteractive, formatConflictComment, } from "./resolve.js";
10
+ export { detectFileType, FileType } from "./file-type.js";
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/merge/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EACL,eAAe,EACf,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Object merging algorithms for semantic YAML merge.
3
+ *
4
+ * Handles field-level merging of objects, recursively merging nested structures
5
+ * and detecting conflicts when both sides modify the same scalar field.
6
+ */
7
+ import type { ConflictInfo } from "./types.js";
8
+ /**
9
+ * Result of merging two objects
10
+ */
11
+ export interface ObjectMergeResult {
12
+ /** The merged object */
13
+ merged: Record<string, unknown>;
14
+ /** Conflicts detected during merge */
15
+ conflicts: ConflictInfo[];
16
+ }
17
+ /**
18
+ * Merge two objects field by field, recursively handling nested objects.
19
+ *
20
+ * AC: @yaml-merge-driver ac-3
21
+ * When both versions modify different fields of the same item, fields are merged.
22
+ *
23
+ * AC: @yaml-merge-driver ac-7
24
+ * Nested objects are merged recursively at field level.
25
+ *
26
+ * Strategy:
27
+ * 1. Collect all keys from base, ours, and theirs
28
+ * 2. For each key, determine what happened:
29
+ * - Added in ours only → include ours value
30
+ * - Added in theirs only → include theirs value
31
+ * - Added in both (not in base) → conflict if different
32
+ * - Modified in ours only → include ours value
33
+ * - Modified in theirs only → include theirs value
34
+ * - Modified in both → recurse if objects, else conflict
35
+ * - Deleted in ours, kept in theirs → include theirs value
36
+ * - Deleted in theirs, kept in ours → include ours value
37
+ * - Deleted in both → omit from result
38
+ *
39
+ * @param base Object from common ancestor
40
+ * @param ours Object from current branch
41
+ * @param theirs Object from incoming branch
42
+ * @param path Path to this object (for conflict reporting)
43
+ * @returns Merged object and any conflicts detected
44
+ */
45
+ export declare function mergeObjects(base: Record<string, unknown> | undefined, ours: Record<string, unknown> | undefined, theirs: Record<string, unknown> | undefined, path?: string): ObjectMergeResult;
46
+ //# sourceMappingURL=objects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objects.d.ts","sourceRoot":"","sources":["../../src/merge/objects.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,sCAAsC;IACtC,SAAS,EAAE,YAAY,EAAE,CAAC;CAC3B;AAcD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACzC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACzC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC3C,IAAI,SAAK,GACR,iBAAiB,CAmInB"}
@@ -0,0 +1,193 @@
1
+ /**
2
+ * Object merging algorithms for semantic YAML merge.
3
+ *
4
+ * Handles field-level merging of objects, recursively merging nested structures
5
+ * and detecting conflicts when both sides modify the same scalar field.
6
+ */
7
+ /**
8
+ * Check if a value is a plain object (not an array, null, or other type)
9
+ */
10
+ function isPlainObject(value) {
11
+ return (typeof value === "object" &&
12
+ value !== null &&
13
+ !Array.isArray(value) &&
14
+ Object.getPrototypeOf(value) === Object.prototype);
15
+ }
16
+ /**
17
+ * Merge two objects field by field, recursively handling nested objects.
18
+ *
19
+ * AC: @yaml-merge-driver ac-3
20
+ * When both versions modify different fields of the same item, fields are merged.
21
+ *
22
+ * AC: @yaml-merge-driver ac-7
23
+ * Nested objects are merged recursively at field level.
24
+ *
25
+ * Strategy:
26
+ * 1. Collect all keys from base, ours, and theirs
27
+ * 2. For each key, determine what happened:
28
+ * - Added in ours only → include ours value
29
+ * - Added in theirs only → include theirs value
30
+ * - Added in both (not in base) → conflict if different
31
+ * - Modified in ours only → include ours value
32
+ * - Modified in theirs only → include theirs value
33
+ * - Modified in both → recurse if objects, else conflict
34
+ * - Deleted in ours, kept in theirs → include theirs value
35
+ * - Deleted in theirs, kept in ours → include ours value
36
+ * - Deleted in both → omit from result
37
+ *
38
+ * @param base Object from common ancestor
39
+ * @param ours Object from current branch
40
+ * @param theirs Object from incoming branch
41
+ * @param path Path to this object (for conflict reporting)
42
+ * @returns Merged object and any conflicts detected
43
+ */
44
+ export function mergeObjects(base, ours, theirs, path = "") {
45
+ const baseObj = base ?? {};
46
+ const oursObj = ours ?? {};
47
+ const theirsObj = theirs ?? {};
48
+ const merged = {};
49
+ const conflicts = [];
50
+ // Collect all keys from all three versions
51
+ const allKeys = new Set([
52
+ ...Object.keys(baseObj),
53
+ ...Object.keys(oursObj),
54
+ ...Object.keys(theirsObj),
55
+ ]);
56
+ for (const key of allKeys) {
57
+ const fieldPath = path ? `${path}.${key}` : key;
58
+ const inBase = key in baseObj;
59
+ const inOurs = key in oursObj;
60
+ const inTheirs = key in theirsObj;
61
+ const baseVal = baseObj[key];
62
+ const oursVal = oursObj[key];
63
+ const theirsVal = theirsObj[key];
64
+ // Case 1: Field only in ours (added in ours)
65
+ if (!inBase && inOurs && !inTheirs) {
66
+ merged[key] = oursVal;
67
+ continue;
68
+ }
69
+ // Case 2: Field only in theirs (added in theirs)
70
+ if (!inBase && !inOurs && inTheirs) {
71
+ merged[key] = theirsVal;
72
+ continue;
73
+ }
74
+ // Case 3: Field added in both (not in base)
75
+ if (!inBase && inOurs && inTheirs) {
76
+ if (valuesEqual(oursVal, theirsVal)) {
77
+ // Same value added in both - no conflict
78
+ merged[key] = oursVal;
79
+ }
80
+ else if (isPlainObject(oursVal) && isPlainObject(theirsVal)) {
81
+ // Both added nested objects - try to merge them
82
+ const result = mergeObjects(undefined, oursVal, theirsVal, fieldPath);
83
+ merged[key] = result.merged;
84
+ conflicts.push(...result.conflicts);
85
+ }
86
+ else {
87
+ // Different values added - conflict
88
+ conflicts.push({
89
+ type: "scalar_field",
90
+ path: fieldPath,
91
+ oursValue: oursVal,
92
+ theirsValue: theirsVal,
93
+ description: `Field "${key}" added with different values in both branches`,
94
+ });
95
+ // Default to ours for now (will be resolved interactively)
96
+ merged[key] = oursVal;
97
+ }
98
+ continue;
99
+ }
100
+ // Case 4: Field deleted in ours, kept/modified in theirs
101
+ if (inBase && !inOurs && inTheirs) {
102
+ // Deletion in ours, but theirs kept it - include theirs value
103
+ merged[key] = theirsVal;
104
+ continue;
105
+ }
106
+ // Case 5: Field deleted in theirs, kept/modified in ours
107
+ if (inBase && inOurs && !inTheirs) {
108
+ // Deletion in theirs, but ours kept it - include ours value
109
+ merged[key] = oursVal;
110
+ continue;
111
+ }
112
+ // Case 6: Field deleted in both
113
+ if (inBase && !inOurs && !inTheirs) {
114
+ // Both deleted - omit from result
115
+ continue;
116
+ }
117
+ // Case 7: Field exists in all three versions
118
+ if (inBase && inOurs && inTheirs) {
119
+ // Check if modified in ours
120
+ const modifiedInOurs = !valuesEqual(baseVal, oursVal);
121
+ // Check if modified in theirs
122
+ const modifiedInTheirs = !valuesEqual(baseVal, theirsVal);
123
+ if (!modifiedInOurs && !modifiedInTheirs) {
124
+ // No changes in either - keep base value
125
+ merged[key] = baseVal;
126
+ }
127
+ else if (modifiedInOurs && !modifiedInTheirs) {
128
+ // Only modified in ours - take ours
129
+ merged[key] = oursVal;
130
+ }
131
+ else if (!modifiedInOurs && modifiedInTheirs) {
132
+ // Only modified in theirs - take theirs
133
+ merged[key] = theirsVal;
134
+ }
135
+ else {
136
+ // Modified in both - need to check for conflicts
137
+ if (valuesEqual(oursVal, theirsVal)) {
138
+ // Same modification in both - no conflict
139
+ merged[key] = oursVal;
140
+ }
141
+ else if (isPlainObject(oursVal) && isPlainObject(theirsVal)) {
142
+ // Both modified nested objects - recurse
143
+ const result = mergeObjects(isPlainObject(baseVal) ? baseVal : undefined, oursVal, theirsVal, fieldPath);
144
+ merged[key] = result.merged;
145
+ conflicts.push(...result.conflicts);
146
+ }
147
+ else {
148
+ // Both modified scalar field with different values - conflict
149
+ conflicts.push({
150
+ type: "scalar_field",
151
+ path: fieldPath,
152
+ oursValue: oursVal,
153
+ theirsValue: theirsVal,
154
+ description: `Field "${key}" modified with different values in both branches`,
155
+ });
156
+ // Default to ours for now (will be resolved interactively)
157
+ merged[key] = oursVal;
158
+ }
159
+ }
160
+ continue;
161
+ }
162
+ }
163
+ return { merged, conflicts };
164
+ }
165
+ /**
166
+ * Compare two values for equality.
167
+ * Handles primitives, arrays, and objects.
168
+ */
169
+ function valuesEqual(a, b) {
170
+ // Handle primitives
171
+ if (a === b)
172
+ return true;
173
+ // Handle null/undefined
174
+ if (a == null || b == null)
175
+ return a === b;
176
+ // Handle arrays
177
+ if (Array.isArray(a) && Array.isArray(b)) {
178
+ if (a.length !== b.length)
179
+ return false;
180
+ return a.every((val, idx) => valuesEqual(val, b[idx]));
181
+ }
182
+ // Handle objects
183
+ if (isPlainObject(a) && isPlainObject(b)) {
184
+ const aKeys = Object.keys(a);
185
+ const bKeys = Object.keys(b);
186
+ if (aKeys.length !== bKeys.length)
187
+ return false;
188
+ return aKeys.every((key) => valuesEqual(a[key], b[key]));
189
+ }
190
+ // Different types or values
191
+ return false;
192
+ }
193
+ //# sourceMappingURL=objects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objects.js","sourceRoot":"","sources":["../../src/merge/objects.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH;;GAEG;AACH,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACrB,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,SAAS,CAClD,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAyC,EACzC,IAAyC,EACzC,MAA2C,EAC3C,IAAI,GAAG,EAAE;IAET,MAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;IAC3B,MAAM,SAAS,GAAG,MAAM,IAAI,EAAE,CAAC;IAE/B,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,MAAM,SAAS,GAAmB,EAAE,CAAC;IAErC,2CAA2C;IAC3C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC;QACtB,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACvB,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACvB,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;K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AAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,CAAU,EAAE,CAAU;IACzC,oBAAoB;IACpB,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzB,wBAAwB;IACxB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI;QAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAE3C,gBAAgB;IAChB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QACxC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,iBAAiB;IACjB,IAAI,aAAa,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAChD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,4BAA4B;IAC5B,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Parsing utilities for merge driver.
3
+ *
4
+ * Handles reading and parsing all three versions (base, ours, theirs)
5
+ * of a YAML file, with graceful fallback when parsing fails.
6
+ */
7
+ import type { ParseResult } from "./types.js";
8
+ /**
9
+ * Parse all three versions of a YAML file.
10
+ *
11
+ * AC: @yaml-merge-driver ac-1
12
+ * Parses base, ours, and theirs as structured data instead of text.
13
+ *
14
+ * AC: @yaml-merge-driver ac-11
15
+ * Returns parse failure if any file cannot be parsed.
16
+ *
17
+ * @param basePath Path to base version (common ancestor)
18
+ * @param oursPath Path to ours version (current branch)
19
+ * @param theirsPath Path to theirs version (incoming branch)
20
+ * @returns ParseResult with parsed versions or error
21
+ */
22
+ export declare function parseYamlVersions(basePath: string, oursPath: string, theirsPath: string): Promise<ParseResult>;
23
+ //# sourceMappingURL=parse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/merge/parse.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,YAAY,CAAC;AAE9D;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,CAAC,CAuDtB"}