@kabmo-labs/kabmo 0.46.1 → 0.48.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 (339) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +506 -502
  3. package/dist/client/static/js/Body-3tspyjtk.js +3 -0
  4. package/dist/client/static/js/{CsvGrid-qdkmv8bj.js → CsvGrid-3pwsfmxp.js} +2 -2
  5. package/dist/client/static/js/{DocxView-k84ns803.js → DocxView-xcg9jktb.js} +3 -3
  6. package/dist/client/static/js/{DrawioView-r1n717f7.js → DrawioView-2q19tgkx.js} +2 -2
  7. package/dist/client/static/js/HtmlPreview-92cadvbr.js +1 -0
  8. package/dist/client/static/js/ImageView-pr4h38hb.js +1 -0
  9. package/dist/client/static/js/LayoutWrapper-n4tzhjes.js +2 -0
  10. package/dist/client/static/js/MergeDiffView-0t15nh9f.js +1 -0
  11. package/dist/client/static/js/{Modal-xe6h99jn.js → Modal-77hgx4dw.js} +20 -20
  12. package/dist/client/static/js/{PdfView-ffg4mccg.js → PdfView-gzxhvxe8.js} +1 -1
  13. package/dist/client/static/js/{SessionsView-cdcbsee9.js → SessionsView-2tdqrvk0.js} +1 -1
  14. package/dist/client/static/js/{SheetView-89sscpz6.js → SheetView-w5w2m2de.js} +22 -22
  15. package/dist/client/static/js/{SvgPreview-68c0ccbv.js → SvgPreview-mtk6de6h.js} +1 -1
  16. package/dist/client/static/js/{abnfDiagram-O67JEVCF-h3a5s259.js → abnfDiagram-O67JEVCF-tha4j2fn.js} +1 -1
  17. package/dist/client/static/js/architecture-7GRP2DOG-zs15nydj.js +1 -0
  18. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-983p0jgn.js → architectureDiagram-NJMV4G6O-heep78p6.js} +6 -6
  19. package/dist/client/static/js/{astro-hyj5wege.js → astro-r4dp34pw.js} +1 -1
  20. package/dist/client/static/js/bash-8d3wrx5c.js +1 -0
  21. package/dist/client/static/js/{blockDiagram-BEXU5L5S-16pse5mh.js → blockDiagram-BEXU5L5S-6mzgfqh8.js} +5 -5
  22. package/dist/client/static/js/c-rn3z0csz.js +1 -0
  23. package/dist/client/static/js/{c4Diagram-YGBWAQC7-mvnb00zt.js → c4Diagram-YGBWAQC7-sfkcw7g9.js} +4 -4
  24. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-kmpd91xb.js → classDiagram-v2-NBCMYWYE-v530ny5e.js} +6 -6
  25. package/dist/client/static/js/{cose-bilkent-JH36ORCC-3ek5r5se.js → cose-bilkent-JH36ORCC-ybv1ttbx.js} +1 -1
  26. package/dist/client/static/js/cpp-99ws9nak.js +1 -0
  27. package/dist/client/static/js/css-narcr42w.js +1 -0
  28. package/dist/client/static/js/cynefin-OW5HDTMX-p3y1b4ap.js +1 -0
  29. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-jkbh84zn.js → cynefinDiagram-VND7K2PF-k8f3z0mm.js} +2 -2
  30. package/dist/client/static/js/{dagre-6A5THRUB-4fdc0sgn.js → dagre-6A5THRUB-gk0gp124.js} +2 -2
  31. package/dist/client/static/js/{diagram-22UHCM2B-hbk61nq9.js → diagram-22UHCM2B-2zh2957c.js} +15 -15
  32. package/dist/client/static/js/{diagram-3UASUU5V-hfpbr9qh.js → diagram-3UASUU5V-bzstt5e2.js} +2 -2
  33. package/dist/client/static/js/{diagram-ATOU4E4O-fn0nt71a.js → diagram-ATOU4E4O-16adx4g0.js} +3 -3
  34. package/dist/client/static/js/{diagram-CDSNMT55-ssswxjeb.js → diagram-CDSNMT55-1ja98ens.js} +5 -5
  35. package/dist/client/static/js/{diagram-MLGK6HIB-whnzxv6f.js → diagram-MLGK6HIB-f9nnyjbq.js} +2 -2
  36. package/dist/client/static/js/{diagram-MPIPVDR6-hk1chzxk.js → diagram-MPIPVDR6-3qgadfjz.js} +2 -2
  37. package/dist/client/static/js/{dockerfile-zmsj8r4g.js → dockerfile-04tc68pq.js} +1 -1
  38. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-q1vkg5mr.js → ebnfDiagram-ZINNZB2B-022cz603.js} +1 -1
  39. package/dist/client/static/js/{elixir-80wq7gak.js → elixir-61gbjv6c.js} +1 -1
  40. package/dist/client/static/js/{elk-276RUBZZ-kt98vg8j.js → elk-276RUBZZ-2anf1c36.js} +1 -1
  41. package/dist/client/static/js/{erDiagram-OPXOYQCR-ey3avsn9.js → erDiagram-OPXOYQCR-ndd27fz1.js} +7 -7
  42. package/dist/client/static/js/{erlang-814e8qy5.js → erlang-bh5cbm8m.js} +1 -1
  43. package/dist/client/static/js/eventmodeling-NTZA5JFV-sx2cwkz3.js +1 -0
  44. package/dist/client/static/js/flowDiagram-KWPJA3E3-dsc17mty.js +1 -0
  45. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-a9k1at43.js → ganttDiagram-FUAMR5RP-9gm6hkgn.js} +4 -4
  46. package/dist/client/static/js/gitGraph-4MIJSDKK-yqhbscsd.js +1 -0
  47. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-gnekjfym.js → gitGraphDiagram-X574FWY7-78bxa67c.js} +8 -8
  48. package/dist/client/static/js/graphql-tr0jcndy.js +1 -0
  49. package/dist/client/static/js/html-n8fdvrdk.js +1 -0
  50. package/dist/client/static/js/index-0e51wknc.js +10 -0
  51. package/dist/client/static/js/{index-z25ss7xj.js → index-13g17wa3.js} +1 -1
  52. package/dist/client/static/js/index-1hb8fvw9.js +1 -0
  53. package/dist/client/static/js/{index-1c2jvnyh.js → index-2bsnywea.js} +2 -2
  54. package/dist/client/static/js/{index-g7s0wsag.js → index-2n1fgpjv.js} +2 -2
  55. package/dist/client/static/js/{index-3x7h2eqj.js → index-30a8py59.js} +2 -2
  56. package/dist/client/static/js/{index-qf3y3ahx.js → index-34aq5bz5.js} +2 -2
  57. package/dist/client/static/js/index-3en15m75.js +2 -0
  58. package/dist/client/static/js/{index-nw5mvcaj.js → index-417fbrqk.js} +2 -2
  59. package/dist/client/static/js/{index-z4530r3c.js → index-45p59fxq.js} +2 -2
  60. package/dist/client/static/js/index-4n7t26ap.js +2 -0
  61. package/dist/client/static/js/{index-kty4ncsr.js → index-55pqvh82.js} +2 -2
  62. package/dist/client/static/js/index-5mpv57fn.js +12 -0
  63. package/dist/client/static/js/{index-x9r7zfp4.js → index-7pz6n3pg.js} +2 -2
  64. package/dist/client/static/js/{index-1ax52p0q.js → index-7whstwc7.js} +2 -2
  65. package/dist/client/static/js/index-869vdnz8.js +2 -0
  66. package/dist/client/static/js/{index-fzngzhww.js → index-8tvrzce0.js} +2 -2
  67. package/dist/client/static/js/index-9a78xmkk.js +462 -0
  68. package/dist/client/static/js/{index-33qxg79j.js → index-a58rkn3f.js} +5 -5
  69. package/dist/client/static/js/{index-60v30k5h.js → index-aa3hmn6j.js} +64 -64
  70. package/dist/client/static/js/{index-wrcdc9vz.js → index-aabp7nt6.js} +1 -1
  71. package/dist/client/static/js/{index-64sqfr4a.js → index-abrrqhne.js} +2 -2
  72. package/dist/client/static/js/{index-9vv7wr1n.js → index-ac2q5903.js} +2 -2
  73. package/dist/client/static/js/index-axtm1aq8.js +2 -0
  74. package/dist/client/static/js/index-b2cs4c51.js +4 -0
  75. package/dist/client/static/js/{index-8g7q8mz4.js → index-c250nzm1.js} +3 -3
  76. package/dist/client/static/js/{index-abs635a1.js → index-dxnkwf39.js} +48 -48
  77. package/dist/client/static/js/{index-kbhrvep8.js → index-e6ny4gd9.js} +6 -6
  78. package/dist/client/static/js/index-ebf50mrs.js +9 -0
  79. package/dist/client/static/js/{index-trvqvb1v.js → index-ep6bqcmg.js} +2 -2
  80. package/dist/client/static/js/{index-qfxn7yh5.js → index-fb2s080r.js} +2 -2
  81. package/dist/client/static/js/index-fryp0kgf.js +2 -0
  82. package/dist/client/static/js/{index-2ks0m8ss.js → index-g3rg6vsd.js} +2 -2
  83. package/dist/client/static/js/{index-sa1675y0.js → index-g8rpydkr.js} +2 -2
  84. package/dist/client/static/js/{index-bsr7wmj2.js → index-gkmn4y1v.js} +1 -1
  85. package/dist/client/static/js/{index-xq5f3nxa.js → index-gpmcth0x.js} +2 -2
  86. package/dist/client/static/js/{index-e9cxje00.js → index-hcmhdpp4.js} +10 -10
  87. package/dist/client/static/js/{index-kb14dhrx.js → index-he4k2j91.js} +2 -2
  88. package/dist/client/static/js/{index-wbws16ag.js → index-hq28918s.js} +2 -2
  89. package/dist/client/static/js/{index-84fyq5a6.js → index-hwzxdwwg.js} +1 -1
  90. package/dist/client/static/js/{index-2a6qp9y6.js → index-jnkc9p53.js} +1 -1
  91. package/dist/client/static/js/{index-pavvxrsz.js → index-k39be93q.js} +1 -1
  92. package/dist/client/static/js/{index-c9e417cs.js → index-kaxvwh07.js} +2 -2
  93. package/dist/client/static/js/{index-ykm7a3cp.js → index-kjr68pcj.js} +2 -2
  94. package/dist/client/static/js/{index-b5dfvget.js → index-m0fatq7c.js} +4 -4
  95. package/dist/client/static/js/{index-atq9q1s7.js → index-m39gbcxn.js} +1 -1
  96. package/dist/client/static/js/{index-hnb66d3s.js → index-mqzgf7rw.js} +2 -2
  97. package/dist/client/static/js/{index-5wz0y88c.js → index-pzsp1src.js} +2 -2
  98. package/dist/client/static/js/{index-yf93db65.js → index-qe0vfv6s.js} +1 -1
  99. package/dist/client/static/js/{index-q9ytjey8.js → index-qek9mt5w.js} +1 -1
  100. package/dist/client/static/js/{index-d23eacf2.js → index-qxzj780x.js} +2 -2
  101. package/dist/client/static/js/index-rgxg0azs.css +1 -0
  102. package/dist/client/static/js/{index-m4k054wz.js → index-rq4dk4tp.js} +4 -4
  103. package/dist/client/static/js/{index-fj5rsp5v.js → index-seekt5k3.js} +2 -2
  104. package/dist/client/static/js/{index-561gkvve.js → index-sng4prpr.js} +2 -2
  105. package/dist/client/static/js/{index-vjmg7kn5.js → index-t4s10406.js} +2 -2
  106. package/dist/client/static/js/{index-b2e5pwx7.js → index-tzz5gp8a.js} +5 -5
  107. package/dist/client/static/js/index-vnv9z0a1.js +1 -0
  108. package/dist/client/static/js/{index-19x11s5w.js → index-x7rajphe.js} +2 -2
  109. package/dist/client/static/js/{index-dxvtjn6a.js → index-xny7vsfz.js} +2 -2
  110. package/dist/client/static/js/index-xr4hjv01.js +2 -0
  111. package/dist/client/static/js/{index-65afr75v.js → index-ya9yqj5w.js} +2 -2
  112. package/dist/client/static/js/{index-z0fkfphe.js → index-zcgqacvx.js} +2 -2
  113. package/dist/client/static/js/info-A6RAGUB7-0sd3zzgg.js +1 -0
  114. package/dist/client/static/js/{infoDiagram-VRGFBTTK-r1p25738.js → infoDiagram-VRGFBTTK-bxk0g0pe.js} +2 -2
  115. package/dist/client/static/js/ini-tnaw7zjy.js +1 -0
  116. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-afgrqdrt.js → ishikawaDiagram-OU5B5YK6-d1kdkhth.js} +3 -3
  117. package/dist/client/static/js/java-m4dpc2vw.js +1 -0
  118. package/dist/client/static/js/javascript-8y26t991.js +1 -0
  119. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-hepa4wk7.js → journeyDiagram-ZHPQQLJL-cahg3zjq.js} +4 -4
  120. package/dist/client/static/js/json-azm7bdqd.js +1 -0
  121. package/dist/client/static/js/jsx-p9j1k773.js +1 -0
  122. package/dist/client/static/js/{julia-yv2j8qd0.js → julia-2n5k898q.js} +1 -1
  123. package/dist/client/static/js/{kanban-definition-PNTS6WVX-jysft8ya.js → kanban-definition-PNTS6WVX-nq7t83en.js} +6 -6
  124. package/dist/client/static/js/lua-hbm9rhz9.js +1 -0
  125. package/dist/client/static/js/markdown-tk3cd3vs.js +1 -0
  126. package/dist/client/static/js/{mermaid.core-0m90b0s8.js → mermaid.core-6nw0853j.js} +8 -8
  127. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-x2rrzpvr.js → mindmap-definition-NLK3R4M7-cm7ykxf2.js} +3 -3
  128. package/dist/client/static/js/one-dark-pro-2cdc2nk7.js +1 -0
  129. package/dist/client/static/js/one-light-bt6z4jf0.js +1 -0
  130. package/dist/client/static/js/packet-AYTQ26CC-13w2v5bb.js +1 -0
  131. package/dist/client/static/js/{pegDiagram-GJSIUBJH-z7vb7f1z.js → pegDiagram-GJSIUBJH-xwxz8nsq.js} +1 -1
  132. package/dist/client/static/js/{perl-917pjq5a.js → perl-66vb5pz7.js} +1 -1
  133. package/dist/client/static/js/{php-hwz75qzt.js → php-4e9we8am.js} +1 -1
  134. package/dist/client/static/js/pie-WAS4IAKB-swtnysgn.js +1 -0
  135. package/dist/client/static/js/{pieDiagram-5QR66LMP-jqv6v4e6.js → pieDiagram-5QR66LMP-n910k9th.js} +3 -3
  136. package/dist/client/static/js/properties-6911ckw7.js +1 -0
  137. package/dist/client/static/js/python-44cvj250.js +1 -0
  138. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-w2h8yxrv.js → quadrantDiagram-O4NWA36T-dxkwxbqb.js} +6 -6
  139. package/dist/client/static/js/r-t3sepzm4.js +1 -0
  140. package/dist/client/static/js/radar-RG4KPBEZ-vtvxkx55.js +1 -0
  141. package/dist/client/static/js/railroad-74A4TZTK-5sp2d63r.js +1 -0
  142. package/dist/client/static/js/railroad-abnf-HS5TGJTU-kg706fan.js +1 -0
  143. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-4ra1gzx5.js +1 -0
  144. package/dist/client/static/js/railroad-peg-WCYAUIDC-hms3zpjm.js +1 -0
  145. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-nd09yac3.js → railroadDiagram-XR7U4H2S-xb1smt7r.js} +1 -1
  146. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-t61zxh5v.js → requirementDiagram-PLB6GJNP-6kb21b9f.js} +6 -6
  147. package/dist/client/static/js/{ruby-er7ayhte.js → ruby-v7nmcvyr.js} +1 -1
  148. package/dist/client/static/js/{rust-avnkhh0p.js → rust-5ersd7be.js} +1 -1
  149. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-2f7h2cmw.js → sankeyDiagram-IPEJSGJF-74z0fskw.js} +4 -4
  150. package/dist/client/static/js/{sass-n47tt136.js → sass-h3nvy4c8.js} +1 -1
  151. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-kfb5d7zd.js → sequenceDiagram-PO4LG4MO-apn6kezn.js} +17 -17
  152. package/dist/client/static/js/{sizeCapture-INFHLROL-amfg19se.js → sizeCapture-INFHLROL-2drzcjb8.js} +1 -1
  153. package/dist/client/static/js/sql-zdkawqx3.js +1 -0
  154. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-k5hx7btx.js → stateDiagram-v2-GCMORJYK-ma09vhby.js} +3 -3
  155. package/dist/client/static/js/{svelte-2pmz35vx.js → svelte-dhspkgss.js} +1 -1
  156. package/dist/client/static/js/{swimlanes-2SLR337P-wv3rp8kk.js → swimlanes-2SLR337P-f6y9xqnx.js} +1 -1
  157. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-3dwas56m.js +8 -0
  158. package/dist/client/static/js/{timeline-definition-EJHVYXUP-0re95wtn.js → timeline-definition-EJHVYXUP-zmcmvq00.js} +5 -5
  159. package/dist/client/static/js/treeView-Q6P3EWNA-7t5k6rs2.js +1 -0
  160. package/dist/client/static/js/treemap-WGGIJYW6-w56ry3bg.js +1 -0
  161. package/dist/client/static/js/tsx-b7eabr17.js +1 -0
  162. package/dist/client/static/js/typescript-nnkvhwfy.js +1 -0
  163. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-yrje14qp.js → usecaseDiagram-POWQR4AR-wfaa019a.js} +24 -24
  164. package/dist/client/static/js/{vennDiagram-UO4OBE2U-jxkmrfy5.js → vennDiagram-UO4OBE2U-46wf2pgd.js} +8 -8
  165. package/dist/client/static/js/{vue-d5gpjfgn.js → vue-ffngx2b3.js} +1 -1
  166. package/dist/client/static/js/wardley-WFR3VGLG-rtjb9kgv.js +1 -0
  167. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-d3v2m9b1.js → wardleyDiagram-VNRHLVJA-10ph3bzq.js} +4 -4
  168. package/dist/client/static/js/xml-xy1tw6b2.js +1 -0
  169. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-9a1s1rjt.js → xychartDiagram-PMCCYNJV-2ba825z9.js} +5 -5
  170. package/dist/client/static/js/yaml-0fexqg2d.js +1 -0
  171. package/marketplace/marketplace.json +34 -7
  172. package/marketplace/plugins/kanban/README.md +143 -0
  173. package/marketplace/plugins/kanban/icon.svg +5 -0
  174. package/marketplace/plugins/kanban/package.json +30 -0
  175. package/marketplace/plugins/kanban/src/app.tsx +34 -0
  176. package/marketplace/plugins/kanban/src/mcp-tools.ts +296 -0
  177. package/marketplace/plugins/kanban/src/mcp.test.ts +199 -0
  178. package/marketplace/plugins/kanban/src/mcp.ts +148 -0
  179. package/marketplace/plugins/kanban/src/panel/CardSheet.tsx +319 -0
  180. package/marketplace/plugins/kanban/src/panel/CardTile.tsx +97 -0
  181. package/marketplace/plugins/kanban/src/panel/StageColumn.tsx +116 -0
  182. package/marketplace/plugins/kanban/src/panel/StageSheet.tsx +249 -0
  183. package/marketplace/plugins/kanban/src/panel/catalogs.ts +114 -0
  184. package/marketplace/plugins/kanban/src/panel/index.tsx +327 -0
  185. package/marketplace/plugins/kanban/src/panel/panel.test.ts +219 -0
  186. package/marketplace/plugins/kanban/src/panel/start-work.ts +132 -0
  187. package/marketplace/plugins/kanban/src/panel/use-board.ts +148 -0
  188. package/marketplace/plugins/kanban/src/panel/use-card-detail.ts +70 -0
  189. package/marketplace/plugins/kanban/src/panel/use-writes.ts +123 -0
  190. package/marketplace/plugins/kanban/src/protocol.ts +180 -0
  191. package/marketplace/plugins/kanban/src/server.test.ts +113 -0
  192. package/marketplace/plugins/kanban/src/server.ts +227 -0
  193. package/marketplace/plugins/kanban/src/store/board.test.ts +311 -0
  194. package/marketplace/plugins/kanban/src/store/board.ts +147 -0
  195. package/marketplace/plugins/kanban/src/store/cards.ts +228 -0
  196. package/marketplace/plugins/kanban/src/store/fs.ts +159 -0
  197. package/marketplace/plugins/kanban/src/store/ops.ts +245 -0
  198. package/marketplace/plugins/kanban/src/store/resolve.test.ts +82 -0
  199. package/marketplace/plugins/kanban/src/store/resolve.ts +135 -0
  200. package/marketplace/plugins/kanban/tsconfig.json +26 -0
  201. package/package.json +2 -2
  202. package/src/client/components/common/file-icon/index.tsx +1 -1
  203. package/src/client/components/layout/desktop-layout/LeftColumn.tsx +12 -3
  204. package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +34 -7
  205. package/src/client/components/layout/desktop-layout/index.tsx +17 -22
  206. package/src/client/components/mobile/mobile-right-sidebar/EditorSurface.tsx +2 -0
  207. package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +11 -3
  208. package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.test.tsx +21 -0
  209. package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.tsx +8 -4
  210. package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +8 -2
  211. package/src/client/components/settings/categories/appearance-settings/ThemeGrid.tsx +15 -4
  212. package/src/client/components/settings/categories/usage-settings/LimitsSection.tsx +10 -3
  213. package/src/client/components/settings/categories/usage-settings/ProviderDetail.tsx +27 -4
  214. package/src/client/components/settings/categories/usage-settings/TokenHarborCard.tsx +160 -0
  215. package/src/client/components/settings/categories/usage-settings/TokenPortalCard.tsx +104 -0
  216. package/src/client/components/settings/categories/usage-settings/format.ts +35 -0
  217. package/src/client/components/settings/categories/usage-settings/limits-section.test.tsx +16 -0
  218. package/src/client/components/settings/categories/usage-settings/providers.ts +26 -4
  219. package/src/client/components/settings/categories/usage-settings/token-harbor-card.test.tsx +114 -0
  220. package/src/client/components/settings/categories/usage-settings/token-harbor-hint.test.ts +68 -0
  221. package/src/client/components/settings/categories/usage-settings/token-portal-card.test.tsx +81 -0
  222. package/src/client/components/settings/categories/usage-settings/usage-and-picker.test.ts +66 -0
  223. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +21 -0
  224. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +7 -1
  225. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +3 -1
  226. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +1 -1
  227. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.test.ts +13 -0
  228. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.tsx +41 -18
  229. package/src/client/components/workspace/editor/BodyLazy.tsx +40 -0
  230. package/src/client/components/workspace/editor/FilePane.tsx +4 -2
  231. package/src/client/components/workspace/editor/Tabs.tsx +7 -1
  232. package/src/client/components/workspace/editor/Toolbar.tsx +7 -1
  233. package/src/client/components/workspace/editor/chrome-rows.test.tsx +126 -0
  234. package/src/client/components/workspace/editor/index.tsx +2 -2
  235. package/src/client/components/workspace/editor/viewers/HtmlPreview.test.tsx +94 -0
  236. package/src/client/components/workspace/editor/viewers/HtmlPreview.tsx +71 -0
  237. package/src/client/components/workspace/editor/viewers/bytes.ts +1 -1
  238. package/src/client/components/workspace/editor/viewers/dispatch.tsx +18 -2
  239. package/src/client/components/workspace/editor/viewers/viewers.test.ts +14 -1
  240. package/src/client/components/workspace/panel-header/index.test.tsx +2 -1
  241. package/src/client/components/workspace/panel-header/index.tsx +6 -4
  242. package/src/client/data/settings/omp-schema.json +33 -10
  243. package/src/client/hooks/editor/resolve-viewer.ts +1 -1
  244. package/src/client/hooks/editor/use-editor-drop.ts +14 -0
  245. package/src/client/hooks/editor/use-editor-tab-state.ts +5 -4
  246. package/src/client/hooks/ui/media-query.ts +27 -0
  247. package/src/client/hooks/workspace/file-tabs.ts +10 -0
  248. package/src/client/hooks/workspace/right-panel-presence.test.ts +152 -0
  249. package/src/client/hooks/workspace/right-panel-presence.ts +119 -0
  250. package/src/client/lib/router/search-params.test.ts +83 -0
  251. package/src/client/lib/router/search-params.ts +14 -3
  252. package/src/server/lib/mcp/session-mcp.test.ts +64 -1
  253. package/src/server/lib/mcp/session-overlay.server.ts +7 -4
  254. package/src/server/lib/omp/rpc/constants.test.ts +31 -0
  255. package/src/server/lib/omp/rpc/constants.ts +19 -0
  256. package/src/server/lib/omp/rpc/session-new.ts +78 -0
  257. package/src/server/lib/omp/rpc/session-registry.ts +22 -49
  258. package/src/server/lib/omp/rpc/spawn-mcp.ts +8 -1
  259. package/src/server/lib/omp/session/blobs.server.ts +2 -1
  260. package/src/server/lib/plugins/e2e.test.ts +71 -2
  261. package/src/server/lib/plugins/loader.server.ts +20 -1
  262. package/src/server/lib/plugins/module-import.server.ts +45 -0
  263. package/src/server/lib/usage/provider-key.ts +18 -0
  264. package/src/server/lib/usage/providers.server.ts +27 -3
  265. package/src/server/lib/usage/report.server.ts +24 -0
  266. package/src/server/lib/usage/token-harbor.test.ts +191 -0
  267. package/src/server/lib/usage/token-harbor.ts +207 -0
  268. package/src/server/lib/usage/token-portal.test.ts +140 -0
  269. package/src/server/lib/usage/token-portal.ts +179 -0
  270. package/src/server/lib/usage/vendor-http.test.ts +52 -0
  271. package/src/server/lib/usage/vendor-http.ts +9 -2
  272. package/src/server/routes/agent/new-prompt.test.ts +81 -0
  273. package/src/server/routes/agent/new.ts +78 -4
  274. package/src/server/routes/fs/raw.test.ts +12 -0
  275. package/src/server/routes/fs/raw.ts +2 -6
  276. package/src/server/routes/wiki/asset.ts +1 -1
  277. package/src/shared/lib/fs/document-kind.test.ts +39 -2
  278. package/src/shared/lib/fs/document-kind.ts +49 -1
  279. package/src/shared/lib/fs/file-kind.test.ts +30 -3
  280. package/src/shared/lib/fs/file-kind.ts +7 -104
  281. package/src/shared/lib/fs/mime.ts +159 -0
  282. package/src/shared/lib/omp/config/schema-releases.test.ts +22 -0
  283. package/src/shared/lib/workspace/sidebar-width.test.ts +34 -0
  284. package/src/shared/lib/workspace/sidebar-width.ts +33 -0
  285. package/src/shared/lib/workspace/workspace-panel-widths.test.ts +124 -0
  286. package/src/shared/lib/workspace/workspace-panel-widths.ts +115 -18
  287. package/src/shared/types/settings/usage.ts +89 -2
  288. package/dist/client/static/js/ImageView-jkrdrq8v.js +0 -1
  289. package/dist/client/static/js/LayoutWrapper-sh634350.js +0 -2
  290. package/dist/client/static/js/architecture-7GRP2DOG-pvb4d65d.js +0 -1
  291. package/dist/client/static/js/bash-8d8z8zrg.js +0 -1
  292. package/dist/client/static/js/c-acmn1zc9.js +0 -1
  293. package/dist/client/static/js/cpp-620mvjkk.js +0 -1
  294. package/dist/client/static/js/css-bt76kxbq.js +0 -1
  295. package/dist/client/static/js/cynefin-OW5HDTMX-gmx4vean.js +0 -1
  296. package/dist/client/static/js/eventmodeling-NTZA5JFV-vrnheyh7.js +0 -1
  297. package/dist/client/static/js/flowDiagram-KWPJA3E3-7gvtpn3d.js +0 -1
  298. package/dist/client/static/js/gitGraph-4MIJSDKK-n6wnc8st.js +0 -1
  299. package/dist/client/static/js/graphql-j1a6zp7m.js +0 -1
  300. package/dist/client/static/js/html-m0megrvb.js +0 -1
  301. package/dist/client/static/js/index-4cag7w6k.js +0 -479
  302. package/dist/client/static/js/index-5ka2tyf9.js +0 -3
  303. package/dist/client/static/js/index-83rkg916.js +0 -2
  304. package/dist/client/static/js/index-amsa0tfs.js +0 -2
  305. package/dist/client/static/js/index-dn7hg4em.js +0 -2
  306. package/dist/client/static/js/index-dpy3ewrn.css +0 -1
  307. package/dist/client/static/js/index-dt6q3rws.js +0 -12
  308. package/dist/client/static/js/index-hgzntg2j.js +0 -2
  309. package/dist/client/static/js/index-vkqb4dnt.js +0 -1
  310. package/dist/client/static/js/index-xwjbq003.js +0 -2
  311. package/dist/client/static/js/info-A6RAGUB7-1xtdxjz2.js +0 -1
  312. package/dist/client/static/js/ini-5f4zqtqr.js +0 -1
  313. package/dist/client/static/js/java-jj41mty3.js +0 -1
  314. package/dist/client/static/js/javascript-n9w9p97f.js +0 -1
  315. package/dist/client/static/js/json-rnh2h17x.js +0 -1
  316. package/dist/client/static/js/jsx-4gecrt29.js +0 -1
  317. package/dist/client/static/js/lua-zszaw2f7.js +0 -1
  318. package/dist/client/static/js/markdown-nm6gw4v4.js +0 -1
  319. package/dist/client/static/js/one-dark-pro-09d8p5vy.js +0 -1
  320. package/dist/client/static/js/one-light-g3ednt6p.js +0 -1
  321. package/dist/client/static/js/packet-AYTQ26CC-zm1r82x5.js +0 -1
  322. package/dist/client/static/js/pie-WAS4IAKB-sqa7321j.js +0 -1
  323. package/dist/client/static/js/properties-rkptax7r.js +0 -1
  324. package/dist/client/static/js/python-qf1se1mj.js +0 -1
  325. package/dist/client/static/js/r-ms0cygq2.js +0 -1
  326. package/dist/client/static/js/radar-RG4KPBEZ-z3z82syp.js +0 -1
  327. package/dist/client/static/js/railroad-74A4TZTK-z6swcqq2.js +0 -1
  328. package/dist/client/static/js/railroad-abnf-HS5TGJTU-33km6py4.js +0 -1
  329. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zbf1xmq.js +0 -1
  330. package/dist/client/static/js/railroad-peg-WCYAUIDC-wte1xzzy.js +0 -1
  331. package/dist/client/static/js/sql-hd42h8wx.js +0 -1
  332. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-6y8zdbm4.js +0 -8
  333. package/dist/client/static/js/treeView-Q6P3EWNA-pvgx6n22.js +0 -1
  334. package/dist/client/static/js/treemap-WGGIJYW6-3n9zm628.js +0 -1
  335. package/dist/client/static/js/tsx-gx7td06z.js +0 -1
  336. package/dist/client/static/js/typescript-1a808spn.js +0 -1
  337. package/dist/client/static/js/wardley-WFR3VGLG-7m07ewc4.js +0 -1
  338. package/dist/client/static/js/xml-3117mxd9.js +0 -1
  339. package/dist/client/static/js/yaml-dmvh8vyt.js +0 -1
@@ -0,0 +1,143 @@
1
+ # Kanban
2
+
3
+ A board that **drives work** rather than describing it.
4
+
5
+ A card is a task: a prompt, an agent, and a stage. Press **Start work** and the
6
+ card's prompt becomes a real chat in its own workspace; the card then shows that
7
+ chat's live state. The agent can move its own card — `in_progress → review` —
8
+ through the plugin's MCP tools, and the board follows without a reload.
9
+
10
+ That is the whole idea. There is no description field, no comments, no labels and
11
+ no epics: a board that accumulates knowledge stops being read, and the prompt
12
+ already carries everything the agent needs.
13
+
14
+ ## One board, two lenses
15
+
16
+ The board lives in Kabmo's own data directory (`~/.kabmo/kanban`, or
17
+ `KABMO_DATA_DIR`), not in a repository. A per-repo board dies with its checkout,
18
+ and "what am I working on" then needs a tool to answer.
19
+
20
+ - **`All`** — every card.
21
+ - **`This workspace`** — the default while a workspace is open.
22
+ - **`Unfiled`** — cards with no workspace.
23
+
24
+ A card carries the workspace it belongs to, so the lenses FILTER and never move
25
+ anything. A card whose folder was deleted stays on the board and says so; only
26
+ starting work needs a real workspace.
27
+
28
+ ## Stages own the agent
29
+
30
+ Each stage can override the harness, model, thinking level, approval mode and
31
+ **system prompt**, and each field falls back independently:
32
+
33
+ ```
34
+ card → stage → board defaults → host default
35
+ ```
36
+
37
+ Per field, so a card that only wants more thinking does not have to restate the
38
+ stage's harness. The sheet names the level every value came from, because a
39
+ fallback chain nobody can see is a chain nobody can override.
40
+
41
+ The stage prompt reaches the agent differently per transport, and the sheet says
42
+ which:
43
+
44
+ | Harness | Delivery |
45
+ |---|---|
46
+ | `omp-rpc` | `--append-system-prompt` at spawn — appended to omp's own coding prompt, so the tool contract survives |
47
+ | any ACP harness | prepended to the first turn in a `<stage_instructions>` block, because ACP's `session/new` has no system-prompt field |
48
+ | an already-linked session | always prepended: spawn flags are fixed once the child exists |
49
+
50
+ A prewarmed omp child is deliberately NOT adopted when a system prompt is asked
51
+ for — omp reads that flag only at spawn, so adopting one would silently drop the
52
+ instructions.
53
+
54
+ ## Start work is one call
55
+
56
+ `POST /api/agent/new` — the route the chat composer itself uses — resolves the
57
+ model when the card names none (project default, then the persisted pick),
58
+ applies the thinking level, spawns omp or an ACP agent, and runs the first
59
+ prompt. It answers the real `sessionId`, so the card is linked on the same
60
+ response; there is no pending-session heuristic and no second spawn path.
61
+
62
+ A card with no workspace is refused by name rather than started in the server's
63
+ own directory.
64
+
65
+ ## MCP: the agent moves its own card
66
+
67
+ The plugin registers a stdio MCP server named `<plugin id>:board`. It is the same
68
+ built bundle: `dist/server.js --mcp` serves it, and `KANBAN_DATA_DIR` tells it
69
+ which board to read (a plugin MCP registration has no `cwd`, so guessing from the
70
+ agent's directory would read the wrong board).
71
+
72
+ | Tool | What it does |
73
+ |---|---|
74
+ | `kanban_list` | Slim rows, filtered by workspace and stage |
75
+ | `kanban_next` | The highest-priority card that is not done, plus its stage prompt |
76
+ | `kanban_get` | One card with its stage and the resolved agent |
77
+ | `kanban_create` | New card (workspace defaults to nothing — say where it belongs) |
78
+ | `kanban_move` | The move the board exists for |
79
+ | `kanban_claim` | Record a session and land in the working stage |
80
+ | `kanban_update` | Title, priority, workspace, prompt |
81
+ | `kanban_link_session` | Link or unlink a chat |
82
+ | `kanban_delete` | Remove a card file |
83
+ | `kanban_stages` | Read or replace the stage list and the board defaults |
84
+
85
+ A move into a stage that **runs a session** does not start one. It answers
86
+ `next: "start_work_required"` and the card shows **Start work**, because a chat
87
+ appearing from nowhere is worse than one click.
88
+
89
+ A refusal is a RESULT the agent can read (`{ ok: false, code, message }`), not a
90
+ JSON-RPC error: `stage "nope" does not exist` is actionable, `the server broke` is
91
+ not.
92
+
93
+ ## Files, and why not a database
94
+
95
+ ```
96
+ <dataDir>/kanban/
97
+ ├── README.md format notes for an agent
98
+ ├── board.json schema, defaults, stages
99
+ └── cards/<id>.json one card per file
100
+ ```
101
+
102
+ Two writers exist — Kabmo's process and the MCP child — so every
103
+ read-modify-write takes `cards/.write.lock` (a stale lock is taken over after
104
+ 5 s) and every write goes through a temp file and a rename. A card file is the
105
+ unit of change, which is also what lets an agent with nothing but its file tools
106
+ read and edit the board.
107
+
108
+ **Removing the plugin never deletes the board.** That is why the board is not in
109
+ `storage.records`: those rows are purged on removal, and a personal queue
110
+ destroyed by an uninstall-and-reinstall is not an acceptable failure.
111
+
112
+ ## The panel
113
+
114
+ - Board: horizontal stages, 200 px floor, horizontal scroll, 120 cards per stage.
115
+ - Card: id, priority, title, workspace (in `All`), prompt preview, live session
116
+ pill (`running` / `needs you` / `idle`).
117
+ - Card sheet: title, stage, priority, workspace, the prompt (with images), the
118
+ agent picks with their origins, and Start work / Link this chat / Open chat /
119
+ Unlink / Delete.
120
+ - Stages sheet: per stage — label, hidden, runs-a-session, harness, thinking,
121
+ access, system prompt; plus the board defaults.
122
+ - A hidden stage that still holds cards keeps showing. A card whose stage no
123
+ longer exists appears under **Unplaced** with its file named.
124
+ - Drag moves a card between stages; the stage select does the same thing, so drag
125
+ is an enhancement rather than the only way.
126
+
127
+ ## Tests
128
+
129
+ ```
130
+ bun test marketplace/plugins/kanban/
131
+ ```
132
+
133
+ 72 assertions across four suites, each owning a rule that fails silently:
134
+
135
+ - `store/board.test.ts` — ids, unknown fields preserved, staleness, the prompt and
136
+ image ceilings, a broken card reported with its path, an unreadable board never
137
+ read as empty, a hidden stage keeping its cards, the fallback chain per field.
138
+ - `mcp.test.ts` — every tool, `start_work_required`, a readable refusal, a bad id
139
+ that never reaches the filesystem.
140
+ - `server.test.ts` — an agent's write is published (the watcher), a burst
141
+ collapses to one frame, dispose stops it.
142
+ - `panel/panel.test.ts` — lenses, which stages draw, the card face, the origin
143
+ labels, and exactly what a Start-work request carries per transport.
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">
2
+ <rect x="3" y="3" width="5" height="18" rx="1" />
3
+ <rect x="10" y="3" width="5" height="12" rx="1" />
4
+ <rect x="17" y="3" width="4" height="15" rx="1" />
5
+ </svg>
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "kanban",
3
+ "version": "0.1.1",
4
+ "private": true,
5
+ "description": "A board that drives work: cards carry a prompt, an agent and a stage, and an agent can move its own cards through MCP.",
6
+ "type": "module",
7
+ "kabmo": {
8
+ "id": "kanban",
9
+ "name": "Kanban",
10
+ "version": "0.1.1",
11
+ "description": "A board that drives work: cards carry a prompt, an agent and a stage, and an agent can move its own cards through MCP.",
12
+ "app": "dist/app.js",
13
+ "server": "dist/server.js",
14
+ "icon": "icon.svg",
15
+ "color": "#0ea5e9",
16
+ "author": { "name": "Kabmo Labs", "url": "https://github.com/kabmo-labs" },
17
+ "slots": ["rightPanel"],
18
+ "capabilities": ["panel", "server", "rpc", "realtime", "mcp"]
19
+ },
20
+ "peerDependencies": {
21
+ "@kabmo-labs/kabmo-sdk": "*",
22
+ "@kabmo-labs/kabmo-ui": "*",
23
+ "preact": "^10.29.8"
24
+ },
25
+ "peerDependenciesMeta": {
26
+ "@kabmo-labs/kabmo-sdk": { "optional": true },
27
+ "@kabmo-labs/kabmo-ui": { "optional": true },
28
+ "preact": { "optional": true }
29
+ }
30
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The Kanban's app half: one contribution, and one guard.
8
+ *
9
+ * The `rightPanel` registration is the whole visible surface — a board, a card
10
+ * sheet and a stages sheet all live inside it. There is deliberately no navbar
11
+ * readout and no content script: a count in the top bar would cost a background
12
+ * read for a number the panel already draws, and nothing has to run while the
13
+ * panel is closed (the server half owns the watcher, and the MCP child owns an
14
+ * agent's writes).
15
+ *
16
+ * The MCP server is NOT here: it lives in `server.ts`, because `dist/server.js`
17
+ * is the only bundle built for Bun and spawned as a process. This bundle runs in
18
+ * a browser, where there is no stdio to serve.
19
+ */
20
+
21
+ import { definePluginApp } from '@kabmo-labs/kabmo-sdk/app';
22
+
23
+ import { KanbanPanel } from './panel/index';
24
+
25
+ export default definePluginApp((app) => {
26
+ app.rightPanel({
27
+ id: 'board',
28
+ title: 'Kanban',
29
+ component: KanbanPanel,
30
+ // A lane is 200 px and a card needs ~180 of it; below this the board is one
31
+ // lane and a scrollbar, which is what the phone gets anyway.
32
+ minWidth: 420,
33
+ });
34
+ });
@@ -0,0 +1,296 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The tool table: what an agent can do to a board, in its own vocabulary.
8
+ *
9
+ * Split from the protocol handler so each file reads as one thing — the table is
10
+ * the CONTRACT (names, schemas, and the operation behind each), while `mcp.ts`
11
+ * owns framing and refusals.
12
+ *
13
+ * Every tool calls the same `store/ops` function the panel's RPC calls, so the
14
+ * two writers cannot drift: an agent's move and a drag both go through
15
+ * `moveCard`, with the same lock, the same validation and the same answer.
16
+ */
17
+
18
+ import { CARD_ID, STAGE_ID, type AgentSpec, type BoardSnapshot } from './protocol';
19
+ import { KanbanError } from './store/fs';
20
+ import {
21
+ addCard,
22
+ cardDetail,
23
+ claimCard,
24
+ linkSession,
25
+ moveCard,
26
+ nextCard,
27
+ removeCard,
28
+ saveDefaults,
29
+ saveStages,
30
+ snapshot,
31
+ updateCard,
32
+ } from './store/ops';
33
+ import { resolveAgent } from './store/resolve';
34
+
35
+ /** One tool as `tools/list` describes it. */
36
+ interface ToolDefinition {
37
+ name: string;
38
+ description: string;
39
+ inputSchema: Record<string, unknown>;
40
+ run: (dataDir: string, args: Record<string, unknown>) => Promise<unknown>;
41
+ }
42
+
43
+ function stringArg(args: Record<string, unknown>, key: string): string | undefined {
44
+ const value = args[key];
45
+ return typeof value === 'string' && value.trim() ? value.trim() : undefined;
46
+ }
47
+
48
+ function requireString(args: Record<string, unknown>, key: string): string {
49
+ const value = stringArg(args, key);
50
+ if (!value) throw new KanbanError('invalid', `"${key}" is required.`);
51
+ return value;
52
+ }
53
+
54
+ /** A workspace argument: a path, or `null` for the global bucket, or absent. */
55
+ function workspaceArg(args: Record<string, unknown>): string | null | undefined {
56
+ if (!('workspace' in args)) return undefined;
57
+ const value = args.workspace;
58
+ if (value === null) return null;
59
+ return typeof value === 'string' ? value : undefined;
60
+ }
61
+
62
+ /** The slim row a list answer carries. */
63
+ function row(card: BoardSnapshot['cards'][number]): Record<string, unknown> {
64
+ return {
65
+ id: card.id,
66
+ title: card.title,
67
+ status: card.status,
68
+ priority: card.priority,
69
+ workspace: card.workspace,
70
+ sessionId: card.sessionId,
71
+ updatedAt: card.updatedAt,
72
+ };
73
+ }
74
+
75
+ /**
76
+ * Every tool, and each one is the same operation the panel performs.
77
+ *
78
+ * `kanban_move` is the reason the tools exist: an agent that finished the work
79
+ * moves its own card, and the answer tells it whether the stage needs a session
80
+ * (`next: "start_work_required"`) — it never spawns one, because a spawn nobody
81
+ * asked for is worse than one click in the panel.
82
+ */
83
+ export const TOOLS: readonly ToolDefinition[] = [
84
+ {
85
+ name: 'kanban_list',
86
+ description: 'List board cards as slim rows. Optional workspace and status filters.',
87
+ inputSchema: {
88
+ type: 'object',
89
+ properties: {
90
+ workspace: { type: ['string', 'null'], description: 'Absolute workspace path, or null for unfiled cards.' },
91
+ status: { type: 'string', description: 'A stage id from board.json.' },
92
+ limit: { type: 'number', description: 'At most this many rows (default 50).' },
93
+ },
94
+ },
95
+ async run(dataDir, args) {
96
+ const board = await snapshot(dataDir);
97
+ const workspace = workspaceArg(args);
98
+ const status = stringArg(args, 'status');
99
+ const limit = typeof args.limit === 'number' && args.limit > 0 ? Math.min(args.limit, 500) : 50;
100
+ const cards = board.cards
101
+ .filter((card) => (workspace === undefined ? true : card.workspace === workspace))
102
+ .filter((card) => (status ? card.status === status : true))
103
+ .slice(0, limit);
104
+ return { cards: cards.map(row), stages: board.board.stages.map((stage) => ({ id: stage.id, label: stage.label })) };
105
+ },
106
+ },
107
+ {
108
+ name: 'kanban_next',
109
+ description: 'The highest-priority card that is not done, with the stage prompt that applies to it.',
110
+ inputSchema: {
111
+ type: 'object',
112
+ properties: { workspace: { type: ['string', 'null'], description: 'Restrict to one workspace.' } },
113
+ },
114
+ async run(dataDir, args) {
115
+ const card = await nextCard(dataDir, workspaceArg(args));
116
+ if (!card) return { card: null };
117
+ const { board } = await cardDetail(dataDir, card.id);
118
+ const stage = board.stages.find((entry) => entry.id === card.status);
119
+ const resolved = resolveAgent(card, stage, board);
120
+ return {
121
+ card: { ...row({ ...card, hasPrompt: card.task.prompt.length > 0, imageCount: card.task.images.length }), prompt: card.task.prompt },
122
+ agent: { harness: resolved.harness, model: resolved.model, thinking: resolved.thinking, prompt: resolved.prompt },
123
+ };
124
+ },
125
+ },
126
+ {
127
+ name: 'kanban_get',
128
+ description: 'One card, its stage, and the resolved agent settings.',
129
+ inputSchema: { type: 'object', properties: { id: { type: 'string' } }, required: ['id'] },
130
+ async run(dataDir, args) {
131
+ const id = requireString(args, 'id');
132
+ const { card, board } = await cardDetail(dataDir, id);
133
+ const stage = board.stages.find((entry) => entry.id === card.status);
134
+ return { card, stage: stage ?? null, agent: resolveAgent(card, stage, board), defaults: board.defaults };
135
+ },
136
+ },
137
+ {
138
+ name: 'kanban_create',
139
+ description: 'Create a card. `workspace` defaults to the caller\'s cwd when one is given.',
140
+ inputSchema: {
141
+ type: 'object',
142
+ properties: {
143
+ title: { type: 'string' },
144
+ prompt: { type: 'string' },
145
+ workspace: { type: ['string', 'null'] },
146
+ status: { type: 'string' },
147
+ priority: { type: 'number', description: '0 (urgent) .. 4 (backlog)' },
148
+ },
149
+ required: ['title'],
150
+ },
151
+ async run(dataDir, args) {
152
+ const card = await addCard(dataDir, {
153
+ title: requireString(args, 'title'),
154
+ status: stringArg(args, 'status'),
155
+ workspace: workspaceArg(args) ?? null,
156
+ priority: typeof args.priority === 'number' ? args.priority : undefined,
157
+ task: { prompt: stringArg(args, 'prompt') ?? '' },
158
+ });
159
+ return { card };
160
+ },
161
+ },
162
+ {
163
+ name: 'kanban_move',
164
+ description: 'Move a card to another stage. Answers next="start_work_required" when that stage runs a session and none is linked.',
165
+ inputSchema: {
166
+ type: 'object',
167
+ properties: { id: { type: 'string' }, status: { type: 'string' }, baseUpdatedAt: { type: 'string' } },
168
+ required: ['id', 'status'],
169
+ },
170
+ async run(dataDir, args) {
171
+ const status = requireString(args, 'status');
172
+ if (!STAGE_ID.test(status)) throw new KanbanError('invalid', `"${status}" is not a stage id.`);
173
+ const moved = await moveCard(dataDir, requireString(args, 'id'), status, stringArg(args, 'baseUpdatedAt'));
174
+ return { card: moved.card, ...(moved.next ? { next: moved.next } : {}) };
175
+ },
176
+ },
177
+ {
178
+ name: 'kanban_claim',
179
+ description: 'Claim a card for a session: record the session and move it to the working stage.',
180
+ inputSchema: {
181
+ type: 'object',
182
+ properties: { id: { type: 'string' }, session_id: { type: 'string' } },
183
+ required: ['id'],
184
+ },
185
+ async run(dataDir, args) {
186
+ return { card: await claimCard(dataDir, requireString(args, 'id'), stringArg(args, 'session_id')) };
187
+ },
188
+ },
189
+ {
190
+ name: 'kanban_update',
191
+ description: 'Change a card\'s control fields: title, priority, workspace, or the task prompt.',
192
+ inputSchema: {
193
+ type: 'object',
194
+ properties: {
195
+ id: { type: 'string' },
196
+ title: { type: 'string' },
197
+ priority: { type: 'number' },
198
+ workspace: { type: ['string', 'null'] },
199
+ prompt: { type: 'string' },
200
+ baseUpdatedAt: { type: 'string' },
201
+ },
202
+ required: ['id'],
203
+ },
204
+ async run(dataDir, args) {
205
+ const id = requireString(args, 'id');
206
+ const prompt = stringArg(args, 'prompt');
207
+ return {
208
+ card: await updateCard(
209
+ dataDir,
210
+ id,
211
+ {
212
+ title: stringArg(args, 'title'),
213
+ priority: typeof args.priority === 'number' ? args.priority : undefined,
214
+ workspace: workspaceArg(args),
215
+ ...(prompt !== undefined ? { task: { prompt } } : {}),
216
+ },
217
+ stringArg(args, 'baseUpdatedAt'),
218
+ ),
219
+ };
220
+ },
221
+ },
222
+ {
223
+ name: 'kanban_link_session',
224
+ description: 'Link (or unlink, with session_id=null) a chat session to a card.',
225
+ inputSchema: {
226
+ type: 'object',
227
+ properties: { id: { type: 'string' }, session_id: { type: ['string', 'null'] } },
228
+ required: ['id', 'session_id'],
229
+ },
230
+ async run(dataDir, args) {
231
+ const session = args.session_id;
232
+ if (session !== null && typeof session !== 'string') throw new KanbanError('invalid', 'session_id must be a string or null.');
233
+ return { card: await linkSession(dataDir, requireString(args, 'id'), session) };
234
+ },
235
+ },
236
+ {
237
+ name: 'kanban_delete',
238
+ description: 'Delete a card file.',
239
+ inputSchema: { type: 'object', properties: { id: { type: 'string' } }, required: ['id'] },
240
+ async run(dataDir, args) {
241
+ const id = requireString(args, 'id');
242
+ if (!CARD_ID.test(id)) throw new KanbanError('invalid', `"${id}" is not a card id.`);
243
+ await removeCard(dataDir, id);
244
+ return { deleted: id };
245
+ },
246
+ },
247
+ {
248
+ name: 'kanban_stages',
249
+ description: 'Read or replace the stage list. Replacing takes the WHOLE list, so read it first.',
250
+ inputSchema: {
251
+ type: 'object',
252
+ properties: {
253
+ stages: {
254
+ type: 'array',
255
+ description: 'The complete list. Omit to read.',
256
+ items: {
257
+ type: 'object',
258
+ properties: {
259
+ id: { type: 'string' },
260
+ label: { type: 'string' },
261
+ hidden: { type: 'boolean' },
262
+ session: { type: 'boolean' },
263
+ },
264
+ required: ['id', 'label'],
265
+ },
266
+ },
267
+ defaults: { type: 'object', description: 'Board defaults: harness, model, thinking, access, prompt, skills.' },
268
+ },
269
+ },
270
+ async run(dataDir, args) {
271
+ if (Array.isArray(args.stages)) {
272
+ const stages = args.stages.map((entry) => {
273
+ const record = entry as Record<string, unknown>;
274
+ return {
275
+ id: String(record.id ?? ''),
276
+ label: String(record.label ?? ''),
277
+ hidden: record.hidden === true,
278
+ session: record.session === true,
279
+ };
280
+ });
281
+ return { board: (await saveStages(dataDir, stages)).board };
282
+ }
283
+ if (args.defaults && typeof args.defaults === 'object') {
284
+ return { board: (await saveDefaults(dataDir, args.defaults as AgentSpec)).board };
285
+ }
286
+ const board = await snapshot(dataDir);
287
+ return { stages: board.board.stages, defaults: board.board.defaults };
288
+ },
289
+ },
290
+ ];
291
+
292
+
293
+ /** The tool by name, or undefined. */
294
+ export function toolNamed(name: string): ToolDefinition | undefined {
295
+ return TOOLS.find((tool) => tool.name === name);
296
+ }