@iowarp/clio-coder 0.4.6 → 0.4.8

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 (1142) hide show
  1. package/.claude-plugin/marketplace.json +283 -0
  2. package/CHANGELOG.md +79 -0
  3. package/CONTRIBUTING.md +178 -96
  4. package/NOTICE +8 -0
  5. package/README.md +100 -47
  6. package/dist/acp-JWPQZM2D.js +130 -0
  7. package/dist/agents-4GCDIRVX.js +149 -0
  8. package/dist/assets/codewiki.json +1 -1
  9. package/dist/assets/tui-notices/get-east-asian-width-LICENSE +9 -0
  10. package/dist/assets/tui-notices/marked-LICENSE +44 -0
  11. package/dist/assets/tui-notices/pi-tui-LICENSE +21 -0
  12. package/dist/assets/web-notices/@hono__node-server-LICENSE +21 -0
  13. package/dist/assets/web-notices/hono-LICENSE +21 -0
  14. package/dist/auth-SYAKTDQE.js +551 -0
  15. package/dist/background-OW67WMYR.js +37 -0
  16. package/dist/builtins-TKS63VNV.js +22 -0
  17. package/dist/chunk-2JSCCEKO.js +85 -0
  18. package/dist/chunk-2SXGG2IV.js +391 -0
  19. package/dist/chunk-2U2U5POA.js +59 -0
  20. package/dist/chunk-2ZWLMA3T.js +658 -0
  21. package/dist/chunk-36XSBPXL.js +579 -0
  22. package/dist/chunk-3IQOZRQ6.js +396 -0
  23. package/dist/chunk-3XE4NRLF.js +324 -0
  24. package/dist/chunk-44U2OUSM.js +243 -0
  25. package/dist/chunk-4P6M2TTE.js +119 -0
  26. package/dist/chunk-526ABLHD.js +1219 -0
  27. package/dist/chunk-5C2OQHLR.js +674 -0
  28. package/dist/chunk-5D2FNBMG.js +185 -0
  29. package/dist/chunk-5EQO5NWP.js +243 -0
  30. package/dist/chunk-5HULHKT2.js +32 -0
  31. package/dist/chunk-5UG6EZI3.js +66 -0
  32. package/dist/chunk-5W4FRA5Q.js +22283 -0
  33. package/dist/chunk-6R5MBXBJ.js +386 -0
  34. package/dist/chunk-6TKOFFGE.js +1058 -0
  35. package/dist/chunk-6UJ7RDI7.js +1143 -0
  36. package/dist/chunk-6X7VOCDY.js +44 -0
  37. package/dist/chunk-7QQRPB2E.js +915 -0
  38. package/dist/chunk-ARRUMZ7X.js +1377 -0
  39. package/dist/chunk-ATB3Q7YO.js +663 -0
  40. package/dist/chunk-AUHVBIDW.js +19 -0
  41. package/dist/chunk-BE4I3UJ2.js +668 -0
  42. package/dist/chunk-BFPHMSK7.js +169 -0
  43. package/dist/chunk-BHJMMCXS.js +466 -0
  44. package/dist/chunk-BIY22UUK.js +1322 -0
  45. package/dist/chunk-D55WO5J7.js +110 -0
  46. package/dist/chunk-DVJL77SO.js +162 -0
  47. package/dist/chunk-E2NSPYLC.js +814 -0
  48. package/dist/chunk-EFXMQYI6.js +4484 -0
  49. package/dist/chunk-EPYATQMG.js +2718 -0
  50. package/dist/chunk-EXKUF426.js +1801 -0
  51. package/dist/chunk-F7Y6QTPL.js +689 -0
  52. package/dist/chunk-FB3KTE2J.js +1710 -0
  53. package/dist/chunk-FNVPQQYT.js +117 -0
  54. package/dist/chunk-GEVQNST4.js +101 -0
  55. package/dist/chunk-GEYX2NZ5.js +697 -0
  56. package/dist/chunk-GJBJHJNY.js +2120 -0
  57. package/dist/chunk-GM4TY6VN.js +1233 -0
  58. package/dist/chunk-GVU4CXPJ.js +5191 -0
  59. package/dist/chunk-H5DPSUBB.js +637 -0
  60. package/dist/chunk-H77XBUBM.js +688 -0
  61. package/dist/chunk-HMGAKB7E.js +380 -0
  62. package/dist/chunk-HP7KJ5O2.js +797 -0
  63. package/dist/chunk-HVCAY2FH.js +67 -0
  64. package/dist/chunk-ICYIUNO4.js +35 -0
  65. package/dist/chunk-IILXVWJY.js +223 -0
  66. package/dist/chunk-JCVIL6TY.js +595 -0
  67. package/dist/chunk-JIMWEYWO.js +63 -0
  68. package/dist/chunk-JLBVCROW.js +562 -0
  69. package/dist/chunk-JOBN2YQQ.js +176 -0
  70. package/dist/chunk-JOL2QRLE.js +152 -0
  71. package/dist/chunk-JRA6OBHY.js +974 -0
  72. package/dist/chunk-JV25I7ID.js +1865 -0
  73. package/dist/chunk-JYKUMHCQ.js +705 -0
  74. package/dist/chunk-K3W6BF5C.js +283 -0
  75. package/dist/chunk-K45LHSCI.js +194 -0
  76. package/dist/chunk-K53E2PTW.js +1289 -0
  77. package/dist/chunk-K5UJD6MM.js +39 -0
  78. package/dist/chunk-KGP3UQGJ.js +200 -0
  79. package/dist/chunk-KKRXONXG.js +43 -0
  80. package/dist/chunk-KWJXCL2X.js +103 -0
  81. package/dist/chunk-L75H5B3B.js +446 -0
  82. package/dist/chunk-LLCGGVSW.js +108 -0
  83. package/dist/chunk-LZCCBLRC.js +57 -0
  84. package/dist/chunk-LZDLYSUN.js +197 -0
  85. package/dist/chunk-MATCRH3M.js +667 -0
  86. package/dist/chunk-MEHBW2SP.js +132 -0
  87. package/dist/chunk-MUXNDNMZ.js +659 -0
  88. package/dist/chunk-MWMW53WW.js +7346 -0
  89. package/dist/chunk-MZDPF35R.js +45 -0
  90. package/dist/chunk-MZKYVIWW.js +188 -0
  91. package/dist/chunk-O2QJDRWP.js +362 -0
  92. package/dist/chunk-O3HSB2YL.js +693 -0
  93. package/dist/chunk-OEMFEL26.js +891 -0
  94. package/dist/chunk-OH3YYA3B.js +15 -0
  95. package/dist/chunk-OPC4DQD6.js +634 -0
  96. package/dist/chunk-ORRNGQDV.js +207 -0
  97. package/dist/chunk-P4JS3MH5.js +165 -0
  98. package/dist/chunk-P7GTE4FX.js +308 -0
  99. package/dist/chunk-PAQVETLA.js +962 -0
  100. package/dist/chunk-PFZJMXIY.js +146 -0
  101. package/dist/chunk-PGEFOTJB.js +1974 -0
  102. package/dist/chunk-PJ5H5B7A.js +3151 -0
  103. package/dist/chunk-PMUUAABD.js +604 -0
  104. package/dist/chunk-Q32C6AWI.js +236 -0
  105. package/dist/chunk-QGIC5SX5.js +139 -0
  106. package/dist/chunk-QLAGXTTV.js +482 -0
  107. package/dist/chunk-QLKCCC2J.js +573 -0
  108. package/dist/chunk-QWUSS2QP.js +3630 -0
  109. package/dist/chunk-QYSAZMSH.js +47 -0
  110. package/dist/chunk-R5NRX5N4.js +123 -0
  111. package/dist/chunk-RAUOKUZV.js +1572 -0
  112. package/dist/chunk-RBES4TCZ.js +302 -0
  113. package/dist/chunk-RFCKPS2V.js +26 -0
  114. package/dist/chunk-RFULVPBX.js +318 -0
  115. package/dist/chunk-RKFNU5UA.js +404 -0
  116. package/dist/chunk-RM3XJX7P.js +1148 -0
  117. package/dist/chunk-RNLAPBJL.js +386 -0
  118. package/dist/chunk-RPMNIFRY.js +65 -0
  119. package/dist/chunk-RRZFRIJP.js +42 -0
  120. package/dist/chunk-RXI7K4J5.js +4493 -0
  121. package/dist/chunk-SER7RRAE.js +4271 -0
  122. package/dist/chunk-STC6CWUZ.js +402 -0
  123. package/dist/chunk-TEHVMHOK.js +97 -0
  124. package/dist/chunk-TOPICHGR.js +33 -0
  125. package/dist/chunk-U3TPUXOQ.js +2653 -0
  126. package/dist/chunk-UB33F3YW.js +709 -0
  127. package/dist/chunk-UDAK6GR2.js +175 -0
  128. package/dist/chunk-USBBEKHW.js +177 -0
  129. package/dist/chunk-V4ZKOKRB.js +13433 -0
  130. package/dist/chunk-W5RM7YAH.js +78 -0
  131. package/dist/chunk-W7KNI3F5.js +215 -0
  132. package/dist/chunk-WFTSK7N3.js +637 -0
  133. package/dist/chunk-WJWNZXRM.js +395 -0
  134. package/dist/chunk-WLHX3MM5.js +63 -0
  135. package/dist/chunk-WS4FOGLY.js +686 -0
  136. package/dist/chunk-WTZVSMQZ.js +52 -0
  137. package/dist/chunk-WWRV5RJI.js +165 -0
  138. package/dist/chunk-X6FLVUM5.js +141 -0
  139. package/dist/chunk-XC5POIL4.js +68 -0
  140. package/dist/chunk-XTLJDC2X.js +1013 -0
  141. package/dist/chunk-XW2UZICE.js +372 -0
  142. package/dist/chunk-Y3JU5RPK.js +8 -0
  143. package/dist/chunk-YGIV24MF.js +1018 -0
  144. package/dist/chunk-YJCCMYYT.js +125 -0
  145. package/dist/chunk-YKIIWURD.js +36 -0
  146. package/dist/chunk-YQ3GFEUY.js +341 -0
  147. package/dist/chunk-YXANQGCX.js +179 -0
  148. package/dist/chunk-YXFKLMX2.js +222 -0
  149. package/dist/chunk-ZST3FRCV.js +132 -0
  150. package/dist/cli/index.js +40 -40
  151. package/dist/clio-BPBAPZGA.js +26 -0
  152. package/dist/code-nav-KBQ3RIFK.js +686 -0
  153. package/dist/components-6DKAXWFN.js +674 -0
  154. package/dist/config-FWL5JK2H.js +270 -0
  155. package/dist/config-graph-ACDB26L2.js +156 -0
  156. package/dist/configure-ZIZ4YV62.js +85 -0
  157. package/dist/context-EZZPT2ZV.js +1074 -0
  158. package/dist/context-VIL5MFRH.js +282 -0
  159. package/dist/context-Z3GOBHDK.js +344 -0
  160. package/dist/context-clear-ZPB3L7MN.js +188 -0
  161. package/dist/context-index-W6A4V7OC.js +120 -0
  162. package/dist/context-map-DKL3QT6D.js +555 -0
  163. package/dist/context-working-set-2GLBVF7L.js +1559 -0
  164. package/dist/detail-VSBWYSGZ.js +119 -0
  165. package/dist/dispatch-runner-EEEHGKX4.js +2442 -0
  166. package/dist/docs-VMMWFVHL.js +101 -0
  167. package/dist/doctor-V5L4IQGP.js +812 -0
  168. package/dist/eval-VJYJ2BV3.js +5050 -0
  169. package/dist/eval-inventory-CX24K2JT.js +260 -0
  170. package/dist/evals-J2H5V6DD.js +104 -0
  171. package/dist/evidence-POWAEBEW.js +229 -0
  172. package/dist/evidence-XCCCLS36.js +242 -0
  173. package/dist/evidence-Y35YSXH6.js +388 -0
  174. package/dist/evolve-GPG72VB6.js +613 -0
  175. package/dist/extensions-YIZ7W3DA.js +308 -0
  176. package/dist/fleet-2MDCQ2VK.js +264 -0
  177. package/dist/fleet-W2AF3TOJ.js +919 -0
  178. package/dist/fleet-commands-WS56G26H.js +75 -0
  179. package/dist/fleet-decisions-MYGZ3JW7.js +52 -0
  180. package/dist/fleet-graph-ELTBXBAV.js +136 -0
  181. package/dist/fleet-inspect-45IK73L4.js +308 -0
  182. package/dist/fleet-preflight-T5NCZKHE.js +22 -0
  183. package/dist/fleet-validate-VG4JBLA4.js +91 -0
  184. package/dist/fleet-verify-VTSABAYO.js +206 -0
  185. package/dist/fleet-view-XC7WMKSS.js +123 -0
  186. package/dist/init-VTJNNTIP.js +329 -0
  187. package/dist/install-6PIF6F6W.js +19 -0
  188. package/dist/interop-IU6BNA7C.js +246 -0
  189. package/dist/inventory-QPQUTUUZ.js +123 -0
  190. package/dist/library-HUTAS57T.js +492 -0
  191. package/dist/library-LF7DLU6S.js +306 -0
  192. package/dist/library-Q3NWL5CM.js +75 -0
  193. package/dist/library-import-PPW4YUC5.js +183 -0
  194. package/dist/library-inventory-DIRVFRZU.js +56 -0
  195. package/dist/library-validation-XHUZ3INE.js +42 -0
  196. package/dist/memory-Z2LSKNV6.js +516 -0
  197. package/dist/models-3FTREYPY.js +302 -0
  198. package/dist/monitor-HF2MQRB3.js +781 -0
  199. package/dist/orchestrator-UYPA6W4S.js +41502 -0
  200. package/dist/panes-736XB73K.js +74 -0
  201. package/dist/panes-C4P3PIWT.js +103 -0
  202. package/dist/paths-JQ4QYIYB.js +67 -0
  203. package/dist/preload-XSLRYH3Y.js +120 -0
  204. package/dist/reset-V7QSPZYE.js +345 -0
  205. package/dist/resources-OJGDFHYT.js +181 -0
  206. package/dist/run-T354SMDW.js +892 -0
  207. package/dist/settings-MWZXO6RV.js +72 -0
  208. package/dist/share-Y5ZKJPND.js +293 -0
  209. package/dist/skills-4GLZC4LN.js +100 -0
  210. package/dist/skills-eval-L5T7GODM.js +1074 -0
  211. package/dist/skills-inventory-LASKXEZI.js +138 -0
  212. package/dist/slash-commands-OIMRU36D.js +95 -0
  213. package/dist/steer-KMAM2Y2C.js +77 -0
  214. package/dist/support-AWC3XKPX.js +38 -0
  215. package/dist/system-CD75NYBU.js +116 -0
  216. package/dist/targets-VSZX2J2S.js +1116 -0
  217. package/dist/tasks-AN567LYH.js +36 -0
  218. package/dist/terminal-lease-6KTWNHVY.js +418 -0
  219. package/dist/tools-AGRK3V5J.js +28 -0
  220. package/dist/trace-P4MQZD33.js +524 -0
  221. package/dist/tui-primitives-A6MUW32V.js +18 -0
  222. package/dist/uninstall-BRUTEPIC.js +432 -0
  223. package/dist/upgrade-SBCGHQGJ.js +307 -0
  224. package/dist/usage-BIDVTO6V.js +1061 -0
  225. package/dist/verifiers-LTGCAMXS.js +630 -0
  226. package/dist/verify-OZU4LLNP.js +30 -0
  227. package/dist/web/client/THIRD_PARTY_LICENSES.md +1809 -0
  228. package/dist/web/client/assets/abnfDiagram-VCTEODGH-C5wfoHm3.js +1 -0
  229. package/dist/web/client/assets/arc-oH91sfLl.js +1 -0
  230. package/dist/web/client/assets/architecture-7GRP2DOG-EGozsYEO.js +1 -0
  231. package/dist/web/client/assets/architectureDiagram-5GKGNRK7-z9FokbJl.js +36 -0
  232. package/dist/web/client/assets/array-BifhSqXX.js +1 -0
  233. package/dist/web/client/assets/atkinson-hyperlegible-next-latin-ext-wght-normal-C6vrW8VD.woff2 +0 -0
  234. package/dist/web/client/assets/atkinson-hyperlegible-next-latin-wght-normal-BcXVPD7q.woff2 +0 -0
  235. package/dist/web/client/assets/blockDiagram-I7D4REHJ-wi0_CYHL.js +129 -0
  236. package/dist/web/client/assets/c4Diagram-7LVT6UL2-DV7NYc2W.js +38 -0
  237. package/dist/web/client/assets/channel-CiUWbHN9.js +1 -0
  238. package/dist/web/client/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
  239. package/dist/web/client/assets/chunk-4HAMMTFA-Bhsegh3F.js +62 -0
  240. package/dist/web/client/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
  241. package/dist/web/client/assets/chunk-75Z2AOVW-RQCckcQG.js +2 -0
  242. package/dist/web/client/assets/chunk-DU6HZSFF-C5USiOAy.js +125 -0
  243. package/dist/web/client/assets/chunk-F27PBJKO-BcNqv2x1.js +1 -0
  244. package/dist/web/client/assets/chunk-FOHPRMQF-CoA4358r.js +161 -0
  245. package/dist/web/client/assets/chunk-GMAD6QVW-Bq8JWiZT.js +72 -0
  246. package/dist/web/client/assets/chunk-GVQU2GXP-DbchrAeJ.js +1 -0
  247. package/dist/web/client/assets/chunk-IMKFNOWR-DrpvjocK.js +231 -0
  248. package/dist/web/client/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
  249. package/dist/web/client/assets/chunk-L3NEJ4N5-DHLmTnCe.js +1 -0
  250. package/dist/web/client/assets/chunk-OSK3NFVY-CsRbtN9n.js +10 -0
  251. package/dist/web/client/assets/chunk-P2QGCYS3-aqPbxoMh.js +1 -0
  252. package/dist/web/client/assets/chunk-POPQ4Y6H-Dl5vw0h0.js +1 -0
  253. package/dist/web/client/assets/chunk-PWAF6VOD-D7OBRSdO.js +1 -0
  254. package/dist/web/client/assets/chunk-SHT3W25Y-CdKCIwuB.js +168 -0
  255. package/dist/web/client/assets/chunk-SVP7TREG-B94Nu_1-.js +88 -0
  256. package/dist/web/client/assets/chunk-TICWLB2K-jjRQI_hk.js +206 -0
  257. package/dist/web/client/assets/chunk-XXDRQBXY-azkbKE37.js +1 -0
  258. package/dist/web/client/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
  259. package/dist/web/client/assets/classDiagram-ZZMXUADV-CMODalmo.js +1 -0
  260. package/dist/web/client/assets/classDiagram-v2-VYDZK3BY-CMODalmo.js +1 -0
  261. package/dist/web/client/assets/commit-mono-latin-400-normal-s0S3qwFW.woff +0 -0
  262. package/dist/web/client/assets/commit-mono-latin-400-normal-wzhe4RuD.woff2 +0 -0
  263. package/dist/web/client/assets/cose-bilkent-JH36ORCC-RbQL23qS.js +1 -0
  264. package/dist/web/client/assets/cynefin-OW5HDTMX--i9RDU5f.js +1 -0
  265. package/dist/web/client/assets/cynefinDiagram-5FMLGOSQ-cRcvyBdp.js +62 -0
  266. package/dist/web/client/assets/cytoscape.esm-c2aL46s-.js +321 -0
  267. package/dist/web/client/assets/dagre-C-rnJpZF.js +1 -0
  268. package/dist/web/client/assets/dagre-GXQ25YYZ-C9mZmAPe.js +4 -0
  269. package/dist/web/client/assets/defaultLocale-BFoDCU3G.js +1 -0
  270. package/dist/web/client/assets/diagram-S7CK7UJ4-Oj_zlLDY.js +30 -0
  271. package/dist/web/client/assets/diagram-UQ7AKVKN-BWKbbfcR.js +41 -0
  272. package/dist/web/client/assets/diagram-VSXAHHWV-C3N3f7DO.js +3 -0
  273. package/dist/web/client/assets/diagram-VX7I27RA-CtDKDAWe.js +24 -0
  274. package/dist/web/client/assets/diagram-Z3DM3KII-B8bkBRCz.js +24 -0
  275. package/dist/web/client/assets/dist-D0_q-A2b.js +1 -0
  276. package/dist/web/client/assets/ebnfDiagram-PWID7BFC-CskW-Whx.js +1 -0
  277. package/dist/web/client/assets/erDiagram-RLTQ6QDP-C-83cgCW.js +99 -0
  278. package/dist/web/client/assets/eventmodeling-NTZA5JFV-DjVq8wKU.js +1 -0
  279. package/dist/web/client/assets/flowDiagram-HODETNUW-BUiCBGXt.js +1 -0
  280. package/dist/web/client/assets/ganttDiagram-EL5Y4UJY-B2lb8lvF.js +292 -0
  281. package/dist/web/client/assets/gitGraph-4MIJSDKK-B40cQtBE.js +1 -0
  282. package/dist/web/client/assets/gitGraphDiagram-WWUBYQGX-CH-7P7Di.js +106 -0
  283. package/dist/web/client/assets/graphlib-DS17s2tU.js +1 -0
  284. package/dist/web/client/assets/index-Dsi52apB.css +1 -0
  285. package/dist/web/client/assets/index-FSIC94pi.js +83 -0
  286. package/dist/web/client/assets/info-A6RAGUB7-eCCE9D_Q.js +1 -0
  287. package/dist/web/client/assets/infoDiagram-27XIBGKW-DRnvqMjM.js +2 -0
  288. package/dist/web/client/assets/init-C-OQMol4.js +1 -0
  289. package/dist/web/client/assets/ishikawaDiagram-5VMMS53U-DBA_55wp.js +70 -0
  290. package/dist/web/client/assets/journeyDiagram-3NMN7TZE-C-ewpNl7.js +139 -0
  291. package/dist/web/client/assets/kanban-definition-UXKFOSKX-B1taGsu0.js +89 -0
  292. package/dist/web/client/assets/katex-ZlcWpGUi.js +257 -0
  293. package/dist/web/client/assets/line-lZ0kyxDI.js +1 -0
  294. package/dist/web/client/assets/linear-DIc8FgZj.js +1 -0
  295. package/dist/web/client/assets/mermaid-parser.core-SXolxpXw.js +7 -0
  296. package/dist/web/client/assets/mermaid.core-DXgQtkNg.js +44 -0
  297. package/dist/web/client/assets/mindmap-definition-YA3MSWOX-DXJas9K7.js +96 -0
  298. package/dist/web/client/assets/newsreader-latin-ext-wght-normal-C-3rgBeH.woff2 +0 -0
  299. package/dist/web/client/assets/newsreader-latin-wght-normal-CCVVNp6i.woff2 +0 -0
  300. package/dist/web/client/assets/newsreader-vietnamese-wght-normal-Czsa-EzN.woff2 +0 -0
  301. package/dist/web/client/assets/ordinal-BDEzSJ7C.js +1 -0
  302. package/dist/web/client/assets/packet-AYTQ26CC-OqVl_07o.js +1 -0
  303. package/dist/web/client/assets/path-fybaL0A-.js +1 -0
  304. package/dist/web/client/assets/pegDiagram-XKGWAZYB-CPE_zdfN.js +1 -0
  305. package/dist/web/client/assets/pie-WAS4IAKB-DAxnMBLe.js +1 -0
  306. package/dist/web/client/assets/pieDiagram-E7YTZNPT-Uwjpufxv.js +39 -0
  307. package/dist/web/client/assets/prism-bash-D6zCJ74D.js +1 -0
  308. package/dist/web/client/assets/prism-c-04YixN25.js +1 -0
  309. package/dist/web/client/assets/prism-clike-DapgWyxx.js +1 -0
  310. package/dist/web/client/assets/prism-core-BngLtbUd.js +1 -0
  311. package/dist/web/client/assets/prism-cpp-C-lJbC-6.js +1 -0
  312. package/dist/web/client/assets/prism-css-CPgOzxXp.js +1 -0
  313. package/dist/web/client/assets/prism-diff-BF8m0_mq.js +3 -0
  314. package/dist/web/client/assets/prism-docker-DkT6yOFj.js +1 -0
  315. package/dist/web/client/assets/prism-fortran-Be5x3y1V.js +1 -0
  316. package/dist/web/client/assets/prism-go-C_8qAH5n.js +1 -0
  317. package/dist/web/client/assets/prism-ini-BESK3y0r.js +1 -0
  318. package/dist/web/client/assets/prism-javascript-BnO-swvr.js +1 -0
  319. package/dist/web/client/assets/prism-json-Dp_-W-Hv.js +1 -0
  320. package/dist/web/client/assets/prism-jsx-D-D0NWtC.js +1 -0
  321. package/dist/web/client/assets/prism-julia-DIjOgiAV.js +1 -0
  322. package/dist/web/client/assets/prism-latex-DNMbqcH_.js +1 -0
  323. package/dist/web/client/assets/prism-makefile-CRKWLQ8l.js +1 -0
  324. package/dist/web/client/assets/prism-markdown-C0FPJ1Iz.js +1 -0
  325. package/dist/web/client/assets/prism-markup-Cp04rIa1.js +1 -0
  326. package/dist/web/client/assets/prism-matlab-D-nk08al.js +1 -0
  327. package/dist/web/client/assets/prism-python-CfiSVtM6.js +1 -0
  328. package/dist/web/client/assets/prism-r-QmNGR8LX.js +1 -0
  329. package/dist/web/client/assets/prism-rust-Bu9N8X3N.js +1 -0
  330. package/dist/web/client/assets/prism-shell-session-Be4UuYoM.js +1 -0
  331. package/dist/web/client/assets/prism-sql-CYhVDMEE.js +1 -0
  332. package/dist/web/client/assets/prism-toml-DKb54GAT.js +1 -0
  333. package/dist/web/client/assets/prism-tsx-p6J2Kc_4.js +1 -0
  334. package/dist/web/client/assets/prism-typescript-BMqONzxf.js +1 -0
  335. package/dist/web/client/assets/prism-yaml-C0JHu8gr.js +1 -0
  336. package/dist/web/client/assets/purify.es-ChwZkWde.js +3 -0
  337. package/dist/web/client/assets/quadrantDiagram-AXDQQJYC-Bjs4yjgs.js +7 -0
  338. package/dist/web/client/assets/radar-RG4KPBEZ-CuCKjHM3.js +1 -0
  339. package/dist/web/client/assets/railroad-74A4TZTK-CnQK-Cc1.js +1 -0
  340. package/dist/web/client/assets/railroad-abnf-HS5TGJTU-BcW01NZG.js +1 -0
  341. package/dist/web/client/assets/railroad-ebnf-LZEXJU2U-B7YCEDDd.js +1 -0
  342. package/dist/web/client/assets/railroad-peg-WCYAUIDC-DjNZbSTZ.js +1 -0
  343. package/dist/web/client/assets/railroadDiagram-O6MQD6OU-BDDIPNLL.js +1 -0
  344. package/dist/web/client/assets/requirementDiagram-BXWQKSXE-B5Ydyxc1.js +84 -0
  345. package/dist/web/client/assets/rough.esm-Dy-Kn_BL.js +1 -0
  346. package/dist/web/client/assets/sankeyDiagram-P5KCCOFB-Bw2Qym75.js +40 -0
  347. package/dist/web/client/assets/sequenceDiagram-WJ2MYXX4-BZf36nO0.js +162 -0
  348. package/dist/web/client/assets/sizeCapture-INFHLROL-B0uUizjq.js +1 -0
  349. package/dist/web/client/assets/src-yeptRXpt.js +1 -0
  350. package/dist/web/client/assets/stateDiagram-D77RDMKH-DnH6JRkp.js +1 -0
  351. package/dist/web/client/assets/stateDiagram-v2-MP3YSRHH-C7QtHeK4.js +1 -0
  352. package/dist/web/client/assets/swimlanes-42K2YHIH-D9PZmtZg.js +1 -0
  353. package/dist/web/client/assets/swimlanesDiagram-VR7AAH4N-CBZlPFky.js +8 -0
  354. package/dist/web/client/assets/timeline-definition-24CTP7MA-CrkZZBo7.js +120 -0
  355. package/dist/web/client/assets/treeView-Q6P3EWNA-C9zDShoC.js +1 -0
  356. package/dist/web/client/assets/treemap-WGGIJYW6-B-plj9yK.js +1 -0
  357. package/dist/web/client/assets/vennDiagram-4TSXK5OY-VeOdaphN.js +34 -0
  358. package/dist/web/client/assets/wardley-WFR3VGLG-Wl1P_m6L.js +1 -0
  359. package/dist/web/client/assets/wardleyDiagram-VM6X3IG4-B85-R9t2.js +78 -0
  360. package/dist/web/client/assets/xychartDiagram-S5SC5T6Z-BrD8OW8m.js +7 -0
  361. package/dist/web/client/clio-coder-logo.webp +0 -0
  362. package/dist/web/client/icon-192.png +0 -0
  363. package/dist/web/client/icon-512.png +0 -0
  364. package/dist/web/client/index.html +4 -0
  365. package/dist/web/client/manifest.webmanifest +15 -0
  366. package/dist/web/client/offline.css +55 -0
  367. package/dist/web/client/offline.html +5 -0
  368. package/dist/web/client/offline.js +27 -0
  369. package/dist/web/client/sw.js +34 -0
  370. package/dist/web/ops-worker.js +37 -0
  371. package/dist/web/reads-worker.js +1726 -0
  372. package/dist/web/server.js +8499 -0
  373. package/dist/web-EU6ATJWA.js +13 -0
  374. package/dist/web-fetch-U22Q7HV4.js +788 -0
  375. package/dist/wiki-generate-LZRLFG6I.js +623 -0
  376. package/dist/with-panes-X5CZOGML.js +628 -0
  377. package/dist/worker/entry.js +300 -93
  378. package/docs/README.md +58 -14
  379. package/docs/architecture/acp.md +5 -9
  380. package/docs/architecture/alcf-provider.md +0 -3
  381. package/docs/architecture/architecture.md +8 -10
  382. package/docs/architecture/artifact-placement.md +0 -3
  383. package/docs/architecture/artifact-versions.md +3 -6
  384. package/docs/architecture/capacity-and-scheduling.md +0 -3
  385. package/docs/architecture/context-engine.md +35 -4
  386. package/docs/architecture/context-working-set.md +0 -3
  387. package/docs/architecture/dispatch-architecture-rationale.md +0 -3
  388. package/docs/architecture/dispatch-typed-intent.md +0 -3
  389. package/docs/architecture/evidence-and-memory.md +0 -3
  390. package/docs/architecture/library.md +30 -0
  391. package/docs/architecture/middleware-and-components.md +1 -4
  392. package/docs/architecture/model-catalog.md +21 -4
  393. package/docs/architecture/observability.md +0 -3
  394. package/docs/architecture/pi-boundary.md +23 -8
  395. package/docs/architecture/prompt-envelope-and-tools.md +6 -9
  396. package/docs/architecture/provider-adapter-cookbook.md +1 -4
  397. package/docs/architecture/safety-model.md +21 -5
  398. package/docs/architecture/session-lifecycle.md +12 -4
  399. package/docs/architecture/time-conventions.md +0 -3
  400. package/docs/architecture/trace-store.md +28 -20
  401. package/docs/architecture/tui-design.md +108 -12
  402. package/docs/architecture/worker-context.md +104 -0
  403. package/docs/architecture/worker-dispatch-mechanics.md +1 -4
  404. package/docs/guide/authoring-plugins.md +158 -0
  405. package/docs/guide/built-in-agents.md +5 -8
  406. package/docs/guide/commands-and-modes.md +162 -61
  407. package/docs/guide/configuration-and-targets.md +198 -5
  408. package/docs/guide/configuration-reference.md +36 -38
  409. package/docs/guide/environment-variables.md +2 -5
  410. package/docs/guide/exit-codes-and-output.md +1 -4
  411. package/docs/guide/extensions-and-sharing.md +92 -55
  412. package/docs/guide/fleet-dispatch.md +31 -7
  413. package/docs/guide/glossary.md +1 -4
  414. package/docs/guide/harness-extensions.md +289 -0
  415. package/docs/guide/installation-and-lifecycle.md +10 -13
  416. package/docs/guide/interop.md +241 -0
  417. package/docs/guide/panes-and-files.md +3 -6
  418. package/docs/guide/plugins.md +77 -0
  419. package/docs/guide/proactive-memory.md +0 -3
  420. package/docs/guide/resource-library.md +109 -45
  421. package/docs/guide/skills-marketplace.md +34 -73
  422. package/docs/guide/tool-usage.md +19 -10
  423. package/docs/guide/troubleshooting.md +1 -4
  424. package/docs/history/config-knobs-audit.md +0 -3
  425. package/docs/history/release-cut-checklist.md +0 -3
  426. package/docs/process/development-pipeline.md +14 -17
  427. package/docs/process/documentation-coverage.md +31 -4
  428. package/docs/process/documentation-guide.md +28 -27
  429. package/docs/process/eval-runner.md +8 -6
  430. package/docs/process/evals-internal.md +0 -3
  431. package/docs/process/evolution.md +0 -3
  432. package/docs/process/fleet-demo-runbook.md +0 -3
  433. package/docs/process/git-commit-provenance.md +0 -3
  434. package/docs/process/performance-methodology.md +2 -5
  435. package/docs/process/release-cut-checklist.md +114 -217
  436. package/docs/process/scientific-validation.md +23 -3
  437. package/evals/scalar-decision-machinery.ts +1 -1
  438. package/examples/extensions/README.md +67 -0
  439. package/examples/extensions/lab-status/clio-coder-extension.json +14 -0
  440. package/examples/extensions/lab-status/extension.mjs +68 -0
  441. package/examples/extensions/lab-status/jobs.synthetic.json +9 -0
  442. package/examples/extensions/measurements/clio-coder-extension.json +28 -0
  443. package/examples/extensions/measurements/summarize.cjs +23 -0
  444. package/library/README.md +109 -0
  445. package/library/_authoring/templates/agent/README.md +28 -0
  446. package/library/_authoring/templates/agent/agents/benchmark-scout.md +30 -0
  447. package/library/_authoring/templates/agent/plugin.json +23 -0
  448. package/library/_authoring/templates/fleet/README.md +29 -0
  449. package/library/_authoring/templates/fleet/fleets/pipeline-review.md +31 -0
  450. package/library/_authoring/templates/fleet/plugin.json +23 -0
  451. package/library/_authoring/templates/plugin/README.md +37 -0
  452. package/library/_authoring/templates/plugin/agents/data-curator.md +31 -0
  453. package/library/_authoring/templates/plugin/assets/curation-guide.md +22 -0
  454. package/library/_authoring/templates/plugin/plugin.json +42 -0
  455. package/library/_authoring/templates/plugin/prompts/inspect-dataset.md +15 -0
  456. package/library/_authoring/templates/plugin/skills/dataset-curation/SKILL.md +36 -0
  457. package/library/_authoring/templates/plugin/skills/dataset-curation/evals.md +17 -0
  458. package/library/_authoring/templates/prompt/README.md +28 -0
  459. package/library/_authoring/templates/prompt/plugin.json +23 -0
  460. package/library/_authoring/templates/prompt/prompts/paper-summary.md +26 -0
  461. package/library/_authoring/templates/skill/README.md +24 -0
  462. package/library/_authoring/templates/skill/SKILL.md +39 -0
  463. package/library/_authoring/templates/skill/evals.md +30 -0
  464. package/library/_authoring/templates/skill/plugin.json +23 -0
  465. package/library/agents/README.md +7 -0
  466. package/library/fleets/README.md +7 -0
  467. package/library/plugins/materio/README.md +137 -0
  468. package/library/plugins/materio/ai.iowarp.clio/agents/materio-lab-definer.md +208 -0
  469. package/library/plugins/materio/ai.iowarp.clio/agents/materio-literature-reviewer.md +308 -0
  470. package/library/plugins/materio/ai.iowarp.clio/agents/materio-research-explorer.md +249 -0
  471. package/library/plugins/materio/ai.iowarp.clio/agents/materio-task-executor.md +416 -0
  472. package/library/plugins/materio/ai.iowarp.clio/agents/materio-task-verifier.md +60 -0
  473. package/library/plugins/materio/ai.iowarp.clio/agents/materio-workflow-planner.md +238 -0
  474. package/library/plugins/materio/ai.iowarp.clio/fleets/materio-execute-task.md +50 -0
  475. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/add-task.md +66 -0
  476. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/archive-task.md +65 -0
  477. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/checkpoint.md +26 -0
  478. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/define-research-tasks.md +230 -0
  479. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/define-virtual-lab.md +181 -0
  480. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/execute-task.md +292 -0
  481. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/help.md +129 -0
  482. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/identify-research.md +206 -0
  483. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/literature-review.md +201 -0
  484. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/pause-research.md +12 -0
  485. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/progress.md +105 -0
  486. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/remove-task.md +63 -0
  487. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/resume-research.md +64 -0
  488. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/settings.md +16 -0
  489. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/status.md +92 -0
  490. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/upload-data.md +104 -0
  491. package/library/plugins/materio/ai.iowarp.clio/prompts/materio/wtfp.md +145 -0
  492. package/library/plugins/materio/ai.iowarp.clio/references/execution.md +56 -0
  493. package/library/plugins/materio/ai.iowarp.portability/provenance.json +9 -0
  494. package/library/plugins/materio/assets/actions/add-task.md +86 -0
  495. package/library/plugins/materio/assets/actions/archive-task.md +84 -0
  496. package/library/plugins/materio/assets/actions/checkpoint.md +47 -0
  497. package/library/plugins/materio/assets/actions/define-research-tasks.md +228 -0
  498. package/library/plugins/materio/assets/actions/define-virtual-lab.md +179 -0
  499. package/library/plugins/materio/assets/actions/execute-task.md +290 -0
  500. package/library/plugins/materio/assets/actions/help.md +140 -0
  501. package/library/plugins/materio/assets/actions/identify-research.md +204 -0
  502. package/library/plugins/materio/assets/actions/literature-review.md +199 -0
  503. package/library/plugins/materio/assets/actions/pause-research.md +34 -0
  504. package/library/plugins/materio/assets/actions/progress.md +125 -0
  505. package/library/plugins/materio/assets/actions/remove-task.md +82 -0
  506. package/library/plugins/materio/assets/actions/resume-research.md +84 -0
  507. package/library/plugins/materio/assets/actions/settings.md +38 -0
  508. package/library/plugins/materio/assets/actions/status.md +112 -0
  509. package/library/plugins/materio/assets/actions/upload-data.md +123 -0
  510. package/library/plugins/materio/assets/actions/wtfp.md +179 -0
  511. package/library/plugins/materio/assets/references/research-domains.md +134 -0
  512. package/library/plugins/materio/assets/references/research-policy.md +77 -0
  513. package/library/plugins/materio/assets/references/traditional-workflows.md +146 -0
  514. package/library/plugins/materio/assets/scripts/check_physics.py +271 -0
  515. package/library/plugins/materio/assets/scripts/check_scripts.py +248 -0
  516. package/library/plugins/materio/assets/scripts/project_plugin.py +165 -0
  517. package/library/plugins/materio/assets/scripts/research_state.py +400 -0
  518. package/library/plugins/materio/assets/scripts/verify_citations.py +616 -0
  519. package/library/plugins/materio/assets/templates/RESEARCH.md +39 -0
  520. package/library/plugins/materio/assets/templates/VIRTUAL-LAB.md +120 -0
  521. package/library/plugins/materio/assets/templates/WORKFLOW.md +42 -0
  522. package/library/plugins/materio/assets/templates/config.json +5 -0
  523. package/library/plugins/materio/evals/scripts.yaml +29 -0
  524. package/library/plugins/materio/plugin.json +530 -0
  525. package/library/plugins/materio/skills/materio-lab-definer/SKILL.md +74 -0
  526. package/library/plugins/materio/skills/materio-literature-reviewer/SKILL.md +64 -0
  527. package/library/plugins/materio/skills/materio-research-explorer/SKILL.md +74 -0
  528. package/library/plugins/materio/skills/materio-task-executor/SKILL.md +214 -0
  529. package/library/plugins/materio/skills/materio-task-verifier/SKILL.md +46 -0
  530. package/library/plugins/materio/skills/materio-workflow-planner/SKILL.md +79 -0
  531. package/library/plugins/materio/tests/test_check_physics.py +139 -0
  532. package/library/plugins/materio/tests/test_check_scripts.py +140 -0
  533. package/library/plugins/materio/tests/test_research_state.py +291 -0
  534. package/library/plugins/materio/tests/test_verify_citations.py +337 -0
  535. package/library/prompts/README.md +7 -0
  536. package/library/registry.yaml +921 -0
  537. package/library/skills/README.md +120 -0
  538. package/library/skills/coding/ast-grep/SKILL.md +213 -0
  539. package/library/skills/coding/ast-grep/evals.md +82 -0
  540. package/library/skills/coding/ast-grep/plugin.json +23 -0
  541. package/library/skills/coding/coding-standards/SKILL.md +164 -0
  542. package/library/skills/coding/coding-standards/evals.md +57 -0
  543. package/library/skills/coding/coding-standards/plugin.json +23 -0
  544. package/library/skills/coding/prototype/SKILL.md +151 -0
  545. package/library/skills/coding/prototype/evals.md +61 -0
  546. package/library/skills/coding/prototype/plugin.json +23 -0
  547. package/library/skills/coding/tdd/SKILL.md +134 -0
  548. package/library/skills/coding/tdd/evals.md +61 -0
  549. package/library/skills/coding/tdd/plugin.json +23 -0
  550. package/library/skills/context/context-handoff/SKILL.md +176 -0
  551. package/library/skills/context/context-handoff/evals.md +101 -0
  552. package/library/skills/context/context-handoff/plugin.json +23 -0
  553. package/library/skills/context/context-prime/SKILL.md +131 -0
  554. package/library/skills/context/context-prime/evals.md +99 -0
  555. package/library/skills/context/context-prime/plugin.json +23 -0
  556. package/library/skills/git/branch-closeout/SKILL.md +132 -0
  557. package/library/skills/git/branch-closeout/plugin.json +23 -0
  558. package/library/skills/git/file-ticket/SKILL.md +126 -0
  559. package/library/skills/git/file-ticket/plugin.json +23 -0
  560. package/library/skills/git/fix-issue/SKILL.md +136 -0
  561. package/library/skills/git/fix-issue/plugin.json +23 -0
  562. package/library/skills/git/resolve-merge-conflicts/SKILL.md +151 -0
  563. package/library/skills/git/resolve-merge-conflicts/evals.md +85 -0
  564. package/library/skills/git/resolve-merge-conflicts/plugin.json +23 -0
  565. package/library/skills/git/ship/SKILL.md +134 -0
  566. package/library/skills/git/ship/plugin.json +23 -0
  567. package/library/skills/git/worktree-create/SKILL.md +127 -0
  568. package/library/skills/git/worktree-create/plugin.json +23 -0
  569. package/library/skills/git/worktree-merge/SKILL.md +147 -0
  570. package/library/skills/git/worktree-merge/plugin.json +23 -0
  571. package/library/skills/meta/clio-coder-dev/SKILL.md +101 -0
  572. package/library/skills/meta/clio-coder-dev/evals.md +46 -0
  573. package/library/skills/meta/clio-coder-dev/plugin.json +23 -0
  574. package/library/skills/meta/clio-coder-test/SKILL.md +156 -0
  575. package/library/skills/meta/clio-coder-test/evals.md +62 -0
  576. package/library/skills/meta/clio-coder-test/plugin.json +23 -0
  577. package/library/skills/meta/clio-coder-test/references/test-map.md +97 -0
  578. package/library/skills/meta/credentials/SKILL.md +132 -0
  579. package/library/skills/meta/credentials/evals.md +104 -0
  580. package/library/skills/meta/credentials/plugin.json +23 -0
  581. package/library/skills/meta/find-skills/SKILL.md +85 -0
  582. package/library/skills/meta/find-skills/evals.md +65 -0
  583. package/library/skills/meta/find-skills/plugin.json +23 -0
  584. package/library/skills/meta/herdr/SKILL.md +133 -0
  585. package/library/skills/meta/herdr/evals.md +38 -0
  586. package/library/skills/meta/herdr/plugin.json +23 -0
  587. package/library/skills/meta/skill-craft/SKILL.md +139 -0
  588. package/library/skills/meta/skill-craft/evals.md +49 -0
  589. package/library/skills/meta/skill-craft/plugin.json +23 -0
  590. package/library/skills/planning/archify/SKILL.md +196 -0
  591. package/library/skills/planning/archify/plugin.json +23 -0
  592. package/library/skills/planning/architecture/SKILL.md +184 -0
  593. package/library/skills/planning/architecture/evals.md +101 -0
  594. package/library/skills/planning/architecture/plugin.json +23 -0
  595. package/library/skills/planning/backlog/SKILL.md +212 -0
  596. package/library/skills/planning/backlog/evals.md +185 -0
  597. package/library/skills/planning/backlog/plugin.json +23 -0
  598. package/library/skills/planning/prd/SKILL.md +129 -0
  599. package/library/skills/planning/prd/evals.md +103 -0
  600. package/library/skills/planning/prd/plugin.json +23 -0
  601. package/library/skills/planning/product-intent/SKILL.md +173 -0
  602. package/library/skills/planning/product-intent/evals.md +106 -0
  603. package/library/skills/planning/product-intent/plugin.json +23 -0
  604. package/library/skills/planning/tech-spec/SKILL.md +172 -0
  605. package/library/skills/planning/tech-spec/evals.md +120 -0
  606. package/library/skills/planning/tech-spec/plugin.json +23 -0
  607. package/library/skills/registry.yaml +144 -0
  608. package/library/skills/remote.yaml +13 -0
  609. package/library/skills/research/arxiv-literature/SKILL.md +168 -0
  610. package/library/skills/research/arxiv-literature/evals.md +108 -0
  611. package/library/skills/research/arxiv-literature/plugin.json +23 -0
  612. package/library/skills/research/experiment-protocol/SKILL.md +148 -0
  613. package/library/skills/research/experiment-protocol/evals.md +114 -0
  614. package/library/skills/research/experiment-protocol/plugin.json +23 -0
  615. package/library/skills/research/scientific-debugging/SKILL.md +149 -0
  616. package/library/skills/research/scientific-debugging/evals.md +156 -0
  617. package/library/skills/research/scientific-debugging/plugin.json +23 -0
  618. package/library/skills/research/scientific-modernization/SKILL.md +170 -0
  619. package/library/skills/research/scientific-modernization/evals.md +111 -0
  620. package/library/skills/research/scientific-modernization/plugin.json +23 -0
  621. package/library/skills/skill-marketplace.json +507 -0
  622. package/library/skills/workflow/cut-it/SKILL.md +153 -0
  623. package/library/skills/workflow/cut-it/evals.md +143 -0
  624. package/library/skills/workflow/cut-it/plugin.json +23 -0
  625. package/library/skills/workflow/design-council/SKILL.md +233 -0
  626. package/library/skills/workflow/design-council/evals.md +258 -0
  627. package/library/skills/workflow/design-council/plugin.json +23 -0
  628. package/library/skills/workflow/grill-me/SKILL.md +267 -0
  629. package/library/skills/workflow/grill-me/evals.md +231 -0
  630. package/library/skills/workflow/grill-me/plugin.json +23 -0
  631. package/library/skills/workflow/workflow-distiller/SKILL.md +204 -0
  632. package/library/skills/workflow/workflow-distiller/evals.md +233 -0
  633. package/library/skills/workflow/workflow-distiller/plugin.json +23 -0
  634. package/package.json +23 -14
  635. package/src/cli/agents.ts +1 -1
  636. package/src/cli/config-inspect.ts +1 -1
  637. package/src/cli/configure.ts +2 -2
  638. package/src/cli/docs.ts +65 -328
  639. package/src/cli/eval.ts +40 -6
  640. package/src/cli/extensions.ts +74 -8
  641. package/src/cli/fleet-preflight.ts +2 -0
  642. package/src/cli/fleet.ts +2 -0
  643. package/src/cli/index.ts +4 -4
  644. package/src/cli/interop-inspect.ts +61 -33
  645. package/src/cli/interop.ts +79 -9
  646. package/src/cli/library-import.ts +139 -0
  647. package/src/cli/library.ts +418 -120
  648. package/src/cli/run.ts +26 -9
  649. package/src/cli/skills-eval.ts +43 -6
  650. package/src/cli/skills-inventory.ts +6 -2
  651. package/src/cli/skills.ts +44 -491
  652. package/src/cli/trace.ts +4 -65
  653. package/src/cli/uninstall.ts +26 -0
  654. package/src/cli/usage.ts +3 -0
  655. package/src/cli/web.ts +79 -0
  656. package/src/core/bus-events.ts +8 -4
  657. package/src/core/config.ts +71 -0
  658. package/src/core/defaults.ts +1 -1
  659. package/src/core/domain-loader.ts +37 -28
  660. package/src/core/recent-models.ts +2 -2
  661. package/src/core/session-routing.ts +3 -3
  662. package/src/core/state-file-lock.ts +1 -1
  663. package/src/core/termination.ts +13 -9
  664. package/src/core/tool-names.ts +5 -0
  665. package/src/domains/agents/contract.ts +1 -1
  666. package/src/domains/agents/extension.ts +53 -9
  667. package/src/domains/agents/fleet-commands.ts +92 -1
  668. package/src/domains/agents/fleet-contract.ts +87 -19
  669. package/src/domains/agents/recipe.ts +5 -4
  670. package/src/domains/agents/registry.ts +80 -24
  671. package/src/domains/config/extension.ts +5 -4
  672. package/src/domains/config/keybindings.ts +155 -95
  673. package/src/domains/context/worker/contract.ts +91 -0
  674. package/src/domains/context/worker/pressure.ts +120 -0
  675. package/src/domains/context/worker/recall.ts +62 -0
  676. package/src/domains/context/worker/select.ts +164 -0
  677. package/src/domains/context/worker/snapshot.ts +35 -0
  678. package/src/domains/context/worker/store.ts +16 -0
  679. package/src/domains/context/working-set/replay/synthetic.ts +2 -1
  680. package/src/domains/dispatch/active-route-planner.ts +2 -0
  681. package/src/domains/dispatch/backoff.ts +1 -0
  682. package/src/domains/dispatch/code-step.ts +12 -2
  683. package/src/domains/dispatch/contract.ts +3 -0
  684. package/src/domains/dispatch/execution-plan.ts +2 -0
  685. package/src/domains/dispatch/extension.ts +184 -39
  686. package/src/domains/dispatch/fleet-plan.ts +10 -0
  687. package/src/domains/dispatch/fleet-run.ts +1 -0
  688. package/src/domains/dispatch/index.ts +1 -0
  689. package/src/domains/dispatch/orphan-recovery.ts +2 -0
  690. package/src/domains/dispatch/receipt-integrity.ts +7 -0
  691. package/src/domains/dispatch/state.ts +2 -2
  692. package/src/domains/dispatch/types.ts +7 -0
  693. package/src/domains/dispatch/validation.ts +12 -0
  694. package/src/domains/dispatch/workspace-checkpoint.ts +1 -1
  695. package/src/domains/eval/metrics/tracked.ts +22 -2
  696. package/src/domains/evidence/failure-attribution.ts +1 -0
  697. package/src/domains/evidence/trust-status.ts +22 -3
  698. package/src/domains/extensions/command-schema.ts +145 -0
  699. package/src/domains/extensions/command-tools.ts +15 -0
  700. package/src/domains/extensions/compatibility.ts +7 -0
  701. package/src/domains/extensions/contract.ts +0 -4
  702. package/src/domains/extensions/discovery.ts +69 -205
  703. package/src/domains/extensions/extension.ts +0 -4
  704. package/src/domains/extensions/index.ts +1 -5
  705. package/src/domains/extensions/manager.ts +1 -6
  706. package/src/domains/extensions/operator-commands.ts +29 -0
  707. package/src/domains/extensions/operator-runtime.ts +485 -0
  708. package/src/domains/extensions/public-api.ts +53 -0
  709. package/src/domains/extensions/runtime-child.mjs +114 -0
  710. package/src/domains/extensions/runtime-process.ts +306 -0
  711. package/src/domains/extensions/runtime-schema.ts +146 -0
  712. package/src/domains/extensions/snapshot-access.ts +21 -0
  713. package/src/domains/extensions/snapshot.ts +4 -32
  714. package/src/domains/extensions/state.ts +5 -83
  715. package/src/domains/extensions/types.ts +33 -34
  716. package/src/domains/interop/adopt.ts +546 -0
  717. package/src/domains/interop/detect.ts +50 -12
  718. package/src/domains/interop/foreign.ts +554 -0
  719. package/src/domains/interop/import.ts +277 -0
  720. package/src/domains/interop/index.ts +24 -0
  721. package/src/domains/interop/install.ts +6 -0
  722. package/src/domains/interop/inventory.ts +351 -0
  723. package/src/domains/interop/projection.ts +360 -0
  724. package/src/domains/interop/registry.ts +106 -3
  725. package/src/domains/interop/types.ts +51 -0
  726. package/src/domains/lifecycle/migrations/index.ts +0 -2
  727. package/src/domains/lifecycle/naming-resources.ts +1 -1
  728. package/src/domains/middleware/hooks.ts +2 -2
  729. package/src/domains/middleware/marketplace-offer.ts +1 -1
  730. package/src/domains/mux/contract.ts +1 -1
  731. package/src/domains/observability/background-memory-usage.ts +3 -0
  732. package/src/domains/observability/compaction-usage.ts +2 -0
  733. package/src/domains/observability/cost.ts +5 -0
  734. package/src/domains/observability/extension.ts +1 -0
  735. package/src/domains/observability/out-of-turn-usage.ts +2 -0
  736. package/src/domains/observability/trace-store.ts +65 -5
  737. package/src/domains/plugins/catalog.ts +204 -0
  738. package/src/domains/plugins/contract.ts +24 -0
  739. package/src/domains/plugins/discovery.ts +316 -0
  740. package/src/domains/plugins/extension.ts +40 -0
  741. package/src/domains/plugins/index.ts +77 -0
  742. package/src/domains/plugins/integrity.ts +6 -0
  743. package/src/domains/plugins/manifest.ts +3 -0
  744. package/src/domains/plugins/resources.ts +102 -0
  745. package/src/domains/plugins/state.ts +753 -0
  746. package/src/domains/plugins/types.ts +217 -0
  747. package/src/domains/prompts/extension.ts +4 -10
  748. package/src/domains/prompts/fragments/operating/skills.md +10 -10
  749. package/src/domains/providers/cache-deployment.ts +147 -0
  750. package/src/domains/providers/catalog.ts +12 -7
  751. package/src/domains/providers/extension.ts +27 -5
  752. package/src/domains/providers/index.ts +1 -0
  753. package/src/domains/providers/plugins.ts +3 -13
  754. package/src/domains/providers/runtimes/common/local-synth.ts +4 -0
  755. package/src/domains/providers/types/target-descriptor.ts +17 -0
  756. package/src/domains/resources/common-loader.ts +9 -6
  757. package/src/domains/resources/index.ts +67 -0
  758. package/src/domains/resources/library-actions.ts +836 -0
  759. package/src/domains/resources/library-evals.ts +38 -0
  760. package/src/domains/resources/library-inventory.ts +1048 -0
  761. package/src/domains/resources/library-types.ts +50 -0
  762. package/src/domains/resources/library-validation.ts +634 -0
  763. package/src/domains/resources/library.ts +437 -156
  764. package/src/domains/resources/package-references.ts +66 -0
  765. package/src/domains/resources/prompts/loader.ts +75 -41
  766. package/src/domains/resources/skills/install.ts +2 -2
  767. package/src/domains/resources/skills/loader.ts +77 -22
  768. package/src/domains/resources/skills/marketplace.ts +48 -57
  769. package/src/domains/resources/skills/promotion.ts +2 -2
  770. package/src/domains/resources/skills/provenance-pin.ts +17 -4
  771. package/src/domains/safety/action-classifier.ts +2 -2
  772. package/src/domains/safety/default-path-policy.ts +3 -1
  773. package/src/domains/safety/policy-engine.ts +1 -1
  774. package/src/domains/safety/protected-artifacts.ts +21 -5
  775. package/src/domains/safety/skill-authority.ts +5 -2
  776. package/src/domains/session/compaction/compact.ts +4 -1
  777. package/src/domains/session/entries.ts +1 -0
  778. package/src/domains/session/usage.ts +6 -7
  779. package/src/domains/share/archive.ts +1 -1
  780. package/src/engine/acp/server.ts +11 -0
  781. package/src/engine/ai.ts +2 -0
  782. package/src/engine/apis/openai-completions.ts +61 -6
  783. package/src/engine/notices/pi-tui-LICENSE +21 -0
  784. package/src/engine/prewarm.ts +232 -0
  785. package/src/engine/provider-diagnostics.ts +6 -1
  786. package/src/engine/tui.ts +3 -0
  787. package/src/engine/worker-runtime.ts +58 -14
  788. package/src/engine/worker-tools.ts +5 -0
  789. package/src/entry/orchestrator.ts +46 -21
  790. package/src/entry/plugin-reload.ts +18 -0
  791. package/src/interactive/application-controller.ts +67 -21
  792. package/src/interactive/chat-loop-messages.ts +3 -0
  793. package/src/interactive/chat-loop.ts +32 -11
  794. package/src/interactive/chat-panel.ts +5 -1
  795. package/src/interactive/clio-editor.ts +53 -21
  796. package/src/interactive/command-output.ts +56 -1
  797. package/src/interactive/editor-submit.ts +65 -28
  798. package/src/interactive/fleet-run-preview.ts +2 -0
  799. package/src/interactive/follow-up-queue-panel.ts +3 -3
  800. package/src/interactive/footer/dashboard.ts +4 -1
  801. package/src/interactive/footer/notifications.ts +2 -2
  802. package/src/interactive/footer/widgets.ts +2 -2
  803. package/src/interactive/interactive-application.ts +209 -21
  804. package/src/interactive/interactive-input-runtime.ts +254 -7
  805. package/src/interactive/interactive-presentation.ts +41 -12
  806. package/src/interactive/interactive-slash-runtime.ts +37 -8
  807. package/src/interactive/keybinding-manager.ts +156 -79
  808. package/src/interactive/keyboard-owner.ts +37 -0
  809. package/src/interactive/leader-key.ts +49 -102
  810. package/src/interactive/leader-menu.ts +45 -0
  811. package/src/interactive/overlay-ask-user-lifecycle.ts +9 -1
  812. package/src/interactive/overlay-frame.ts +15 -0
  813. package/src/interactive/overlay-key-routing.ts +46 -47
  814. package/src/interactive/overlay-lifecycle.ts +30 -15
  815. package/src/interactive/overlay-resource-openers.ts +56 -46
  816. package/src/interactive/overlays/ask-user.ts +630 -556
  817. package/src/interactive/overlays/extension-panel.ts +70 -0
  818. package/src/interactive/overlays/extensions.ts +28 -5
  819. package/src/interactive/overlays/fleet-run-approval.ts +7 -3
  820. package/src/interactive/overlays/help-reference.ts +89 -40
  821. package/src/interactive/overlays/interop.ts +122 -3
  822. package/src/interactive/overlays/keybinding-detail.ts +2 -2
  823. package/src/interactive/overlays/library-lifecycle.ts +90 -0
  824. package/src/interactive/overlays/library-model.ts +574 -0
  825. package/src/interactive/overlays/library-review.ts +557 -0
  826. package/src/interactive/overlays/library-tabs.ts +3 -15
  827. package/src/interactive/overlays/library.ts +602 -0
  828. package/src/interactive/overlays/list-overlay.ts +218 -39
  829. package/src/interactive/overlays/model-selector.ts +28 -25
  830. package/src/interactive/overlays/session-selector.ts +9 -3
  831. package/src/interactive/overlays/settings.ts +25 -18
  832. package/src/interactive/overlays/tree-selector.ts +16 -11
  833. package/src/interactive/permission-hint.ts +13 -0
  834. package/src/interactive/permission-overlay.ts +77 -28
  835. package/src/interactive/prewarm.ts +11 -197
  836. package/src/interactive/prompt-source-label.ts +21 -0
  837. package/src/interactive/renderers/reference-card.ts +35 -0
  838. package/src/interactive/renderers/worker-entry.ts +35 -3
  839. package/src/interactive/session-usage-reseed.ts +2 -0
  840. package/src/interactive/side-question.ts +2 -0
  841. package/src/interactive/slash-autocomplete.ts +99 -1
  842. package/src/interactive/slash-commands.ts +390 -67
  843. package/src/interactive/slash-spec.ts +0 -1
  844. package/src/interactive/terminal-lease.ts +44 -12
  845. package/src/interactive/turn-context.ts +1 -0
  846. package/src/interactive/turn-persistence.ts +3 -0
  847. package/src/interactive/turn-prewarm.ts +126 -19
  848. package/src/interactive/turn-queues.ts +8 -7
  849. package/src/interactive/turn-runtime.ts +15 -1
  850. package/src/interactive/view/view-overlay.ts +19 -14
  851. package/src/interactive/welcome-dashboard.ts +525 -408
  852. package/src/tools/bootstrap.ts +8 -0
  853. package/src/tools/builtin-tool-catalog.ts +15 -6
  854. package/src/tools/context/index.ts +58 -5
  855. package/src/tools/context/library.ts +465 -0
  856. package/src/tools/context/surface.ts +20 -6
  857. package/src/tools/core-bootstrap.ts +3 -0
  858. package/src/tools/dispatch-admission.ts +24 -1
  859. package/src/tools/dispatch-arguments.ts +8 -0
  860. package/src/tools/dispatch-plan.ts +32 -0
  861. package/src/tools/dispatch-schema.ts +31 -1
  862. package/src/tools/dispatch-types.ts +3 -0
  863. package/src/tools/dispatch.ts +1 -1
  864. package/src/tools/harness-extensions.ts +169 -0
  865. package/src/tools/observation.ts +4 -0
  866. package/src/tools/policy.ts +7 -1
  867. package/src/tools/registry.ts +31 -3
  868. package/src/tools/worker-evidence.ts +5 -0
  869. package/src/worker/context-seed.ts +192 -0
  870. package/src/worker/entry.ts +1 -0
  871. package/src/worker/spec-contract.ts +35 -1
  872. package/dist/acp-UVEVWSDL.js +0 -130
  873. package/dist/agents-VWY37DTK.js +0 -148
  874. package/dist/auth-PCV2XQDV.js +0 -551
  875. package/dist/builtins-PD652MTK.js +0 -22
  876. package/dist/chunk-22PQ4TX4.js +0 -360
  877. package/dist/chunk-24T2YZ7A.js +0 -22648
  878. package/dist/chunk-2AKYFREM.js +0 -1008
  879. package/dist/chunk-2QPI3TR3.js +0 -162
  880. package/dist/chunk-3BJGMT2D.js +0 -324
  881. package/dist/chunk-3HQVBIKD.js +0 -308
  882. package/dist/chunk-3JLFK5MW.js +0 -193
  883. package/dist/chunk-3O2ZAUGQ.js +0 -283
  884. package/dist/chunk-3QKXHCGS.js +0 -59
  885. package/dist/chunk-3T4DXWP6.js +0 -668
  886. package/dist/chunk-3UW3KU4A.js +0 -21
  887. package/dist/chunk-3WBALRQH.js +0 -5076
  888. package/dist/chunk-4DU2TVI4.js +0 -108
  889. package/dist/chunk-4U4TKZFR.js +0 -5052
  890. package/dist/chunk-4VMV6OS6.js +0 -101
  891. package/dist/chunk-536HXRFE.js +0 -1257
  892. package/dist/chunk-5CMARGPF.js +0 -477
  893. package/dist/chunk-5CY4Q6QI.js +0 -141
  894. package/dist/chunk-5QRX7SLS.js +0 -1018
  895. package/dist/chunk-5VTJP36Q.js +0 -36
  896. package/dist/chunk-5ZSZEYJK.js +0 -119
  897. package/dist/chunk-6HAO6X5B.js +0 -197
  898. package/dist/chunk-6OII3LOK.js +0 -404
  899. package/dist/chunk-6RYDAVQT.js +0 -4338
  900. package/dist/chunk-6VRRJT7L.js +0 -146
  901. package/dist/chunk-6YA46L5A.js +0 -386
  902. package/dist/chunk-77CZRFTE.js +0 -634
  903. package/dist/chunk-7JSSKXG2.js +0 -1215
  904. package/dist/chunk-7WUZEB2M.js +0 -165
  905. package/dist/chunk-7YJWEF2L.js +0 -974
  906. package/dist/chunk-ACCKVSHU.js +0 -44
  907. package/dist/chunk-B3MOMLJ4.js +0 -433
  908. package/dist/chunk-BBV5TKE6.js +0 -35
  909. package/dist/chunk-BLTEAUCB.js +0 -668
  910. package/dist/chunk-BS4GAMUB.js +0 -233
  911. package/dist/chunk-BT7HGDOX.js +0 -3151
  912. package/dist/chunk-CBSKDFWL.js +0 -101
  913. package/dist/chunk-CXQ37WJH.js +0 -45
  914. package/dist/chunk-DXLUVUD4.js +0 -1490
  915. package/dist/chunk-DZK63TZJ.js +0 -1334
  916. package/dist/chunk-E7RF4KBO.js +0 -266
  917. package/dist/chunk-ECOMVOHP.js +0 -139
  918. package/dist/chunk-EHOSNVVM.js +0 -59
  919. package/dist/chunk-F5Z7EWMN.js +0 -4484
  920. package/dist/chunk-FQOOGXBH.js +0 -579
  921. package/dist/chunk-GLYBJ4RQ.js +0 -396
  922. package/dist/chunk-HHVJNVUJ.js +0 -179
  923. package/dist/chunk-HL26ADLH.js +0 -77
  924. package/dist/chunk-HPTJF6DG.js +0 -2465
  925. package/dist/chunk-HXHFDHB6.js +0 -962
  926. package/dist/chunk-HZ2T2YED.js +0 -1687
  927. package/dist/chunk-HZFBVU5X.js +0 -666
  928. package/dist/chunk-I2K2NCZQ.js +0 -659
  929. package/dist/chunk-IGLVVNEG.js +0 -402
  930. package/dist/chunk-IKRWLEDA.js +0 -1567
  931. package/dist/chunk-J2FYEQ5L.js +0 -33
  932. package/dist/chunk-JMPL7NUB.js +0 -108
  933. package/dist/chunk-K2HL3GBL.js +0 -998
  934. package/dist/chunk-KAFMW7WM.js +0 -386
  935. package/dist/chunk-KTFSFCVN.js +0 -46
  936. package/dist/chunk-LIN2K3EL.js +0 -66
  937. package/dist/chunk-LUL5Z66S.js +0 -221
  938. package/dist/chunk-LVFANMOH.js +0 -466
  939. package/dist/chunk-LY4N4TTL.js +0 -117
  940. package/dist/chunk-LZBMXNLP.js +0 -1196
  941. package/dist/chunk-M6TAYK66.js +0 -807
  942. package/dist/chunk-N2OKBREN.js +0 -243
  943. package/dist/chunk-NC4KV7EL.js +0 -39
  944. package/dist/chunk-NF3BK5WR.js +0 -42
  945. package/dist/chunk-NNWJYUNO.js +0 -573
  946. package/dist/chunk-NTK3WTHM.js +0 -141
  947. package/dist/chunk-ODUTYZIU.js +0 -688
  948. package/dist/chunk-OQM5IVJY.js +0 -1377
  949. package/dist/chunk-P5JMBPDJ.js +0 -7192
  950. package/dist/chunk-P5SC4DLJ.js +0 -47
  951. package/dist/chunk-P6M7RKMI.js +0 -97
  952. package/dist/chunk-PWWSIB2A.js +0 -52
  953. package/dist/chunk-PZN2LQY6.js +0 -674
  954. package/dist/chunk-Q7NNUHQV.js +0 -705
  955. package/dist/chunk-QCOV5DFY.js +0 -911
  956. package/dist/chunk-QNWRHOMF.js +0 -692
  957. package/dist/chunk-QRFXEO6Y.js +0 -17
  958. package/dist/chunk-QXFBABFJ.js +0 -380
  959. package/dist/chunk-RGZNQ5CT.js +0 -657
  960. package/dist/chunk-SRZOW5L2.js +0 -1865
  961. package/dist/chunk-SXQKNKRA.js +0 -223
  962. package/dist/chunk-T334FW2H.js +0 -362
  963. package/dist/chunk-T52TPHYC.js +0 -318
  964. package/dist/chunk-TJFDL26W.js +0 -658
  965. package/dist/chunk-TN5FW4XY.js +0 -172
  966. package/dist/chunk-U7H5WRG5.js +0 -123
  967. package/dist/chunk-UFYNOQK4.js +0 -302
  968. package/dist/chunk-URBGEOH3.js +0 -32
  969. package/dist/chunk-USZA7GWL.js +0 -341
  970. package/dist/chunk-UUQ5G6EZ.js +0 -697
  971. package/dist/chunk-VAHLPXPY.js +0 -399
  972. package/dist/chunk-VANN3GDP.js +0 -2488
  973. package/dist/chunk-VHMX7SXF.js +0 -1289
  974. package/dist/chunk-WJIMKGD6.js +0 -132
  975. package/dist/chunk-WKUYQBCG.js +0 -795
  976. package/dist/chunk-WNGF5AJX.js +0 -1911
  977. package/dist/chunk-WV6TDAPN.js +0 -3627
  978. package/dist/chunk-X3BI7HTV.js +0 -562
  979. package/dist/chunk-XWMSPJYN.js +0 -149
  980. package/dist/chunk-YPRSNUTC.js +0 -395
  981. package/dist/chunk-ZS43Y2FT.js +0 -438
  982. package/dist/clio-QQCMTUZE.js +0 -26
  983. package/dist/code-nav-GUPM6766.js +0 -686
  984. package/dist/components-TNIKXCBH.js +0 -674
  985. package/dist/config-IIM7YOD3.js +0 -621
  986. package/dist/configure-4ZM5HWJX.js +0 -73
  987. package/dist/context-44BZLJ3J.js +0 -344
  988. package/dist/context-AIDVQKMW.js +0 -278
  989. package/dist/context-OL5P3HEP.js +0 -1031
  990. package/dist/context-clear-OQV76MYP.js +0 -184
  991. package/dist/context-index-HP2JFUWA.js +0 -120
  992. package/dist/context-map-INTXD54D.js +0 -555
  993. package/dist/context-working-set-ZUW3EGLS.js +0 -1556
  994. package/dist/detail-UXPWRANG.js +0 -115
  995. package/dist/dispatch-runner-P3ZW6G77.js +0 -2438
  996. package/dist/docs-BL7ROUFN.js +0 -292
  997. package/dist/doctor-JJVGPZWT.js +0 -797
  998. package/dist/eval-V2RTN3UH.js +0 -4972
  999. package/dist/eval-inventory-QOYZERXJ.js +0 -315
  1000. package/dist/evidence-35PYWGSO.js +0 -225
  1001. package/dist/evidence-CIGGKI6J.js +0 -383
  1002. package/dist/evolve-33SM3NJP.js +0 -609
  1003. package/dist/extensions-YVRHX6ZI.js +0 -229
  1004. package/dist/fleet-LFO7SIPC.js +0 -908
  1005. package/dist/fleet-commands-RLK72GU3.js +0 -75
  1006. package/dist/fleet-decisions-3SBSCTCW.js +0 -159
  1007. package/dist/fleet-graph-JZIBCGMW.js +0 -134
  1008. package/dist/fleet-inspect-2L5YGGZJ.js +0 -469
  1009. package/dist/fleet-preflight-QRSHIIDE.js +0 -22
  1010. package/dist/fleet-validate-LIAVKDUU.js +0 -92
  1011. package/dist/fleet-verify-JIK3OQZR.js +0 -202
  1012. package/dist/fleet-view-IWHYGQKK.js +0 -118
  1013. package/dist/init-NJEDOTQW.js +0 -321
  1014. package/dist/interop-RVCAYECG.js +0 -115
  1015. package/dist/inventory-74UL7UHU.js +0 -118
  1016. package/dist/library-CTKZA7K3.js +0 -226
  1017. package/dist/memory-I76I5VUH.js +0 -512
  1018. package/dist/models-D4YDIQZQ.js +0 -289
  1019. package/dist/monitor-NKVD55HX.js +0 -775
  1020. package/dist/orchestrator-I6OATVPK.js +0 -39518
  1021. package/dist/panes-7BTYH3XQ.js +0 -103
  1022. package/dist/panes-WPOMEMRH.js +0 -74
  1023. package/dist/paths-J3KN7UAO.js +0 -67
  1024. package/dist/preload-EJAWJEIO.js +0 -116
  1025. package/dist/reset-4XMQKDNZ.js +0 -345
  1026. package/dist/resources-TVYVXK3Q.js +0 -125
  1027. package/dist/run-OWQNNSJU.js +0 -872
  1028. package/dist/share-NPZZMUXG.js +0 -290
  1029. package/dist/skills-OXFEAWMT.js +0 -510
  1030. package/dist/skills-eval-J5TCKSJA.js +0 -1034
  1031. package/dist/skills-inventory-7II4DM57.js +0 -133
  1032. package/dist/slash-commands-MDSDSWYF.js +0 -92
  1033. package/dist/steer-S7D7IKPU.js +0 -77
  1034. package/dist/support-5VAEC32W.js +0 -38
  1035. package/dist/targets-KILZEOCE.js +0 -1109
  1036. package/dist/tasks-R6P6OV22.js +0 -36
  1037. package/dist/terminal-lease-LZCG2KN3.js +0 -405
  1038. package/dist/tools-6OCQ6SVB.js +0 -28
  1039. package/dist/trace-JHLXWUMN.js +0 -572
  1040. package/dist/tui-primitives-RCY2HN7G.js +0 -17
  1041. package/dist/uninstall-FXYMFFRT.js +0 -407
  1042. package/dist/upgrade-D2OZH6IQ.js +0 -307
  1043. package/dist/usage-PIASNUS4.js +0 -1052
  1044. package/dist/verifiers-LTHUY2PX.js +0 -630
  1045. package/dist/verify-HYF7KBVE.js +0 -30
  1046. package/dist/web-fetch-MQN4FH3X.js +0 -788
  1047. package/dist/wiki-generate-RK7JQ5NP.js +0 -615
  1048. package/dist/with-panes-OFTNAR4Y.js +0 -628
  1049. package/skills/README.md +0 -418
  1050. package/skills/coding/ast-grep/SKILL.md +0 -213
  1051. package/skills/coding/ast-grep/evals.md +0 -82
  1052. package/skills/coding/coding-standards/SKILL.md +0 -164
  1053. package/skills/coding/coding-standards/evals.md +0 -57
  1054. package/skills/coding/prototype/SKILL.md +0 -151
  1055. package/skills/coding/prototype/evals.md +0 -61
  1056. package/skills/coding/tdd/SKILL.md +0 -134
  1057. package/skills/coding/tdd/evals.md +0 -61
  1058. package/skills/context/context-handoff/SKILL.md +0 -176
  1059. package/skills/context/context-handoff/evals.md +0 -101
  1060. package/skills/context/context-prime/SKILL.md +0 -131
  1061. package/skills/context/context-prime/evals.md +0 -99
  1062. package/skills/git/branch-closeout/SKILL.md +0 -132
  1063. package/skills/git/file-ticket/SKILL.md +0 -126
  1064. package/skills/git/fix-issue/SKILL.md +0 -136
  1065. package/skills/git/resolve-merge-conflicts/SKILL.md +0 -151
  1066. package/skills/git/resolve-merge-conflicts/evals.md +0 -85
  1067. package/skills/git/ship/SKILL.md +0 -134
  1068. package/skills/git/worktree-create/SKILL.md +0 -127
  1069. package/skills/git/worktree-merge/SKILL.md +0 -147
  1070. package/skills/meta/clio-coder-dev/SKILL.md +0 -101
  1071. package/skills/meta/clio-coder-dev/evals.md +0 -46
  1072. package/skills/meta/clio-coder-test/SKILL.md +0 -146
  1073. package/skills/meta/clio-coder-test/evals.md +0 -48
  1074. package/skills/meta/clio-coder-test/references/test-map.md +0 -96
  1075. package/skills/meta/credentials/SKILL.md +0 -132
  1076. package/skills/meta/credentials/evals.md +0 -104
  1077. package/skills/meta/find-skills/SKILL.md +0 -78
  1078. package/skills/meta/find-skills/evals.md +0 -47
  1079. package/skills/meta/herdr/SKILL.md +0 -133
  1080. package/skills/meta/herdr/evals.md +0 -38
  1081. package/skills/meta/skill-craft/SKILL.md +0 -125
  1082. package/skills/meta/skill-craft/evals.md +0 -41
  1083. package/skills/planning/archify/SKILL.md +0 -196
  1084. package/skills/planning/architecture/SKILL.md +0 -184
  1085. package/skills/planning/architecture/evals.md +0 -101
  1086. package/skills/planning/backlog/SKILL.md +0 -212
  1087. package/skills/planning/backlog/evals.md +0 -185
  1088. package/skills/planning/prd/SKILL.md +0 -129
  1089. package/skills/planning/prd/evals.md +0 -103
  1090. package/skills/planning/product-intent/SKILL.md +0 -173
  1091. package/skills/planning/product-intent/evals.md +0 -106
  1092. package/skills/planning/tech-spec/SKILL.md +0 -172
  1093. package/skills/planning/tech-spec/evals.md +0 -120
  1094. package/skills/registry.yaml +0 -144
  1095. package/skills/remote.yaml +0 -13
  1096. package/skills/research/arxiv-literature/SKILL.md +0 -168
  1097. package/skills/research/arxiv-literature/evals.md +0 -108
  1098. package/skills/research/experiment-protocol/SKILL.md +0 -148
  1099. package/skills/research/experiment-protocol/evals.md +0 -114
  1100. package/skills/research/scientific-debugging/SKILL.md +0 -149
  1101. package/skills/research/scientific-debugging/evals.md +0 -156
  1102. package/skills/research/scientific-modernization/SKILL.md +0 -170
  1103. package/skills/research/scientific-modernization/evals.md +0 -111
  1104. package/skills/skill-marketplace.json +0 -507
  1105. package/skills/workflow/cut-it/SKILL.md +0 -153
  1106. package/skills/workflow/cut-it/evals.md +0 -143
  1107. package/skills/workflow/design-council/SKILL.md +0 -233
  1108. package/skills/workflow/design-council/evals.md +0 -258
  1109. package/skills/workflow/grill-me/SKILL.md +0 -267
  1110. package/skills/workflow/grill-me/evals.md +0 -231
  1111. package/skills/workflow/workflow-distiller/SKILL.md +0 -201
  1112. package/skills/workflow/workflow-distiller/evals.md +0 -225
  1113. package/src/domains/extensions/resource-path.ts +0 -27
  1114. package/src/domains/extensions/resources.ts +0 -37
  1115. package/src/domains/lifecycle/migrations/2026-09-01-extension-install-digests.ts +0 -27
  1116. package/src/interactive/overlays/agents.ts +0 -70
  1117. package/src/interactive/overlays/library-install-confirm.ts +0 -152
  1118. package/src/interactive/overlays/prompts.ts +0 -89
  1119. package/src/interactive/overlays/skills-hub.ts +0 -615
  1120. /package/{skills → library/skills}/coding/ast-grep/references/rule_reference.md +0 -0
  1121. /package/{skills → library/skills}/coding/prototype/references/LOGIC.md +0 -0
  1122. /package/{skills → library/skills}/coding/prototype/references/UI.md +0 -0
  1123. /package/{skills → library/skills}/coding/tdd/references/mocking.md +0 -0
  1124. /package/{skills → library/skills}/coding/tdd/references/tests.md +0 -0
  1125. /package/{skills → library/skills}/context/context-handoff/scripts/new-handoff.sh +0 -0
  1126. /package/{skills → library/skills}/git/branch-closeout/evals.md +0 -0
  1127. /package/{skills → library/skills}/git/branch-closeout/references/closeout-checklist.md +0 -0
  1128. /package/{skills → library/skills}/git/file-ticket/assets/issue-template.md +0 -0
  1129. /package/{skills → library/skills}/git/file-ticket/evals.md +0 -0
  1130. /package/{skills → library/skills}/git/file-ticket/references/issue-discovery.md +0 -0
  1131. /package/{skills → library/skills}/git/fix-issue/evals.md +0 -0
  1132. /package/{skills → library/skills}/git/fix-issue/references/diagnosis-and-rca.md +0 -0
  1133. /package/{skills → library/skills}/git/resolve-merge-conflicts/references/conflict-matrix.md +0 -0
  1134. /package/{skills → library/skills}/git/ship/assets/pr-template.md +0 -0
  1135. /package/{skills → library/skills}/git/ship/evals.md +0 -0
  1136. /package/{skills → library/skills}/git/ship/references/remote-and-branch-policy.md +0 -0
  1137. /package/{skills → library/skills}/git/worktree-create/evals.md +0 -0
  1138. /package/{skills → library/skills}/git/worktree-create/references/worktree-setup.md +0 -0
  1139. /package/{skills → library/skills}/git/worktree-merge/evals.md +0 -0
  1140. /package/{skills → library/skills}/git/worktree-merge/references/merge-strategies.md +0 -0
  1141. /package/{skills → library/skills}/meta/clio-coder-test/references/harness.md +0 -0
  1142. /package/{skills → library/skills}/planning/archify/evals.md +0 -0
@@ -1,2488 +0,0 @@
1
- import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
2
- import {
3
- combineBashOutput
4
- } from "./chunk-5A6XR3RJ.js";
5
- import {
6
- init_esm_shims
7
- } from "./chunk-ECBHH7LU.js";
8
-
9
- // src/engine/tui.ts
10
- init_esm_shims();
11
- import {
12
- Box,
13
- CombinedAutocompleteProvider,
14
- Container,
15
- Editor,
16
- fuzzyFilter,
17
- getKeybindings,
18
- Input,
19
- isKeyRelease,
20
- KeybindingsManager,
21
- Markdown,
22
- Marked,
23
- matchesKey,
24
- ProcessTerminal,
25
- ScrollView,
26
- setKeybindings,
27
- stripTerminalSequences,
28
- Text,
29
- TUI_KEYBINDINGS,
30
- TuiAltScreen as TuiAltScreen2,
31
- TuiMainScreen as TuiMainScreen2,
32
- truncateToWidth,
33
- VStack,
34
- visibleWidth,
35
- wrapTextWithAnsi
36
- } from "@earendil-works/pi-tui";
37
-
38
- // src/engine/instrumented-tui.ts
39
- init_esm_shims();
40
- import { TuiAltScreen, TuiMainScreen } from "@earendil-works/pi-tui";
41
- var DeferredRenderAdmission = class {
42
- constructor(admission, render) {
43
- this.admission = admission;
44
- this.render = render;
45
- }
46
- admission;
47
- render;
48
- pending = false;
49
- force = false;
50
- release = null;
51
- request(force) {
52
- if (!this.admission?.blocked) return false;
53
- this.pending = true;
54
- this.force ||= force;
55
- this.release ??= this.admission.onWritable(() => {
56
- this.release?.();
57
- this.release = null;
58
- if (!this.pending) return;
59
- const pendingForce = this.force;
60
- this.pending = false;
61
- this.force = false;
62
- this.render(pendingForce);
63
- });
64
- return true;
65
- }
66
- /** A direct/final render supersedes any older request held behind the gate. */
67
- settled() {
68
- this.pending = false;
69
- this.force = false;
70
- this.release?.();
71
- this.release = null;
72
- }
73
- };
74
- var InstrumentedTuiMainScreen = class extends TuiMainScreen {
75
- constructor(terminal, renderObserver, showHardwareCursor, logDirectory, renderAdmission) {
76
- super(terminal, showHardwareCursor, logDirectory);
77
- this.renderObserver = renderObserver;
78
- this.deferredAdmission = new DeferredRenderAdmission(renderAdmission, (force) => super.requestRender(force));
79
- }
80
- renderObserver;
81
- requestRender(force = false) {
82
- if (!this.deferredAdmission.request(force)) super.requestRender(force);
83
- }
84
- doRender() {
85
- this.deferredAdmission.settled();
86
- if (this.renderObserver.isEnabled?.() === false) {
87
- super.doRender();
88
- return;
89
- }
90
- const frame2 = this.renderObserver.beginFrame({
91
- mode: this.mode,
92
- columns: this.terminal.columns,
93
- rows: this.terminal.rows
94
- });
95
- this.currentFrame = frame2;
96
- try {
97
- super.doRender();
98
- } finally {
99
- this.currentFrame = void 0;
100
- this.renderObserver.endFrame(frame2);
101
- }
102
- }
103
- compositeOverlays(lines, termWidth, termHeight) {
104
- return this.measure("overlay", () => super.compositeOverlays(lines, termWidth, termHeight));
105
- }
106
- applyLineResets(lines) {
107
- return this.measure("normalization", () => super.applyLineResets(lines));
108
- }
109
- extractCursorPosition(lines, height) {
110
- return this.measure("cursor", () => super.extractCursorPosition(lines, height));
111
- }
112
- measure(phase, operation) {
113
- if (this.renderObserver.isEnabled?.() === false) return operation();
114
- const frame2 = this.currentFrame;
115
- if (frame2 === void 0) return operation();
116
- const phaseToken = this.renderObserver.beginPhase(frame2, phase);
117
- try {
118
- return operation();
119
- } finally {
120
- this.renderObserver.endPhase(frame2, phase, phaseToken);
121
- }
122
- }
123
- currentFrame;
124
- deferredAdmission;
125
- };
126
- var InstrumentedTuiAltScreen = class extends TuiAltScreen {
127
- constructor(terminal, renderObserver, showHardwareCursor, logDirectory, options, renderAdmission) {
128
- super(terminal, showHardwareCursor, logDirectory, options);
129
- this.renderObserver = renderObserver;
130
- this.deferredAdmission = new DeferredRenderAdmission(renderAdmission, (force) => super.requestRender(force));
131
- }
132
- renderObserver;
133
- currentFrame;
134
- requestRender(force = false) {
135
- if (!this.deferredAdmission.request(force)) super.requestRender(force);
136
- }
137
- doRender() {
138
- this.deferredAdmission.settled();
139
- if (this.renderObserver.isEnabled?.() === false) {
140
- super.doRender();
141
- return;
142
- }
143
- const frame2 = this.renderObserver.beginFrame({
144
- mode: this.mode,
145
- columns: this.terminal.columns,
146
- rows: this.terminal.rows
147
- });
148
- this.currentFrame = frame2;
149
- try {
150
- super.doRender();
151
- } finally {
152
- this.currentFrame = void 0;
153
- this.renderObserver.endFrame(frame2);
154
- }
155
- }
156
- compositeOverlays(lines, termWidth, termHeight) {
157
- return this.measure("overlay", () => super.compositeOverlays(lines, termWidth, termHeight));
158
- }
159
- applyLineResets(lines) {
160
- return this.measure("normalization", () => super.applyLineResets(lines));
161
- }
162
- extractCursorPosition(lines, height) {
163
- return this.measure("cursor", () => super.extractCursorPosition(lines, height));
164
- }
165
- measure(phase, operation) {
166
- if (this.renderObserver.isEnabled?.() === false) return operation();
167
- const frame2 = this.currentFrame;
168
- if (frame2 === void 0) return operation();
169
- const phaseToken = this.renderObserver.beginPhase(frame2, phase);
170
- try {
171
- return operation();
172
- } finally {
173
- this.renderObserver.endPhase(frame2, phase, phaseToken);
174
- }
175
- }
176
- deferredAdmission;
177
- };
178
-
179
- // src/engine/select-list.ts
180
- init_esm_shims();
181
- import {
182
- SelectList as EngineSelectList
183
- } from "@earendil-works/pi-tui";
184
- var PI_SELECT_CURSOR = "\u2192";
185
- var ESC = String.fromCharCode(27);
186
- var LEADING_CURSOR_PATTERN = new RegExp(`^((?:${ESC}\\[[0-9;]*m)*)${PI_SELECT_CURSOR} `);
187
- var SelectList = class extends EngineSelectList {
188
- designCursor;
189
- constructor(items, maxVisible, theme, layout) {
190
- super(items, maxVisible, theme, layout);
191
- this.designCursor = theme.cursor;
192
- }
193
- render(width) {
194
- const lines = super.render(width);
195
- const cursor = this.designCursor;
196
- if (!cursor || cursor === PI_SELECT_CURSOR) return lines;
197
- return lines.map((line) => line.replace(LEADING_CURSOR_PATTERN, `$1${cursor} `));
198
- }
199
- };
200
-
201
- // src/engine/tui.ts
202
- function createAgentProgress(terminal) {
203
- let active = false;
204
- return {
205
- start() {
206
- if (active) return;
207
- active = true;
208
- terminal.setProgress(true);
209
- },
210
- stop() {
211
- if (!active) return;
212
- active = false;
213
- terminal.setProgress(false);
214
- },
215
- isActive() {
216
- return active;
217
- }
218
- };
219
- }
220
-
221
- // src/interactive/theme/glyphs.ts
222
- init_esm_shims();
223
- var GLYPH = {
224
- // Clio wordmark, shown in the welcome and dashboard headers only.
225
- brand: ">C_",
226
- // Agent voice glyph for the chat reply prefix. It renders in accent on a
227
- // normal turn and error red on a failed one. The `>C_` wordmark is no longer
228
- // the reply prefix; it survives only in the two headers above.
229
- agent: "\u2726",
230
- user: "\u203A",
231
- // Selection focus marker for list overlays. It is deliberately distinct from
232
- // the tool ledger's toolHeader so a focused row never reads as a tool line.
233
- cursor: "\u276F",
234
- toolHeader: "\u25B8",
235
- running: "\u25CF",
236
- queued: "\u25CC",
237
- speed: "\u26A1",
238
- ok: "\u2713",
239
- error: "\u2717",
240
- cancelled: "\u2298",
241
- active: "\u25C6",
242
- scoped: "\u25C7",
243
- up: "\u2191",
244
- down: "\u2193",
245
- rail: "\u2502",
246
- innerDivider: "\u254C",
247
- barFull: "\u2588",
248
- barEmpty: "\u2591",
249
- contextFull: "\u25B0",
250
- contextFree: "\u25B1",
251
- // Autocompact reserve cells: held-back headroom is neither used nor free,
252
- // so it carries its own glyph and never reads as filled when only color is
253
- // lost. The medium-shade block is single-width in the same fonts that carry
254
- // the barFull/barEmpty fallbacks.
255
- contextReserve: "\u2592",
256
- info: "\u2139",
257
- warn: "\u26A0",
258
- warnInline: "!",
259
- phaseWaiting: "\u25D4",
260
- phaseThinking: "\u25D0",
261
- phaseWriting: "\u25D1",
262
- phaseTool: "\u2699",
263
- phaseBlocked: "\u23F8",
264
- phaseRetry: "\u21BB",
265
- phaseCompact: "\u267B",
266
- phaseDispatch: "\u21F2",
267
- // Marks a run that Clio started for itself (a shadow worker or an internal
268
- // harness run) so internal activity reads as a sub-process of the current
269
- // turn. It replaces the old `sh:`/`in:` agent-name prefixes; the two
270
- // audiences are told apart by tone, not by a second glyph.
271
- subProcess: "\u21B3",
272
- // Who asked for a dispatched run. Hollow is the operator's own (/run,
273
- // /delegate); filled is one the model started by calling a dispatch tool.
274
- // The transcript block, the board row, and the footer count share the pair,
275
- // so a running ◇ anywhere is work the operator started themselves.
276
- workerHuman: "\u25C7",
277
- workerAgent: "\u25C6",
278
- // A run neither the operator nor the model asked for: wiki documenting, a
279
- // bootstrap scout, a judge. It stays off the transcript entirely, so the
280
- // board is the only surface that shows it and it gets the quietest mark
281
- // that still holds the origin column.
282
- workerInternal: "\xB7",
283
- ellipsis: "\u2026",
284
- favorite: "\u2605"
285
- };
286
- var SPINNER_FRAMES = ["\u28FE", "\u28FD", "\u28FB", "\u28BF", "\u287F", "\u28DF", "\u28EF", "\u28F7"];
287
- function spinnerFrame(tick) {
288
- const index = (tick % SPINNER_FRAMES.length + SPINNER_FRAMES.length) % SPINNER_FRAMES.length;
289
- return SPINNER_FRAMES[index] ?? SPINNER_FRAMES[0];
290
- }
291
-
292
- // src/interactive/theme/index.ts
293
- init_esm_shims();
294
-
295
- // src/interactive/theme/tokens.ts
296
- init_esm_shims();
297
- var TOKENS = {
298
- accent: { rgb: [70, 229, 208], xterm: 80 },
299
- accentDeep: { rgb: [31, 183, 166], xterm: 44 },
300
- // Second brand color: neon orange. The token name teaches the rule: orange
301
- // means Clio is acting. It fires only for Clio's signature actions
302
- // (dispatching, queued and running fleet work, steering) and for the border
303
- // of a prompt that has taken the keyboard and is waiting on a decision, never
304
- // as decoration, and never a metric, at most one orange element per region of
305
- // the screen. warning stays the soft amber for actual warnings.
306
- action: { rgb: [255, 126, 41], xterm: 208 },
307
- success: { rgb: [87, 227, 137], xterm: 114 },
308
- warning: { rgb: [255, 180, 84], xterm: 221 },
309
- error: { rgb: [255, 92, 102], xterm: 203 },
310
- info: { rgb: [91, 168, 255], xterm: 75 },
311
- reason: { rgb: [157, 140, 255], xterm: 141 },
312
- dim: { rgb: [106, 122, 133], xterm: 59 },
313
- muted: { rgb: [138, 153, 164], xterm: 102 },
314
- title: { rgb: [70, 229, 208], xterm: 80 },
315
- frame: { rgb: [47, 93, 90], xterm: 23 },
316
- frameStrong: { rgb: [42, 171, 158], xterm: 37 }
317
- };
318
- var SGR_RESET = "\x1B[0m";
319
- var SGR_DIM = "\x1B[2m";
320
- function colorDisabled(env = process.env) {
321
- const raw = env.NO_COLOR;
322
- return typeof raw === "string" && raw.length > 0;
323
- }
324
- function detectTruecolor(env = process.env) {
325
- const colorTerm = (env.COLORTERM ?? "").toLowerCase();
326
- if (colorTerm.includes("truecolor") || colorTerm.includes("24bit")) return true;
327
- const term = (env.TERM ?? "").toLowerCase();
328
- return term.includes("truecolor") || term.includes("24bit");
329
- }
330
- function fgCode(color, truecolor) {
331
- return truecolor ? `38;2;${color.rgb[0]};${color.rgb[1]};${color.rgb[2]}` : `38;5;${color.xterm}`;
332
- }
333
- function bgCode(color, truecolor) {
334
- return truecolor ? `48;2;${color.rgb[0]};${color.rgb[1]};${color.rgb[2]}` : `48;5;${color.xterm}`;
335
- }
336
- function fgSequence(token, truecolor = detectTruecolor()) {
337
- if (colorDisabled()) return "";
338
- return `\x1B[${fgCode(TOKENS[token], truecolor)}m`;
339
- }
340
- function createClioTheme(options = {}) {
341
- const truecolor = options.truecolor ?? detectTruecolor();
342
- const color = options.color ?? !colorDisabled();
343
- const paint = (text, mods) => {
344
- const codes = [];
345
- if (mods.bold) codes.push("1");
346
- if (mods.dim) codes.push("2");
347
- if (mods.italic) codes.push("3");
348
- if (mods.underline) codes.push("4");
349
- if (color && mods.fg) codes.push(fgCode(TOKENS[mods.fg], truecolor));
350
- if (color && mods.bg) codes.push(bgCode(TOKENS[mods.bg], truecolor));
351
- if (codes.length === 0) return text;
352
- return `\x1B[${codes.join(";")}m${text}${SGR_RESET}`;
353
- };
354
- return {
355
- truecolor,
356
- paint,
357
- fg: (token, text) => paint(text, { fg: token }),
358
- bg: (token, text) => paint(text, { bg: token }),
359
- style: (token, text, mods = {}) => paint(text, { ...mods, fg: token }),
360
- fgSequence: (token) => color ? `\x1B[${fgCode(TOKENS[token], truecolor)}m` : ""
361
- };
362
- }
363
- function isClioToken(value) {
364
- return Object.hasOwn(TOKENS, value);
365
- }
366
- var HEX_COLOR = /^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/u;
367
- function paintHex(text, hex, options = {}) {
368
- const match = HEX_COLOR.exec(hex);
369
- if (match === null) return text;
370
- if (!(options.color ?? !colorDisabled())) return text;
371
- const truecolor = options.truecolor ?? detectTruecolor();
372
- const red = Number.parseInt(match[1] ?? "0", 16);
373
- const green = Number.parseInt(match[2] ?? "0", 16);
374
- const blue = Number.parseInt(match[3] ?? "0", 16);
375
- if (truecolor) return `\x1B[38;2;${red};${green};${blue}m${text}${SGR_RESET}`;
376
- const cube = (channel) => Math.round(channel / 255 * 5);
377
- return `\x1B[38;5;${16 + 36 * cube(red) + 6 * cube(green) + cube(blue)}m${text}${SGR_RESET}`;
378
- }
379
-
380
- // src/interactive/theme/components.ts
381
- init_esm_shims();
382
-
383
- // src/interactive/theme/segments.ts
384
- init_esm_shims();
385
- function present(parts) {
386
- return parts.filter((part) => typeof part === "string" && part.length > 0);
387
- }
388
- function brandMark(theme) {
389
- const prompt = GLYPH.brand.slice(0, 1);
390
- const initial = GLYPH.brand.slice(1, 2);
391
- const cursor = GLYPH.brand.slice(2, 3);
392
- return `${theme.fg("dim", prompt)}${theme.style("accent", initial, { bold: true })}${theme.fg("dim", cursor)}`;
393
- }
394
- function dotSep(theme) {
395
- return theme.fg("dim", " \xB7 ");
396
- }
397
- function barSep(theme) {
398
- return theme.fg("frame", " \u2502 ");
399
- }
400
- function sectionTag(theme, token, label, pad = 0) {
401
- const text = pad > 0 ? label.padEnd(pad) : label;
402
- return theme.style(token, text, { bold: true });
403
- }
404
- function screenTitle(theme, label) {
405
- return theme.style("title", label, { bold: true });
406
- }
407
- function listGroupHeader(theme, label) {
408
- return theme.fg("dim", `\u2500\u2500 ${label}`);
409
- }
410
- function joinChips(theme, parts) {
411
- return present(parts).join(dotSep(theme));
412
- }
413
- function joinSections(theme, parts) {
414
- return present(parts).join(barSep(theme));
415
- }
416
-
417
- // src/interactive/theme/components.ts
418
- var identity = (text) => text;
419
- function markdownTheme(theme, highlightCode) {
420
- return {
421
- heading: (text) => screenTitle(theme, text),
422
- link: (text) => theme.fg("info", text),
423
- linkUrl: (text) => theme.fg("dim", text),
424
- code: (text) => theme.fg("muted", text),
425
- codeBlock: (text) => text,
426
- codeBlockBorder: (text) => theme.fg("frame", text),
427
- quote: (text) => theme.fg("muted", text),
428
- quoteBorder: (text) => theme.fg("frame", text),
429
- hr: (text) => theme.fg("frame", text),
430
- listBullet: (text) => theme.fg("accent", text),
431
- bold: (text) => theme.paint(text, { bold: true }),
432
- italic: (text) => theme.paint(text, { italic: true }),
433
- strikethrough: identity,
434
- underline: (text) => theme.paint(text, { underline: true }),
435
- ...highlightCode ? { highlightCode } : {}
436
- };
437
- }
438
- function selectListTheme(theme) {
439
- return {
440
- // The design cursor the engine SelectList swaps in for pi-tui's arrow.
441
- cursor: GLYPH.cursor,
442
- selectedPrefix: (text) => theme.fg("accent", text),
443
- selectedText: (text) => theme.style("accent", text, { bold: true }),
444
- description: (text) => theme.fg("muted", text),
445
- scrollInfo: (text) => theme.fg("dim", text),
446
- noMatch: (text) => theme.fg("warning", text)
447
- };
448
- }
449
- function settingsListTheme(theme) {
450
- return {
451
- label: (text, selected) => selected ? theme.style("accent", text, { bold: true }) : text,
452
- value: (text, selected) => selected ? theme.fg("success", text) : theme.fg("muted", text),
453
- description: (text) => theme.fg("muted", text),
454
- cursor: GLYPH.cursor,
455
- hint: (text) => theme.fg("dim", text)
456
- };
457
- }
458
- function editorTheme(theme) {
459
- return {
460
- borderColor: (text) => theme.style("frameStrong", text, { bold: true }),
461
- selectList: selectListTheme(theme)
462
- };
463
- }
464
-
465
- // src/interactive/theme/labels.ts
466
- init_esm_shims();
467
- function abbreviateModelId(modelId) {
468
- const segments = (modelId ?? "").trim().split("/").filter(Boolean);
469
- const base = segments.pop() ?? "";
470
- if (base.length === 0) return "model";
471
- const prefix = segments[0];
472
- const maxLeaf = prefix ? Math.max(8, 24 - prefix.length - 1) : 18;
473
- const parts = base.split("-").filter((part) => part.length > 0);
474
- let leaf;
475
- if (parts.length <= 1) leaf = base.length > maxLeaf ? base.slice(0, maxLeaf) : base;
476
- else {
477
- const kept = [];
478
- for (const part of parts) {
479
- const next = [...kept, part].join("-");
480
- if (kept.length > 0 && next.length > maxLeaf) break;
481
- kept.push(part);
482
- }
483
- const joined = kept.join("-");
484
- leaf = joined.length > maxLeaf ? joined.slice(0, maxLeaf) : joined;
485
- }
486
- return prefix ? `${prefix}/${leaf}` : leaf;
487
- }
488
- function formatTargetLabel(targetId, modelId, options = {}) {
489
- const target = (targetId ?? "").trim();
490
- const model = (modelId ?? "").trim();
491
- if (target.length === 0 && model.length === 0) return "not configured";
492
- const shown = options.abbreviate === false ? model : abbreviateModelId(model);
493
- if (target.length === 0) return `no target \xB7 ${shown}`;
494
- if (model.length === 0) return `${target} \xB7 no model`;
495
- return `${target}${options.separator ?? " \xB7 "}${shown}`;
496
- }
497
- function formatCompactMs(value) {
498
- const ms = Math.max(0, Math.round(value));
499
- if (ms < 1e3) return `${ms}ms`;
500
- const seconds = ms / 1e3;
501
- return seconds < 60 ? `${seconds.toFixed(seconds >= 10 ? 0 : 1)}s` : `${Math.floor(seconds / 60)}m${Math.round(seconds % 60)}s`;
502
- }
503
- function formatContextPercent(percent) {
504
- return typeof percent === "number" && Number.isFinite(percent) ? `${percent.toFixed(1)}%` : "?%";
505
- }
506
- function collapseHomePath(path) {
507
- const home = process.env.HOME;
508
- if (!home || home.length === 0) return path;
509
- if (path === home) return "~";
510
- return path.startsWith(`${home}/`) ? `~/${path.slice(home.length + 1)}` : path;
511
- }
512
-
513
- // src/interactive/theme/rules.ts
514
- init_esm_shims();
515
- function padAnsi(text, width, ellipsis = "") {
516
- return truncateToWidth(text, Math.max(0, width), ellipsis, true);
517
- }
518
- function fitUnits(theme, prefix, units, maxWidth) {
519
- const sep = " \xB7 ";
520
- let line = prefix;
521
- for (let index = 0; index < units.length; index += 1) {
522
- const candidate = index === 0 ? `${line}${units[index]}` : `${line}${sep}${units[index]}`;
523
- const reserve = index < units.length - 1 ? 2 : 0;
524
- if (visibleWidth(candidate) + reserve > maxWidth) {
525
- if (index === 0) return truncateToWidth(candidate, Math.max(0, maxWidth), "\u2026", false);
526
- return `${line} ${theme.fg("dim", "\u2026")}`;
527
- }
528
- line = candidate;
529
- }
530
- return line;
531
- }
532
- function rule(theme, width, options = {}) {
533
- const safeWidth = Math.max(0, width);
534
- if (safeWidth === 0) return "";
535
- const left = options.left ? `${theme.style(options.leftToken ?? "accent", options.left, { bold: true })} ` : "";
536
- const rightBody = options.rightRaw ? options.right : theme.fg(options.rightToken ?? "muted", options.right ?? "");
537
- const right = options.right ? ` ${rightBody} ${options.rightTail ?? ""}` : "";
538
- const labelsWidth = visibleWidth(left) + visibleWidth(right);
539
- if (labelsWidth >= safeWidth) return truncateToWidth(`${left}${right}`.trim(), safeWidth, "", true);
540
- const fill = theme.style(options.fillToken ?? "frame", "\u2500".repeat(safeWidth - labelsWidth), {
541
- bold: options.fillToken === "frameStrong"
542
- });
543
- return `${left}${fill}${right}`;
544
- }
545
- function frame(theme, title, lines, width, opts = {}) {
546
- const safeWidth = Math.max(4, width);
547
- const contentWidth = Math.max(0, safeWidth - 4);
548
- const frameFg = (text) => theme.fg("frame", text);
549
- const hasTitle = title.length > 0;
550
- const styledTitle = !hasTitle ? "" : title.includes("\x1B") ? title : theme.style("title", title, { bold: true });
551
- const titleWidth = visibleWidth(title);
552
- const meta = opts.rightMeta ?? "";
553
- const hasMeta = meta.length > 0;
554
- const metaWidth = hasMeta ? visibleWidth(meta) : 0;
555
- const leftVisible = 2 + (hasTitle ? titleWidth + 2 : 0);
556
- const rightVisible = hasMeta ? metaWidth + 4 : 1;
557
- const fillWidth = Math.max(0, safeWidth - leftVisible - rightVisible);
558
- const leftStr = hasTitle ? `${frameFg("\u250C\u2500")} ${styledTitle} ` : frameFg("\u250C\u2500");
559
- const rightStr = hasMeta ? ` ${theme.fg("dim", meta)} ${frameFg("\u2500\u2510")}` : frameFg("\u2510");
560
- const top = `${leftStr}${frameFg("\u2500".repeat(fillWidth))}${rightStr}`;
561
- const body = lines.map((line) => `${frameFg("\u2502")} ${padAnsi(line, contentWidth)} ${frameFg("\u2502")}`);
562
- const bottom = `${frameFg("\u2514")}${frameFg("\u2500".repeat(safeWidth - 2))}${frameFg("\u2518")}`;
563
- return [top, ...body, bottom];
564
- }
565
- function innerDivider(theme, width) {
566
- return theme.fg("frame", GLYPH.innerDivider.repeat(Math.max(0, width)));
567
- }
568
-
569
- // src/interactive/theme/index.ts
570
- var sharedTheme = null;
571
- function clioTheme() {
572
- sharedTheme ??= createClioTheme();
573
- return sharedTheme;
574
- }
575
-
576
- // src/interactive/clio-editor.ts
577
- init_esm_shims();
578
-
579
- // src/interactive/editor-bash.ts
580
- init_esm_shims();
581
- var PASTED_EDITOR_OPERATOR_GUARD = "\u2063";
582
- function guardPastedEditorOperator(text) {
583
- return `${PASTED_EDITOR_OPERATOR_GUARD}${text}`;
584
- }
585
- function unguardPastedEditorOperator(text) {
586
- return text.startsWith(PASTED_EDITOR_OPERATOR_GUARD) ? text.slice(PASTED_EDITOR_OPERATOR_GUARD.length) : text;
587
- }
588
- function parseEditorBashCommand(text) {
589
- if (text.startsWith(PASTED_EDITOR_OPERATOR_GUARD) || text.includes("\n") || text.includes("\r")) return null;
590
- if (!text.startsWith("!")) return null;
591
- const excludeFromContext = text.startsWith("!!");
592
- const command = (excludeFromContext ? text.slice(2) : text.slice(1)).trim();
593
- if (command.length === 0) return null;
594
- return { command, excludeFromContext };
595
- }
596
- function appendStatusNotes(output, result, timeoutMs) {
597
- const notes = [];
598
- if (result.aborted) notes.push("command aborted");
599
- if (result.timedOut) notes.push(`command timed out after ${timeoutMs}ms`);
600
- if (result.outputCapped) notes.push("command output exceeded the inline output limit");
601
- if (result.error && output.trim().length === 0) notes.push(result.error.message);
602
- if (notes.length === 0) return output;
603
- const suffix = notes.map((note) => `[${note}]`).join("\n");
604
- return output.length > 0 ? `${output.replace(/\s+$/g, "")}
605
- ${suffix}` : suffix;
606
- }
607
- function bashExecutionEntryInput(args) {
608
- const output = appendStatusNotes(combineBashOutput(args.result), args.result, args.timeoutMs);
609
- return {
610
- kind: "bashExecution",
611
- parentTurnId: args.parentTurnId,
612
- command: args.command,
613
- output,
614
- exitCode: args.result.exitCode,
615
- cancelled: args.result.aborted,
616
- truncated: args.result.outputCapped,
617
- excludeFromContext: args.excludeFromContext
618
- };
619
- }
620
-
621
- // src/interactive/overlay-frame.ts
622
- init_esm_shims();
623
-
624
- // src/interactive/modal-marker.ts
625
- init_esm_shims();
626
- var MODAL_MARKER_BASE_TITLE = "clio";
627
- function formatModalMarkerTitle(stack) {
628
- const top = stack.at(-1);
629
- if (top === void 0) return MODAL_MARKER_BASE_TITLE;
630
- const beneath = stack.length - 1;
631
- return `${MODAL_MARKER_BASE_TITLE} [modal:${top}${beneath > 0 ? `+${beneath}` : ""}]`;
632
- }
633
- function createModalMarkerRegistry() {
634
- const entries = [];
635
- let sink = null;
636
- let published = null;
637
- function activeIds() {
638
- return entries.filter((entry) => entry.active).map((entry) => entry.id);
639
- }
640
- function publish() {
641
- if (sink === null) return;
642
- const title = formatModalMarkerTitle(activeIds());
643
- if (published === null && title === MODAL_MARKER_BASE_TITLE) return;
644
- if (title === published) return;
645
- published = title;
646
- sink.setTitle(title);
647
- }
648
- function enter(id, nextSink) {
649
- if (nextSink) sink = nextSink;
650
- const entry = { id, active: true };
651
- entries.push(entry);
652
- publish();
653
- let released = false;
654
- return {
655
- release() {
656
- if (released) return;
657
- released = true;
658
- const index = entries.indexOf(entry);
659
- if (index !== -1) entries.splice(index, 1);
660
- publish();
661
- },
662
- setActive(active) {
663
- if (released || entry.active === active) return;
664
- entry.active = active;
665
- publish();
666
- },
667
- raise() {
668
- if (released) return;
669
- entry.active = true;
670
- const index = entries.indexOf(entry);
671
- if (index !== -1 && index !== entries.length - 1) {
672
- entries.splice(index, 1);
673
- entries.push(entry);
674
- }
675
- publish();
676
- }
677
- };
678
- }
679
- return { enter, stack: () => activeIds() };
680
- }
681
- var registry = createModalMarkerRegistry();
682
- function enterModal(id, sink) {
683
- return registry.enter(id, sink);
684
- }
685
-
686
- // src/interactive/overlay-frame.ts
687
- var DEFAULT_SELECT_THEME = selectListTheme(clioTheme());
688
- var DEFAULT_SETTINGS_THEME = settingsListTheme(clioTheme());
689
- var FocusBox = class extends Box {
690
- inputTarget;
691
- onInput;
692
- constructor(children, options) {
693
- super(options?.x ?? 1, options?.y ?? 0);
694
- const childList = Array.isArray(children) ? children : [children];
695
- for (const child of childList) this.addChild(child);
696
- this.inputTarget = options?.inputTarget === void 0 ? childList[0] ?? null : options.inputTarget;
697
- this.onInput = options?.onInput;
698
- }
699
- handleInput(data) {
700
- if (this.onInput) {
701
- this.onInput(data);
702
- return;
703
- }
704
- this.inputTarget?.handleInput?.(data);
705
- }
706
- };
707
- function resolveTone(tone) {
708
- return typeof tone === "function" ? tone() : tone;
709
- }
710
- function clioFrame(text, token = "frame") {
711
- return clioTheme().fg(token, text);
712
- }
713
- function clioTitle(text, token) {
714
- return token === void 0 ? screenTitle(clioTheme(), text) : clioTheme().style(token, text, { bold: true });
715
- }
716
- function clioError(text) {
717
- return clioTheme().fg("error", text);
718
- }
719
- function brandedTopBorder(label, innerWidth, tone) {
720
- const frame2 = (text) => clioFrame(text, tone ?? "frame");
721
- const clean = label.replace(/^[┌┐└┘├┤─│\s]+/, "").replace(/[┌┐└┘├┤─│\s]+$/, "");
722
- const formatted = clean.length > 0 ? `\u2500 ${clean} ` : "\u2500";
723
- const clipped = visibleWidth(formatted) > innerWidth ? truncateToWidth(formatted, innerWidth, "\u2026", true) : formatted;
724
- const fill = "\u2500".repeat(Math.max(0, innerWidth - visibleWidth(clipped)));
725
- const cleanIndex = clipped.indexOf(clean);
726
- if (cleanIndex !== -1) {
727
- const prefix = clipped.slice(0, cleanIndex);
728
- const suffix = clipped.slice(cleanIndex + clean.length);
729
- return `${frame2("\u250C")}${frame2(prefix)}${clioTitle(clean, tone)}${frame2(suffix)}${frame2(fill)}${frame2("\u2510")}`;
730
- }
731
- return `${frame2("\u250C")}${frame2(clipped)}${frame2(fill)}${frame2("\u2510")}`;
732
- }
733
- function isCriticalHintKey(key) {
734
- const canonical = canonicalizeKey(key);
735
- return canonical === "Esc" || canonical === "Enter" || canonical === "Enter/Space" || canonical === "type";
736
- }
737
- function isCriticalEntry(entry) {
738
- return entry.critical ?? isCriticalHintKey(entry.key);
739
- }
740
- function renderHintEntries(entries, short) {
741
- return entries.map((entry) => `[${canonicalizeKey(entry.key)}] ${short ? entry.short ?? entry.verb : entry.verb}`).join(" \xB7 ");
742
- }
743
- function fitHintEntries(entries, maxWidth) {
744
- if (entries.length === 0) return "";
745
- for (const short of [false, true]) {
746
- const rendered = renderHintEntries(entries, short);
747
- if (visibleWidth(rendered) <= maxWidth) return rendered;
748
- }
749
- const kept = [...entries];
750
- for (const criticalPass of [false, true]) {
751
- while (kept.length > 1) {
752
- const index = kept.findIndex((entry) => criticalPass || !isCriticalEntry(entry));
753
- if (index === -1) break;
754
- kept.splice(index, 1);
755
- const rendered = renderHintEntries(kept, true);
756
- if (visibleWidth(rendered) <= maxWidth) return rendered;
757
- }
758
- }
759
- return renderHintEntries(kept, true);
760
- }
761
- var FILTER_HINT = { key: "type", verb: "filter" };
762
- function canonicalizeKey(key) {
763
- const trimmed = key.trim();
764
- if (trimmed === "R") return "R";
765
- const lower = trimmed.toLowerCase();
766
- if (lower === "up/down" || lower === "updown" || lower === "\u2191/\u2193" || lower === "up/down/j/k" || lower === "\u2191\u2193")
767
- return "\u2191\u2193";
768
- if (lower === "enter/space") return "Enter/Space";
769
- if (lower === "enter") return "Enter";
770
- if (lower === "esc" || lower === "escape") return "Esc";
771
- if (lower === "space") return "Space";
772
- if (lower === "tab") return "Tab";
773
- if (lower === "r") return "r";
774
- if (lower === "type") return "type";
775
- return trimmed;
776
- }
777
- function buildHint(entries, esc = "close") {
778
- const finalEntries = [
779
- ...entries.map((e) => ({ key: canonicalizeKey(e.key), verb: e.verb })),
780
- { key: "Esc", verb: esc }
781
- ];
782
- return finalEntries.map((e) => `[${e.key}] ${e.verb}`).join(" \xB7 ");
783
- }
784
- function buildResponsiveHint(entries, esc = "close") {
785
- const escEntry = esc === null ? null : typeof esc === "string" ? { key: "Esc", verb: esc } : esc;
786
- const all = escEntry ? [...entries, escEntry] : [...entries];
787
- return (innerWidth) => fitHintEntries(all, innerWidth - 3);
788
- }
789
- function elideHint(hint, maxCleanWidth) {
790
- const parts = hint.split(" \xB7 ");
791
- if (parts.length <= 2) return hint;
792
- const entries = parts.map((part) => {
793
- const match = /^\[([^\]]+)\] ([\s\S]+)$/u.exec(part);
794
- if (!match) return { key: "", verb: part, critical: false };
795
- return { key: match[1] ?? "", verb: match[2] ?? "" };
796
- });
797
- const rendered = fitHintEntries(entries, maxCleanWidth);
798
- return rendered.replace(/\[\] /gu, "");
799
- }
800
- function brandedBottomBorder(innerWidth, hint, tone) {
801
- const frame2 = (text) => clioFrame(text, tone ?? "frame");
802
- if (!hint || hint.trim().length === 0) {
803
- return `${frame2("\u2514")}${frame2("\u2500".repeat(innerWidth))}${frame2("\u2518")}`;
804
- }
805
- let clean = hint.trim();
806
- const maxCleanWidth = innerWidth - 3;
807
- if (clean.includes(" \xB7 ") && visibleWidth(`\u2500 ${clean} `) > innerWidth) {
808
- clean = elideHint(clean, maxCleanWidth);
809
- }
810
- const formatted = `\u2500 ${clean} `;
811
- const clipped = visibleWidth(formatted) > innerWidth ? truncateToWidth(formatted, innerWidth, "\u2026", true) : formatted;
812
- const fill = "\u2500".repeat(Math.max(0, innerWidth - visibleWidth(clipped)));
813
- const cleanIndex = clipped.indexOf(clean);
814
- if (cleanIndex !== -1) {
815
- const prefix = clipped.slice(0, cleanIndex);
816
- const suffix = clipped.slice(cleanIndex + clean.length);
817
- return `${frame2("\u2514")}${frame2(prefix)}${clioTheme().fg("dim", clean)}${frame2(suffix)}${frame2(fill)}${frame2("\u2518")}`;
818
- }
819
- return `${frame2("\u2514")}${frame2(clipped)}${frame2(fill)}${frame2("\u2518")}`;
820
- }
821
- function formatRuntimeResolutionDiagnostic(diagnostic) {
822
- return `${diagnostic.severity}: ${diagnostic.code}: ${diagnostic.message}`;
823
- }
824
- function diagnosticSeverityToken(severity) {
825
- return severity === "error" ? "error" : severity === "warning" ? "warning" : "muted";
826
- }
827
- function frameAlignForAnchor(anchor) {
828
- if (anchor === void 0) return "center";
829
- if (anchor === "left-center" || anchor.endsWith("-left")) return "left";
830
- if (anchor === "right-center" || anchor.endsWith("-right")) return "right";
831
- return "center";
832
- }
833
- function fitBody(lines, rowBudget, contentWidth) {
834
- if (rowBudget <= 0) return lines;
835
- const bodyBudget = Math.max(1, rowBudget - 2);
836
- if (lines.length <= bodyBudget) return lines;
837
- const kept = lines.slice(0, bodyBudget - 1);
838
- const hidden = lines.length - kept.length;
839
- return [...kept, clioTheme().fg("dim", truncateToWidth(`\u2026 ${hidden} more rows`, contentWidth, "", true))];
840
- }
841
- var ClioOverlayFrame = class {
842
- constructor(child, title, footerHint, boxWidth = 0, align = "center", tone) {
843
- this.child = child;
844
- this.title = title;
845
- this.footerHint = footerHint;
846
- this.boxWidth = boxWidth;
847
- this.align = align;
848
- this.tone = tone;
849
- }
850
- child;
851
- title;
852
- footerHint;
853
- boxWidth;
854
- align;
855
- tone;
856
- /**
857
- * Rows the box may occupy, or zero while unknown.
858
- *
859
- * `Component.render` is handed a width and nothing else, so the frame learns
860
- * its height budget from the engine's `visible` predicate, which is called
861
- * with the live terminal size immediately before the render pass that
862
- * composites this overlay.
863
- */
864
- rowBudget = 0;
865
- /**
866
- * Last rendered box, keyed by everything that shapes it. `childLines` is
867
- * compared by array identity: a child that rebuilds its rows returns a fresh
868
- * array and correctly misses, and one that serves a cache returns the same
869
- * array and correctly hits.
870
- */
871
- cachedRender;
872
- setRowBudget(rows) {
873
- this.rowBudget = Math.max(0, Math.floor(rows));
874
- }
875
- render(width) {
876
- const boxWidth = Math.max(5, Math.min(this.boxWidth > 0 ? this.boxWidth : width, width));
877
- const contentWidth = Math.max(1, boxWidth - 4);
878
- const childLines = this.child.render(contentWidth);
879
- const titleText = typeof this.title === "function" ? this.title() : this.title;
880
- const hint = typeof this.footerHint === "function" ? this.footerHint(contentWidth + 2) : this.footerHint;
881
- const tone = resolveTone(this.tone);
882
- const cached = this.cachedRender;
883
- if (cached !== void 0 && cached.width === width && cached.rowBudget === this.rowBudget && cached.childLines === childLines && cached.title === titleText && cached.hint === hint && cached.tone === tone) {
884
- return cached.lines;
885
- }
886
- const label = titleText.length > 0 ? `\u2500 ${titleText} ` : "\u2500 ";
887
- const side = clioFrame("\u2502", tone ?? "frame");
888
- const boxLines = [
889
- brandedTopBorder(label, contentWidth + 2, tone),
890
- ...fitBody(childLines, this.rowBudget, contentWidth).map((line) => `${side} ${padAnsi(line, contentWidth)} ${side}`),
891
- brandedBottomBorder(contentWidth + 2, hint, tone)
892
- ];
893
- const slack = Math.max(0, width - boxWidth);
894
- const lines = (() => {
895
- if (slack === 0) return boxLines;
896
- const leading = this.align === "left" ? 0 : this.align === "right" ? slack : Math.floor(slack / 2);
897
- const lead = " ".repeat(leading);
898
- const trail = " ".repeat(slack - leading);
899
- return boxLines.map((line) => `${lead}${line}${trail}`);
900
- })();
901
- this.cachedRender = { width, rowBudget: this.rowBudget, childLines, title: titleText, hint, tone, lines };
902
- return lines;
903
- }
904
- handleInput(data) {
905
- this.child.handleInput?.(data);
906
- }
907
- invalidate() {
908
- this.cachedRender = void 0;
909
- this.child.invalidate?.();
910
- }
911
- };
912
- function showClioOverlayFrame(tui, child, options) {
913
- const { title, footerHint, tone, width, visible, maxHeight, margin, markerId, ...overlayOptions } = options;
914
- const boxWidth = typeof width === "number" ? width : 0;
915
- const frame2 = new ClioOverlayFrame(child, title, footerHint, boxWidth, frameAlignForAnchor(options.anchor), tone);
916
- const handle = tui.showOverlay(frame2, {
917
- ...overlayOptions,
918
- ...margin !== void 0 ? { margin } : {},
919
- width: "100%",
920
- visible: (termWidth, termHeight) => {
921
- const shown = visible ? visible(termWidth, termHeight) : true;
922
- const marginRows = typeof margin === "number" ? margin * 2 : (margin?.top ?? 0) + (margin?.bottom ?? 0);
923
- const available = Math.max(1, termHeight - marginRows);
924
- const requested = resolveRowSize(maxHeight, termHeight);
925
- frame2.setRowBudget(requested === null ? available : Math.min(requested, available));
926
- return shown;
927
- }
928
- });
929
- const marker = enterModal(markerId, modalMarkerSink(tui));
930
- return {
931
- hide() {
932
- marker.release();
933
- handle.hide();
934
- },
935
- setHidden(hidden) {
936
- marker.setActive(!hidden);
937
- handle.setHidden(hidden);
938
- },
939
- isHidden: () => handle.isHidden(),
940
- focus() {
941
- marker.raise();
942
- handle.focus();
943
- },
944
- // A pure passthrough on purpose. The engine hands focus to the next
945
- // visible capturing overlay, which is another modal, so the stack is
946
- // unchanged; the surface that gives the keyboard back to the composer
947
- // does it by hiding, which `setHidden` already reports.
948
- unfocus: (unfocusOptions) => unfocusOptions ? handle.unfocus(unfocusOptions) : handle.unfocus(),
949
- isFocused: () => handle.isFocused(),
950
- getBounds: () => handle.getBounds()
951
- };
952
- }
953
- function modalMarkerSink(tui) {
954
- const terminal = tui.terminal;
955
- return typeof terminal?.setTitle === "function" ? terminal : null;
956
- }
957
- function resolveRowSize(value, termHeight) {
958
- if (typeof value === "number") return Math.max(1, Math.floor(value));
959
- if (typeof value !== "string") return null;
960
- const percent = /^(\d+(?:\.\d+)?)%$/u.exec(value.trim());
961
- if (!percent?.[1]) return null;
962
- return Math.max(1, Math.floor(termHeight * Number.parseFloat(percent[1]) / 100));
963
- }
964
-
965
- // src/interactive/permission-hint.ts
966
- init_esm_shims();
967
- var MUTATION_PREVIEW_KEY = "v";
968
- function permissionHintEntries(composerHasDraft = false, inspection = "none") {
969
- return [
970
- composerHasDraft ? { key: "Backspace", verb: "clear the draft to allow", short: "clear draft", critical: true } : { key: "Enter", verb: "allow once", short: "allow", critical: true },
971
- ...inspection === "none" ? [] : inspection === "open" ? [
972
- { key: "\u2191\u2193", verb: "scroll", critical: false },
973
- { key: MUTATION_PREVIEW_KEY, verb: "hide mutation", short: "hide", critical: false }
974
- ] : [{ key: MUTATION_PREVIEW_KEY, verb: "inspect mutation", short: "inspect", critical: false }],
975
- { key: "s", verb: "stop turn", short: "stop", critical: true },
976
- // With a draft, deny and stop are the only immediate answers, so Esc
977
- // outranks the narrowing that would otherwise drop it first.
978
- { key: "Esc", verb: "deny", critical: composerHasDraft }
979
- ];
980
- }
981
-
982
- // src/interactive/clio-editor.ts
983
- var REVERSE_VIDEO_BLANK = `${String.fromCharCode(27)}[7m ${String.fromCharCode(27)}[0m`;
984
- var EMPTY_PROMPT = "Ask Clio\u2026 / for commands";
985
- var CONFIRM_PROMPT = "A parked call is waiting for your decision";
986
- var PREPARING_PROMPT = "Clio has your prompt and is preparing the turn";
987
- var COMPACTING_PROMPT = "Clio has your prompt and is compacting the context first";
988
- var MIN_HINT_WIDTH = 60;
989
- function hasScrollIndicator(line) {
990
- const stripped = stripTerminalSequences(line);
991
- return stripped.includes(GLYPH.up) || stripped.includes(GLYPH.down);
992
- }
993
- function normalizeThinkingHint(value) {
994
- return value.replace(/^think\s+/i, "").trim().toLowerCase();
995
- }
996
- function styledThinkingHint(theme, value) {
997
- const hint = normalizeThinkingHint(value);
998
- switch (hint) {
999
- case "off":
1000
- return theme.fg("dim", hint);
1001
- case "minimal":
1002
- case "low":
1003
- return theme.fg("muted", hint);
1004
- case "xhigh":
1005
- case "max":
1006
- case "on":
1007
- return theme.style("reason", hint, { bold: true });
1008
- default:
1009
- return theme.fg("reason", hint);
1010
- }
1011
- }
1012
- function styledRailLabel(theme, chrome) {
1013
- return `${theme.fg("dim", chrome.getModelLabel())} ${theme.fg("dim", "\xB7")} ${styledThinkingHint(theme, chrome.getThinkingLabel())}`;
1014
- }
1015
- function composerMode(chrome, text) {
1016
- if (chrome.isAwaitingApproval?.() ?? false) return "CONFIRM";
1017
- if (!(chrome.isStreaming?.() ?? false)) {
1018
- const preparation = chrome.getTurnPreparation?.() ?? "idle";
1019
- if (preparation === "compacting") return "COMPACTING";
1020
- if (preparation === "preparing") return "PREPARING";
1021
- return "MESSAGE";
1022
- }
1023
- const willSteer = chrome.willEnterSteer?.(text) ?? text.trim().length > 0;
1024
- return willSteer ? "STEER" : "FOLLOW-UP";
1025
- }
1026
- function lowerRailHint(theme, chrome) {
1027
- return theme.fg(
1028
- "dim",
1029
- `${chrome.getSubmitKeyLabel?.() ?? "Enter"} send \xB7 ${chrome.getNewlineKeyLabel?.() ?? "Shift+Enter"} newline`
1030
- );
1031
- }
1032
- function confirmRailHint(theme, width, hasDraft, inspection) {
1033
- return theme.fg("warning", fitHintEntries(permissionHintEntries(hasDraft, inspection), Math.max(1, width - 3)));
1034
- }
1035
- function modeToken(mode) {
1036
- if (mode === "STEER" || mode === "PREPARING" || mode === "COMPACTING") return "action";
1037
- if (mode === "CONFIRM") return "warning";
1038
- return "accentDeep";
1039
- }
1040
- function emptyPromptFor(mode) {
1041
- if (mode === "CONFIRM") return CONFIRM_PROMPT;
1042
- if (mode === "PREPARING") return PREPARING_PROMPT;
1043
- if (mode === "COMPACTING") return COMPACTING_PROMPT;
1044
- return EMPTY_PROMPT;
1045
- }
1046
- function renderEmptyPrompt(line, width, theme, text = EMPTY_PROMPT) {
1047
- const cursorAt = line.indexOf(REVERSE_VIDEO_BLANK);
1048
- if (cursorAt < 0) return line;
1049
- const afterCursorAt = cursorAt + REVERSE_VIDEO_BLANK.length;
1050
- const available = Math.max(0, width - 1);
1051
- const prompt = truncateToWidth(theme.fg("dim", text), available, "\u2026", false);
1052
- const consumed = visibleWidth(prompt);
1053
- return `${line.slice(0, afterCursorAt)}${prompt}${line.slice(afterCursorAt + consumed)}`;
1054
- }
1055
- function findBottomRail(lines, width) {
1056
- const rail = "\u2500".repeat(Math.max(0, width));
1057
- for (let index = 1; index < lines.length; index += 1) {
1058
- if (stripTerminalSequences(lines[index] ?? "") === rail) return index;
1059
- }
1060
- return -1;
1061
- }
1062
- function cursorEndsDirectoryPath(editor) {
1063
- const cursor = editor.getCursor();
1064
- const line = editor.getLines()[cursor.line] ?? "";
1065
- return line.slice(0, cursor.col).endsWith("/");
1066
- }
1067
- function remapPastedBangOffsets(before, after, offsets, markInsertedAsPasted) {
1068
- let prefix = 0;
1069
- while (prefix < before.length && prefix < after.length && before[prefix] === after[prefix]) prefix += 1;
1070
- let beforeEnd = before.length;
1071
- let afterEnd = after.length;
1072
- while (beforeEnd > prefix && afterEnd > prefix && before[beforeEnd - 1] === after[afterEnd - 1]) {
1073
- beforeEnd -= 1;
1074
- afterEnd -= 1;
1075
- }
1076
- const next = /* @__PURE__ */ new Set();
1077
- const shift = afterEnd - prefix - (beforeEnd - prefix);
1078
- for (const offset of offsets) {
1079
- if (offset < prefix) next.add(offset);
1080
- else if (offset >= beforeEnd) next.add(offset + shift);
1081
- }
1082
- if (markInsertedAsPasted) {
1083
- for (let offset = prefix; offset < afterEnd; offset += 1) {
1084
- if (after[offset] === "!") next.add(offset);
1085
- }
1086
- }
1087
- return next;
1088
- }
1089
- function startsWithPastedOperator(text, pastedBangOffsets) {
1090
- const first = text.search(/\S/u);
1091
- return first >= 0 && text[first] === "!" && pastedBangOffsets.has(first);
1092
- }
1093
- var ClioEditor = class extends Editor {
1094
- constructor(tui, chrome) {
1095
- super(tui, editorTheme(clioTheme()));
1096
- this.chrome = chrome;
1097
- }
1098
- chrome;
1099
- pastedBangOffsets = /* @__PURE__ */ new Set();
1100
- bracketedPasteActive = false;
1101
- render(width) {
1102
- const lines = super.render(width);
1103
- if (lines.length === 0) return lines;
1104
- const theme = clioTheme();
1105
- const safeWidth = Math.max(0, width);
1106
- const text = this.getText();
1107
- const mode = composerMode(this.chrome, text);
1108
- if (hasScrollIndicator(lines[0] ?? "")) {
1109
- const modeLabel = theme.style(modeToken(mode), mode, { bold: true });
1110
- lines[0] = truncateToWidth(`${modeLabel} ${lines[0] ?? ""}`, safeWidth, "", true);
1111
- } else {
1112
- lines[0] = rule(theme, safeWidth, {
1113
- left: mode,
1114
- leftToken: modeToken(mode),
1115
- right: styledRailLabel(theme, this.chrome),
1116
- fillToken: "frameStrong",
1117
- rightRaw: true,
1118
- rightTail: theme.style("frameStrong", "\u2500", { bold: true })
1119
- });
1120
- }
1121
- if (text.length === 0 && lines[1]) {
1122
- lines[1] = renderEmptyPrompt(lines[1], safeWidth, theme, emptyPromptFor(mode));
1123
- }
1124
- const bottomRail = findBottomRail(lines, safeWidth);
1125
- if (bottomRail >= 0 && mode === "CONFIRM") {
1126
- lines[bottomRail] = rule(theme, safeWidth, {
1127
- right: confirmRailHint(theme, safeWidth, text.length > 0, this.chrome.getPermissionInspection?.() ?? "none"),
1128
- fillToken: "frameStrong",
1129
- rightRaw: true,
1130
- rightTail: theme.style("frameStrong", "\u2500", { bold: true })
1131
- });
1132
- } else if (bottomRail >= 0 && safeWidth >= MIN_HINT_WIDTH) {
1133
- lines[bottomRail] = rule(theme, safeWidth, {
1134
- right: lowerRailHint(theme, this.chrome),
1135
- fillToken: "frameStrong",
1136
- rightRaw: true,
1137
- rightTail: theme.style("frameStrong", "\u2500", { bold: true })
1138
- });
1139
- }
1140
- return lines;
1141
- }
1142
- /**
1143
- * Preserve paste provenance for every immediate-send binding, including the
1144
- * alternate paths that invoke the submit controller without an Editor Enter.
1145
- */
1146
- getTextForSubmit() {
1147
- const text = this.getExpandedText();
1148
- return startsWithPastedOperator(this.getText(), this.pastedBangOffsets) ? guardPastedEditorOperator(text) : text;
1149
- }
1150
- /**
1151
- * pi-tui's bracketed-paste handling inserts pasted text (including a
1152
- * trailing newline the paste carried) without submitting: a pasted
1153
- * `/model\n` lands as two lines in the buffer and just sits there. Once
1154
- * the base handler has applied a chunk that closed a paste, check whether
1155
- * the buffer now reads as a completed slash command and, if so, submit it
1156
- * through the same handler the typed-Enter path uses.
1157
- */
1158
- handleInput(data) {
1159
- const openedPaste = data.includes("\x1B[200~");
1160
- const closedPaste = data.includes("\x1B[201~");
1161
- const pasteMutation = this.bracketedPasteActive || openedPaste;
1162
- const textBeforeInput = this.getText();
1163
- const keybindings = getKeybindings();
1164
- if (startsWithPastedOperator(textBeforeInput, this.pastedBangOffsets) && keybindings.matches(data, "tui.input.submit")) {
1165
- const pastedText = this.getTextForSubmit();
1166
- this.pastedBangOffsets.clear();
1167
- this.bracketedPasteActive = false;
1168
- super.setText(pastedText);
1169
- super.handleInput(data);
1170
- return;
1171
- }
1172
- const completingDirectory = this.isShowingAutocomplete() && (keybindings.matches(data, "tui.input.tab") || keybindings.matches(data, "tui.select.confirm"));
1173
- const textBeforeCompletion = completingDirectory ? this.getText() : "";
1174
- super.handleInput(data);
1175
- if (completingDirectory && this.getText() !== textBeforeCompletion && cursorEndsDirectoryPath(this)) {
1176
- super.handleInput(" ");
1177
- }
1178
- const textAfterInput = this.getText();
1179
- this.pastedBangOffsets = remapPastedBangOffsets(
1180
- textBeforeInput,
1181
- textAfterInput,
1182
- this.pastedBangOffsets,
1183
- pasteMutation
1184
- );
1185
- if (openedPaste) this.bracketedPasteActive = true;
1186
- if (closedPaste) this.bracketedPasteActive = false;
1187
- if (!closedPaste) return;
1188
- const text = this.getText();
1189
- if (!text.endsWith("\n")) return;
1190
- const command = text.trimEnd();
1191
- if (!command.startsWith("/")) return;
1192
- this.setText("");
1193
- this.onSubmit?.(command);
1194
- }
1195
- setText(text) {
1196
- this.pastedBangOffsets.clear();
1197
- this.bracketedPasteActive = false;
1198
- super.setText(text);
1199
- }
1200
- };
1201
-
1202
- // src/interactive/interactive-shell.ts
1203
- init_esm_shims();
1204
-
1205
- // src/interactive/render-trace.ts
1206
- init_esm_shims();
1207
- import { mkdirSync, readdirSync, rmSync, writeFileSync } from "node:fs";
1208
- import { appendFile } from "node:fs/promises";
1209
- import { dirname, join } from "node:path";
1210
- var RENDER_TRACE_VERSION = 2;
1211
- var INPUT_WEDGE_RING_CAPACITY = 256;
1212
- var INPUT_WEDGE_DUMP_DIRNAME = "input-wedge";
1213
- var INPUT_WEDGE_DUMP_RETAINED = 5;
1214
- function createRing(capacity) {
1215
- const slots = [];
1216
- let next = 0;
1217
- return {
1218
- push(value) {
1219
- if (slots.length < capacity) slots.push(value);
1220
- else slots[next] = value;
1221
- next = (next + 1) % capacity;
1222
- },
1223
- toArray() {
1224
- if (slots.length < capacity) return [...slots];
1225
- return [...slots.slice(next), ...slots.slice(0, next)];
1226
- }
1227
- };
1228
- }
1229
- function classifyInputWedge(inputIngress, frames) {
1230
- const newest = [...inputIngress].reverse().find((record) => record.visualExpected) ?? inputIngress.at(-1);
1231
- if (newest === void 0) return "no-input-recorded";
1232
- return frames.some((frame2) => frame2.inputHighWater >= newest.inputSeq) ? "input-committed" : "input-not-committed";
1233
- }
1234
- function writeInputWedgeDump(stateDir, snapshot) {
1235
- const directory = join(stateDir, INPUT_WEDGE_DUMP_DIRNAME);
1236
- mkdirSync(directory, { recursive: true });
1237
- const stamp = new Date(snapshot.atEpochMs).toISOString().replace(/[:.]/gu, "-");
1238
- const path = join(directory, `${stamp}-${snapshot.pid}.json`);
1239
- writeFileSync(path, `${JSON.stringify(snapshot, null, 2)}
1240
- `, "utf8");
1241
- try {
1242
- const existing = readdirSync(directory).filter((name) => name.endsWith(".json")).sort();
1243
- for (const name of existing.slice(0, Math.max(0, existing.length - INPUT_WEDGE_DUMP_RETAINED))) {
1244
- rmSync(join(directory, name), { force: true });
1245
- }
1246
- } catch {
1247
- }
1248
- return path;
1249
- }
1250
- function createAsyncTraceWriter(path, options = {}) {
1251
- const maxRecords = options.maxRecords ?? 4096;
1252
- const batchRecords = options.batchRecords ?? 128;
1253
- const append = options.append ?? ((target, payload) => appendFile(target, payload, "utf8"));
1254
- const recordTime = options.recordTime ?? (() => performance.now());
1255
- const appendTimeoutMs = options.appendTimeoutMs ?? 5e3;
1256
- const pending = [];
1257
- let dropped = 0;
1258
- let inFlight = false;
1259
- let scheduled = false;
1260
- let failed = false;
1261
- let closing = false;
1262
- let closePromise = null;
1263
- let resolveClose = null;
1264
- const settleClose = () => {
1265
- if (closing && !inFlight && pending.length === 0) resolveClose?.();
1266
- };
1267
- const pump = () => {
1268
- scheduled = false;
1269
- if (failed || inFlight || pending.length === 0) {
1270
- settleClose();
1271
- return;
1272
- }
1273
- inFlight = true;
1274
- const payload = pending.splice(0, batchRecords).join("");
1275
- let appendTimer = null;
1276
- const appendDeadline = new Promise((_resolve, reject) => {
1277
- appendTimer = setTimeout(() => reject(new Error("render trace append timed out")), appendTimeoutMs);
1278
- });
1279
- void Promise.race([append(path, payload), appendDeadline]).catch(() => {
1280
- failed = true;
1281
- pending.length = 0;
1282
- }).finally(() => {
1283
- if (appendTimer) clearTimeout(appendTimer);
1284
- inFlight = false;
1285
- if (pending.length > 0 && !failed) queueMicrotask(pump);
1286
- else settleClose();
1287
- });
1288
- };
1289
- const schedule = () => {
1290
- if (scheduled || inFlight || failed) return;
1291
- scheduled = true;
1292
- queueMicrotask(pump);
1293
- };
1294
- return {
1295
- enqueue(record) {
1296
- if (failed || closing) return;
1297
- if (pending.length >= maxRecords) {
1298
- pending.shift();
1299
- dropped += 1;
1300
- }
1301
- pending.push(`${JSON.stringify(record)}
1302
- `);
1303
- schedule();
1304
- },
1305
- close() {
1306
- if (closePromise) return closePromise;
1307
- if (dropped > 0 && !failed) {
1308
- pending.push(
1309
- `${JSON.stringify({ type: "trace_drop", version: RENDER_TRACE_VERSION, at: recordTime(), records: dropped })}
1310
- `
1311
- );
1312
- }
1313
- closing = true;
1314
- closePromise = new Promise((resolve) => {
1315
- resolveClose = resolve;
1316
- });
1317
- if (failed) {
1318
- pending.length = 0;
1319
- resolveClose?.();
1320
- } else {
1321
- schedule();
1322
- settleClose();
1323
- }
1324
- return closePromise;
1325
- }
1326
- };
1327
- }
1328
- function rounded(value) {
1329
- return Math.round(value * 1e3) / 1e3;
1330
- }
1331
- function graphemeCount(text) {
1332
- const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
1333
- let count = 0;
1334
- for (const _part of segmenter.segment(text)) count += 1;
1335
- return count;
1336
- }
1337
- function renderTracePath(env = process.env) {
1338
- const raw = env.CLIO_CODER_RENDER_TRACE?.trim();
1339
- return raw && raw.length > 0 ? raw : null;
1340
- }
1341
- function createRenderTrace(path, now = () => performance.now(), writerOptions = {}) {
1342
- if (path !== null) {
1343
- mkdirSync(dirname(path), { recursive: true });
1344
- writeFileSync(path, "", "utf8");
1345
- }
1346
- const openedAt = now();
1347
- const openedAtEpochMs = Date.now();
1348
- const at = () => rounded(now() - openedAt);
1349
- const writer = path === null ? null : createAsyncTraceWriter(path, { ...writerOptions, recordTime: at });
1350
- const inputRing = createRing(INPUT_WEDGE_RING_CAPACITY);
1351
- const frameRing = createRing(INPUT_WEDGE_RING_CAPACITY);
1352
- let frameSeq = 0;
1353
- let writeSeq = 0;
1354
- let eventSeq = 0;
1355
- let inputSeq = 0;
1356
- let generation = 0;
1357
- let panelHighWater = 0;
1358
- let inputHighWater = 0;
1359
- let queueDepth = 0;
1360
- let currentFrame = null;
1361
- let pendingPanel = null;
1362
- let lastCommitAt = null;
1363
- let firstCommitListener = null;
1364
- let firstCommitDelivered = false;
1365
- const ranges = /* @__PURE__ */ new Map();
1366
- const pendingDrains = /* @__PURE__ */ new Map();
1367
- writer?.enqueue({ type: "trace_start", version: RENDER_TRACE_VERSION, at: 0 });
1368
- const trace = {
1369
- recordPanelRender(metrics) {
1370
- pendingPanel = metrics;
1371
- },
1372
- beginGeneration() {
1373
- generation += 1;
1374
- ranges.clear();
1375
- },
1376
- recordVisibleEvent(fields) {
1377
- eventSeq += 1;
1378
- if (writer === null) return eventSeq;
1379
- const key = `${generation}:${fields.kind}:${fields.contentIndex}`;
1380
- const previous = ranges.get(key) ?? { codeUnits: 0, graphemes: 0 };
1381
- const graphemes = graphemeCount(fields.delta);
1382
- const next = { codeUnits: previous.codeUnits + fields.delta.length, graphemes: previous.graphemes + graphemes };
1383
- ranges.set(key, next);
1384
- writer?.enqueue({
1385
- type: "event_ingress",
1386
- version: RENDER_TRACE_VERSION,
1387
- eventSeq,
1388
- generation,
1389
- kind: fields.kind,
1390
- contentIndex: fields.contentIndex,
1391
- at: at(),
1392
- codeUnitStart: previous.codeUnits,
1393
- codeUnitEnd: next.codeUnits,
1394
- graphemeStart: previous.graphemes,
1395
- graphemeEnd: next.graphemes,
1396
- bytes: Buffer.byteLength(fields.delta, "utf8")
1397
- });
1398
- return eventSeq;
1399
- },
1400
- recordQueue(sequence, action) {
1401
- queueDepth = Math.max(0, queueDepth + (action === "admit" ? 1 : -1));
1402
- writer?.enqueue({
1403
- type: "queue",
1404
- version: RENDER_TRACE_VERSION,
1405
- eventSeq: sequence,
1406
- action,
1407
- at: at(),
1408
- depth: queueDepth
1409
- });
1410
- },
1411
- recordPanelApplied(sequence) {
1412
- panelHighWater = Math.max(panelHighWater, sequence);
1413
- writer?.enqueue({
1414
- type: "panel",
1415
- version: RENDER_TRACE_VERSION,
1416
- eventSeq: sequence,
1417
- at: at(),
1418
- highWater: panelHighWater
1419
- });
1420
- },
1421
- recordInputIngress(action, bytes, visualExpected = action !== "no-visual-change") {
1422
- inputSeq += 1;
1423
- if (visualExpected) inputHighWater = inputSeq;
1424
- const record = {
1425
- type: "input_ingress",
1426
- version: RENDER_TRACE_VERSION,
1427
- inputSeq,
1428
- action,
1429
- at: at(),
1430
- bytes,
1431
- visualExpected
1432
- };
1433
- inputRing.push(record);
1434
- writer?.enqueue(record);
1435
- return inputSeq;
1436
- },
1437
- beginFrame(fields) {
1438
- frameSeq += 1;
1439
- const frame2 = {
1440
- frameId: frameSeq,
1441
- ...fields,
1442
- beginAt: at(),
1443
- panelHighWater,
1444
- inputHighWater,
1445
- panel: pendingPanel,
1446
- phases: { component: 0, overlay: 0, normalization: 0, cursor: 0 },
1447
- commits: []
1448
- };
1449
- pendingPanel = null;
1450
- currentFrame = frame2;
1451
- return frame2;
1452
- },
1453
- endFrame(frameToken) {
1454
- const frame2 = frameToken;
1455
- const endAt = at();
1456
- const terminalEnqueueMs = frame2.commits.reduce((sum, commit) => sum + commit.enqueueMs, 0);
1457
- const measured = frame2.phases.component + frame2.phases.overlay + frame2.phases.normalization + frame2.phases.cursor + terminalEnqueueMs;
1458
- const record = {
1459
- type: "frame",
1460
- version: RENDER_TRACE_VERSION,
1461
- frameId: frame2.frameId,
1462
- mode: frame2.mode,
1463
- columns: frame2.columns,
1464
- rows: frame2.rows,
1465
- beginAt: frame2.beginAt,
1466
- endAt,
1467
- durationMs: rounded(Math.max(0, endAt - frame2.beginAt)),
1468
- sinceLastCommitMs: lastCommitAt === null || frame2.commits.length === 0 ? null : rounded(Math.max(0, (frame2.commits[0]?.at ?? endAt) - lastCommitAt)),
1469
- panelHighWater: frame2.panelHighWater,
1470
- inputHighWater: frame2.inputHighWater,
1471
- panel: frame2.panel,
1472
- pipeline: {
1473
- componentMs: rounded(frame2.phases.component),
1474
- overlayCompositionMs: rounded(frame2.phases.overlay),
1475
- normalizationMs: rounded(frame2.phases.normalization),
1476
- cursorExtractionMs: rounded(frame2.phases.cursor),
1477
- viewportDiffAnsiCursorMs: rounded(Math.max(0, endAt - frame2.beginAt - measured)),
1478
- terminalEnqueueMs: rounded(terminalEnqueueMs)
1479
- },
1480
- commits: frame2.commits
1481
- };
1482
- writer?.enqueue(record);
1483
- if (frame2.commits.length > 0) {
1484
- frameRing.push(record);
1485
- lastCommitAt = frame2.commits.at(-1)?.at ?? endAt;
1486
- if (!firstCommitDelivered) {
1487
- firstCommitDelivered = true;
1488
- firstCommitListener?.(frame2.frameId);
1489
- }
1490
- }
1491
- if (currentFrame === frame2) currentFrame = null;
1492
- },
1493
- beginPhase(_frame, _phase) {
1494
- return now();
1495
- },
1496
- endPhase(frameToken, phase, phaseToken) {
1497
- const frame2 = frameToken;
1498
- frame2.phases[phase] += Math.max(0, now() - phaseToken);
1499
- },
1500
- beginComponentRender() {
1501
- return currentFrame ? now() : null;
1502
- },
1503
- endComponentRender(token) {
1504
- if (currentFrame === null || token === null) return;
1505
- currentFrame.phases.component += Math.max(0, now() - token);
1506
- },
1507
- recordTerminalWrite(fields) {
1508
- writeSeq += 1;
1509
- const frameId = currentFrame?.frameId ?? null;
1510
- const commit = {
1511
- writeId: writeSeq,
1512
- at: at(),
1513
- bytes: fields.bytes,
1514
- enqueueMs: rounded(fields.enqueueMs),
1515
- returned: fields.returned,
1516
- backpressured: !fields.returned
1517
- };
1518
- currentFrame?.commits.push(commit);
1519
- if (writer === null) return writeSeq;
1520
- writer.enqueue({ type: "terminal_write", version: RENDER_TRACE_VERSION, frameId, ...commit });
1521
- if (!fields.returned) pendingDrains.set(writeSeq, { frameId, at: commit.at });
1522
- return writeSeq;
1523
- },
1524
- recordTerminalDrain(writeId) {
1525
- const pending = pendingDrains.get(writeId);
1526
- if (!pending) return;
1527
- pendingDrains.delete(writeId);
1528
- const drainAt = at();
1529
- writer?.enqueue({
1530
- type: "terminal_drain",
1531
- version: RENDER_TRACE_VERSION,
1532
- writeId,
1533
- frameId: pending.frameId,
1534
- at: drainAt,
1535
- waitMs: rounded(Math.max(0, drainAt - pending.at))
1536
- });
1537
- },
1538
- currentFrameId: () => currentFrame?.frameId ?? null,
1539
- onFirstFrameCommit(listener) {
1540
- firstCommitListener = listener;
1541
- },
1542
- snapshotInputWedge() {
1543
- const inputIngress = inputRing.toArray();
1544
- const frames = frameRing.toArray();
1545
- const nowAt = at();
1546
- const lastIngressAt = inputIngress.at(-1)?.at;
1547
- const lastFrame = frames.at(-1);
1548
- const lastFrameCommitAt = lastFrame?.commits.at(-1)?.at ?? lastFrame?.endAt;
1549
- return {
1550
- version: RENDER_TRACE_VERSION,
1551
- capacity: INPUT_WEDGE_RING_CAPACITY,
1552
- pid: process.pid,
1553
- openedAtEpochMs,
1554
- atEpochMs: Date.now(),
1555
- at: nowAt,
1556
- classification: classifyInputWedge(inputIngress, frames),
1557
- msSinceLastInputIngress: lastIngressAt === void 0 ? null : rounded(nowAt - lastIngressAt),
1558
- msSinceLastCommittedFrame: lastFrameCommitAt === void 0 ? null : rounded(nowAt - lastFrameCommitAt),
1559
- inputIngress,
1560
- frames
1561
- };
1562
- },
1563
- close: () => writer?.close() ?? Promise.resolve()
1564
- };
1565
- return trace;
1566
- }
1567
- function traceComponentRenders(component, trace) {
1568
- const original = component.render;
1569
- const wrapped = function(width) {
1570
- const token = trace.beginComponentRender();
1571
- try {
1572
- return original.call(this, width);
1573
- } finally {
1574
- trace.endComponentRender(token);
1575
- }
1576
- };
1577
- component.render = wrapped;
1578
- return () => {
1579
- if (component.render === wrapped) component.render = original;
1580
- };
1581
- }
1582
- function traceProcessStdout(trace, now = () => performance.now(), stdout = process.stdout) {
1583
- const original = stdout.write;
1584
- const pendingDrainWrites = [];
1585
- let drainListening = false;
1586
- const wrapped = function(...args) {
1587
- const chunk = args[0];
1588
- const start = now();
1589
- const returned = Reflect.apply(original, this, args);
1590
- const enqueueMs = Math.max(0, now() - start);
1591
- let bytes = 0;
1592
- try {
1593
- bytes = Buffer.isBuffer(chunk) ? chunk.byteLength : ArrayBuffer.isView(chunk) ? chunk.byteLength : Buffer.byteLength(String(chunk), typeof args[1] === "string" ? args[1] : "utf8");
1594
- } catch {
1595
- bytes = Buffer.byteLength(String(chunk), "utf8");
1596
- }
1597
- const writeId = trace.recordTerminalWrite({ bytes, enqueueMs, returned });
1598
- if (!returned) {
1599
- pendingDrainWrites.push(writeId);
1600
- if (!drainListening) {
1601
- drainListening = true;
1602
- stdout.once("drain", () => {
1603
- drainListening = false;
1604
- for (const pendingWriteId of pendingDrainWrites.splice(0)) trace.recordTerminalDrain(pendingWriteId);
1605
- });
1606
- }
1607
- }
1608
- return returned;
1609
- };
1610
- stdout.write = wrapped;
1611
- return () => {
1612
- if (stdout.write === wrapped) stdout.write = original;
1613
- };
1614
- }
1615
-
1616
- // src/interactive/stdout-backpressure.ts
1617
- init_esm_shims();
1618
- function installStdoutBackpressureGate(stdout = process.stdout) {
1619
- const original = stdout.write;
1620
- const listeners = /* @__PURE__ */ new Set();
1621
- let blocked = false;
1622
- let observed = false;
1623
- let restored = false;
1624
- let drainListening = false;
1625
- const notifyWritable = () => {
1626
- drainListening = false;
1627
- if (!blocked) return;
1628
- blocked = false;
1629
- for (const listener of [...listeners]) listener();
1630
- };
1631
- const listenForDrain = () => {
1632
- if (drainListening || restored) return;
1633
- drainListening = true;
1634
- stdout.once("drain", notifyWritable);
1635
- };
1636
- const wrapped = function(...args) {
1637
- const returned = Reflect.apply(original, this, args);
1638
- if (!returned) {
1639
- observed = true;
1640
- blocked = true;
1641
- listenForDrain();
1642
- }
1643
- return returned;
1644
- };
1645
- stdout.write = wrapped;
1646
- return {
1647
- get blocked() {
1648
- return blocked;
1649
- },
1650
- get observed() {
1651
- return observed;
1652
- },
1653
- onWritable(listener) {
1654
- if (restored || !blocked) {
1655
- queueMicrotask(listener);
1656
- return () => {
1657
- };
1658
- }
1659
- listeners.add(listener);
1660
- return () => listeners.delete(listener);
1661
- },
1662
- whenWritable(timeoutMs) {
1663
- if (restored || !blocked) return Promise.resolve(true);
1664
- return new Promise((resolve) => {
1665
- let timer;
1666
- const release = this.onWritable(() => {
1667
- if (timer) clearTimeout(timer);
1668
- release();
1669
- resolve(true);
1670
- });
1671
- if (timeoutMs !== void 0 && Number.isFinite(timeoutMs) && timeoutMs >= 0) {
1672
- timer = setTimeout(() => {
1673
- release();
1674
- resolve(false);
1675
- }, timeoutMs);
1676
- }
1677
- });
1678
- },
1679
- restore() {
1680
- if (restored) return;
1681
- restored = true;
1682
- blocked = false;
1683
- if (drainListening) {
1684
- stdout.off("drain", notifyWritable);
1685
- drainListening = false;
1686
- }
1687
- if (stdout.write === wrapped) stdout.write = original;
1688
- for (const listener of [...listeners]) listener();
1689
- listeners.clear();
1690
- }
1691
- };
1692
- }
1693
-
1694
- // src/interactive/interactive-shell.ts
1695
- var KEEP_ALIVE_INTERVAL_MS = 1 << 30;
1696
- function createInteractiveShell(deps) {
1697
- const terminal = deps.createTerminal();
1698
- const tui = deps.createTui(terminal);
1699
- const scheduleInterval = deps.scheduleInterval ?? ((callback, intervalMs) => setInterval(callback, intervalMs));
1700
- const clearScheduledInterval = deps.clearScheduledInterval ?? ((handle) => clearInterval(handle));
1701
- let mounted = false;
1702
- let keepAlive = null;
1703
- let resolveRun = null;
1704
- let run = null;
1705
- let completedCode = null;
1706
- let stopped = false;
1707
- let stopSettlement = null;
1708
- return {
1709
- terminal,
1710
- tui,
1711
- mount(root, focus) {
1712
- if (mounted) return;
1713
- mounted = true;
1714
- deps.prepareRoot?.(root);
1715
- tui.addChild(root);
1716
- if (tui.mode === "fullscreen") tui.setLayoutRoot?.(root);
1717
- tui.setFocus(focus);
1718
- tui.start();
1719
- },
1720
- anchor() {
1721
- if (run) return run;
1722
- run = new Promise((resolve) => {
1723
- resolveRun = resolve;
1724
- if (completedCode !== null) resolve(completedCode);
1725
- });
1726
- keepAlive = scheduleInterval(() => {
1727
- }, KEEP_ALIVE_INTERVAL_MS);
1728
- return run;
1729
- },
1730
- releaseAnchor() {
1731
- if (!keepAlive) return;
1732
- clearScheduledInterval(keepAlive);
1733
- keepAlive = null;
1734
- },
1735
- stop() {
1736
- if (stopped) return;
1737
- stopped = true;
1738
- try {
1739
- tui.stop();
1740
- } catch {
1741
- } finally {
1742
- try {
1743
- stopSettlement = Promise.resolve(deps.onStop?.()).then(() => void 0);
1744
- } catch {
1745
- stopSettlement = Promise.resolve();
1746
- }
1747
- }
1748
- },
1749
- async commitCurrentFrame() {
1750
- if (!tui.renderNow) {
1751
- tui.requestRender();
1752
- return null;
1753
- }
1754
- tui.renderNow(false);
1755
- return null;
1756
- },
1757
- hasObservedBackpressure: () => false,
1758
- setStreamPacingActive: () => {
1759
- },
1760
- settle() {
1761
- return stopSettlement ?? Promise.resolve();
1762
- },
1763
- nextCommittedFrame() {
1764
- return Promise.resolve(null);
1765
- },
1766
- complete(code) {
1767
- if (completedCode !== null) return;
1768
- completedCode = code;
1769
- resolveRun?.(code);
1770
- }
1771
- };
1772
- }
1773
- var activeRenderTrace = null;
1774
- function getActiveRenderTrace() {
1775
- return activeRenderTrace;
1776
- }
1777
- async function settleLatestInteractiveFrame(gate, timeoutMs, renderFrame) {
1778
- const writableBeforeRender = gate ? await gate.whenWritable(timeoutMs) : true;
1779
- const frameId = await renderFrame();
1780
- if (writableBeforeRender && gate) await gate.whenWritable(timeoutMs);
1781
- return frameId;
1782
- }
1783
- function createProcessInteractiveShell(options = {}) {
1784
- const tracePath = renderTracePath();
1785
- let restoreStdout = null;
1786
- let restoreFirstFrameStdout = null;
1787
- let restoreRoot = null;
1788
- let backpressure = null;
1789
- let observedBackpressure = false;
1790
- let candidate = null;
1791
- try {
1792
- candidate = createRenderTrace(tracePath);
1793
- restoreStdout = traceProcessStdout(candidate);
1794
- activeRenderTrace = candidate;
1795
- } catch {
1796
- restoreStdout?.();
1797
- restoreStdout = null;
1798
- void candidate?.close().catch(() => {
1799
- });
1800
- activeRenderTrace = null;
1801
- }
1802
- const trace = activeRenderTrace;
1803
- if (trace && options.onFirstFrameCommit) trace.onFirstFrameCommit(options.onFirstFrameCommit);
1804
- let firstFrameDelivered = false;
1805
- let firstFrameSeq = 0;
1806
- let firstFrameActive = false;
1807
- let firstFrameWrote = false;
1808
- if (!trace && options.onFirstFrameCommit) {
1809
- const stdout = process.stdout;
1810
- const original = stdout.write;
1811
- const wrapped = function(...args) {
1812
- const returned = Reflect.apply(original, this, args);
1813
- if (firstFrameActive) firstFrameWrote = true;
1814
- return returned;
1815
- };
1816
- stdout.write = wrapped;
1817
- restoreFirstFrameStdout = () => {
1818
- if (stdout.write === wrapped) stdout.write = original;
1819
- };
1820
- }
1821
- const firstFrameOnlyObserver = {
1822
- isEnabled: () => !firstFrameDelivered,
1823
- beginFrame: () => {
1824
- firstFrameSeq += 1;
1825
- firstFrameActive = true;
1826
- firstFrameWrote = false;
1827
- return firstFrameSeq;
1828
- },
1829
- endFrame: (frame2) => {
1830
- firstFrameActive = false;
1831
- if (firstFrameDelivered || !firstFrameWrote) return;
1832
- firstFrameDelivered = true;
1833
- options.onFirstFrameCommit?.(frame2);
1834
- restoreFirstFrameStdout?.();
1835
- restoreFirstFrameStdout = null;
1836
- },
1837
- beginPhase: () => null,
1838
- endPhase: () => {
1839
- }
1840
- };
1841
- const primaryObserver = trace ?? (options.onFirstFrameCommit ? firstFrameOnlyObserver : null);
1842
- let committedFrameSequence = 0;
1843
- const frameWaiters = [];
1844
- const renderObserver = {
1845
- isEnabled: () => frameWaiters.length > 0 || primaryObserver !== null && (primaryObserver.isEnabled?.() ?? true),
1846
- beginFrame: (fields) => ({
1847
- primary: primaryObserver?.beginFrame(fields),
1848
- primaryActive: primaryObserver !== null && (primaryObserver.isEnabled?.() ?? true),
1849
- frameId: ++committedFrameSequence
1850
- }),
1851
- endFrame: (token) => {
1852
- const frame2 = token;
1853
- if (frame2.primaryActive) primaryObserver?.endFrame(frame2.primary);
1854
- for (const waiter of frameWaiters.splice(0)) waiter.resolve(frame2.frameId);
1855
- },
1856
- beginPhase: (token, phase) => {
1857
- const frame2 = token;
1858
- return frame2.primaryActive ? primaryObserver?.beginPhase(frame2.primary, phase) : null;
1859
- },
1860
- endPhase: (token, phase, phaseToken) => {
1861
- const frame2 = token;
1862
- if (frame2.primaryActive) primaryObserver?.endPhase(frame2.primary, phase, phaseToken);
1863
- }
1864
- };
1865
- const renderAdmission = {
1866
- get blocked() {
1867
- return backpressure?.blocked ?? false;
1868
- },
1869
- onWritable(listener) {
1870
- if (backpressure) return backpressure.onWritable(listener);
1871
- queueMicrotask(listener);
1872
- return () => {
1873
- };
1874
- }
1875
- };
1876
- const setStreamPacingActive = (active) => {
1877
- if (active) {
1878
- backpressure ??= installStdoutBackpressureGate();
1879
- return;
1880
- }
1881
- if (!backpressure) return;
1882
- observedBackpressure ||= backpressure.observed;
1883
- backpressure.restore();
1884
- backpressure = null;
1885
- };
1886
- let instrumentationCleanupStarted = false;
1887
- let instrumentationCleanupPromise = Promise.resolve();
1888
- const cleanupInstrumentation = () => {
1889
- if (instrumentationCleanupStarted) return instrumentationCleanupPromise;
1890
- instrumentationCleanupStarted = true;
1891
- const errors = [];
1892
- const attempt = (operation) => {
1893
- try {
1894
- operation();
1895
- } catch (error) {
1896
- errors.push(error);
1897
- }
1898
- };
1899
- attempt(() => setStreamPacingActive(false));
1900
- attempt(() => restoreRoot?.());
1901
- restoreRoot = null;
1902
- attempt(() => restoreStdout?.());
1903
- restoreStdout = null;
1904
- attempt(() => restoreFirstFrameStdout?.());
1905
- restoreFirstFrameStdout = null;
1906
- if (activeRenderTrace === trace) activeRenderTrace = null;
1907
- instrumentationCleanupPromise = (async () => {
1908
- if (trace) {
1909
- try {
1910
- await trace.close();
1911
- } catch (error) {
1912
- errors.push(error);
1913
- }
1914
- }
1915
- if (errors.length > 0) throw new AggregateError(errors, "interactive shell instrumentation cleanup failed");
1916
- })();
1917
- return instrumentationCleanupPromise;
1918
- };
1919
- let shell;
1920
- try {
1921
- setStreamPacingActive(options.streamPacingActive === true);
1922
- shell = createInteractiveShell({
1923
- createTerminal: options.testing?.createTerminal ?? (() => new ProcessTerminal()),
1924
- createTui: (terminal) => options.testing?.createTui?.(terminal) ?? (options.tuiMode === "fullscreen" ? new InstrumentedTuiAltScreen(terminal, renderObserver, void 0, void 0, void 0, renderAdmission) : new InstrumentedTuiMainScreen(terminal, renderObserver, void 0, void 0, renderAdmission)),
1925
- prepareRoot: (root) => {
1926
- if (trace) restoreRoot = traceComponentRenders(root, trace);
1927
- },
1928
- onStop: cleanupInstrumentation
1929
- });
1930
- } catch (error) {
1931
- void cleanupInstrumentation().catch(() => {
1932
- });
1933
- throw error;
1934
- }
1935
- return {
1936
- ...shell,
1937
- nextCommittedFrame() {
1938
- return new Promise((resolve) => {
1939
- frameWaiters.push({ resolve });
1940
- });
1941
- },
1942
- async commitCurrentFrame(timeoutMs = 3e4) {
1943
- return await settleLatestInteractiveFrame(backpressure, timeoutMs, async () => {
1944
- const tui = shell.tui;
1945
- const waiter = { resolve: () => {
1946
- } };
1947
- const frame2 = new Promise((resolve) => {
1948
- waiter.resolve = resolve;
1949
- frameWaiters.push(waiter);
1950
- });
1951
- try {
1952
- tui.renderNow(false);
1953
- } catch (error) {
1954
- const index = frameWaiters.indexOf(waiter);
1955
- if (index >= 0) frameWaiters.splice(index, 1);
1956
- throw error;
1957
- }
1958
- return await frame2;
1959
- });
1960
- },
1961
- hasObservedBackpressure: () => observedBackpressure || backpressure?.observed === true,
1962
- setStreamPacingActive
1963
- };
1964
- }
1965
-
1966
- // src/interactive/keybinding-manager.ts
1967
- init_esm_shims();
1968
-
1969
- // src/domains/config/keybindings.ts
1970
- init_esm_shims();
1971
- var CLIO_APP_KEYBINDINGS = {
1972
- "clio-coder.thinking.cycle": {
1973
- defaultKeys: "shift+tab",
1974
- description: "Cycle orchestrator thinking level"
1975
- },
1976
- "clio-coder.exit": {
1977
- defaultKeys: "ctrl+d",
1978
- description: "Exit when the editor is empty"
1979
- },
1980
- "clio-coder.status.toggle": {
1981
- defaultKeys: "alt+u",
1982
- description: "Toggle the footer dashboard (compact / expanded)"
1983
- },
1984
- "clio-coder.session.tree": {
1985
- defaultKeys: "alt+t",
1986
- description: "Open the /tree navigator"
1987
- },
1988
- "clio-coder.dispatchBoard.toggle": {
1989
- defaultKeys: "alt+w",
1990
- description: "Toggle the dispatch (workers) board overlay"
1991
- },
1992
- "clio-coder.files.toggle": {
1993
- // Alt+F is a pi-tui editor reserve (word-forward), so the files pane
1994
- // takes the next letter that reads as "explorer" and stays inside the
1995
- // Alt+<letter> scheme, which also earns it the Ctrl+G leader fallback.
1996
- defaultKeys: "alt+e",
1997
- description: "Toggle the files pane beside the session (a --with-panes session inside herdr)"
1998
- },
1999
- "clio-coder.tasks.open": {
2000
- // Approved application-boundary override of pi-tui editor word-back.
2001
- defaultKeys: "alt+b",
2002
- description: "Open the composite session and operator task board"
2003
- },
2004
- "clio-coder.decisions.open": {
2005
- // Approved application-boundary override of pi-tui editor word-delete.
2006
- defaultKeys: "alt+d",
2007
- description: "Open the settled interview decision board"
2008
- },
2009
- "clio-coder.dispatch.background": {
2010
- // Ctrl+B alone is pi-tui's editor cursor-left, so the Claude Code chord
2011
- // cannot be the primary here. Alt+S ("send to background") keeps the app
2012
- // scheme and earns the Ctrl+G leader fallback, which only alt+<letter>
2013
- // bindings get; Ctrl+Alt+B stays for the b-for-background muscle memory.
2014
- defaultKeys: ["alt+s", "ctrl+alt+b"],
2015
- description: "Send the running attached dispatch to the background as a detached batch"
2016
- },
2017
- "clio-coder.model.select": {
2018
- defaultKeys: "alt+l",
2019
- description: "Open the model + targets selector"
2020
- },
2021
- "clio-coder.model.cycleForward": {
2022
- defaultKeys: "alt+j",
2023
- description: "Cycle to next scoped model"
2024
- },
2025
- "clio-coder.model.cycleBackward": {
2026
- defaultKeys: "alt+k",
2027
- description: "Cycle to previous scoped model"
2028
- },
2029
- "clio-coder.output.cycle": {
2030
- defaultKeys: "alt+o",
2031
- description: "Cycle output style: Compact, Standard, Detailed"
2032
- },
2033
- "clio-coder.editor.external": {
2034
- defaultKeys: "alt+g",
2035
- description: "Open the current input in an external editor"
2036
- },
2037
- "clio-coder.message.followUp": {
2038
- defaultKeys: "alt+enter",
2039
- description: "End of turn: queue the current input for delivery when the active run settles (Enter delivers it at the next slot, between tool batches)"
2040
- },
2041
- "clio-coder.message.interrupt": {
2042
- // Alt+I keeps the app scheme and earns the Ctrl+G leader fallback. A
2043
- // Ctrl+Enter chord was rejected because legacy terminals send it as a
2044
- // plain Enter, which would turn every send into a cancel.
2045
- defaultKeys: "alt+i",
2046
- description: "Interrupt: cancel the active run and deliver the current input now (refused while an attached dispatch runs or a permission ask is parked; the input then queues for the next slot)"
2047
- },
2048
- "clio-coder.message.dequeue": {
2049
- defaultKeys: "alt+up",
2050
- description: "Restore queued steering and follow-up messages to the editor"
2051
- },
2052
- "clio-coder.notifications.dismiss": {
2053
- defaultKeys: "alt+x",
2054
- description: "Dismiss footer notifications"
2055
- },
2056
- "clio-coder.leader": {
2057
- defaultKeys: "ctrl+g",
2058
- description: "Start portable leader-key fallback for Alt shortcuts"
2059
- }
2060
- };
2061
- var CLIO_KEYBINDINGS = {
2062
- ...TUI_KEYBINDINGS,
2063
- "tui.editor.historyPrevious": {
2064
- ...TUI_KEYBINDINGS["tui.editor.historyPrevious"],
2065
- defaultKeys: "ctrl+p"
2066
- },
2067
- "tui.editor.historyNext": {
2068
- ...TUI_KEYBINDINGS["tui.editor.historyNext"],
2069
- defaultKeys: "ctrl+n"
2070
- },
2071
- ...CLIO_APP_KEYBINDINGS
2072
- };
2073
- var CLIO_APP_KEYBINDING_IDS = Object.keys(CLIO_APP_KEYBINDINGS);
2074
-
2075
- // src/interactive/keybinding-manager.ts
2076
- var BASE_SPECIAL_KEYS = /* @__PURE__ */ new Set([
2077
- "escape",
2078
- "esc",
2079
- "enter",
2080
- "return",
2081
- "tab",
2082
- "space",
2083
- "backspace",
2084
- "delete",
2085
- "insert",
2086
- "clear",
2087
- "home",
2088
- "end",
2089
- "pageup",
2090
- "pagedown",
2091
- "up",
2092
- "down",
2093
- "left",
2094
- "right",
2095
- "f1",
2096
- "f2",
2097
- "f3",
2098
- "f4",
2099
- "f5",
2100
- "f6",
2101
- "f7",
2102
- "f8",
2103
- "f9",
2104
- "f10",
2105
- "f11",
2106
- "f12"
2107
- ]);
2108
- var BASE_SYMBOL_KEYS = /* @__PURE__ */ new Set([
2109
- "`",
2110
- "-",
2111
- "=",
2112
- "[",
2113
- "]",
2114
- "\\",
2115
- ";",
2116
- "'",
2117
- ",",
2118
- ".",
2119
- "/",
2120
- "!",
2121
- "@",
2122
- "#",
2123
- "$",
2124
- "%",
2125
- "^",
2126
- "&",
2127
- "*",
2128
- "(",
2129
- ")",
2130
- "_",
2131
- "+",
2132
- "|",
2133
- "~",
2134
- "{",
2135
- "}",
2136
- ":",
2137
- "<",
2138
- ">",
2139
- "?"
2140
- ]);
2141
- var MODIFIERS = /* @__PURE__ */ new Set(["ctrl", "shift", "alt", "super"]);
2142
- function isValidKeyId(keyId) {
2143
- if (typeof keyId !== "string" || keyId.length === 0) return false;
2144
- const parts = keyId.toLowerCase().split("+");
2145
- if (parts.length === 0) return false;
2146
- const base = parts[parts.length - 1];
2147
- if (!base) return false;
2148
- const mods = parts.slice(0, -1);
2149
- const seen = /* @__PURE__ */ new Set();
2150
- for (const mod of mods) {
2151
- if (!MODIFIERS.has(mod)) return false;
2152
- if (seen.has(mod)) return false;
2153
- seen.add(mod);
2154
- }
2155
- if (base.length === 1) {
2156
- const ch = base.charCodeAt(0);
2157
- const isLetter = ch >= 97 && ch <= 122;
2158
- const isDigit = ch >= 48 && ch <= 57;
2159
- return isLetter || isDigit || BASE_SYMBOL_KEYS.has(base);
2160
- }
2161
- return BASE_SPECIAL_KEYS.has(base);
2162
- }
2163
- function validateKeybindings(raw) {
2164
- const valid = {};
2165
- const invalid = [];
2166
- for (const [id, value] of Object.entries(raw)) {
2167
- if (typeof value === "string") {
2168
- if (value.length === 0) continue;
2169
- if (isValidKeyId(value)) {
2170
- valid[id] = value;
2171
- } else {
2172
- invalid.push({ id, keys: [value] });
2173
- }
2174
- continue;
2175
- }
2176
- if (Array.isArray(value)) {
2177
- const accepted = [];
2178
- const rejected = [];
2179
- for (const entry of value) {
2180
- if (typeof entry !== "string" || entry.length === 0) continue;
2181
- if (isValidKeyId(entry)) {
2182
- accepted.push(entry);
2183
- } else {
2184
- rejected.push(entry);
2185
- }
2186
- }
2187
- if (accepted.length > 0) valid[id] = accepted;
2188
- if (rejected.length > 0) invalid.push({ id, keys: rejected });
2189
- }
2190
- }
2191
- return { valid, invalid };
2192
- }
2193
- function formatInvalidKeybindingNotice(invalid) {
2194
- const count = invalid.reduce((sum, entry) => sum + entry.keys.length, 0);
2195
- const detail = invalid.flatMap((entry) => entry.keys.map((key) => `${entry.id}="${key}"`)).join(", ");
2196
- return `Clio Coder: ${count} invalid keybinding${count === 1 ? "" : "s"} in settings.yaml (defaults kept): ${detail}. Fix settings.yaml or run \`clio-coder doctor\`.
2197
- `;
2198
- }
2199
- function envValue(env, key) {
2200
- return env[key]?.trim() ?? "";
2201
- }
2202
- function detectTerminalKeySupport(env = process.env) {
2203
- const term = envValue(env, "TERM");
2204
- const termProgram = envValue(env, "TERM_PROGRAM");
2205
- const kittyWindow = envValue(env, "KITTY_WINDOW_ID");
2206
- const normalized = `${term} ${termProgram}`.toLowerCase();
2207
- if (kittyWindow.length > 0 || normalized.includes("xterm-kitty") || normalized.includes("kitty")) {
2208
- return { name: "kitty", supportsCsiU: true, reason: "Kitty keyboard protocol detected", altLetterMode: "meta" };
2209
- }
2210
- if (normalized.includes("wezterm") || normalized.includes("ghostty")) {
2211
- return {
2212
- name: termProgram || term || "modern terminal",
2213
- supportsCsiU: true,
2214
- reason: "CSI-u capable terminal",
2215
- altLetterMode: "meta"
2216
- };
2217
- }
2218
- if (termProgram === "Apple_Terminal") {
2219
- return {
2220
- name: termProgram,
2221
- supportsCsiU: false,
2222
- reason: "Terminal.app sends Option-letter as composed text unless Use Option as Meta key is enabled",
2223
- altLetterMode: "text"
2224
- };
2225
- }
2226
- if (termProgram === "iTerm.app") {
2227
- return {
2228
- name: termProgram,
2229
- supportsCsiU: true,
2230
- reason: "iTerm2 reports modified keys as Meta or CSI-u",
2231
- altLetterMode: "meta"
2232
- };
2233
- }
2234
- if (termProgram.toLowerCase() === "vscode") {
2235
- return {
2236
- name: "vscode",
2237
- supportsCsiU: false,
2238
- reason: "VS Code terminal does not reliably emit CSI-u",
2239
- altLetterMode: "meta",
2240
- ideReservedKeys: ["ctrl+p", "shift+ctrl+p", "ctrl+l"]
2241
- };
2242
- }
2243
- if (term.startsWith("screen") || term.startsWith("tmux")) {
2244
- return { name: term, supportsCsiU: false, reason: "terminal multiplexer may block CSI-u", altLetterMode: "meta" };
2245
- }
2246
- return {
2247
- name: termProgram || term || "legacy terminal",
2248
- supportsCsiU: false,
2249
- reason: "CSI-u support not detected",
2250
- altLetterMode: "meta"
2251
- };
2252
- }
2253
- function keyRequiresCsiU(keyId) {
2254
- const parts = keyId.toLowerCase().split("+");
2255
- if (parts.length < 3) return false;
2256
- const base = parts[parts.length - 1] ?? "";
2257
- const modifiers = new Set(parts.slice(0, -1));
2258
- if (!modifiers.has("shift") || !modifiers.has("ctrl")) return false;
2259
- if (base.length !== 1) return false;
2260
- const code = base.charCodeAt(0);
2261
- const isLetter = code >= 97 && code <= 122;
2262
- const isDigit = code >= 48 && code <= 57;
2263
- return isLetter || isDigit || BASE_SYMBOL_KEYS.has(base);
2264
- }
2265
- function normalizeBindingValue(value) {
2266
- if (value === void 0) return [];
2267
- return (Array.isArray(value) ? value : [value]).map(String);
2268
- }
2269
- function defaultBindingValue(id) {
2270
- const value = CLIO_APP_KEYBINDINGS[id].defaultKeys;
2271
- return normalizeBindingValue(value);
2272
- }
2273
- function normalizeKeyForRisk(keyId) {
2274
- return keyId.toLowerCase().replace(/^ctrl\+shift\+/, "shift+ctrl+");
2275
- }
2276
- function altLetterBase(keyId) {
2277
- const parts = keyId.toLowerCase().split("+");
2278
- if (parts.length !== 2 || parts[0] !== "alt") return null;
2279
- const base = parts[1] ?? "";
2280
- return base.length === 1 && base >= "a" && base <= "z" ? base : null;
2281
- }
2282
- function keyUsesAltLetter(keyId) {
2283
- return altLetterBase(keyId) !== null;
2284
- }
2285
- function terminalReservedReason(keyId) {
2286
- const key = normalizeKeyForRisk(keyId);
2287
- if (key === "ctrl+s" || key === "ctrl+q") return "terminal flow control may intercept this chord";
2288
- if (key === "ctrl+z") return "shell job control may suspend the process";
2289
- return null;
2290
- }
2291
- function keyRiskReason(keyId, support) {
2292
- const key = normalizeKeyForRisk(keyId);
2293
- if (!support.supportsCsiU && keyRequiresCsiU(key)) return `needs CSI-u; ${support.reason}`;
2294
- if (support.altLetterMode === "text" && keyUsesAltLetter(key)) return support.reason;
2295
- if (support.ideReservedKeys?.map(normalizeKeyForRisk).includes(key)) return `${support.name} may reserve this chord`;
2296
- return terminalReservedReason(key);
2297
- }
2298
- var MACOS_OPTION_DEFAULT_WARNING_ID = "clio.macos.option-letter.defaults";
2299
- function detectPlatformKeybindingWarnings(userBindings, support = detectTerminalKeySupport()) {
2300
- const warnings = [];
2301
- const macosDefaultAltKeys = [];
2302
- for (const id of CLIO_APP_KEYBINDING_IDS) {
2303
- const userValue = userBindings[id];
2304
- const source = userValue === void 0 ? "default" : "user";
2305
- const keys = userValue === void 0 ? defaultBindingValue(id) : normalizeBindingValue(userValue);
2306
- const risky = keys.filter((key) => keyRiskReason(key, support) !== null);
2307
- if (risky.length === 0) continue;
2308
- const firstReason = keyRiskReason(risky[0] ?? "", support) ?? support.reason;
2309
- if (source === "default" && support.name === "Apple_Terminal" && risky.every(keyUsesAltLetter)) {
2310
- macosDefaultAltKeys.push(...risky);
2311
- continue;
2312
- }
2313
- warnings.push({ id, keys: risky, terminal: support.name, reason: firstReason, source });
2314
- }
2315
- if (macosDefaultAltKeys.length > 0) {
2316
- warnings.unshift({
2317
- id: MACOS_OPTION_DEFAULT_WARNING_ID,
2318
- keys: [...new Set(macosDefaultAltKeys)],
2319
- terminal: support.name,
2320
- reason: support.reason,
2321
- source: "default"
2322
- });
2323
- }
2324
- return warnings;
2325
- }
2326
- function isMacosOptionDefaultWarning(warning) {
2327
- return warning.id === MACOS_OPTION_DEFAULT_WARNING_ID;
2328
- }
2329
- function formatPlatformKeybindingNotice(warnings) {
2330
- const macosOption = warnings.find(isMacosOptionDefaultWarning);
2331
- if (macosOption && warnings.length === 1) {
2332
- const keys = macosOption.keys.map((key) => {
2333
- const base = altLetterBase(key);
2334
- return base ? `Alt+${base.toUpperCase()}` : key;
2335
- }).join(", ");
2336
- return `Clio keybinding notice: Terminal.app may not send Option-letter shortcuts by default (${keys}). Enable Use Option as Meta key in Settings \u25B8 Profiles \u25B8 Keyboard for native Alt, or use Ctrl+G then the shortcut letter, slash commands (/help lists commands), and /help.
2337
- `;
2338
- }
2339
- const count = warnings.reduce((sum, entry) => sum + entry.keys.length, 0);
2340
- const detail = warnings.flatMap((entry) => entry.keys.map((key) => `${entry.id}="${key}" (${entry.source}, ${entry.reason})`)).join(", ");
2341
- return `Clio keybinding notice: ${count} keybinding${count === 1 ? "" : "s"} may not fire reliably in this terminal: ${detail}. Rebind in settings.yaml or inspect /help.
2342
- `;
2343
- }
2344
- function joinKeys(keys) {
2345
- if (keys.length === 0) return "(unbound)";
2346
- if (keys.length === 1) return String(keys[0]);
2347
- return keys.join(" / ");
2348
- }
2349
- function deriveLeaderTargets(inner) {
2350
- const targets = [];
2351
- for (const id of CLIO_APP_KEYBINDING_IDS) {
2352
- for (const key of inner.getKeys(id)) {
2353
- const base = altLetterBase(String(key));
2354
- if (base) targets.push({ key: base, id });
2355
- }
2356
- }
2357
- return targets;
2358
- }
2359
- function buildManager(inner, invalid, platformWarnings) {
2360
- const frozen = invalid.map((entry) => ({ id: entry.id, keys: [...entry.keys] }));
2361
- const frozenPlatformWarnings = platformWarnings.map((entry) => ({
2362
- id: entry.id,
2363
- keys: [...entry.keys],
2364
- terminal: entry.terminal,
2365
- reason: entry.reason,
2366
- source: entry.source
2367
- }));
2368
- const frozenLeaderTargets = deriveLeaderTargets(inner).map((entry) => ({ ...entry }));
2369
- return {
2370
- matches(data, id) {
2371
- return inner.matches(data, id);
2372
- },
2373
- getKeys(id) {
2374
- return inner.getKeys(id);
2375
- },
2376
- getDescription(id) {
2377
- return inner.getDefinition(id).description ?? "";
2378
- },
2379
- getConflicts() {
2380
- return inner.getConflicts();
2381
- },
2382
- overrideCount() {
2383
- return Object.keys(inner.getUserBindings()).length;
2384
- },
2385
- invalidCount() {
2386
- return frozen.reduce((sum, entry) => sum + entry.keys.length, 0);
2387
- },
2388
- invalidBindings() {
2389
- return frozen;
2390
- },
2391
- platformWarnings() {
2392
- return frozenPlatformWarnings;
2393
- },
2394
- leaderTargets() {
2395
- return frozenLeaderTargets;
2396
- },
2397
- hotkeyEntries() {
2398
- const userBindings = inner.getUserBindings();
2399
- return CLIO_APP_KEYBINDING_IDS.map((id) => ({
2400
- id,
2401
- keys: joinKeys(inner.getKeys(id)),
2402
- description: inner.getDefinition(id).description ?? "",
2403
- source: userBindings[id] === void 0 ? "default" : "user"
2404
- }));
2405
- }
2406
- };
2407
- }
2408
- function createKeybindingManager(settings, env = process.env) {
2409
- const { valid, invalid } = validateKeybindings(settings.interface.keybindings ?? {});
2410
- const inner = new KeybindingsManager(CLIO_KEYBINDINGS, valid);
2411
- setKeybindings(inner);
2412
- return buildManager(inner, invalid, detectPlatformKeybindingWarnings(valid, detectTerminalKeySupport(env)));
2413
- }
2414
-
2415
- export {
2416
- SelectList,
2417
- createAgentProgress,
2418
- CombinedAutocompleteProvider,
2419
- Container,
2420
- fuzzyFilter,
2421
- getKeybindings,
2422
- Input,
2423
- isKeyRelease,
2424
- Markdown,
2425
- Marked,
2426
- matchesKey,
2427
- ScrollView,
2428
- stripTerminalSequences,
2429
- Text,
2430
- truncateToWidth,
2431
- VStack,
2432
- visibleWidth,
2433
- wrapTextWithAnsi,
2434
- unguardPastedEditorOperator,
2435
- parseEditorBashCommand,
2436
- bashExecutionEntryInput,
2437
- SGR_RESET,
2438
- SGR_DIM,
2439
- fgSequence,
2440
- isClioToken,
2441
- paintHex,
2442
- GLYPH,
2443
- spinnerFrame,
2444
- brandMark,
2445
- dotSep,
2446
- barSep,
2447
- sectionTag,
2448
- screenTitle,
2449
- listGroupHeader,
2450
- joinChips,
2451
- joinSections,
2452
- markdownTheme,
2453
- selectListTheme,
2454
- abbreviateModelId,
2455
- formatTargetLabel,
2456
- formatCompactMs,
2457
- formatContextPercent,
2458
- collapseHomePath,
2459
- padAnsi,
2460
- fitUnits,
2461
- rule,
2462
- frame,
2463
- innerDivider,
2464
- clioTheme,
2465
- DEFAULT_SELECT_THEME,
2466
- FocusBox,
2467
- clioError,
2468
- fitHintEntries,
2469
- FILTER_HINT,
2470
- buildHint,
2471
- buildResponsiveHint,
2472
- formatRuntimeResolutionDiagnostic,
2473
- diagnosticSeverityToken,
2474
- showClioOverlayFrame,
2475
- MUTATION_PREVIEW_KEY,
2476
- permissionHintEntries,
2477
- ClioEditor,
2478
- writeInputWedgeDump,
2479
- getActiveRenderTrace,
2480
- createProcessInteractiveShell,
2481
- validateKeybindings,
2482
- formatInvalidKeybindingNotice,
2483
- detectTerminalKeySupport,
2484
- detectPlatformKeybindingWarnings,
2485
- formatPlatformKeybindingNotice,
2486
- createKeybindingManager
2487
- };
2488
- //# sourceMappingURL=chunk-VANN3GDP.js.map