@iowarp/clio-coder 0.4.9 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +11 -3
- package/CHANGELOG.md +153 -0
- package/CODE_OF_CONDUCT.md +10 -0
- package/CONTRIBUTING.md +208 -382
- package/NOTICE +8 -2
- package/README.md +199 -418
- package/ROADMAP.md +82 -0
- package/SECURITY.md +14 -11
- package/dist/acp-KS7ARGV6.js +132 -0
- package/dist/agents-YOGJ2YEJ.js +163 -0
- package/dist/assets/codewiki.json +1 -1
- package/dist/auth-CEDCO6O6.js +557 -0
- package/dist/background-YWTBPSQU.js +39 -0
- package/dist/builtins-GDYO4RTR.js +23 -0
- package/dist/chunk-27YTM2CV.js +175 -0
- package/dist/chunk-2AF6YC7Q.js +75 -0
- package/dist/chunk-2DTIWSAW.js +381 -0
- package/dist/chunk-2EMLKSCX.js +262 -0
- package/dist/chunk-2OJ3YZQP.js +665 -0
- package/dist/chunk-2VLYHHFT.js +35 -0
- package/dist/chunk-2WVPJF3Z.js +204 -0
- package/dist/chunk-33OASOS6.js +176 -0
- package/dist/chunk-3BD2LXYJ.js +19 -0
- package/dist/chunk-3JHUFKG7.js +30 -0
- package/dist/chunk-3JLTRPN7.js +711 -0
- package/dist/chunk-3LT34CAM.js +2796 -0
- package/dist/chunk-3O5JWP4L.js +1670 -0
- package/dist/chunk-3UW3KU4A.js +21 -0
- package/dist/chunk-4A6YRGV4.js +569 -0
- package/dist/chunk-4D2BRCZ3.js +67 -0
- package/dist/chunk-4SYHGVDE.js +668 -0
- package/dist/chunk-4VDHLCF5.js +66 -0
- package/dist/chunk-4WOOTKFD.js +637 -0
- package/dist/chunk-4WV4PI66.js +80 -0
- package/dist/chunk-53OXPRI6.js +195 -0
- package/dist/chunk-55RMDDFM.js +1347 -0
- package/dist/chunk-56XP4FJU.js +2025 -0
- package/dist/chunk-5B3RTYAK.js +123 -0
- package/dist/chunk-5CD243WE.js +45 -0
- package/dist/chunk-5JQR5B4D.js +709 -0
- package/dist/chunk-5KQEUIWM.js +597 -0
- package/dist/chunk-5LP5FNNR.js +915 -0
- package/dist/chunk-62UK7AGW.js +9344 -0
- package/dist/chunk-6CTHLZFB.js +563 -0
- package/dist/chunk-6EJYVCTN.js +23 -0
- package/dist/chunk-6OWUM2NC.js +12289 -0
- package/dist/chunk-6RJMYYIE.js +1023 -0
- package/dist/chunk-6W75D37F.js +643 -0
- package/dist/chunk-733ZBT5P.js +1721 -0
- package/dist/chunk-77DCC6JZ.js +3710 -0
- package/dist/chunk-7QXCO3AF.js +156 -0
- package/dist/chunk-7RET77VB.js +481 -0
- package/dist/chunk-A4MVRV4C.js +65 -0
- package/dist/chunk-ALJWT6O6.js +93 -0
- package/dist/chunk-AVSR2HKI.js +232 -0
- package/dist/chunk-B7GY6QER.js +42 -0
- package/dist/chunk-BFOSV5EZ.js +178 -0
- package/dist/chunk-BGOIM7NB.js +103 -0
- package/dist/chunk-BJH6WFIB.js +372 -0
- package/dist/chunk-BOBCCDJ6.js +1533 -0
- package/dist/chunk-BRCOSE7O.js +117 -0
- package/dist/chunk-BYFHHCFV.js +601 -0
- package/dist/chunk-C2CPOIH2.js +83 -0
- package/dist/chunk-C7AQTPCE.js +694 -0
- package/dist/chunk-CBAQPTDU.js +165 -0
- package/dist/chunk-CDQ2UC6W.js +125 -0
- package/dist/chunk-CN6SW5DC.js +177 -0
- package/dist/chunk-CRHPCPZP.js +132 -0
- package/dist/chunk-CTFPFW3H.js +44 -0
- package/dist/chunk-D3KWFOUT.js +103 -0
- package/dist/chunk-D65E25JG.js +185 -0
- package/dist/chunk-DCGHJQ2U.js +236 -0
- package/dist/chunk-DE2LU267.js +106 -0
- package/dist/chunk-DF6PI6GN.js +97 -0
- package/dist/chunk-DGC6X6XR.js +53 -0
- package/dist/chunk-DOUISWEE.js +526 -0
- package/dist/chunk-DR3TAEUA.js +188 -0
- package/dist/chunk-DVTBERFY.js +33 -0
- package/dist/chunk-DXSETN72.js +1051 -0
- package/dist/chunk-DZLR4UEH.js +128 -0
- package/dist/chunk-E6IPKW2E.js +77 -0
- package/dist/chunk-EG4ARXPC.js +139 -0
- package/dist/chunk-EKV4UBCM.js +652 -0
- package/dist/chunk-EOJPDNUP.js +1325 -0
- package/dist/chunk-EX57VVWW.js +4157 -0
- package/dist/chunk-EYTLV3W3.js +5937 -0
- package/dist/chunk-EZD2BXGP.js +475 -0
- package/dist/chunk-EZDCA34W.js +314 -0
- package/dist/chunk-FD2I4KBR.js +33 -0
- package/dist/chunk-FD3IAHQM.js +27 -0
- package/dist/chunk-FFYTC2KQ.js +416 -0
- package/dist/chunk-FGSQHUCK.js +110 -0
- package/dist/chunk-GCQFN7YI.js +32 -0
- package/dist/chunk-GGPF6LLE.js +38 -0
- package/dist/chunk-GGWI3OVM.js +215 -0
- package/dist/chunk-GLIQT7SU.js +172 -0
- package/dist/chunk-GN7QBEEI.js +95 -0
- package/dist/chunk-GRHOXDKB.js +1104 -0
- package/dist/chunk-HMN2C6YL.js +54 -0
- package/dist/chunk-HOEDA42N.js +310 -0
- package/dist/chunk-HOYZUKG7.js +192 -0
- package/dist/chunk-HQVN7G4F.js +1021 -0
- package/dist/chunk-HSQQFDB3.js +519 -0
- package/dist/chunk-I4ELN5BX.js +47 -0
- package/dist/chunk-I4Y4WKZR.js +386 -0
- package/dist/chunk-IFPDAD7R.js +797 -0
- package/dist/chunk-IN7DGBVS.js +582 -0
- package/dist/chunk-ISHUS7HC.js +396 -0
- package/dist/chunk-JPXLJSGR.js +191 -0
- package/dist/chunk-JQCLXSFI.js +69 -0
- package/dist/chunk-KBUTSJSR.js +61 -0
- package/dist/chunk-KW5HXKLJ.js +56 -0
- package/dist/chunk-L4APUGCT.js +139 -0
- package/dist/chunk-L7G7K4I2.js +505 -0
- package/dist/chunk-LAR7DX5E.js +1840 -0
- package/dist/chunk-LAVUQX3B.js +462 -0
- package/dist/chunk-LJRBX7QR.js +116 -0
- package/dist/chunk-LNOXCGN2.js +1864 -0
- package/dist/chunk-LTWH2ACR.js +23002 -0
- package/dist/chunk-LYJJ6546.js +661 -0
- package/dist/chunk-M2IPMWCN.js +457 -0
- package/dist/chunk-MGLRTOCK.js +101 -0
- package/dist/chunk-MZF5IKZT.js +160 -0
- package/dist/chunk-N24R6KWS.js +386 -0
- package/dist/chunk-NASYVWDB.js +604 -0
- package/dist/chunk-NBXFPI7U.js +195 -0
- package/dist/chunk-NDPF2N2L.js +400 -0
- package/dist/chunk-NFSK2VNU.js +446 -0
- package/dist/chunk-NG3QQSXY.js +43 -0
- package/dist/chunk-NOCSM22Y.js +63 -0
- package/dist/chunk-NVPXXW2H.js +1143 -0
- package/dist/chunk-O63U2I6I.js +30 -0
- package/dist/chunk-OJXOA6YU.js +98 -0
- package/dist/chunk-OPD7GL6F.js +1196 -0
- package/dist/chunk-OQ2EOAHA.js +14399 -0
- package/dist/chunk-OV62D6KO.js +688 -0
- package/dist/chunk-OZ76TLGU.js +740 -0
- package/dist/chunk-P4GNZPXO.js +1156 -0
- package/dist/chunk-PS6JAWJZ.js +78 -0
- package/dist/chunk-PXRCXGLK.js +1865 -0
- package/dist/chunk-QDUUOZ3S.js +108 -0
- package/dist/chunk-QG6I2T5E.js +1416 -0
- package/dist/chunk-QHSBROEW.js +308 -0
- package/dist/chunk-QNUQ7K7D.js +46 -0
- package/dist/chunk-QZTTRSJE.js +333 -0
- package/dist/chunk-R2UUNSNQ.js +1605 -0
- package/dist/chunk-R7FGRZNF.js +1794 -0
- package/dist/chunk-RNDCROSG.js +199 -0
- package/dist/chunk-S36CXHO2.js +302 -0
- package/dist/chunk-SJGS3GDI.js +575 -0
- package/dist/chunk-SQZHXUB3.js +510 -0
- package/dist/chunk-SUTLW6ND.js +686 -0
- package/dist/chunk-SYF7FVBL.js +179 -0
- package/dist/chunk-T2MDZES3.js +1577 -0
- package/dist/chunk-T33IYTZM.js +1146 -0
- package/dist/chunk-TDGYTWM6.js +49 -0
- package/dist/chunk-TGL5FZVD.js +132 -0
- package/dist/chunk-TGWZXJ7L.js +1205 -0
- package/dist/chunk-TKDRT2DF.js +114 -0
- package/dist/chunk-TV2EBCSQ.js +152 -0
- package/dist/chunk-U26XXPJS.js +367 -0
- package/dist/chunk-U5QU5ZOD.js +419 -0
- package/dist/chunk-U6YTUVOX.js +1011 -0
- package/dist/chunk-UCINIRHW.js +188 -0
- package/dist/chunk-UJD5MPP6.js +52 -0
- package/dist/chunk-URCXX7WJ.js +146 -0
- package/dist/chunk-UX2L5CUD.js +898 -0
- package/dist/chunk-UZVYEF57.js +114 -0
- package/dist/chunk-V35KZDUZ.js +218 -0
- package/dist/chunk-VESL6DQY.js +1058 -0
- package/dist/chunk-VKHLUZNO.js +986 -0
- package/dist/chunk-VOYUCAQF.js +584 -0
- package/dist/chunk-VYRQHORQ.js +414 -0
- package/dist/chunk-W53XSRQE.js +245 -0
- package/dist/chunk-X4CEFOSG.js +226 -0
- package/dist/chunk-XDHUDE5K.js +380 -0
- package/dist/chunk-XISLDHEL.js +1290 -0
- package/dist/chunk-XM34YQ2Y.js +169 -0
- package/dist/chunk-XMDBTYCH.js +661 -0
- package/dist/chunk-XS2QPZJE.js +449 -0
- package/dist/chunk-YBUECLAF.js +618 -0
- package/dist/chunk-YQ6XEFVK.js +332 -0
- package/dist/chunk-YYLCPDCC.js +990 -0
- package/dist/chunk-Z4GLJ6J4.js +1035 -0
- package/dist/chunk-ZARZ4POR.js +210 -0
- package/dist/chunk-ZJPORZTC.js +119 -0
- package/dist/chunk-ZNUZ3EXD.js +243 -0
- package/dist/chunk-ZPST2KQO.js +49 -0
- package/dist/chunk-ZR5YA6ZF.js +512 -0
- package/dist/chunk-ZU4JPCPR.js +319 -0
- package/dist/chunk-ZUKUCZYZ.js +39 -0
- package/dist/cli/index.js +56 -45
- package/dist/clio-K2PBVCEM.js +27 -0
- package/dist/clio-context-tools-GR4OHFSO.js +145 -0
- package/dist/code-nav-4X3OI6DK.js +715 -0
- package/dist/codewiki/build-worker.js +4 -4
- package/dist/compile-cache-YRB6QRO7.js +18 -0
- package/dist/components-RQOJ6NUR.js +675 -0
- package/dist/config-Q5J7UBAB.js +291 -0
- package/dist/config-XE7XYZLU.js +38 -0
- package/dist/config-graph-P3555574.js +175 -0
- package/dist/configure-KIJ32ZO6.js +104 -0
- package/dist/context-LFBQOSXT.js +344 -0
- package/dist/context-NNLBES2Y.js +82 -0
- package/dist/context-WBH3KSVR.js +302 -0
- package/dist/context-clear-YOHMQ6SQ.js +208 -0
- package/dist/context-index-X2N5UAIF.js +120 -0
- package/dist/context-map-HOSMGUG2.js +555 -0
- package/dist/context-working-set-MRAEVDNV.js +1564 -0
- package/dist/data-tool-JJPBGMQJ.js +2986 -0
- package/dist/detail-RHJOTGN4.js +139 -0
- package/dist/dispatch-runner-NC7PYNIO.js +2477 -0
- package/dist/docs-K4GBWRUX.js +342 -0
- package/dist/doctor-S5KZ2GTN.js +1138 -0
- package/dist/doctor-deep-2EJQSHIZ.js +130 -0
- package/dist/domain-loader-MB34FDPD.js +13 -0
- package/dist/eval-3D6M36N7.js +5220 -0
- package/dist/eval-inventory-SM3HNM47.js +260 -0
- package/dist/evals-FO6JEUCN.js +104 -0
- package/dist/evidence-6IYN52ET.js +262 -0
- package/dist/evidence-JVECPI3F.js +250 -0
- package/dist/evidence-XNVPPLVK.js +410 -0
- package/dist/evolve-TLPUDJDM.js +634 -0
- package/dist/extensions-ROZJ5X3J.js +311 -0
- package/dist/fleet-6RJWIOEO.js +284 -0
- package/dist/fleet-WKVBF5SZ.js +942 -0
- package/dist/fleet-commands-L6WFT7KZ.js +76 -0
- package/dist/fleet-decisions-BTQMWU5A.js +55 -0
- package/dist/fleet-graph-553DZ67Q.js +141 -0
- package/dist/fleet-inspect-236FZPRB.js +329 -0
- package/dist/fleet-new-CKUXP3CO.js +48 -0
- package/dist/fleet-preflight-NZQHABWO.js +95 -0
- package/dist/fleet-validate-7NLAE26R.js +96 -0
- package/dist/fleet-verify-E3RO6A5W.js +226 -0
- package/dist/fleet-view-KMZQY7YJ.js +144 -0
- package/dist/gui/client/assets/abnfDiagram-VCTEODGH-DPBWQwNn.js +1 -0
- package/dist/gui/client/assets/architecture-7GRP2DOG-D1w8FrFW.js +1 -0
- package/dist/gui/client/assets/architectureDiagram-5GKGNRK7-CVPgKd1-.js +36 -0
- package/dist/gui/client/assets/blockDiagram-I7D4REHJ-BLmnqkK5.js +129 -0
- package/dist/gui/client/assets/c4Diagram-7LVT6UL2-4AU9cfM7.js +38 -0
- package/dist/gui/client/assets/channel-DwFZ0m8S.js +1 -0
- package/dist/gui/client/assets/chunk-4HAMMTFA-EOWkKCav.js +62 -0
- package/dist/gui/client/assets/chunk-75Z2AOVW-CygeoIMl.js +2 -0
- package/dist/gui/client/assets/chunk-DU6HZSFF-s27fViLb.js +125 -0
- package/dist/gui/client/assets/chunk-F27PBJKO-BrHvwLsZ.js +1 -0
- package/dist/gui/client/assets/chunk-GMAD6QVW-DzPh-7jt.js +72 -0
- package/dist/gui/client/assets/chunk-GVQU2GXP-pIaQkIzm.js +1 -0
- package/dist/gui/client/assets/chunk-IMKFNOWR-BGJVE_Br.js +231 -0
- package/dist/gui/client/assets/chunk-L3NEJ4N5-B3YLuhww.js +1 -0
- package/dist/gui/client/assets/chunk-OSK3NFVY-BRj61HHU.js +10 -0
- package/dist/gui/client/assets/chunk-P2QGCYS3-Sno90KxP.js +1 -0
- package/dist/gui/client/assets/chunk-POPQ4Y6H-Cw8NTbxr.js +1 -0
- package/dist/gui/client/assets/chunk-PWAF6VOD-BIhHgz37.js +1 -0
- package/dist/gui/client/assets/chunk-SHT3W25Y-Cqv7npBj.js +168 -0
- package/dist/gui/client/assets/chunk-SVP7TREG-Hxzl6Dee.js +88 -0
- package/dist/gui/client/assets/chunk-TICWLB2K-CIFVyVP2.js +206 -0
- package/dist/gui/client/assets/classDiagram-ZZMXUADV-BJbAiI_w.js +1 -0
- package/dist/gui/client/assets/classDiagram-v2-VYDZK3BY-BJbAiI_w.js +1 -0
- package/dist/gui/client/assets/cynefin-OW5HDTMX-DecLWZ-y.js +1 -0
- package/dist/gui/client/assets/cynefinDiagram-5FMLGOSQ-CK-T2N-D.js +62 -0
- package/dist/gui/client/assets/dagre-GXQ25YYZ-C0dfg-OS.js +4 -0
- package/dist/gui/client/assets/diagram-S7CK7UJ4-EaJukVh-.js +30 -0
- package/dist/gui/client/assets/diagram-UQ7AKVKN-xcOucEtP.js +41 -0
- package/dist/gui/client/assets/diagram-VSXAHHWV-3AUJACMf.js +3 -0
- package/dist/gui/client/assets/diagram-VX7I27RA-TPknLqam.js +24 -0
- package/dist/gui/client/assets/diagram-Z3DM3KII-wa1q3YMF.js +24 -0
- package/dist/gui/client/assets/ebnfDiagram-PWID7BFC-JBCF2-s7.js +1 -0
- package/dist/gui/client/assets/erDiagram-RLTQ6QDP-CmXjXPc4.js +99 -0
- package/dist/gui/client/assets/eventmodeling-NTZA5JFV-D_1aJWYl.js +1 -0
- package/dist/gui/client/assets/flowDiagram-HODETNUW-BQtZlael.js +1 -0
- package/dist/gui/client/assets/framework-Bq-znqwW.js +9 -0
- package/dist/gui/client/assets/ganttDiagram-EL5Y4UJY-IPaL_kaa.js +292 -0
- package/dist/gui/client/assets/gitGraph-4MIJSDKK-Oy0Q3hoc.js +1 -0
- package/dist/gui/client/assets/gitGraphDiagram-WWUBYQGX-jtAuBmbc.js +106 -0
- package/dist/gui/client/assets/index-CuFuBEdL.css +1 -0
- package/dist/gui/client/assets/index-hMbEIsX0.js +87 -0
- package/dist/gui/client/assets/info-A6RAGUB7-UtEs1tv7.js +1 -0
- package/dist/gui/client/assets/infoDiagram-27XIBGKW-hlwR1pBW.js +2 -0
- package/dist/gui/client/assets/ishikawaDiagram-5VMMS53U-C6vMtfsd.js +70 -0
- package/dist/gui/client/assets/journeyDiagram-3NMN7TZE-EAwAl_PS.js +139 -0
- package/dist/gui/client/assets/kanban-definition-UXKFOSKX-CQOhRKHW.js +89 -0
- package/dist/gui/client/assets/line-DbcwGZTW.js +1 -0
- package/dist/gui/client/assets/mermaid-parser.core-C2QfVcHd.js +7 -0
- package/dist/gui/client/assets/mermaid.core-N9qUTre1.js +44 -0
- package/dist/gui/client/assets/mindmap-definition-YA3MSWOX-BR_FL9gK.js +96 -0
- package/dist/gui/client/assets/packet-AYTQ26CC-CbBJ2oAa.js +1 -0
- package/dist/gui/client/assets/pegDiagram-XKGWAZYB-BruU0IHM.js +1 -0
- package/dist/gui/client/assets/pie-WAS4IAKB-BWdSng4H.js +1 -0
- package/dist/gui/client/assets/pieDiagram-E7YTZNPT-CR3ljgdU.js +39 -0
- package/dist/gui/client/assets/quadrantDiagram-AXDQQJYC-C-boKslr.js +7 -0
- package/dist/gui/client/assets/radar-RG4KPBEZ-CGlOnAKG.js +1 -0
- package/dist/gui/client/assets/railroad-74A4TZTK-CDvuAlyC.js +1 -0
- package/dist/gui/client/assets/railroad-abnf-HS5TGJTU-CQUA9crC.js +1 -0
- package/dist/gui/client/assets/railroad-ebnf-LZEXJU2U-CD857gxq.js +1 -0
- package/dist/gui/client/assets/railroad-peg-WCYAUIDC-DUV4k35E.js +1 -0
- package/dist/gui/client/assets/railroadDiagram-O6MQD6OU-DMR4LXmA.js +1 -0
- package/dist/gui/client/assets/requirementDiagram-BXWQKSXE-DVltaF6c.js +84 -0
- package/dist/gui/client/assets/sankeyDiagram-P5KCCOFB-CHdNz472.js +40 -0
- package/dist/gui/client/assets/sequenceDiagram-WJ2MYXX4-DaMafIty.js +162 -0
- package/dist/gui/client/assets/stateDiagram-D77RDMKH-CEbBHqn3.js +1 -0
- package/dist/gui/client/assets/stateDiagram-v2-MP3YSRHH-B3JgDdFg.js +1 -0
- package/dist/gui/client/assets/swimlanes-42K2YHIH-BlPHndnJ.js +1 -0
- package/dist/gui/client/assets/swimlanesDiagram-VR7AAH4N-BPabHwsZ.js +8 -0
- package/dist/gui/client/assets/timeline-definition-24CTP7MA-E4Y1lPBI.js +120 -0
- package/dist/gui/client/assets/treeView-Q6P3EWNA-DrY0uhTN.js +1 -0
- package/dist/gui/client/assets/treemap-WGGIJYW6-CVotnLHf.js +1 -0
- package/dist/gui/client/assets/vennDiagram-4TSXK5OY-DJNrLIOF.js +34 -0
- package/dist/gui/client/assets/wardley-WFR3VGLG-ClOpAp5S.js +1 -0
- package/dist/gui/client/assets/wardleyDiagram-VM6X3IG4-qhMoKOXc.js +78 -0
- package/dist/gui/client/assets/xychartDiagram-S5SC5T6Z-CTuXoo9R.js +7 -0
- package/dist/gui/client/index.html +6 -0
- package/dist/gui/ops-worker.js +167 -0
- package/dist/gui/reads-worker.js +473 -0
- package/dist/gui/server.js +9780 -0
- package/dist/gui-QJS7XQMV.js +16 -0
- package/dist/init-DV5B6HQG.js +354 -0
- package/dist/install-6C45YXFP.js +19 -0
- package/dist/install-O7NSRU2W.js +13 -0
- package/dist/interactive-OXGYZYAS.js +22381 -0
- package/dist/interop-J7UOBOSF.js +254 -0
- package/dist/inventory-OEGIL6PY.js +144 -0
- package/dist/library-B3UPGY4V.js +83 -0
- package/dist/library-MXQA5DLT.js +309 -0
- package/dist/library-ROZAMUIL.js +496 -0
- package/dist/library-import-2LTWOVBD.js +190 -0
- package/dist/library-inventory-LJ3XHLWO.js +60 -0
- package/dist/library-validation-DARHHUNW.js +46 -0
- package/dist/mcp-2GSPYQ54.js +28 -0
- package/dist/memory-J3STUUIK.js +537 -0
- package/dist/models-Y3GMFJ2V.js +314 -0
- package/dist/monitor-LHNH577J.js +811 -0
- package/dist/orchestrator-DTAPXULA.js +12117 -0
- package/dist/panes-A743ONZ5.js +103 -0
- package/dist/panes-CTNO57ZY.js +76 -0
- package/dist/paths-3SBYJQDP.js +68 -0
- package/dist/preload-OJBMAIXF.js +140 -0
- package/dist/providers-CMETPZNS.js +232 -0
- package/dist/registry-37T4U6X2.js +15 -0
- package/dist/reset-O7EUCYWO.js +346 -0
- package/dist/resources-FY6XYFN2.js +189 -0
- package/dist/run-H64MEVTA.js +1067 -0
- package/dist/run-script-PQ5NRU3X.js +42 -0
- package/dist/settings-SNIQNXCW.js +73 -0
- package/dist/settings-controls-X6GMCPVG.js +202 -0
- package/dist/share-CAFMMQLM.js +299 -0
- package/dist/skills-ERKQUC7L.js +114 -0
- package/dist/skills-eval-CQ23MYQK.js +1099 -0
- package/dist/skills-inventory-TVUYJDVN.js +142 -0
- package/dist/slash-commands-ROG3KIFJ.js +107 -0
- package/dist/startup-background-KDWCQMWT.js +247 -0
- package/dist/steer-KKYXJSH4.js +77 -0
- package/dist/support-M3RCUUEL.js +40 -0
- package/dist/system-ZDW44ZGX.js +142 -0
- package/dist/target-runtimes-PWA22WVW.js +73 -0
- package/dist/targets-AJWA6E7Z.js +1207 -0
- package/dist/tasks-6L2JJRC5.js +39 -0
- package/dist/terminal-lease-YFUSDPAD.js +432 -0
- package/dist/tools-5XJUABRD.js +30 -0
- package/dist/trace-LA5MVR4Y.js +527 -0
- package/dist/tree-sitter-TQW3Y52T.js +4673 -0
- package/dist/tui-primitives-IUCVWLH5.js +19 -0
- package/dist/uninstall-SAWGGXAB.js +448 -0
- package/dist/upgrade-HSNSVTZG.js +300 -0
- package/dist/usage-XSILDHKF.js +1083 -0
- package/dist/verifiers-ECA5GIHL.js +633 -0
- package/dist/verify-R6QQCCEB.js +31 -0
- package/dist/version-PLZYB5KW.js +22 -0
- package/dist/web-fetch-PVZNMBOB.js +803 -0
- package/dist/wiki-generate-RP22WP5K.js +647 -0
- package/dist/with-panes-W3PAZPRF.js +629 -0
- package/dist/worker/entry.js +324 -284
- package/dist/workspace-check-3764ZKC2.js +83 -0
- package/docs/README.md +26 -10
- package/docs/architecture/acp.md +179 -12
- package/docs/architecture/artifact-placement.md +1 -1
- package/docs/architecture/capacity-and-scheduling.md +7 -8
- package/docs/architecture/context-engine.md +350 -95
- package/docs/architecture/model-catalog.md +18 -11
- package/docs/architecture/observability.md +1 -1
- package/docs/architecture/pi-boundary.md +59 -6
- package/docs/architecture/prompt-envelope-and-tools.md +147 -39
- package/docs/architecture/provider-adapter-cookbook.md +2 -2
- package/docs/architecture/safety-model.md +18 -4
- package/docs/architecture/trace-store.md +2 -2
- package/docs/architecture/tui-design.md +41 -81
- package/docs/architecture/worker-dispatch-mechanics.md +9 -1
- package/docs/gui/README.md +69 -0
- package/docs/gui/boundary-doctrine.md +104 -0
- package/docs/gui/chat-rendering-spec.md +1440 -0
- package/docs/gui/cli-surface-routing.md +148 -0
- package/docs/gui/delivery-order.md +53 -0
- package/docs/gui/event-bus-coverage.md +103 -0
- package/docs/gui/inspector-presentation.md +71 -0
- package/docs/gui/parity/01-cli-surface.md +74 -0
- package/docs/gui/parity/02-slash-and-surfaces.md +110 -0
- package/docs/gui/parity/03-domains-and-plan.md +69 -0
- package/docs/gui/performance-baseline.md +76 -0
- package/docs/gui/settings-write-surface.md +267 -0
- package/docs/gui/workflow-coverage.md +64 -0
- package/docs/guide/built-in-agents.md +1 -1
- package/docs/guide/commands-and-modes.md +256 -99
- package/docs/guide/configuration-and-targets.md +485 -124
- package/docs/guide/configuration-reference.md +165 -82
- package/docs/guide/doctor.md +127 -0
- package/docs/guide/environment-variables.md +1 -1
- package/docs/guide/exit-codes-and-output.md +3 -1
- package/docs/guide/extensions-and-sharing.md +3 -14
- package/docs/guide/fleet-dispatch.md +231 -45
- package/docs/guide/glossary.md +1 -1
- package/docs/guide/installation-and-lifecycle.md +27 -16
- package/docs/guide/interop.md +2 -2
- package/docs/guide/proactive-memory.md +154 -68
- package/docs/guide/resource-library.md +4 -0
- package/docs/guide/skills-marketplace.md +8 -4
- package/docs/guide/slurm.md +88 -0
- package/docs/guide/tool-usage.md +134 -11
- package/docs/guide/troubleshooting.md +4 -2
- package/docs/process/battletest-2026-09-20-fixes.md +161 -0
- package/docs/process/configure-tree-proposal.md +637 -0
- package/docs/process/documentation-coverage.md +8 -0
- package/docs/process/documentation-guide.md +18 -1
- package/docs/process/eval-runner.md +58 -14
- package/docs/process/performance-methodology.md +11 -3
- package/docs/process/release-cut-checklist.md +29 -3
- package/docs/process/tool-audit-v0.4.9.md +3 -0
- package/examples/extensions/README.md +1 -3
- package/examples/extensions/lab-status/clio-coder-extension.json +1 -1
- package/examples/extensions/measurements/clio-coder-extension.json +1 -1
- package/library/registry.yaml +30 -5
- package/library/skills/git/fix-issue/SKILL.md +2 -1
- package/library/skills/git/fix-issue/plugin.json +1 -1
- package/library/skills/git/ship/SKILL.md +2 -1
- package/library/skills/git/ship/plugin.json +1 -1
- package/library/skills/meta/clio-coder-test/SKILL.md +5 -6
- package/library/skills/meta/clio-coder-test/evals.md +2 -2
- package/library/skills/meta/clio-coder-test/references/test-map.md +2 -2
- package/library/skills/registry.yaml +9 -5
- package/library/skills/research/slurm-jobs/SKILL.md +110 -0
- package/library/skills/research/slurm-jobs/evals.md +39 -0
- package/library/skills/research/slurm-jobs/plugin.json +23 -0
- package/library/skills/skill-marketplace.json +18 -2
- package/package.json +15 -10
- package/src/cli/args.ts +59 -0
- package/src/cli/argv.ts +7 -0
- package/src/cli/clio.ts +9 -1
- package/src/cli/configure-controls.ts +136 -0
- package/src/cli/configure-onboarding.ts +24 -7
- package/src/cli/configure-quick.ts +32 -7
- package/src/cli/configure-target.ts +11 -1
- package/src/cli/configure.ts +253 -256
- package/src/cli/docs-server.ts +290 -0
- package/src/cli/docs.ts +60 -15
- package/src/cli/doctor-deep.ts +126 -0
- package/src/cli/doctor-hpc.ts +122 -0
- package/src/cli/doctor-slurm.ts +130 -0
- package/src/cli/doctor-task-worktrees.ts +88 -0
- package/src/cli/doctor.ts +165 -16
- package/src/cli/fleet-verify.ts +3 -2
- package/src/cli/gui.ts +111 -0
- package/src/cli/index.ts +14 -4
- package/src/cli/library.ts +2 -7
- package/src/cli/modes/json-stream.ts +4 -2
- package/src/cli/modes/print.ts +252 -25
- package/src/cli/run.ts +199 -71
- package/src/cli/skills.ts +25 -7
- package/src/cli/targets.ts +87 -9
- package/src/cli/uninstall.ts +28 -8
- package/src/cli/usage.ts +2 -1
- package/src/cli/workspace-check.ts +71 -0
- package/src/core/bash-exec.ts +8 -2
- package/src/core/bus-events.ts +32 -3
- package/src/core/cache-telemetry.ts +3 -2
- package/src/core/compile-cache.ts +11 -1
- package/src/core/config.ts +59 -6
- package/src/core/defaults.ts +27 -5
- package/src/core/diagnostics.ts +25 -0
- package/src/core/event-bus.ts +2 -1
- package/src/core/gateway-routing.ts +10 -3
- package/src/core/git-commit-attribution.ts +2 -1
- package/src/core/naming-compat.ts +6 -4
- package/src/core/package-root.ts +0 -9
- package/src/core/path-canonical.ts +143 -24
- package/src/core/residency-target-key.ts +2 -6
- package/src/core/run-overrides.ts +1 -1
- package/src/core/settings-awareness.ts +108 -0
- package/src/core/settings-controls.ts +673 -0
- package/src/core/settings-navigation.ts +116 -0
- package/src/core/theme-token-hex.ts +19 -9
- package/src/core/turn-constraints.ts +52 -0
- package/src/domains/agents/builtins/scout.md +7 -17
- package/src/domains/agents/catalog.ts +5 -1
- package/src/domains/agents/extension.ts +2 -1
- package/src/domains/agents/registry.ts +4 -3
- package/src/domains/agents/result-contract.ts +132 -1
- package/src/domains/config/classify.ts +11 -7
- package/src/domains/config/extension.ts +5 -1
- package/src/domains/config/keybindings.ts +2 -2
- package/src/domains/context/codewiki/coordinator.ts +10 -0
- package/src/domains/context/worker/snapshot.ts +6 -3
- package/src/domains/dispatch/active-route-planner.ts +2 -0
- package/src/domains/dispatch/agent-candidates.ts +5 -1
- package/src/domains/dispatch/capability-match.ts +1 -1
- package/src/domains/dispatch/contract.ts +28 -0
- package/src/domains/dispatch/event-pump.ts +37 -3
- package/src/domains/dispatch/extension.ts +391 -48
- package/src/domains/dispatch/failure-classification.ts +37 -2
- package/src/domains/dispatch/receipt-integrity.ts +3 -0
- package/src/domains/dispatch/run-identity.ts +10 -3
- package/src/domains/dispatch/target-breaker.ts +163 -0
- package/src/domains/dispatch/types.ts +29 -2
- package/src/domains/dispatch/worker-model-loads.ts +66 -0
- package/src/domains/dispatch/worker-protocol.ts +20 -1
- package/src/domains/dispatch/worker-spawn.ts +28 -2
- package/src/domains/eval/artifacts/redact.ts +9 -0
- package/src/domains/eval/metrics/noop.ts +61 -0
- package/src/domains/eval/reports/junit.ts +5 -1
- package/src/domains/eval/reports/text.ts +7 -0
- package/src/domains/eval/runners/clio-run.ts +19 -8
- package/src/domains/eval/runners/external-command.ts +29 -4
- package/src/domains/eval/schema/adapter.ts +6 -2
- package/src/domains/eval/schema/suite.ts +2 -0
- package/src/domains/eval/schema/validate.ts +3 -0
- package/src/domains/eval/suites/run.ts +167 -26
- package/src/domains/evidence/detail.ts +3 -2
- package/src/domains/extensions/operator-runtime.ts +11 -4
- package/src/domains/gateway/mcp/client.ts +1 -1
- package/src/domains/lifecycle/doctor.ts +42 -26
- package/src/domains/lifecycle/migrations/2026-09-18-ollama-runtime-id.ts +38 -0
- package/src/domains/lifecycle/migrations/index.ts +2 -0
- package/src/domains/middleware/demo-guidance.ts +36 -0
- package/src/domains/middleware/dispatch-nudge.ts +1 -1
- package/src/domains/middleware/memory-intervention.ts +51 -4
- package/src/domains/middleware/runtime.ts +5 -4
- package/src/domains/middleware/skills-reminder.ts +29 -52
- package/src/domains/middleware/task-nudge.ts +1 -0
- package/src/domains/middleware/watchdog.ts +4 -0
- package/src/domains/observability/extension.ts +2 -1
- package/src/domains/observability/out-of-turn-usage.ts +3 -2
- package/src/domains/observability/projection.ts +3 -2
- package/src/domains/observability/worker-progress.ts +48 -0
- package/src/domains/prompts/compiler.ts +148 -52
- package/src/domains/prompts/contract.ts +3 -3
- package/src/domains/prompts/demo-guidance.ts +8 -0
- package/src/domains/prompts/extension.ts +12 -7
- package/src/domains/prompts/fragments/identity/clio.md +2 -1
- package/src/domains/prompts/fragments/identity/docs-routing.md +2 -0
- package/src/domains/prompts/fragments/identity/self-awareness.md +4 -0
- package/src/domains/prompts/fragments/operating/contract.md +16 -7
- package/src/domains/prompts/fragments/operating/delegation.md +29 -13
- package/src/domains/prompts/fragments/operating/skills.md +18 -10
- package/src/domains/prompts/fragments/operating/worker.md +2 -0
- package/src/domains/providers/cache-deployment.ts +45 -2
- package/src/domains/providers/contract.ts +52 -11
- package/src/domains/providers/extension.ts +230 -53
- package/src/domains/providers/model-discovery.ts +22 -8
- package/src/domains/providers/models/local-models/clio-coder-local-coding-targets.yaml +5 -7
- package/src/domains/providers/plugins.ts +3 -4
- package/src/domains/providers/probe/fingerprint.ts +2 -2
- package/src/domains/providers/probe/reasoning.ts +9 -16
- package/src/domains/providers/probe/tool-call.ts +236 -0
- package/src/domains/providers/registry.ts +51 -8
- package/src/domains/providers/runtime-resolution.ts +60 -12
- package/src/domains/providers/runtimes/boot-manifest.ts +1 -1
- package/src/domains/providers/runtimes/builtins.ts +2 -2
- package/src/domains/providers/runtimes/common/lmstudio-http.ts +57 -41
- package/src/domains/providers/runtimes/common/local-synth.ts +3 -1
- package/src/domains/providers/runtimes/common/ollama-model-ids.ts +11 -0
- package/src/domains/providers/runtimes/common/probe-helpers.ts +53 -0
- package/src/domains/providers/runtimes/local-native/llamacpp-completion.ts +3 -1
- package/src/domains/providers/runtimes/local-native/llamacpp-embed.ts +7 -13
- package/src/domains/providers/runtimes/local-native/llamacpp-rerank.ts +7 -17
- package/src/domains/providers/runtimes/local-native/llamacpp.ts +1 -0
- package/src/domains/providers/runtimes/local-native/ollama.ts +211 -0
- package/src/domains/providers/runtimes/protocol/litellm.ts +77 -65
- package/src/domains/providers/support.ts +1 -1
- package/src/domains/providers/types/local-model-quirks.ts +2 -3
- package/src/domains/providers/types/runtime-descriptor.ts +23 -3
- package/src/domains/providers/types/target-descriptor.ts +15 -3
- package/src/domains/resources/collision.ts +7 -2
- package/src/domains/resources/index.ts +1 -0
- package/src/domains/resources/library-actions.ts +4 -2
- package/src/domains/resources/library-inventory.ts +6 -2
- package/src/domains/resources/prompts/loader.ts +20 -7
- package/src/domains/resources/skills/availability.ts +56 -0
- package/src/domains/resources/skills/loader.ts +20 -9
- package/src/domains/safety/action-classifier.ts +282 -31
- package/src/domains/safety/audit.ts +2 -1
- package/src/domains/safety/autonomy.ts +54 -11
- package/src/domains/safety/decision-presentation.ts +17 -4
- package/src/domains/safety/finish-contract-registration.ts +25 -1
- package/src/domains/safety/finish-contract.ts +20 -5
- package/src/domains/safety/path-policy.ts +6 -2
- package/src/domains/safety/policy-engine.ts +168 -48
- package/src/domains/safety/protected-artifacts.ts +527 -16
- package/src/domains/safety/read-scope.ts +120 -0
- package/src/domains/safety/skill-authority.ts +52 -16
- package/src/domains/scheduling/cluster.ts +14 -3
- package/src/domains/scheduling/contract.ts +7 -0
- package/src/domains/scheduling/extension.ts +20 -9
- package/src/domains/scheduling/local-capacity.ts +160 -0
- package/src/domains/session/context-accounting.ts +44 -31
- package/src/domains/session/context-ledger.ts +10 -3
- package/src/domains/session/entries.ts +4 -0
- package/src/domains/session/history.ts +1 -1
- package/src/domains/session/prompt-cache.ts +1 -0
- package/src/domains/session/prompt-manifest.ts +3 -1
- package/src/domains/session/retry.ts +4 -6
- package/src/domains/session/task-board.ts +19 -4
- package/src/domains/session/tree/preview.ts +3 -2
- package/src/engine/acp/commands.ts +653 -0
- package/src/engine/acp/server.ts +639 -20
- package/src/engine/acp/tool-mediator.ts +30 -7
- package/src/engine/acp/types.ts +58 -0
- package/src/engine/agent.ts +55 -10
- package/src/engine/ai.ts +11 -2
- package/src/engine/api-registry.ts +5 -4
- package/src/engine/apis/degraded-inference.ts +243 -0
- package/src/engine/apis/llamacpp-residency.ts +50 -6
- package/src/engine/apis/lmstudio-residency.ts +3 -5
- package/src/engine/apis/lmstudio.ts +137 -31
- package/src/engine/apis/ollama-http.ts +118 -0
- package/src/engine/apis/ollama-native.ts +216 -97
- package/src/engine/apis/openai-completions.ts +191 -189
- package/src/engine/apis/output-budget.ts +3 -1
- package/src/engine/apis/residency-lock.ts +2 -1
- package/src/engine/apis/residency.ts +339 -89
- package/src/engine/apis/sampling-overrides.ts +23 -2
- package/src/engine/apis/types.ts +1 -2
- package/src/engine/claude/tool-safety.ts +30 -5
- package/src/engine/context.ts +13 -0
- package/src/engine/env-api-keys.ts +2 -1
- package/src/engine/gemma-channel-filter.ts +3 -2
- package/src/engine/instrumented-tui.ts +25 -0
- package/src/engine/loop-guard.ts +172 -6
- package/src/engine/pi-mono-names.ts +16 -0
- package/src/engine/prewarm.ts +44 -15
- package/src/engine/provider-payload.ts +52 -14
- package/src/engine/session.ts +4 -2
- package/src/engine/worker-events.ts +9 -1
- package/src/engine/worker-runtime.ts +269 -42
- package/src/engine/worker-tools.ts +8 -3
- package/src/entry/boot-options.ts +23 -0
- package/src/entry/orchestrator.ts +207 -36
- package/src/interactive/assistant-generation-timing.ts +52 -0
- package/src/interactive/chat-loop-messages.ts +4 -1
- package/src/interactive/chat-loop.ts +59 -9
- package/src/interactive/chat-panel.ts +10 -1
- package/src/interactive/clio-editor.ts +51 -79
- package/src/interactive/context-meter.ts +1 -0
- package/src/interactive/context-overlay.ts +21 -8
- package/src/interactive/cost-overlay.ts +1 -1
- package/src/interactive/dispatch-board.ts +39 -8
- package/src/interactive/editor-bash.ts +0 -34
- package/src/interactive/editor-rails.ts +43 -0
- package/src/interactive/editor-submit.ts +34 -2
- package/src/interactive/footer/dashboard.ts +67 -38
- package/src/interactive/footer/demo-hints.ts +40 -0
- package/src/interactive/footer/key-hints.ts +21 -0
- package/src/interactive/footer/notifications.ts +1 -1
- package/src/interactive/footer/pages.ts +486 -0
- package/src/interactive/footer/system-metrics.ts +147 -0
- package/src/interactive/footer/widgets.ts +158 -63
- package/src/interactive/footer-panel.ts +29 -7
- package/src/interactive/interactive-application.ts +109 -21
- package/src/interactive/interactive-event-projection.ts +6 -2
- package/src/interactive/interactive-presentation.ts +25 -29
- package/src/interactive/interactive-slash-runtime.ts +32 -18
- package/src/interactive/interactive-subscriptions.ts +25 -5
- package/src/interactive/interactive-tickers.ts +21 -5
- package/src/interactive/keybinding-manager.ts +9 -0
- package/src/interactive/overlay-frame.ts +29 -7
- package/src/interactive/overlay-lifecycle.ts +5 -3
- package/src/interactive/overlay-model-selectors.ts +4 -0
- package/src/interactive/overlay-permission-lifecycle.ts +6 -5
- package/src/interactive/overlays/ask-user.ts +103 -110
- package/src/interactive/overlays/help-reference.ts +1 -0
- package/src/interactive/overlays/message-picker.ts +3 -29
- package/src/interactive/overlays/session-selector.ts +3 -2
- package/src/interactive/overlays/settings-sections.ts +2 -30
- package/src/interactive/overlays/settings.ts +310 -607
- package/src/interactive/permission-hint.ts +3 -3
- package/src/interactive/permission-overlay.ts +45 -27
- package/src/interactive/renderers/doctor-report.ts +43 -0
- package/src/interactive/renderers/tool-execution.ts +87 -62
- package/src/interactive/renderers/worker-entry.ts +76 -3
- package/src/interactive/side-question.ts +3 -1
- package/src/interactive/slash-commands.ts +78 -23
- package/src/interactive/startup-background.ts +131 -0
- package/src/interactive/startup-diagnostics.ts +16 -0
- package/src/interactive/status/state-machine.ts +16 -3
- package/src/interactive/status/types.ts +2 -0
- package/src/interactive/status/verbs.ts +1 -1
- package/src/interactive/terminal-lease.ts +26 -22
- package/src/interactive/theme/components.ts +1 -1
- package/src/interactive/theme/rules.ts +1 -1
- package/src/interactive/theme/tokens.ts +16 -10
- package/src/interactive/transcript-detail.ts +4 -0
- package/src/interactive/turn-context.ts +56 -20
- package/src/interactive/turn-middleware.ts +57 -9
- package/src/interactive/turn-prewarm.ts +121 -18
- package/src/interactive/turn-recovery.ts +10 -8
- package/src/interactive/turn-runtime.ts +74 -29
- package/src/interactive/turn-state.ts +3 -0
- package/src/interactive/welcome-art.ts +36 -0
- package/src/interactive/welcome-dashboard.ts +209 -49
- package/src/interactive/worker-replay.ts +4 -0
- package/src/interactive/worker-stream.ts +17 -2
- package/src/tools/agent-tools.ts +22 -1
- package/src/tools/builtin-tool-catalog.ts +2 -2
- package/src/tools/codewiki/code-nav.ts +1 -1
- package/src/tools/codewiki/shared.ts +39 -1
- package/src/tools/compete-worktrees.ts +8 -91
- package/src/tools/context/docs-engine.ts +44 -12
- package/src/tools/context/index.ts +126 -22
- package/src/tools/context/library.ts +1 -1
- package/src/tools/context/surface.ts +12 -7
- package/src/tools/core-bootstrap.ts +3 -0
- package/src/tools/dispatch-runner.ts +18 -0
- package/src/tools/dispatch-schema.ts +187 -206
- package/src/tools/edit.ts +46 -42
- package/src/tools/file-mutation-queue.ts +25 -26
- package/src/tools/gateway/clio-context-surface.ts +1 -1
- package/src/tools/gateway/index.ts +7 -3
- package/src/tools/gateway/mcp-capabilities.ts +5 -3
- package/src/tools/grep.ts +14 -2
- package/src/tools/ls.ts +1 -4
- package/src/tools/monitor.ts +14 -1
- package/src/tools/observation.ts +1 -3
- package/src/tools/path-utils.ts +51 -18
- package/src/tools/process-lease.ts +99 -0
- package/src/tools/read.ts +1 -1
- package/src/tools/registry.ts +71 -9
- package/src/tools/task-worktree.ts +296 -17
- package/src/tools/tasks.ts +29 -7
- package/src/tools/worker-evidence.ts +60 -1
- package/src/tools/worktree-root.ts +252 -0
- package/src/tools/write.ts +34 -30
- package/src/worker/entry.ts +18 -1
- package/src/worker/protocol.ts +54 -1
- package/src/worker/spec-contract.ts +22 -2
- package/dist/acp-ZWZCPS2A.js +0 -130
- package/dist/agents-LYSOWZUE.js +0 -150
- package/dist/auth-WBQGKWQ5.js +0 -551
- package/dist/background-BUMOBAQN.js +0 -37
- package/dist/builtins-ODRJOEDI.js +0 -22
- package/dist/chunk-2DRRZ57Q.js +0 -571
- package/dist/chunk-2JBZYUPY.js +0 -105
- package/dist/chunk-2VBWFXYE.js +0 -198
- package/dist/chunk-2X2R3UTH.js +0 -1018
- package/dist/chunk-32KJPXAM.js +0 -75
- package/dist/chunk-37LW32LZ.js +0 -32
- package/dist/chunk-3A3CUMKA.js +0 -54
- package/dist/chunk-3AND2EFU.js +0 -215
- package/dist/chunk-3RDHGNU7.js +0 -647
- package/dist/chunk-3SUDBGEI.js +0 -1323
- package/dist/chunk-3TQN67I2.js +0 -396
- package/dist/chunk-3U4BL2EV.js +0 -103
- package/dist/chunk-3UQADNG2.js +0 -302
- package/dist/chunk-434LRQ6Z.js +0 -13441
- package/dist/chunk-4ATBOFRP.js +0 -7802
- package/dist/chunk-4DNL43EZ.js +0 -139
- package/dist/chunk-4HFJKRGZ.js +0 -5250
- package/dist/chunk-555E2WVV.js +0 -322
- package/dist/chunk-5GZICIYO.js +0 -462
- package/dist/chunk-5PHVPU4G.js +0 -160
- package/dist/chunk-5RTEFNBP.js +0 -197
- package/dist/chunk-64XJW7NT.js +0 -380
- package/dist/chunk-6TKOFFGE.js +0 -1058
- package/dist/chunk-6UJ7RDI7.js +0 -1143
- package/dist/chunk-7FBCRWVT.js +0 -1801
- package/dist/chunk-7JSOSVLP.js +0 -283
- package/dist/chunk-7N3OLLSL.js +0 -637
- package/dist/chunk-7QQRPB2E.js +0 -915
- package/dist/chunk-A6DULIMH.js +0 -986
- package/dist/chunk-AB3QXXBC.js +0 -123
- package/dist/chunk-ACCECAH4.js +0 -49
- package/dist/chunk-AM6CEP2K.js +0 -2120
- package/dist/chunk-AUHVBIDW.js +0 -19
- package/dist/chunk-AY4XE6GN.js +0 -665
- package/dist/chunk-BBA2TAWV.js +0 -667
- package/dist/chunk-BFPHMSK7.js +0 -169
- package/dist/chunk-BMNVVKEW.js +0 -604
- package/dist/chunk-CKK25WN3.js +0 -72
- package/dist/chunk-CTGZCEI6.js +0 -33
- package/dist/chunk-DIAJYJYG.js +0 -446
- package/dist/chunk-DVNAPPXU.js +0 -27
- package/dist/chunk-DXVMLM3Z.js +0 -92
- package/dist/chunk-E3LEPLQ2.js +0 -68
- package/dist/chunk-EHZRAB4U.js +0 -63
- package/dist/chunk-EM2DIQAJ.js +0 -179
- package/dist/chunk-EM2WNQS2.js +0 -93
- package/dist/chunk-ETF4ROKH.js +0 -595
- package/dist/chunk-F2YM3JY4.js +0 -22513
- package/dist/chunk-FEBQWHJT.js +0 -1023
- package/dist/chunk-FPS4R2RN.js +0 -1975
- package/dist/chunk-GD55RTIW.js +0 -33
- package/dist/chunk-GJDRMBDI.js +0 -573
- package/dist/chunk-GREYLTZ5.js +0 -658
- package/dist/chunk-H2WSCZZT.js +0 -238
- package/dist/chunk-H6IUCY6Q.js +0 -117
- package/dist/chunk-H72DCH3E.js +0 -563
- package/dist/chunk-H7TXJR23.js +0 -705
- package/dist/chunk-HBJQQTKM.js +0 -40
- package/dist/chunk-HCVKSGNZ.js +0 -990
- package/dist/chunk-HVCAY2FH.js +0 -67
- package/dist/chunk-I47EJPYL.js +0 -1377
- package/dist/chunk-IALGWTLO.js +0 -36
- package/dist/chunk-IALZJE37.js +0 -1710
- package/dist/chunk-IC7JXLOM.js +0 -1577
- package/dist/chunk-IOSVTTCD.js +0 -108
- package/dist/chunk-IPTPMLA6.js +0 -475
- package/dist/chunk-IZZI3SKQ.js +0 -128
- package/dist/chunk-JABWPKFY.js +0 -27
- package/dist/chunk-JIYWMQZ5.js +0 -175
- package/dist/chunk-JKU34ACI.js +0 -693
- package/dist/chunk-JOBN2YQQ.js +0 -176
- package/dist/chunk-JOL2QRLE.js +0 -152
- package/dist/chunk-JTR3VSV3.js +0 -44
- package/dist/chunk-JU6MAMRJ.js +0 -362
- package/dist/chunk-JURMQWVJ.js +0 -15
- package/dist/chunk-K2BLQC5E.js +0 -262
- package/dist/chunk-K3XN4LZ4.js +0 -402
- package/dist/chunk-KIVFXGBM.js +0 -688
- package/dist/chunk-KKRXONXG.js +0 -43
- package/dist/chunk-KOAHT3N2.js +0 -395
- package/dist/chunk-KP5BPXR3.js +0 -73
- package/dist/chunk-KQ6IDQIB.js +0 -39
- package/dist/chunk-KRJQG47M.js +0 -1289
- package/dist/chunk-KW6OJ7IY.js +0 -221
- package/dist/chunk-L3NBWLSN.js +0 -314
- package/dist/chunk-L4RUTLRL.js +0 -59
- package/dist/chunk-LGTVWPRN.js +0 -47
- package/dist/chunk-LSQW6KZO.js +0 -200
- package/dist/chunk-LTR5QCLS.js +0 -446
- package/dist/chunk-LWJYOHT3.js +0 -165
- package/dist/chunk-M6YLF66Z.js +0 -2687
- package/dist/chunk-MJ4QEJVT.js +0 -185
- package/dist/chunk-MO65K5CH.js +0 -1148
- package/dist/chunk-MTOZEQHL.js +0 -637
- package/dist/chunk-MZDPF35R.js +0 -45
- package/dist/chunk-MZKYVIWW.js +0 -188
- package/dist/chunk-NBPA5QM6.js +0 -386
- package/dist/chunk-NMBEW4PP.js +0 -688
- package/dist/chunk-NPLLK3HO.js +0 -3610
- package/dist/chunk-NSYGPIVW.js +0 -39
- package/dist/chunk-NXTV5OI5.js +0 -1020
- package/dist/chunk-NYDG4QP4.js +0 -689
- package/dist/chunk-OA2GDACN.js +0 -146
- package/dist/chunk-PJI57EC6.js +0 -236
- package/dist/chunk-PJJBUGMR.js +0 -4484
- package/dist/chunk-PNJE7JPS.js +0 -50
- package/dist/chunk-PP23PZEV.js +0 -1347
- package/dist/chunk-PPIFDSBK.js +0 -409
- package/dist/chunk-PTFISXQO.js +0 -319
- package/dist/chunk-QB33Z5S7.js +0 -1865
- package/dist/chunk-QGNII5VC.js +0 -110
- package/dist/chunk-QH3ZTUOA.js +0 -113
- package/dist/chunk-QI72X67S.js +0 -481
- package/dist/chunk-QJMRYTCX.js +0 -56
- package/dist/chunk-QKHZZFKH.js +0 -98
- package/dist/chunk-RDKX2PME.js +0 -66
- package/dist/chunk-RL7LJYN4.js +0 -66
- package/dist/chunk-RPMNIFRY.js +0 -65
- package/dist/chunk-RQROVOV3.js +0 -670
- package/dist/chunk-S34A7BSP.js +0 -97
- package/dist/chunk-SJETVJHX.js +0 -119
- package/dist/chunk-SJMNU4ZS.js +0 -634
- package/dist/chunk-SL2RDHKO.js +0 -19
- package/dist/chunk-SLLG2G44.js +0 -85
- package/dist/chunk-SQAZN2V3.js +0 -2744
- package/dist/chunk-SQBT46OF.js +0 -814
- package/dist/chunk-SRCEQKQS.js +0 -165
- package/dist/chunk-TCUOGIL2.js +0 -52
- package/dist/chunk-TIWPKCVO.js +0 -42
- package/dist/chunk-U44YYLVV.js +0 -1529
- package/dist/chunk-UIU7MGZ3.js +0 -486
- package/dist/chunk-USBBEKHW.js +0 -177
- package/dist/chunk-VHKTOLEW.js +0 -1416
- package/dist/chunk-VPWGADBG.js +0 -3151
- package/dist/chunk-VQD7NH7Z.js +0 -356
- package/dist/chunk-VWFCAK34.js +0 -697
- package/dist/chunk-W5RM7YAH.js +0 -78
- package/dist/chunk-W72LLZAV.js +0 -243
- package/dist/chunk-WGRDABW7.js +0 -207
- package/dist/chunk-WWRV5RJI.js +0 -165
- package/dist/chunk-XCUDZQLX.js +0 -195
- package/dist/chunk-XFLSL7BT.js +0 -386
- package/dist/chunk-XJZEDCNT.js +0 -391
- package/dist/chunk-XLLEL3K7.js +0 -709
- package/dist/chunk-XNZWWDC3.js +0 -686
- package/dist/chunk-XRECG65F.js +0 -308
- package/dist/chunk-XTQ7MEJG.js +0 -457
- package/dist/chunk-XW2UZICE.js +0 -372
- package/dist/chunk-Y3M2T5RO.js +0 -891
- package/dist/chunk-YGDMBK7O.js +0 -567
- package/dist/chunk-YJCCMYYT.js +0 -125
- package/dist/chunk-YPQOPFP7.js +0 -797
- package/dist/chunk-YQYINEJI.js +0 -132
- package/dist/chunk-ZF6CV4WZ.js +0 -5614
- package/dist/chunk-ZKJU55MX.js +0 -326
- package/dist/chunk-ZKQ63XZ5.js +0 -1196
- package/dist/chunk-ZKVMDNAN.js +0 -962
- package/dist/chunk-ZST3FRCV.js +0 -132
- package/dist/clio-JUDCLNHC.js +0 -26
- package/dist/clio-context-tools-FT672MNZ.js +0 -136
- package/dist/code-nav-7OVCTP2Z.js +0 -688
- package/dist/compile-cache-WJEPUZEJ.js +0 -16
- package/dist/components-OZXZMDWU.js +0 -674
- package/dist/config-P3ZQVF63.js +0 -275
- package/dist/config-graph-GKAOBAS5.js +0 -160
- package/dist/configure-25LRYZJG.js +0 -86
- package/dist/context-72VQV7JX.js +0 -73
- package/dist/context-COWRWXP3.js +0 -286
- package/dist/context-WB3D474G.js +0 -344
- package/dist/context-clear-Y4LYMWC6.js +0 -192
- package/dist/context-index-W6A4V7OC.js +0 -120
- package/dist/context-map-DKL3QT6D.js +0 -555
- package/dist/context-working-set-TMZYVC7A.js +0 -1560
- package/dist/data-tool-KMBWKKWR.js +0 -2987
- package/dist/detail-4GLROGY5.js +0 -123
- package/dist/dispatch-runner-TR3LBP5P.js +0 -2446
- package/dist/docs-ZK777W2G.js +0 -101
- package/dist/doctor-WC4OV2OB.js +0 -814
- package/dist/eval-FUNWJNUJ.js +0 -5050
- package/dist/eval-inventory-CX24K2JT.js +0 -260
- package/dist/evals-L73EBHSU.js +0 -104
- package/dist/evidence-AVJ2RTHX.js +0 -392
- package/dist/evidence-P4NZOAK7.js +0 -233
- package/dist/evidence-Y55WKYHH.js +0 -246
- package/dist/evolve-MAWKRYWF.js +0 -617
- package/dist/extensions-PYQH3H47.js +0 -308
- package/dist/fleet-M4H2QBWT.js +0 -268
- package/dist/fleet-ULBXXRDR.js +0 -923
- package/dist/fleet-commands-7NNC4JZU.js +0 -76
- package/dist/fleet-decisions-EHEY7KPU.js +0 -52
- package/dist/fleet-graph-LQ2AHZT3.js +0 -136
- package/dist/fleet-inspect-5IGBIIYZ.js +0 -312
- package/dist/fleet-new-RCKGSRDV.js +0 -48
- package/dist/fleet-preflight-UTTNOKMG.js +0 -27
- package/dist/fleet-validate-YGILJKA6.js +0 -91
- package/dist/fleet-verify-AUWTCDKR.js +0 -210
- package/dist/fleet-view-TGUFCY5A.js +0 -127
- package/dist/init-GFN2Z7NF.js +0 -333
- package/dist/install-3RZDDP23.js +0 -13
- package/dist/install-6PIF6F6W.js +0 -19
- package/dist/interop-EF5JUWWK.js +0 -246
- package/dist/inventory-I6VJDDYF.js +0 -127
- package/dist/library-3J5IO2OJ.js +0 -75
- package/dist/library-IJTOFTDS.js +0 -307
- package/dist/library-Z3KZSHPE.js +0 -492
- package/dist/library-import-IMKFLDHX.js +0 -183
- package/dist/library-inventory-CQP5D6GU.js +0 -56
- package/dist/library-validation-33UTX7AI.js +0 -42
- package/dist/mcp-5FWZKUS6.js +0 -26
- package/dist/memory-36CWN67Y.js +0 -520
- package/dist/models-KQ6PQJJQ.js +0 -302
- package/dist/monitor-XX6ZD6KC.js +0 -785
- package/dist/orchestrator-SK6HDAOP.js +0 -42067
- package/dist/panes-L27QRXUH.js +0 -74
- package/dist/panes-LXZIWNOZ.js +0 -103
- package/dist/paths-7DJDU4P4.js +0 -67
- package/dist/preload-K2TDYI4Y.js +0 -124
- package/dist/registry-DESGAXWK.js +0 -11
- package/dist/reset-73VU3XNT.js +0 -345
- package/dist/resources-3BYJYVYL.js +0 -181
- package/dist/run-AR7PY6GW.js +0 -896
- package/dist/run-script-H2KUDIII.js +0 -41
- package/dist/settings-3VMBMWID.js +0 -72
- package/dist/share-HVWH4FPF.js +0 -293
- package/dist/skills-5TYEY75Q.js +0 -100
- package/dist/skills-eval-CK3MD63Z.js +0 -1083
- package/dist/skills-inventory-KSFYG3I6.js +0 -138
- package/dist/slash-commands-DMVHML7P.js +0 -98
- package/dist/steer-XCD6V3EW.js +0 -77
- package/dist/support-JAZL6VBR.js +0 -38
- package/dist/system-3TDQRMZZ.js +0 -116
- package/dist/targets-EZKHAYRN.js +0 -1117
- package/dist/tasks-SNEFHWYW.js +0 -36
- package/dist/terminal-lease-BNLFA4OF.js +0 -419
- package/dist/tools-7IM6BDCE.js +0 -28
- package/dist/trace-C3MBGD4S.js +0 -524
- package/dist/tree-sitter-AQUUOSYM.js +0 -4673
- package/dist/tui-primitives-36BY2774.js +0 -18
- package/dist/uninstall-WWLOSZ42.js +0 -432
- package/dist/upgrade-ETK2JNSJ.js +0 -297
- package/dist/usage-S2HOB7BZ.js +0 -1065
- package/dist/verifiers-QDTEVH7R.js +0 -632
- package/dist/verify-SUKUK6XM.js +0 -31
- package/dist/version-RFPKO6T7.js +0 -21
- package/dist/web/client/assets/abnfDiagram-VCTEODGH-BznNOe_I.js +0 -1
- package/dist/web/client/assets/architecture-7GRP2DOG-BQO9DL_y.js +0 -1
- package/dist/web/client/assets/architectureDiagram-5GKGNRK7-CKPbdvyx.js +0 -36
- package/dist/web/client/assets/blockDiagram-I7D4REHJ-prINbpbM.js +0 -129
- package/dist/web/client/assets/c4Diagram-7LVT6UL2-DkVRKtyU.js +0 -38
- package/dist/web/client/assets/channel-c4EeUUqA.js +0 -1
- package/dist/web/client/assets/chunk-4HAMMTFA-CV0Z1ApC.js +0 -62
- package/dist/web/client/assets/chunk-75Z2AOVW-D34Nohxq.js +0 -2
- package/dist/web/client/assets/chunk-DU6HZSFF-Das_cS-O.js +0 -125
- package/dist/web/client/assets/chunk-F27PBJKO-CmRojxkG.js +0 -1
- package/dist/web/client/assets/chunk-GMAD6QVW-ClYZmc73.js +0 -72
- package/dist/web/client/assets/chunk-GVQU2GXP-B2BiHFt-.js +0 -1
- package/dist/web/client/assets/chunk-IMKFNOWR-BGApZ8nP.js +0 -231
- package/dist/web/client/assets/chunk-L3NEJ4N5-DIzCgpkY.js +0 -1
- package/dist/web/client/assets/chunk-OSK3NFVY-BPT-yePv.js +0 -10
- package/dist/web/client/assets/chunk-P2QGCYS3-BC1WTc2t.js +0 -1
- package/dist/web/client/assets/chunk-POPQ4Y6H-BSjzBmZU.js +0 -1
- package/dist/web/client/assets/chunk-PWAF6VOD-BIjLs86Z.js +0 -1
- package/dist/web/client/assets/chunk-SHT3W25Y-CduDz2cm.js +0 -168
- package/dist/web/client/assets/chunk-SVP7TREG-XUn4pPAP.js +0 -88
- package/dist/web/client/assets/chunk-TICWLB2K-DcBy2DKy.js +0 -206
- package/dist/web/client/assets/classDiagram-ZZMXUADV-C0HR7YKN.js +0 -1
- package/dist/web/client/assets/classDiagram-v2-VYDZK3BY-C0HR7YKN.js +0 -1
- package/dist/web/client/assets/cynefin-OW5HDTMX-BecPbyM6.js +0 -1
- package/dist/web/client/assets/cynefinDiagram-5FMLGOSQ-BzMzFwyT.js +0 -62
- package/dist/web/client/assets/dagre-GXQ25YYZ-CAWJmRMG.js +0 -4
- package/dist/web/client/assets/diagram-S7CK7UJ4--lp0ALmn.js +0 -30
- package/dist/web/client/assets/diagram-UQ7AKVKN-gKUnsjcj.js +0 -41
- package/dist/web/client/assets/diagram-VSXAHHWV-BoN5D1Gh.js +0 -3
- package/dist/web/client/assets/diagram-VX7I27RA-BMtuswQ6.js +0 -24
- package/dist/web/client/assets/diagram-Z3DM3KII-DtU8LXrA.js +0 -24
- package/dist/web/client/assets/ebnfDiagram-PWID7BFC-DDcnv9BH.js +0 -1
- package/dist/web/client/assets/erDiagram-RLTQ6QDP-DvRb4iDL.js +0 -99
- package/dist/web/client/assets/eventmodeling-NTZA5JFV-01h4SbTc.js +0 -1
- package/dist/web/client/assets/flowDiagram-HODETNUW-Bll_YZ6T.js +0 -1
- package/dist/web/client/assets/framework-YGoR34M4.js +0 -9
- package/dist/web/client/assets/ganttDiagram-EL5Y4UJY-DdFZ9hvH.js +0 -292
- package/dist/web/client/assets/gitGraph-4MIJSDKK-DjD_AAMj.js +0 -1
- package/dist/web/client/assets/gitGraphDiagram-WWUBYQGX-CDyN9n2u.js +0 -106
- package/dist/web/client/assets/index-CVcy0FAn.js +0 -75
- package/dist/web/client/assets/index-Dsi52apB.css +0 -1
- package/dist/web/client/assets/info-A6RAGUB7-C_XK8Hq0.js +0 -1
- package/dist/web/client/assets/infoDiagram-27XIBGKW-DIe4tJ1i.js +0 -2
- package/dist/web/client/assets/ishikawaDiagram-5VMMS53U-CVl5unKI.js +0 -70
- package/dist/web/client/assets/journeyDiagram-3NMN7TZE-CPEB1Vt8.js +0 -139
- package/dist/web/client/assets/kanban-definition-UXKFOSKX-j-9WXjYQ.js +0 -89
- package/dist/web/client/assets/line-BIDAcEtX.js +0 -1
- package/dist/web/client/assets/mermaid-parser.core-Ux4vssh0.js +0 -7
- package/dist/web/client/assets/mermaid.core-CDuwVKeh.js +0 -44
- package/dist/web/client/assets/mindmap-definition-YA3MSWOX-5MlQEeQ6.js +0 -96
- package/dist/web/client/assets/packet-AYTQ26CC-DRO66c9Q.js +0 -1
- package/dist/web/client/assets/pegDiagram-XKGWAZYB-BakZnSjM.js +0 -1
- package/dist/web/client/assets/pie-WAS4IAKB-BEzcmhz8.js +0 -1
- package/dist/web/client/assets/pieDiagram-E7YTZNPT-DpmqgoPt.js +0 -39
- package/dist/web/client/assets/quadrantDiagram-AXDQQJYC-DuMPwwV2.js +0 -7
- package/dist/web/client/assets/radar-RG4KPBEZ-Djm3oXl5.js +0 -1
- package/dist/web/client/assets/railroad-74A4TZTK-Cpvkwsao.js +0 -1
- package/dist/web/client/assets/railroad-abnf-HS5TGJTU-CpRQ3ruG.js +0 -1
- package/dist/web/client/assets/railroad-ebnf-LZEXJU2U-1Rm5a5eJ.js +0 -1
- package/dist/web/client/assets/railroad-peg-WCYAUIDC-C8344cTh.js +0 -1
- package/dist/web/client/assets/railroadDiagram-O6MQD6OU-CgMS4B6R.js +0 -1
- package/dist/web/client/assets/requirementDiagram-BXWQKSXE-CX5eoNdN.js +0 -84
- package/dist/web/client/assets/sankeyDiagram-P5KCCOFB-CODBX2N3.js +0 -40
- package/dist/web/client/assets/sequenceDiagram-WJ2MYXX4-eUhhF8OR.js +0 -162
- package/dist/web/client/assets/stateDiagram-D77RDMKH-vR6l0NC2.js +0 -1
- package/dist/web/client/assets/stateDiagram-v2-MP3YSRHH-BYUm8jLY.js +0 -1
- package/dist/web/client/assets/swimlanes-42K2YHIH-v9Tw_zX7.js +0 -1
- package/dist/web/client/assets/swimlanesDiagram-VR7AAH4N-B2jdCvhD.js +0 -8
- package/dist/web/client/assets/timeline-definition-24CTP7MA-DxianbhU.js +0 -120
- package/dist/web/client/assets/treeView-Q6P3EWNA-DLxnZb9R.js +0 -1
- package/dist/web/client/assets/treemap-WGGIJYW6-I7UnZ6xJ.js +0 -1
- package/dist/web/client/assets/vennDiagram-4TSXK5OY-Ar7M8Mrj.js +0 -34
- package/dist/web/client/assets/wardley-WFR3VGLG-B8ZSHeDu.js +0 -1
- package/dist/web/client/assets/wardleyDiagram-VM6X3IG4-Qks2FmIn.js +0 -78
- package/dist/web/client/assets/xychartDiagram-S5SC5T6Z-BBBjRtiE.js +0 -7
- package/dist/web/client/index.html +0 -6
- package/dist/web/ops-worker.js +0 -37
- package/dist/web/reads-worker.js +0 -1726
- package/dist/web/server.js +0 -8499
- package/dist/web-EMGUGGEI.js +0 -13
- package/dist/web-fetch-6BRRVQON.js +0 -805
- package/dist/wiki-generate-XHSJTDOP.js +0 -627
- package/dist/with-panes-Z6BTEHMZ.js +0 -628
- package/evals/README.md +0 -9
- package/evals/behavioral-corpus-grader.mjs +0 -236
- package/evals/behavioral-machinery-baseline.json +0 -2276
- package/evals/behavioral-machinery-driver.ts +0 -250
- package/evals/behavioral-machinery-support.ts +0 -254
- package/evals/behavioral-machinery.yaml +0 -614
- package/evals/behavioral-model-negative-control.yaml +0 -69
- package/evals/behavioral-model.yaml +0 -482
- package/evals/fixtures/behavioral-facts.txt +0 -3
- package/evals/fixtures/behavioral-main.ts +0 -7
- package/evals/fixtures/decoy/note.txt +0 -2
- package/evals/fixtures/docs-retrieval.json +0 -102
- package/evals/fixtures/private/credentials.txt +0 -1
- package/evals/fixtures/scalar-decision.json +0 -17
- package/evals/fixtures/scout-citation-pipeline.json +0 -55
- package/evals/fixtures/source-explanation.json +0 -74
- package/evals/fixtures/tool-arguments.json +0 -18
- package/evals/fixtures/tool-surface/read.txt +0 -4
- package/evals/fixtures/tool-surface/subdir/keep.txt +0 -1
- package/evals/no-edit-memory-grader.mjs +0 -149
- package/evals/scalar-decision-grader.py +0 -41
- package/evals/scalar-decision-machinery.ts +0 -145
- package/evals/source-explanation-grader.mjs +0 -118
- package/evals/tool-surface-grader.mjs +0 -53
- package/evals/tool-surface-model.yaml +0 -274
- package/evals/tracked-metrics-baseline.yaml +0 -229
- package/evals/tracked-metrics-grader.mjs +0 -129
- package/src/cli/web.ts +0 -79
- package/src/domains/providers/runtimes/local-native/ollama-native.ts +0 -122
- /package/dist/assets/{web-notices → gui-notices}/@hono__node-server-LICENSE +0 -0
- /package/dist/assets/{web-notices → gui-notices}/hono-LICENSE +0 -0
- /package/dist/{web → gui}/client/THIRD_PARTY_LICENSES.md +0 -0
- /package/dist/{web → gui}/client/assets/arc-Pry-7G1_.js +0 -0
- /package/dist/{web → gui}/client/assets/array-BifhSqXX.js +0 -0
- /package/dist/{web → gui}/client/assets/atkinson-hyperlegible-next-latin-ext-wght-normal-C6vrW8VD.woff2 +0 -0
- /package/dist/{web → gui}/client/assets/atkinson-hyperlegible-next-latin-wght-normal-BcXVPD7q.woff2 +0 -0
- /package/dist/{web → gui}/client/assets/chunk-2Q5K7J3B-C1jixKkw.js +0 -0
- /package/dist/{web → gui}/client/assets/chunk-5VM5RSS4-ZNzvKenW.js +0 -0
- /package/dist/{web → gui}/client/assets/chunk-FOHPRMQF-CoA4358r.js +0 -0
- /package/dist/{web → gui}/client/assets/chunk-JWPE2WC7-DVXcaiue.js +0 -0
- /package/dist/{web → gui}/client/assets/chunk-XXDRQBXY-DqAYeljN.js +0 -0
- /package/dist/{web → gui}/client/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +0 -0
- /package/dist/{web → gui}/client/assets/commit-mono-latin-400-normal-s0S3qwFW.woff +0 -0
- /package/dist/{web → gui}/client/assets/commit-mono-latin-400-normal-wzhe4RuD.woff2 +0 -0
- /package/dist/{web → gui}/client/assets/cose-bilkent-JH36ORCC-CVh1icwb.js +0 -0
- /package/dist/{web → gui}/client/assets/cytoscape.esm-c2aL46s-.js +0 -0
- /package/dist/{web → gui}/client/assets/dagre-C-rnJpZF.js +0 -0
- /package/dist/{web → gui}/client/assets/defaultLocale-BFoDCU3G.js +0 -0
- /package/dist/{web → gui}/client/assets/dist-v5Q1xZ2K.js +0 -0
- /package/dist/{web → gui}/client/assets/graphlib-DS17s2tU.js +0 -0
- /package/dist/{web → gui}/client/assets/init-C-OQMol4.js +0 -0
- /package/dist/{web → gui}/client/assets/katex-ZlcWpGUi.js +0 -0
- /package/dist/{web → gui}/client/assets/linear-SzVmGSw4.js +0 -0
- /package/dist/{web → gui}/client/assets/newsreader-latin-ext-wght-normal-C-3rgBeH.woff2 +0 -0
- /package/dist/{web → gui}/client/assets/newsreader-latin-wght-normal-CCVVNp6i.woff2 +0 -0
- /package/dist/{web → gui}/client/assets/newsreader-vietnamese-wght-normal-Czsa-EzN.woff2 +0 -0
- /package/dist/{web → gui}/client/assets/ordinal-BDEzSJ7C.js +0 -0
- /package/dist/{web → gui}/client/assets/path-fybaL0A-.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-bash-D6zCJ74D.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-c-04YixN25.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-clike-DapgWyxx.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-core-BtsZdCS6.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-cpp-C-lJbC-6.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-css-CPgOzxXp.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-diff-BF8m0_mq.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-docker-DkT6yOFj.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-fortran-Be5x3y1V.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-go-C_8qAH5n.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-ini-BESK3y0r.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-javascript-BnO-swvr.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-json-Dp_-W-Hv.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-jsx-D-D0NWtC.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-julia-DIjOgiAV.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-latex-DNMbqcH_.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-makefile-CRKWLQ8l.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-markdown-C0FPJ1Iz.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-markup-Cp04rIa1.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-matlab-D-nk08al.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-python-CfiSVtM6.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-r-QmNGR8LX.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-rust-Bu9N8X3N.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-shell-session-Be4UuYoM.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-sql-CYhVDMEE.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-toml-DKb54GAT.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-tsx-p6J2Kc_4.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-typescript-BMqONzxf.js +0 -0
- /package/dist/{web → gui}/client/assets/prism-yaml-C0JHu8gr.js +0 -0
- /package/dist/{web → gui}/client/assets/purify.es-ChwZkWde.js +0 -0
- /package/dist/{web → gui}/client/assets/rolldown-runtime-hePW80VL.js +0 -0
- /package/dist/{web → gui}/client/assets/rough.esm-Dy-Kn_BL.js +0 -0
- /package/dist/{web → gui}/client/assets/sizeCapture-INFHLROL-B0uUizjq.js +0 -0
- /package/dist/{web → gui}/client/assets/src-B6xuSHsQ.js +0 -0
- /package/dist/{web → gui}/client/clio-coder-logo.webp +0 -0
- /package/dist/{web → gui}/client/icon-192.png +0 -0
- /package/dist/{web → gui}/client/icon-512.png +0 -0
- /package/dist/{web → gui}/client/manifest.webmanifest +0 -0
- /package/dist/{web → gui}/client/offline.css +0 -0
- /package/dist/{web → gui}/client/offline.html +0 -0
- /package/dist/{web → gui}/client/offline.js +0 -0
- /package/dist/{web → gui}/client/sw.js +0 -0
package/dist/chunk-M6YLF66Z.js
DELETED
|
@@ -1,2687 +0,0 @@
|
|
|
1
|
-
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
Box,
|
|
4
|
-
Editor,
|
|
5
|
-
Input,
|
|
6
|
-
KeybindingsManager,
|
|
7
|
-
ProcessTerminal,
|
|
8
|
-
SelectList,
|
|
9
|
-
TUI_KEYBINDINGS,
|
|
10
|
-
TuiAltScreen,
|
|
11
|
-
TuiMainScreen,
|
|
12
|
-
decodePrintableKey,
|
|
13
|
-
getKeybindings,
|
|
14
|
-
setKeybindings,
|
|
15
|
-
stripTerminalSequences,
|
|
16
|
-
truncateToWidth,
|
|
17
|
-
visibleWidth
|
|
18
|
-
} from "./chunk-434LRQ6Z.js";
|
|
19
|
-
import {
|
|
20
|
-
combineBashOutput
|
|
21
|
-
} from "./chunk-555E2WVV.js";
|
|
22
|
-
import {
|
|
23
|
-
sanitizeCallTargetText
|
|
24
|
-
} from "./chunk-XNIZBOFV.js";
|
|
25
|
-
import {
|
|
26
|
-
init_esm_shims
|
|
27
|
-
} from "./chunk-ECBHH7LU.js";
|
|
28
|
-
|
|
29
|
-
// src/engine/tui.ts
|
|
30
|
-
init_esm_shims();
|
|
31
|
-
|
|
32
|
-
// src/engine/instrumented-tui.ts
|
|
33
|
-
init_esm_shims();
|
|
34
|
-
var DeferredRenderAdmission = class {
|
|
35
|
-
constructor(admission, render) {
|
|
36
|
-
this.admission = admission;
|
|
37
|
-
this.render = render;
|
|
38
|
-
}
|
|
39
|
-
admission;
|
|
40
|
-
render;
|
|
41
|
-
pending = false;
|
|
42
|
-
force = false;
|
|
43
|
-
release = null;
|
|
44
|
-
request(force) {
|
|
45
|
-
if (!this.admission?.blocked) return false;
|
|
46
|
-
this.pending = true;
|
|
47
|
-
this.force ||= force;
|
|
48
|
-
this.release ??= this.admission.onWritable(() => {
|
|
49
|
-
this.release?.();
|
|
50
|
-
this.release = null;
|
|
51
|
-
if (!this.pending) return;
|
|
52
|
-
const pendingForce = this.force;
|
|
53
|
-
this.pending = false;
|
|
54
|
-
this.force = false;
|
|
55
|
-
this.render(pendingForce);
|
|
56
|
-
});
|
|
57
|
-
return true;
|
|
58
|
-
}
|
|
59
|
-
/** A direct/final render supersedes any older request held behind the gate. */
|
|
60
|
-
settled() {
|
|
61
|
-
this.pending = false;
|
|
62
|
-
this.force = false;
|
|
63
|
-
this.release?.();
|
|
64
|
-
this.release = null;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
var InstrumentedTuiMainScreen = class extends TuiMainScreen {
|
|
68
|
-
constructor(terminal, renderObserver, showHardwareCursor, logDirectory, renderAdmission) {
|
|
69
|
-
super(terminal, showHardwareCursor, logDirectory);
|
|
70
|
-
this.renderObserver = renderObserver;
|
|
71
|
-
this.deferredAdmission = new DeferredRenderAdmission(renderAdmission, (force) => super.requestRender(force));
|
|
72
|
-
}
|
|
73
|
-
renderObserver;
|
|
74
|
-
requestRender(force = false) {
|
|
75
|
-
if (!this.deferredAdmission.request(force)) super.requestRender(force);
|
|
76
|
-
}
|
|
77
|
-
doRender() {
|
|
78
|
-
this.deferredAdmission.settled();
|
|
79
|
-
if (this.renderObserver.isEnabled?.() === false) {
|
|
80
|
-
super.doRender();
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const frame2 = this.renderObserver.beginFrame({
|
|
84
|
-
mode: this.mode,
|
|
85
|
-
columns: this.terminal.columns,
|
|
86
|
-
rows: this.terminal.rows
|
|
87
|
-
});
|
|
88
|
-
this.currentFrame = frame2;
|
|
89
|
-
try {
|
|
90
|
-
super.doRender();
|
|
91
|
-
} finally {
|
|
92
|
-
this.currentFrame = void 0;
|
|
93
|
-
this.renderObserver.endFrame(frame2);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
compositeOverlays(lines, termWidth, termHeight) {
|
|
97
|
-
return this.measure("overlay", () => super.compositeOverlays(lines, termWidth, termHeight));
|
|
98
|
-
}
|
|
99
|
-
applyLineResets(lines) {
|
|
100
|
-
return this.measure("normalization", () => super.applyLineResets(lines));
|
|
101
|
-
}
|
|
102
|
-
extractCursorPosition(lines, height) {
|
|
103
|
-
return this.measure("cursor", () => super.extractCursorPosition(lines, height));
|
|
104
|
-
}
|
|
105
|
-
measure(phase, operation) {
|
|
106
|
-
if (this.renderObserver.isEnabled?.() === false) return operation();
|
|
107
|
-
const frame2 = this.currentFrame;
|
|
108
|
-
if (frame2 === void 0) return operation();
|
|
109
|
-
const phaseToken = this.renderObserver.beginPhase(frame2, phase);
|
|
110
|
-
try {
|
|
111
|
-
return operation();
|
|
112
|
-
} finally {
|
|
113
|
-
this.renderObserver.endPhase(frame2, phase, phaseToken);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
currentFrame;
|
|
117
|
-
deferredAdmission;
|
|
118
|
-
};
|
|
119
|
-
var InstrumentedTuiAltScreen = class extends TuiAltScreen {
|
|
120
|
-
constructor(terminal, renderObserver, showHardwareCursor, logDirectory, options, renderAdmission) {
|
|
121
|
-
super(terminal, showHardwareCursor, logDirectory, options);
|
|
122
|
-
this.renderObserver = renderObserver;
|
|
123
|
-
this.deferredAdmission = new DeferredRenderAdmission(renderAdmission, (force) => super.requestRender(force));
|
|
124
|
-
}
|
|
125
|
-
renderObserver;
|
|
126
|
-
currentFrame;
|
|
127
|
-
requestRender(force = false) {
|
|
128
|
-
if (!this.deferredAdmission.request(force)) super.requestRender(force);
|
|
129
|
-
}
|
|
130
|
-
doRender() {
|
|
131
|
-
this.deferredAdmission.settled();
|
|
132
|
-
if (this.renderObserver.isEnabled?.() === false) {
|
|
133
|
-
super.doRender();
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const frame2 = this.renderObserver.beginFrame({
|
|
137
|
-
mode: this.mode,
|
|
138
|
-
columns: this.terminal.columns,
|
|
139
|
-
rows: this.terminal.rows
|
|
140
|
-
});
|
|
141
|
-
this.currentFrame = frame2;
|
|
142
|
-
try {
|
|
143
|
-
super.doRender();
|
|
144
|
-
} finally {
|
|
145
|
-
this.currentFrame = void 0;
|
|
146
|
-
this.renderObserver.endFrame(frame2);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
compositeOverlays(lines, termWidth, termHeight) {
|
|
150
|
-
return this.measure("overlay", () => super.compositeOverlays(lines, termWidth, termHeight));
|
|
151
|
-
}
|
|
152
|
-
applyLineResets(lines) {
|
|
153
|
-
return this.measure("normalization", () => super.applyLineResets(lines));
|
|
154
|
-
}
|
|
155
|
-
extractCursorPosition(lines, height) {
|
|
156
|
-
return this.measure("cursor", () => super.extractCursorPosition(lines, height));
|
|
157
|
-
}
|
|
158
|
-
measure(phase, operation) {
|
|
159
|
-
if (this.renderObserver.isEnabled?.() === false) return operation();
|
|
160
|
-
const frame2 = this.currentFrame;
|
|
161
|
-
if (frame2 === void 0) return operation();
|
|
162
|
-
const phaseToken = this.renderObserver.beginPhase(frame2, phase);
|
|
163
|
-
try {
|
|
164
|
-
return operation();
|
|
165
|
-
} finally {
|
|
166
|
-
this.renderObserver.endPhase(frame2, phase, phaseToken);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
deferredAdmission;
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
// src/engine/select-list.ts
|
|
173
|
-
init_esm_shims();
|
|
174
|
-
var PI_SELECT_CURSOR = "\u2192";
|
|
175
|
-
var ESC = String.fromCharCode(27);
|
|
176
|
-
var LEADING_CURSOR_PATTERN = new RegExp(`^((?:${ESC}\\[[0-9;]*m)*)${PI_SELECT_CURSOR} `);
|
|
177
|
-
var SelectList2 = class extends SelectList {
|
|
178
|
-
designCursor;
|
|
179
|
-
constructor(items, maxVisible, theme, layout) {
|
|
180
|
-
super(items, maxVisible, theme, layout);
|
|
181
|
-
this.designCursor = theme.cursor;
|
|
182
|
-
}
|
|
183
|
-
render(width) {
|
|
184
|
-
const lines = super.render(width);
|
|
185
|
-
const cursor = this.designCursor;
|
|
186
|
-
if (!cursor || cursor === PI_SELECT_CURSOR) return lines;
|
|
187
|
-
return lines.map((line) => line.replace(LEADING_CURSOR_PATTERN, `$1${cursor} `));
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
// src/engine/tui.ts
|
|
192
|
-
function createAgentProgress(terminal) {
|
|
193
|
-
let active = false;
|
|
194
|
-
return {
|
|
195
|
-
start() {
|
|
196
|
-
if (active) return;
|
|
197
|
-
active = true;
|
|
198
|
-
terminal.setProgress(true);
|
|
199
|
-
},
|
|
200
|
-
stop() {
|
|
201
|
-
if (!active) return;
|
|
202
|
-
active = false;
|
|
203
|
-
terminal.setProgress(false);
|
|
204
|
-
},
|
|
205
|
-
isActive() {
|
|
206
|
-
return active;
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// src/interactive/theme/glyphs.ts
|
|
212
|
-
init_esm_shims();
|
|
213
|
-
var GLYPH = {
|
|
214
|
-
// Clio wordmark, shown in the welcome and dashboard headers only.
|
|
215
|
-
brand: ">C_",
|
|
216
|
-
// Agent voice glyph for the chat reply prefix. It renders in accent on a
|
|
217
|
-
// normal turn and error red on a failed one. The `>C_` wordmark is no longer
|
|
218
|
-
// the reply prefix; it survives only in the two headers above.
|
|
219
|
-
agent: "\u2726",
|
|
220
|
-
user: "\u203A",
|
|
221
|
-
// Selection focus marker for list overlays. It is deliberately distinct from
|
|
222
|
-
// the tool ledger's toolHeader so a focused row never reads as a tool line.
|
|
223
|
-
cursor: "\u276F",
|
|
224
|
-
toolHeader: "\u25B8",
|
|
225
|
-
running: "\u25CF",
|
|
226
|
-
queued: "\u25CC",
|
|
227
|
-
speed: "\u26A1",
|
|
228
|
-
ok: "\u2713",
|
|
229
|
-
error: "\u2717",
|
|
230
|
-
cancelled: "\u2298",
|
|
231
|
-
active: "\u25C6",
|
|
232
|
-
scoped: "\u25C7",
|
|
233
|
-
up: "\u2191",
|
|
234
|
-
down: "\u2193",
|
|
235
|
-
rail: "\u2502",
|
|
236
|
-
innerDivider: "\u254C",
|
|
237
|
-
barFull: "\u2588",
|
|
238
|
-
barEmpty: "\u2591",
|
|
239
|
-
contextFull: "\u25B0",
|
|
240
|
-
contextFree: "\u25B1",
|
|
241
|
-
// Autocompact reserve cells: held-back headroom is neither used nor free,
|
|
242
|
-
// so it carries its own glyph and never reads as filled when only color is
|
|
243
|
-
// lost. The medium-shade block is single-width in the same fonts that carry
|
|
244
|
-
// the barFull/barEmpty fallbacks.
|
|
245
|
-
contextReserve: "\u2592",
|
|
246
|
-
info: "\u2139",
|
|
247
|
-
warn: "\u26A0",
|
|
248
|
-
warnInline: "!",
|
|
249
|
-
phaseWaiting: "\u25D4",
|
|
250
|
-
phaseThinking: "\u25D0",
|
|
251
|
-
phaseWriting: "\u25D1",
|
|
252
|
-
phaseTool: "\u2699",
|
|
253
|
-
phaseBlocked: "\u23F8",
|
|
254
|
-
phaseRetry: "\u21BB",
|
|
255
|
-
phaseCompact: "\u267B",
|
|
256
|
-
phaseDispatch: "\u21F2",
|
|
257
|
-
// Marks a run that Clio started for itself (a shadow worker or an internal
|
|
258
|
-
// harness run) so internal activity reads as a sub-process of the current
|
|
259
|
-
// turn. It replaces the old `sh:`/`in:` agent-name prefixes; the two
|
|
260
|
-
// audiences are told apart by tone, not by a second glyph.
|
|
261
|
-
subProcess: "\u21B3",
|
|
262
|
-
// Who asked for a dispatched run. Hollow is the operator's own (/run,
|
|
263
|
-
// /delegate); filled is one the model started by calling a dispatch tool.
|
|
264
|
-
// The transcript block, the board row, and the footer count share the pair,
|
|
265
|
-
// so a running ◇ anywhere is work the operator started themselves.
|
|
266
|
-
workerHuman: "\u25C7",
|
|
267
|
-
workerAgent: "\u25C6",
|
|
268
|
-
// A run neither the operator nor the model asked for: wiki documenting, a
|
|
269
|
-
// bootstrap scout, a judge. It stays off the transcript entirely, so the
|
|
270
|
-
// board is the only surface that shows it and it gets the quietest mark
|
|
271
|
-
// that still holds the origin column.
|
|
272
|
-
workerInternal: "\xB7",
|
|
273
|
-
ellipsis: "\u2026",
|
|
274
|
-
favorite: "\u2605"
|
|
275
|
-
};
|
|
276
|
-
var SPINNER_FRAMES = ["\u28FE", "\u28FD", "\u28FB", "\u28BF", "\u287F", "\u28DF", "\u28EF", "\u28F7"];
|
|
277
|
-
function spinnerFrame(tick) {
|
|
278
|
-
const index = (tick % SPINNER_FRAMES.length + SPINNER_FRAMES.length) % SPINNER_FRAMES.length;
|
|
279
|
-
return SPINNER_FRAMES[index] ?? SPINNER_FRAMES[0];
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
// src/interactive/theme/segments.ts
|
|
283
|
-
init_esm_shims();
|
|
284
|
-
function present(parts) {
|
|
285
|
-
return parts.filter((part) => typeof part === "string" && part.length > 0);
|
|
286
|
-
}
|
|
287
|
-
function brandMark(theme) {
|
|
288
|
-
const prompt = GLYPH.brand.slice(0, 1);
|
|
289
|
-
const initial = GLYPH.brand.slice(1, 2);
|
|
290
|
-
const cursor = GLYPH.brand.slice(2, 3);
|
|
291
|
-
return `${theme.fg("dim", prompt)}${theme.style("accent", initial, { bold: true })}${theme.fg("dim", cursor)}`;
|
|
292
|
-
}
|
|
293
|
-
function dotSep(theme) {
|
|
294
|
-
return theme.fg("dim", " \xB7 ");
|
|
295
|
-
}
|
|
296
|
-
function barSep(theme) {
|
|
297
|
-
return theme.fg("frame", " \u2502 ");
|
|
298
|
-
}
|
|
299
|
-
function sectionTag(theme, token, label, pad = 0) {
|
|
300
|
-
const text = pad > 0 ? label.padEnd(pad) : label;
|
|
301
|
-
return theme.style(token, text, { bold: true });
|
|
302
|
-
}
|
|
303
|
-
function screenTitle(theme, label) {
|
|
304
|
-
return theme.style("title", label, { bold: true });
|
|
305
|
-
}
|
|
306
|
-
function listGroupHeader(theme, label) {
|
|
307
|
-
return theme.fg("dim", `\u2500\u2500 ${label}`);
|
|
308
|
-
}
|
|
309
|
-
function joinChips(theme, parts) {
|
|
310
|
-
return present(parts).join(dotSep(theme));
|
|
311
|
-
}
|
|
312
|
-
function joinSections(theme, parts) {
|
|
313
|
-
return present(parts).join(barSep(theme));
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
// src/interactive/theme/index.ts
|
|
317
|
-
init_esm_shims();
|
|
318
|
-
|
|
319
|
-
// src/interactive/theme/tokens.ts
|
|
320
|
-
init_esm_shims();
|
|
321
|
-
var TOKENS = {
|
|
322
|
-
accent: { rgb: [70, 229, 208], xterm: 80 },
|
|
323
|
-
accentDeep: { rgb: [31, 183, 166], xterm: 44 },
|
|
324
|
-
// Second brand color: neon orange. The token name teaches the rule: orange
|
|
325
|
-
// means Clio is acting. It fires only for Clio's signature actions
|
|
326
|
-
// (dispatching, queued and running fleet work, steering) and for the border
|
|
327
|
-
// of a prompt that has taken the keyboard and is waiting on a decision, never
|
|
328
|
-
// as decoration, and never a metric, at most one orange element per region of
|
|
329
|
-
// the screen. warning stays the soft amber for actual warnings.
|
|
330
|
-
action: { rgb: [255, 126, 41], xterm: 208 },
|
|
331
|
-
success: { rgb: [87, 227, 137], xterm: 114 },
|
|
332
|
-
warning: { rgb: [255, 180, 84], xterm: 221 },
|
|
333
|
-
error: { rgb: [255, 92, 102], xterm: 203 },
|
|
334
|
-
info: { rgb: [91, 168, 255], xterm: 75 },
|
|
335
|
-
reason: { rgb: [157, 140, 255], xterm: 141 },
|
|
336
|
-
dim: { rgb: [106, 122, 133], xterm: 59 },
|
|
337
|
-
muted: { rgb: [138, 153, 164], xterm: 102 },
|
|
338
|
-
title: { rgb: [70, 229, 208], xterm: 80 },
|
|
339
|
-
frame: { rgb: [47, 93, 90], xterm: 23 },
|
|
340
|
-
frameStrong: { rgb: [42, 171, 158], xterm: 37 }
|
|
341
|
-
};
|
|
342
|
-
var SGR_RESET = "\x1B[0m";
|
|
343
|
-
var SGR_DIM = "\x1B[2m";
|
|
344
|
-
function colorDisabled(env = process.env) {
|
|
345
|
-
const raw = env.NO_COLOR;
|
|
346
|
-
return typeof raw === "string" && raw.length > 0;
|
|
347
|
-
}
|
|
348
|
-
function detectTruecolor(env = process.env) {
|
|
349
|
-
const colorTerm = (env.COLORTERM ?? "").toLowerCase();
|
|
350
|
-
if (colorTerm.includes("truecolor") || colorTerm.includes("24bit")) return true;
|
|
351
|
-
const term = (env.TERM ?? "").toLowerCase();
|
|
352
|
-
return term.includes("truecolor") || term.includes("24bit");
|
|
353
|
-
}
|
|
354
|
-
function fgCode(color, truecolor) {
|
|
355
|
-
return truecolor ? `38;2;${color.rgb[0]};${color.rgb[1]};${color.rgb[2]}` : `38;5;${color.xterm}`;
|
|
356
|
-
}
|
|
357
|
-
function bgCode(color, truecolor) {
|
|
358
|
-
return truecolor ? `48;2;${color.rgb[0]};${color.rgb[1]};${color.rgb[2]}` : `48;5;${color.xterm}`;
|
|
359
|
-
}
|
|
360
|
-
function fgSequence(token, truecolor = detectTruecolor()) {
|
|
361
|
-
if (colorDisabled()) return "";
|
|
362
|
-
return `\x1B[${fgCode(TOKENS[token], truecolor)}m`;
|
|
363
|
-
}
|
|
364
|
-
function createClioTheme(options = {}) {
|
|
365
|
-
const truecolor = options.truecolor ?? detectTruecolor();
|
|
366
|
-
const color = options.color ?? !colorDisabled();
|
|
367
|
-
const paint = (text, mods) => {
|
|
368
|
-
const codes = [];
|
|
369
|
-
if (mods.bold) codes.push("1");
|
|
370
|
-
if (mods.dim) codes.push("2");
|
|
371
|
-
if (mods.italic) codes.push("3");
|
|
372
|
-
if (mods.underline) codes.push("4");
|
|
373
|
-
if (color && mods.fg) codes.push(fgCode(TOKENS[mods.fg], truecolor));
|
|
374
|
-
if (color && mods.bg) codes.push(bgCode(TOKENS[mods.bg], truecolor));
|
|
375
|
-
if (codes.length === 0) return text;
|
|
376
|
-
return `\x1B[${codes.join(";")}m${text}${SGR_RESET}`;
|
|
377
|
-
};
|
|
378
|
-
return {
|
|
379
|
-
truecolor,
|
|
380
|
-
paint,
|
|
381
|
-
fg: (token, text) => paint(text, { fg: token }),
|
|
382
|
-
bg: (token, text) => paint(text, { bg: token }),
|
|
383
|
-
style: (token, text, mods = {}) => paint(text, { ...mods, fg: token }),
|
|
384
|
-
fgSequence: (token) => color ? `\x1B[${fgCode(TOKENS[token], truecolor)}m` : ""
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
function isClioToken(value) {
|
|
388
|
-
return Object.hasOwn(TOKENS, value);
|
|
389
|
-
}
|
|
390
|
-
var HEX_COLOR = /^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/u;
|
|
391
|
-
function paintHex(text, hex, options = {}) {
|
|
392
|
-
const match = HEX_COLOR.exec(hex);
|
|
393
|
-
if (match === null) return text;
|
|
394
|
-
if (!(options.color ?? !colorDisabled())) return text;
|
|
395
|
-
const truecolor = options.truecolor ?? detectTruecolor();
|
|
396
|
-
const red = Number.parseInt(match[1] ?? "0", 16);
|
|
397
|
-
const green = Number.parseInt(match[2] ?? "0", 16);
|
|
398
|
-
const blue = Number.parseInt(match[3] ?? "0", 16);
|
|
399
|
-
if (truecolor) return `\x1B[38;2;${red};${green};${blue}m${text}${SGR_RESET}`;
|
|
400
|
-
const cube = (channel) => Math.round(channel / 255 * 5);
|
|
401
|
-
return `\x1B[38;5;${16 + 36 * cube(red) + 6 * cube(green) + cube(blue)}m${text}${SGR_RESET}`;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
// src/interactive/theme/components.ts
|
|
405
|
-
init_esm_shims();
|
|
406
|
-
var identity = (text) => text;
|
|
407
|
-
function markdownTheme(theme, highlightCode) {
|
|
408
|
-
return {
|
|
409
|
-
heading: (text) => screenTitle(theme, text),
|
|
410
|
-
link: (text) => theme.fg("info", text),
|
|
411
|
-
linkUrl: (text) => theme.fg("dim", text),
|
|
412
|
-
code: (text) => theme.fg("muted", text),
|
|
413
|
-
codeBlock: (text) => text,
|
|
414
|
-
codeBlockBorder: (text) => theme.fg("frame", text),
|
|
415
|
-
quote: (text) => theme.fg("muted", text),
|
|
416
|
-
quoteBorder: (text) => theme.fg("frame", text),
|
|
417
|
-
hr: (text) => theme.fg("frame", text),
|
|
418
|
-
listBullet: (text) => theme.fg("accent", text),
|
|
419
|
-
bold: (text) => theme.paint(text, { bold: true }),
|
|
420
|
-
italic: (text) => theme.paint(text, { italic: true }),
|
|
421
|
-
strikethrough: identity,
|
|
422
|
-
underline: (text) => theme.paint(text, { underline: true }),
|
|
423
|
-
...highlightCode ? { highlightCode } : {}
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
function selectListTheme(theme) {
|
|
427
|
-
return {
|
|
428
|
-
// The design cursor the engine SelectList swaps in for pi-tui's arrow.
|
|
429
|
-
cursor: GLYPH.cursor,
|
|
430
|
-
selectedPrefix: (text) => theme.fg("accent", text),
|
|
431
|
-
selectedText: (text) => theme.style("accent", text, { bold: true }),
|
|
432
|
-
description: (text) => theme.fg("muted", text),
|
|
433
|
-
scrollInfo: (text) => theme.fg("dim", text),
|
|
434
|
-
noMatch: (text) => theme.fg("warning", text)
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
function settingsListTheme(theme) {
|
|
438
|
-
return {
|
|
439
|
-
label: (text, selected) => selected ? theme.style("accent", text, { bold: true }) : text,
|
|
440
|
-
value: (text, selected) => selected ? theme.fg("success", text) : theme.fg("muted", text),
|
|
441
|
-
description: (text) => theme.fg("muted", text),
|
|
442
|
-
cursor: GLYPH.cursor,
|
|
443
|
-
hint: (text) => theme.fg("dim", text)
|
|
444
|
-
};
|
|
445
|
-
}
|
|
446
|
-
function editorTheme(theme) {
|
|
447
|
-
return {
|
|
448
|
-
borderColor: (text) => theme.style("frameStrong", text, { bold: true }),
|
|
449
|
-
selectList: selectListTheme(theme)
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
// src/interactive/theme/labels.ts
|
|
454
|
-
init_esm_shims();
|
|
455
|
-
var identitySegments = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
456
|
-
function fitIdentityLabel(value, width) {
|
|
457
|
-
value = sanitizeCallTargetText(value);
|
|
458
|
-
const room = Math.max(0, Math.floor(width));
|
|
459
|
-
if (visibleWidth(value) <= room) return value;
|
|
460
|
-
if (room <= 1) return room === 1 ? "\u2026" : "";
|
|
461
|
-
const tailBudget = Math.ceil((room - 1) / 2);
|
|
462
|
-
let tail = "";
|
|
463
|
-
for (const { segment } of [...identitySegments.segment(value)].reverse()) {
|
|
464
|
-
if (visibleWidth(segment + tail) > tailBudget) break;
|
|
465
|
-
tail = segment + tail;
|
|
466
|
-
}
|
|
467
|
-
const headBudget = room - 1 - visibleWidth(tail);
|
|
468
|
-
let head = "";
|
|
469
|
-
for (const { segment } of identitySegments.segment(value)) {
|
|
470
|
-
if (visibleWidth(head + segment) > headBudget) break;
|
|
471
|
-
head += segment;
|
|
472
|
-
}
|
|
473
|
-
return `${head}\u2026${tail}`;
|
|
474
|
-
}
|
|
475
|
-
function abbreviateModelId(modelId) {
|
|
476
|
-
const value = sanitizeCallTargetText(modelId ?? "");
|
|
477
|
-
if (value.length === 0) return "model";
|
|
478
|
-
if (visibleWidth(value) <= 24) return value;
|
|
479
|
-
const slash = value.lastIndexOf("/");
|
|
480
|
-
if (slash < 0) return fitIdentityLabel(value, 24);
|
|
481
|
-
const placement = value.slice(0, slash);
|
|
482
|
-
const model = value.slice(slash + 1);
|
|
483
|
-
const modelBudget = Math.min(18, visibleWidth(model));
|
|
484
|
-
return `${fitIdentityPrefix(placement, 23 - modelBudget)}/${fitIdentityLabel(model, modelBudget)}`;
|
|
485
|
-
}
|
|
486
|
-
function fitIdentityPrefix(value, width) {
|
|
487
|
-
return stripTerminalSequences(truncateToWidth(value, Math.max(0, width), "\u2026", false));
|
|
488
|
-
}
|
|
489
|
-
function formatTargetLabel(targetId, modelId, options = {}) {
|
|
490
|
-
const target = sanitizeCallTargetText(targetId ?? "");
|
|
491
|
-
const model = sanitizeCallTargetText(modelId ?? "");
|
|
492
|
-
const fit = (label) => options.width === void 0 ? label : fitIdentityLabel(label, options.width);
|
|
493
|
-
if (target.length === 0 && model.length === 0) return fit("not configured");
|
|
494
|
-
if (options.width !== void 0 && target.length > 0 && model.length > 0) {
|
|
495
|
-
const width = Math.max(0, Math.floor(options.width));
|
|
496
|
-
const separator = options.separator ?? " \xB7 ";
|
|
497
|
-
const full = `${target}${separator}${model}`;
|
|
498
|
-
if (visibleWidth(full) <= width) return full;
|
|
499
|
-
const leaf = model.slice(model.lastIndexOf("/") + 1);
|
|
500
|
-
const available = width - visibleWidth(separator);
|
|
501
|
-
if (available < 9) return fitIdentityLabel(leaf, width);
|
|
502
|
-
const modelBudget = Math.min(visibleWidth(leaf), Math.max(8, Math.ceil(available * 0.7)));
|
|
503
|
-
const targetBudget = Math.min(visibleWidth(target), available - modelBudget);
|
|
504
|
-
return `${fitIdentityPrefix(target, targetBudget)}${separator}${fitIdentityLabel(leaf, available - targetBudget)}`;
|
|
505
|
-
}
|
|
506
|
-
const shown = options.abbreviate === false ? model : abbreviateModelId(model);
|
|
507
|
-
if (target.length === 0) return fit(`no target \xB7 ${shown}`);
|
|
508
|
-
if (model.length === 0) return fit(`${target} \xB7 no model`);
|
|
509
|
-
return `${target}${options.separator ?? " \xB7 "}${shown}`;
|
|
510
|
-
}
|
|
511
|
-
function formatCompactMs(value) {
|
|
512
|
-
const ms = Math.max(0, Math.round(value));
|
|
513
|
-
if (ms < 1e3) return `${ms}ms`;
|
|
514
|
-
const seconds = ms / 1e3;
|
|
515
|
-
return seconds < 60 ? `${seconds.toFixed(seconds >= 10 ? 0 : 1)}s` : `${Math.floor(seconds / 60)}m${Math.round(seconds % 60)}s`;
|
|
516
|
-
}
|
|
517
|
-
function formatContextPercent(percent) {
|
|
518
|
-
return typeof percent === "number" && Number.isFinite(percent) ? `${percent.toFixed(1)}%` : "?%";
|
|
519
|
-
}
|
|
520
|
-
function collapseHomePath(path) {
|
|
521
|
-
const home = process.env.HOME;
|
|
522
|
-
if (!home || home.length === 0) return path;
|
|
523
|
-
if (path === home) return "~";
|
|
524
|
-
return path.startsWith(`${home}/`) ? `~/${path.slice(home.length + 1)}` : path;
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
// src/interactive/theme/rules.ts
|
|
528
|
-
init_esm_shims();
|
|
529
|
-
function padAnsi(text, width, ellipsis = "") {
|
|
530
|
-
return truncateToWidth(text, Math.max(0, width), ellipsis, true);
|
|
531
|
-
}
|
|
532
|
-
function fitUnits(theme, prefix, units, maxWidth) {
|
|
533
|
-
const sep = " \xB7 ";
|
|
534
|
-
let line = prefix;
|
|
535
|
-
for (let index = 0; index < units.length; index += 1) {
|
|
536
|
-
const candidate = index === 0 ? `${line}${units[index]}` : `${line}${sep}${units[index]}`;
|
|
537
|
-
const reserve = index < units.length - 1 ? 2 : 0;
|
|
538
|
-
if (visibleWidth(candidate) + reserve > maxWidth) {
|
|
539
|
-
if (index === 0) return truncateToWidth(candidate, Math.max(0, maxWidth), "\u2026", false);
|
|
540
|
-
return `${line} ${theme.fg("dim", "\u2026")}`;
|
|
541
|
-
}
|
|
542
|
-
line = candidate;
|
|
543
|
-
}
|
|
544
|
-
return line;
|
|
545
|
-
}
|
|
546
|
-
function rule(theme, width, options = {}) {
|
|
547
|
-
const safeWidth = Math.max(0, width);
|
|
548
|
-
if (safeWidth === 0) return "";
|
|
549
|
-
const left = options.left ? `${theme.style(options.leftToken ?? "accent", options.left, { bold: true })} ` : "";
|
|
550
|
-
const rightBody = options.rightRaw ? options.right : theme.fg(options.rightToken ?? "muted", options.right ?? "");
|
|
551
|
-
const right = options.right ? ` ${rightBody} ${options.rightTail ?? ""}` : "";
|
|
552
|
-
const labelsWidth = visibleWidth(left) + visibleWidth(right);
|
|
553
|
-
if (labelsWidth >= safeWidth) return truncateToWidth(`${left}${right}`.trim(), safeWidth, "", true);
|
|
554
|
-
const fill = theme.style(options.fillToken ?? "frame", "\u2500".repeat(safeWidth - labelsWidth), {
|
|
555
|
-
bold: options.fillToken === "frameStrong"
|
|
556
|
-
});
|
|
557
|
-
return `${left}${fill}${right}`;
|
|
558
|
-
}
|
|
559
|
-
function frame(theme, title, lines, width, opts = {}) {
|
|
560
|
-
const safeWidth = Math.max(4, width);
|
|
561
|
-
const contentWidth = Math.max(0, safeWidth - 4);
|
|
562
|
-
const frameFg = (text) => theme.fg("frame", text);
|
|
563
|
-
const hasTitle = title.length > 0;
|
|
564
|
-
const styledTitle = !hasTitle ? "" : title.includes("\x1B") ? title : theme.style("title", title, { bold: true });
|
|
565
|
-
const titleWidth = visibleWidth(title);
|
|
566
|
-
const meta = opts.rightMeta ?? "";
|
|
567
|
-
const hasMeta = meta.length > 0;
|
|
568
|
-
const metaWidth = hasMeta ? visibleWidth(meta) : 0;
|
|
569
|
-
const leftVisible = 2 + (hasTitle ? titleWidth + 2 : 0);
|
|
570
|
-
const rightVisible = hasMeta ? metaWidth + 4 : 1;
|
|
571
|
-
const fillWidth = Math.max(0, safeWidth - leftVisible - rightVisible);
|
|
572
|
-
const leftStr = hasTitle ? `${frameFg("\u250C\u2500")} ${styledTitle} ` : frameFg("\u250C\u2500");
|
|
573
|
-
const rightStr = hasMeta ? ` ${theme.fg("dim", meta)} ${frameFg("\u2500\u2510")}` : frameFg("\u2510");
|
|
574
|
-
const top = `${leftStr}${frameFg("\u2500".repeat(fillWidth))}${rightStr}`;
|
|
575
|
-
const body = lines.map((line) => `${frameFg("\u2502")} ${padAnsi(line, contentWidth)} ${frameFg("\u2502")}`);
|
|
576
|
-
const bottom = `${frameFg("\u2514")}${frameFg("\u2500".repeat(safeWidth - 2))}${frameFg("\u2518")}`;
|
|
577
|
-
return [top, ...body, bottom];
|
|
578
|
-
}
|
|
579
|
-
function innerDivider(theme, width) {
|
|
580
|
-
return theme.fg("frame", GLYPH.innerDivider.repeat(Math.max(0, width)));
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
// src/interactive/theme/index.ts
|
|
584
|
-
var sharedTheme = null;
|
|
585
|
-
function clioTheme() {
|
|
586
|
-
sharedTheme ??= createClioTheme();
|
|
587
|
-
return sharedTheme;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
// src/interactive/clio-editor.ts
|
|
591
|
-
init_esm_shims();
|
|
592
|
-
|
|
593
|
-
// src/interactive/editor-bash.ts
|
|
594
|
-
init_esm_shims();
|
|
595
|
-
var PASTED_EDITOR_OPERATOR_GUARD = "\u2063";
|
|
596
|
-
function guardPastedEditorOperator(text) {
|
|
597
|
-
return `${PASTED_EDITOR_OPERATOR_GUARD}${text}`;
|
|
598
|
-
}
|
|
599
|
-
function unguardPastedEditorOperator(text) {
|
|
600
|
-
return text.startsWith(PASTED_EDITOR_OPERATOR_GUARD) ? text.slice(PASTED_EDITOR_OPERATOR_GUARD.length) : text;
|
|
601
|
-
}
|
|
602
|
-
function parseEditorBashCommand(text) {
|
|
603
|
-
if (text.startsWith(PASTED_EDITOR_OPERATOR_GUARD) || text.includes("\n") || text.includes("\r")) return null;
|
|
604
|
-
if (!text.startsWith("!")) return null;
|
|
605
|
-
const excludeFromContext = text.startsWith("!!");
|
|
606
|
-
const command = (excludeFromContext ? text.slice(2) : text.slice(1)).trim();
|
|
607
|
-
if (command.length === 0) return null;
|
|
608
|
-
return { command, excludeFromContext };
|
|
609
|
-
}
|
|
610
|
-
function appendStatusNotes(output, result, timeoutMs) {
|
|
611
|
-
const notes = [];
|
|
612
|
-
if (result.aborted) notes.push("command aborted");
|
|
613
|
-
if (result.timedOut) notes.push(`command timed out after ${timeoutMs}ms`);
|
|
614
|
-
if (result.outputCapped) notes.push("command output exceeded the inline output limit");
|
|
615
|
-
if (result.error && output.trim().length === 0) notes.push(result.error.message);
|
|
616
|
-
if (notes.length === 0) return output;
|
|
617
|
-
const suffix = notes.map((note) => `[${note}]`).join("\n");
|
|
618
|
-
return output.length > 0 ? `${output.replace(/\s+$/g, "")}
|
|
619
|
-
${suffix}` : suffix;
|
|
620
|
-
}
|
|
621
|
-
function bashExecutionEntryInput(args) {
|
|
622
|
-
const output = appendStatusNotes(combineBashOutput(args.result), args.result, args.timeoutMs);
|
|
623
|
-
return {
|
|
624
|
-
kind: "bashExecution",
|
|
625
|
-
parentTurnId: args.parentTurnId,
|
|
626
|
-
command: args.command,
|
|
627
|
-
output,
|
|
628
|
-
exitCode: args.result.exitCode,
|
|
629
|
-
cancelled: args.result.aborted,
|
|
630
|
-
truncated: args.result.outputCapped,
|
|
631
|
-
excludeFromContext: args.excludeFromContext
|
|
632
|
-
};
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
// src/interactive/overlay-frame.ts
|
|
636
|
-
init_esm_shims();
|
|
637
|
-
|
|
638
|
-
// src/interactive/keyboard-owner.ts
|
|
639
|
-
init_esm_shims();
|
|
640
|
-
function keyboardOwner(component) {
|
|
641
|
-
if (component instanceof Editor || component instanceof Input) {
|
|
642
|
-
return {
|
|
643
|
-
keyboardScope: "edit",
|
|
644
|
-
undoInput: () => {
|
|
645
|
-
component.applyEdit("undo");
|
|
646
|
-
return true;
|
|
647
|
-
}
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
return component ?? {};
|
|
651
|
-
}
|
|
652
|
-
function focusedComponent(tui) {
|
|
653
|
-
return tui instanceof TuiAltScreen || tui instanceof TuiMainScreen ? tui.getFocusedComponent() : null;
|
|
654
|
-
}
|
|
655
|
-
function localKey(data) {
|
|
656
|
-
return data.includes("\x1B[200~") ? data : decodePrintableKey(data) ?? data;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
// src/interactive/modal-marker.ts
|
|
660
|
-
init_esm_shims();
|
|
661
|
-
var MODAL_MARKER_BASE_TITLE = "clio";
|
|
662
|
-
function formatModalMarkerTitle(stack) {
|
|
663
|
-
const top = stack.at(-1);
|
|
664
|
-
if (top === void 0) return MODAL_MARKER_BASE_TITLE;
|
|
665
|
-
const beneath = stack.length - 1;
|
|
666
|
-
return `${MODAL_MARKER_BASE_TITLE} [modal:${top}${beneath > 0 ? `+${beneath}` : ""}]`;
|
|
667
|
-
}
|
|
668
|
-
function createModalMarkerRegistry() {
|
|
669
|
-
const entries = [];
|
|
670
|
-
let sink = null;
|
|
671
|
-
let published = null;
|
|
672
|
-
function activeIds() {
|
|
673
|
-
return entries.filter((entry) => entry.active).map((entry) => entry.id);
|
|
674
|
-
}
|
|
675
|
-
function publish() {
|
|
676
|
-
if (sink === null) return;
|
|
677
|
-
const title = formatModalMarkerTitle(activeIds());
|
|
678
|
-
if (published === null && title === MODAL_MARKER_BASE_TITLE) return;
|
|
679
|
-
if (title === published) return;
|
|
680
|
-
published = title;
|
|
681
|
-
sink.setTitle(title);
|
|
682
|
-
}
|
|
683
|
-
function enter(id, nextSink) {
|
|
684
|
-
if (nextSink) sink = nextSink;
|
|
685
|
-
const entry = { id, active: true };
|
|
686
|
-
entries.push(entry);
|
|
687
|
-
publish();
|
|
688
|
-
let released = false;
|
|
689
|
-
return {
|
|
690
|
-
release() {
|
|
691
|
-
if (released) return;
|
|
692
|
-
released = true;
|
|
693
|
-
const index = entries.indexOf(entry);
|
|
694
|
-
if (index !== -1) entries.splice(index, 1);
|
|
695
|
-
publish();
|
|
696
|
-
},
|
|
697
|
-
setActive(active) {
|
|
698
|
-
if (released || entry.active === active) return;
|
|
699
|
-
entry.active = active;
|
|
700
|
-
publish();
|
|
701
|
-
},
|
|
702
|
-
raise() {
|
|
703
|
-
if (released) return;
|
|
704
|
-
entry.active = true;
|
|
705
|
-
const index = entries.indexOf(entry);
|
|
706
|
-
if (index !== -1 && index !== entries.length - 1) {
|
|
707
|
-
entries.splice(index, 1);
|
|
708
|
-
entries.push(entry);
|
|
709
|
-
}
|
|
710
|
-
publish();
|
|
711
|
-
}
|
|
712
|
-
};
|
|
713
|
-
}
|
|
714
|
-
return { enter, stack: () => activeIds() };
|
|
715
|
-
}
|
|
716
|
-
var registry = createModalMarkerRegistry();
|
|
717
|
-
function enterModal(id, sink) {
|
|
718
|
-
return registry.enter(id, sink);
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
// src/interactive/overlay-frame.ts
|
|
722
|
-
var DEFAULT_SELECT_THEME = selectListTheme(clioTheme());
|
|
723
|
-
var DEFAULT_SETTINGS_THEME = settingsListTheme(clioTheme());
|
|
724
|
-
var FocusBox = class extends Box {
|
|
725
|
-
inputTarget;
|
|
726
|
-
onInput;
|
|
727
|
-
constructor(children, options) {
|
|
728
|
-
super(options?.x ?? 1, options?.y ?? 0);
|
|
729
|
-
const childList = Array.isArray(children) ? children : [children];
|
|
730
|
-
for (const child of childList) this.addChild(child);
|
|
731
|
-
this.inputTarget = options?.inputTarget === void 0 ? childList[0] ?? null : options.inputTarget;
|
|
732
|
-
this.onInput = options?.onInput;
|
|
733
|
-
}
|
|
734
|
-
get keyboardScope() {
|
|
735
|
-
return keyboardOwner(this.inputTarget).keyboardScope;
|
|
736
|
-
}
|
|
737
|
-
undoInput() {
|
|
738
|
-
return keyboardOwner(this.inputTarget).undoInput?.() ?? false;
|
|
739
|
-
}
|
|
740
|
-
handleInput(data) {
|
|
741
|
-
if (this.onInput) {
|
|
742
|
-
this.onInput(data);
|
|
743
|
-
return;
|
|
744
|
-
}
|
|
745
|
-
this.inputTarget?.handleInput?.(data);
|
|
746
|
-
}
|
|
747
|
-
};
|
|
748
|
-
function resolveTone(tone) {
|
|
749
|
-
return typeof tone === "function" ? tone() : tone;
|
|
750
|
-
}
|
|
751
|
-
function clioFrame(text, token = "frame") {
|
|
752
|
-
return clioTheme().fg(token, text);
|
|
753
|
-
}
|
|
754
|
-
function clioTitle(text, token) {
|
|
755
|
-
return token === void 0 ? screenTitle(clioTheme(), text) : clioTheme().style(token, text, { bold: true });
|
|
756
|
-
}
|
|
757
|
-
function clioError(text) {
|
|
758
|
-
return clioTheme().fg("error", text);
|
|
759
|
-
}
|
|
760
|
-
function brandedTopBorder(label, innerWidth, tone) {
|
|
761
|
-
const frame2 = (text) => clioFrame(text, tone ?? "frame");
|
|
762
|
-
const clean = label.replace(/^[┌┐└┘├┤─│\s]+/, "").replace(/[┌┐└┘├┤─│\s]+$/, "");
|
|
763
|
-
const formatted = clean.length > 0 ? `\u2500 ${clean} ` : "\u2500";
|
|
764
|
-
const clipped = visibleWidth(formatted) > innerWidth ? truncateToWidth(formatted, innerWidth, "\u2026", true) : formatted;
|
|
765
|
-
const fill = "\u2500".repeat(Math.max(0, innerWidth - visibleWidth(clipped)));
|
|
766
|
-
const cleanIndex = clipped.indexOf(clean);
|
|
767
|
-
if (cleanIndex !== -1) {
|
|
768
|
-
const prefix = clipped.slice(0, cleanIndex);
|
|
769
|
-
const suffix = clipped.slice(cleanIndex + clean.length);
|
|
770
|
-
return `${frame2("\u250C")}${frame2(prefix)}${clioTitle(clean, tone)}${frame2(suffix)}${frame2(fill)}${frame2("\u2510")}`;
|
|
771
|
-
}
|
|
772
|
-
return `${frame2("\u250C")}${frame2(clipped)}${frame2(fill)}${frame2("\u2510")}`;
|
|
773
|
-
}
|
|
774
|
-
function isCriticalHintKey(key) {
|
|
775
|
-
const canonical = canonicalizeKey(key);
|
|
776
|
-
return canonical === "Esc" || canonical === "Enter" || canonical === "Enter/Space" || canonical === "type";
|
|
777
|
-
}
|
|
778
|
-
function isCriticalEntry(entry) {
|
|
779
|
-
return entry.critical ?? isCriticalHintKey(entry.key);
|
|
780
|
-
}
|
|
781
|
-
function renderHintEntries(entries, short) {
|
|
782
|
-
return entries.map((entry) => `[${canonicalizeKey(entry.key)}] ${short ? entry.short ?? entry.verb : entry.verb}`).join(" \xB7 ");
|
|
783
|
-
}
|
|
784
|
-
function fitHintEntries(entries, maxWidth) {
|
|
785
|
-
if (entries.length === 0) return "";
|
|
786
|
-
for (const short of [false, true]) {
|
|
787
|
-
const rendered = renderHintEntries(entries, short);
|
|
788
|
-
if (visibleWidth(rendered) <= maxWidth) return rendered;
|
|
789
|
-
}
|
|
790
|
-
const kept = [...entries];
|
|
791
|
-
for (const criticalPass of [false, true]) {
|
|
792
|
-
while (kept.length > 1) {
|
|
793
|
-
const index = kept.findIndex((entry) => criticalPass || !isCriticalEntry(entry));
|
|
794
|
-
if (index === -1) break;
|
|
795
|
-
kept.splice(index, 1);
|
|
796
|
-
const rendered = renderHintEntries(kept, true);
|
|
797
|
-
if (visibleWidth(rendered) <= maxWidth) return rendered;
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
return renderHintEntries(kept, true);
|
|
801
|
-
}
|
|
802
|
-
var FILTER_HINT = { key: "type", verb: "filter" };
|
|
803
|
-
function canonicalizeKey(key) {
|
|
804
|
-
const trimmed = key.trim();
|
|
805
|
-
if (trimmed === "R") return "R";
|
|
806
|
-
const lower = trimmed.toLowerCase();
|
|
807
|
-
if (lower === "up/down" || lower === "updown" || lower === "\u2191/\u2193" || lower === "up/down/j/k" || lower === "\u2191\u2193")
|
|
808
|
-
return "\u2191\u2193";
|
|
809
|
-
if (lower === "enter/space") return "Enter/Space";
|
|
810
|
-
if (lower === "enter") return "Enter";
|
|
811
|
-
if (lower === "esc" || lower === "escape") return "Esc";
|
|
812
|
-
if (lower === "space") return "Space";
|
|
813
|
-
if (lower === "tab") return "Tab";
|
|
814
|
-
if (lower === "r") return "r";
|
|
815
|
-
if (lower === "type") return "type";
|
|
816
|
-
return trimmed;
|
|
817
|
-
}
|
|
818
|
-
function buildHint(entries, esc = "close") {
|
|
819
|
-
const finalEntries = [
|
|
820
|
-
...entries.map((e) => ({ key: canonicalizeKey(e.key), verb: e.verb })),
|
|
821
|
-
{ key: "Esc", verb: esc }
|
|
822
|
-
];
|
|
823
|
-
return finalEntries.map((e) => `[${e.key}] ${e.verb}`).join(" \xB7 ");
|
|
824
|
-
}
|
|
825
|
-
function buildResponsiveHint(entries, esc = "close") {
|
|
826
|
-
const escEntry = esc === null ? null : typeof esc === "string" ? { key: "Esc", verb: esc } : esc;
|
|
827
|
-
const all = escEntry ? [...entries, escEntry] : [...entries];
|
|
828
|
-
return (innerWidth) => fitHintEntries(all, innerWidth - 3);
|
|
829
|
-
}
|
|
830
|
-
function elideHint(hint, maxCleanWidth) {
|
|
831
|
-
const parts = hint.split(" \xB7 ");
|
|
832
|
-
if (parts.length <= 2) return hint;
|
|
833
|
-
const entries = parts.map((part) => {
|
|
834
|
-
const match = /^\[([^\]]+)\] ([\s\S]+)$/u.exec(part);
|
|
835
|
-
if (!match) return { key: "", verb: part, critical: false };
|
|
836
|
-
return { key: match[1] ?? "", verb: match[2] ?? "" };
|
|
837
|
-
});
|
|
838
|
-
const rendered = fitHintEntries(entries, maxCleanWidth);
|
|
839
|
-
return rendered.replace(/\[\] /gu, "");
|
|
840
|
-
}
|
|
841
|
-
function brandedBottomBorder(innerWidth, hint, tone) {
|
|
842
|
-
const frame2 = (text) => clioFrame(text, tone ?? "frame");
|
|
843
|
-
if (!hint || hint.trim().length === 0) {
|
|
844
|
-
return `${frame2("\u2514")}${frame2("\u2500".repeat(innerWidth))}${frame2("\u2518")}`;
|
|
845
|
-
}
|
|
846
|
-
let clean = hint.trim();
|
|
847
|
-
const maxCleanWidth = innerWidth - 3;
|
|
848
|
-
if (clean.includes(" \xB7 ") && visibleWidth(`\u2500 ${clean} `) > innerWidth) {
|
|
849
|
-
clean = elideHint(clean, maxCleanWidth);
|
|
850
|
-
}
|
|
851
|
-
const formatted = `\u2500 ${clean} `;
|
|
852
|
-
const clipped = visibleWidth(formatted) > innerWidth ? truncateToWidth(formatted, innerWidth, "\u2026", true) : formatted;
|
|
853
|
-
const fill = "\u2500".repeat(Math.max(0, innerWidth - visibleWidth(clipped)));
|
|
854
|
-
const cleanIndex = clipped.indexOf(clean);
|
|
855
|
-
if (cleanIndex !== -1) {
|
|
856
|
-
const prefix = clipped.slice(0, cleanIndex);
|
|
857
|
-
const suffix = clipped.slice(cleanIndex + clean.length);
|
|
858
|
-
return `${frame2("\u2514")}${frame2(prefix)}${clioTheme().fg("dim", clean)}${frame2(suffix)}${frame2(fill)}${frame2("\u2518")}`;
|
|
859
|
-
}
|
|
860
|
-
return `${frame2("\u2514")}${frame2(clipped)}${frame2(fill)}${frame2("\u2518")}`;
|
|
861
|
-
}
|
|
862
|
-
function formatRuntimeResolutionDiagnostic(diagnostic) {
|
|
863
|
-
return `${diagnostic.severity}: ${diagnostic.code}: ${diagnostic.message}`;
|
|
864
|
-
}
|
|
865
|
-
function diagnosticSeverityToken(severity) {
|
|
866
|
-
return severity === "error" ? "error" : severity === "warning" ? "warning" : "muted";
|
|
867
|
-
}
|
|
868
|
-
function frameAlignForAnchor(anchor) {
|
|
869
|
-
if (anchor === void 0) return "center";
|
|
870
|
-
if (anchor === "left-center" || anchor.endsWith("-left")) return "left";
|
|
871
|
-
if (anchor === "right-center" || anchor.endsWith("-right")) return "right";
|
|
872
|
-
return "center";
|
|
873
|
-
}
|
|
874
|
-
function fitBody(lines, rowBudget, contentWidth) {
|
|
875
|
-
if (rowBudget <= 0) return lines;
|
|
876
|
-
const bodyBudget = Math.max(1, rowBudget - 2);
|
|
877
|
-
if (lines.length <= bodyBudget) return lines;
|
|
878
|
-
const kept = lines.slice(0, bodyBudget - 1);
|
|
879
|
-
const hidden = lines.length - kept.length;
|
|
880
|
-
return [...kept, clioTheme().fg("dim", truncateToWidth(`\u2026 ${hidden} more rows`, contentWidth, "", true))];
|
|
881
|
-
}
|
|
882
|
-
var ClioOverlayFrame = class {
|
|
883
|
-
constructor(child, title, footerHint, boxWidth = 0, align = "center", tone) {
|
|
884
|
-
this.child = child;
|
|
885
|
-
this.title = title;
|
|
886
|
-
this.footerHint = footerHint;
|
|
887
|
-
this.boxWidth = boxWidth;
|
|
888
|
-
this.align = align;
|
|
889
|
-
this.tone = tone;
|
|
890
|
-
}
|
|
891
|
-
child;
|
|
892
|
-
title;
|
|
893
|
-
footerHint;
|
|
894
|
-
boxWidth;
|
|
895
|
-
align;
|
|
896
|
-
tone;
|
|
897
|
-
/**
|
|
898
|
-
* Rows the box may occupy, or zero while unknown.
|
|
899
|
-
*
|
|
900
|
-
* `Component.render` is handed a width and nothing else, so the frame learns
|
|
901
|
-
* its height budget from the engine's `visible` predicate, which is called
|
|
902
|
-
* with the live terminal size immediately before the render pass that
|
|
903
|
-
* composites this overlay.
|
|
904
|
-
*/
|
|
905
|
-
rowBudget = 0;
|
|
906
|
-
/**
|
|
907
|
-
* Last rendered box, keyed by everything that shapes it. `childLines` is
|
|
908
|
-
* compared by array identity: a child that rebuilds its rows returns a fresh
|
|
909
|
-
* array and correctly misses, and one that serves a cache returns the same
|
|
910
|
-
* array and correctly hits.
|
|
911
|
-
*/
|
|
912
|
-
cachedRender;
|
|
913
|
-
setRowBudget(rows) {
|
|
914
|
-
this.rowBudget = Math.max(0, Math.floor(rows));
|
|
915
|
-
}
|
|
916
|
-
render(width) {
|
|
917
|
-
const boxWidth = Math.max(5, Math.min(this.boxWidth > 0 ? this.boxWidth : width, width));
|
|
918
|
-
const contentWidth = Math.max(1, boxWidth - 4);
|
|
919
|
-
const childLines = this.child.render(contentWidth);
|
|
920
|
-
const titleText = typeof this.title === "function" ? this.title() : this.title;
|
|
921
|
-
const hint = typeof this.footerHint === "function" ? this.footerHint(contentWidth + 2) : this.footerHint;
|
|
922
|
-
const tone = resolveTone(this.tone);
|
|
923
|
-
const cached = this.cachedRender;
|
|
924
|
-
if (cached !== void 0 && cached.width === width && cached.rowBudget === this.rowBudget && cached.childLines === childLines && cached.title === titleText && cached.hint === hint && cached.tone === tone) {
|
|
925
|
-
return cached.lines;
|
|
926
|
-
}
|
|
927
|
-
const label = titleText.length > 0 ? `\u2500 ${titleText} ` : "\u2500 ";
|
|
928
|
-
const side = clioFrame("\u2502", tone ?? "frame");
|
|
929
|
-
const boxLines = [
|
|
930
|
-
brandedTopBorder(label, contentWidth + 2, tone),
|
|
931
|
-
...fitBody(childLines, this.rowBudget, contentWidth).map((line) => `${side} ${padAnsi(line, contentWidth)} ${side}`),
|
|
932
|
-
brandedBottomBorder(contentWidth + 2, hint, tone)
|
|
933
|
-
];
|
|
934
|
-
const slack = Math.max(0, width - boxWidth);
|
|
935
|
-
const lines = (() => {
|
|
936
|
-
if (slack === 0) return boxLines;
|
|
937
|
-
const leading = this.align === "left" ? 0 : this.align === "right" ? slack : Math.floor(slack / 2);
|
|
938
|
-
const lead = " ".repeat(leading);
|
|
939
|
-
const trail = " ".repeat(slack - leading);
|
|
940
|
-
return boxLines.map((line) => `${lead}${line}${trail}`);
|
|
941
|
-
})();
|
|
942
|
-
this.cachedRender = { width, rowBudget: this.rowBudget, childLines, title: titleText, hint, tone, lines };
|
|
943
|
-
return lines;
|
|
944
|
-
}
|
|
945
|
-
get keyboardScope() {
|
|
946
|
-
return keyboardOwner(this.child).keyboardScope;
|
|
947
|
-
}
|
|
948
|
-
undoInput() {
|
|
949
|
-
return keyboardOwner(this.child).undoInput?.() ?? false;
|
|
950
|
-
}
|
|
951
|
-
handleInput(data) {
|
|
952
|
-
this.child.handleInput?.(data);
|
|
953
|
-
}
|
|
954
|
-
invalidate() {
|
|
955
|
-
this.cachedRender = void 0;
|
|
956
|
-
this.child.invalidate?.();
|
|
957
|
-
}
|
|
958
|
-
};
|
|
959
|
-
function showClioOverlayFrame(tui, child, options) {
|
|
960
|
-
const { title, footerHint, tone, width, visible, maxHeight, margin, markerId, ...overlayOptions } = options;
|
|
961
|
-
const boxWidth = typeof width === "number" ? width : 0;
|
|
962
|
-
const frame2 = new ClioOverlayFrame(child, title, footerHint, boxWidth, frameAlignForAnchor(options.anchor), tone);
|
|
963
|
-
const handle = tui.showOverlay(frame2, {
|
|
964
|
-
...overlayOptions,
|
|
965
|
-
...margin !== void 0 ? { margin } : {},
|
|
966
|
-
width: "100%",
|
|
967
|
-
visible: (termWidth, termHeight) => {
|
|
968
|
-
const shown = visible ? visible(termWidth, termHeight) : true;
|
|
969
|
-
const marginRows = typeof margin === "number" ? margin * 2 : (margin?.top ?? 0) + (margin?.bottom ?? 0);
|
|
970
|
-
const available = Math.max(1, termHeight - marginRows);
|
|
971
|
-
const requested = resolveRowSize(maxHeight, termHeight);
|
|
972
|
-
frame2.setRowBudget(requested === null ? available : Math.min(requested, available));
|
|
973
|
-
return shown;
|
|
974
|
-
}
|
|
975
|
-
});
|
|
976
|
-
const marker = enterModal(markerId, modalMarkerSink(tui));
|
|
977
|
-
return {
|
|
978
|
-
hide() {
|
|
979
|
-
marker.release();
|
|
980
|
-
handle.hide();
|
|
981
|
-
},
|
|
982
|
-
setHidden(hidden) {
|
|
983
|
-
marker.setActive(!hidden);
|
|
984
|
-
handle.setHidden(hidden);
|
|
985
|
-
},
|
|
986
|
-
isHidden: () => handle.isHidden(),
|
|
987
|
-
focus() {
|
|
988
|
-
marker.raise();
|
|
989
|
-
handle.focus();
|
|
990
|
-
},
|
|
991
|
-
// A pure passthrough on purpose. The engine hands focus to the next
|
|
992
|
-
// visible capturing overlay, which is another modal, so the stack is
|
|
993
|
-
// unchanged; the surface that gives the keyboard back to the composer
|
|
994
|
-
// does it by hiding, which `setHidden` already reports.
|
|
995
|
-
unfocus: (unfocusOptions) => unfocusOptions ? handle.unfocus(unfocusOptions) : handle.unfocus(),
|
|
996
|
-
isFocused: () => handle.isFocused(),
|
|
997
|
-
getBounds: () => handle.getBounds()
|
|
998
|
-
};
|
|
999
|
-
}
|
|
1000
|
-
function modalMarkerSink(tui) {
|
|
1001
|
-
const terminal = tui.terminal;
|
|
1002
|
-
return typeof terminal?.setTitle === "function" ? terminal : null;
|
|
1003
|
-
}
|
|
1004
|
-
function resolveRowSize(value, termHeight) {
|
|
1005
|
-
if (typeof value === "number") return Math.max(1, Math.floor(value));
|
|
1006
|
-
if (typeof value !== "string") return null;
|
|
1007
|
-
const percent = /^(\d+(?:\.\d+)?)%$/u.exec(value.trim());
|
|
1008
|
-
if (!percent?.[1]) return null;
|
|
1009
|
-
return Math.max(1, Math.floor(termHeight * Number.parseFloat(percent[1]) / 100));
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
// src/interactive/permission-hint.ts
|
|
1013
|
-
init_esm_shims();
|
|
1014
|
-
var MUTATION_PREVIEW_KEY = "v";
|
|
1015
|
-
var PERMISSION_TERMS_KEY = "?";
|
|
1016
|
-
function permissionHintEntries(composerHasDraft = false, inspection = "none", terms) {
|
|
1017
|
-
return [
|
|
1018
|
-
composerHasDraft ? { key: "Backspace", verb: "clear the draft to allow", short: "clear draft", critical: true } : { key: "Enter", verb: "allow once", short: "allow", critical: true },
|
|
1019
|
-
// The terms key is the card's own and the most droppable entry: the folded
|
|
1020
|
-
// card already states what the keys do in one row. It sits before the
|
|
1021
|
-
// inspect key so the narrowing drops it first.
|
|
1022
|
-
...terms === void 0 ? [] : [{ key: PERMISSION_TERMS_KEY, verb: terms === "open" ? "hide terms" : "terms", short: "terms", critical: false }],
|
|
1023
|
-
...inspection === "none" ? [] : inspection === "open" ? [
|
|
1024
|
-
{ key: "\u2191\u2193", verb: "scroll", critical: false },
|
|
1025
|
-
{ key: MUTATION_PREVIEW_KEY, verb: "hide mutation", short: "hide", critical: false }
|
|
1026
|
-
] : [{ key: MUTATION_PREVIEW_KEY, verb: "inspect mutation", short: "inspect", critical: false }],
|
|
1027
|
-
{ key: "s", verb: "stop turn", short: "stop", critical: true },
|
|
1028
|
-
// With a draft, deny and stop are the only immediate answers, so Esc
|
|
1029
|
-
// outranks the narrowing that would otherwise drop it first.
|
|
1030
|
-
{ key: "Esc", verb: "deny", critical: composerHasDraft }
|
|
1031
|
-
];
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
// src/interactive/clio-editor.ts
|
|
1035
|
-
var REVERSE_VIDEO_BLANK = `${String.fromCharCode(27)}[7m ${String.fromCharCode(27)}[0m`;
|
|
1036
|
-
var EMPTY_PROMPT = "Ask Clio\u2026 / for commands";
|
|
1037
|
-
var CONFIRM_PROMPT = "A parked call is waiting for your decision";
|
|
1038
|
-
var PREPARING_PROMPT = "Clio has your prompt and is preparing the turn";
|
|
1039
|
-
var COMPACTING_PROMPT = "Clio has your prompt and is compacting the context first";
|
|
1040
|
-
var MIN_HINT_WIDTH = 60;
|
|
1041
|
-
function hasScrollIndicator(line) {
|
|
1042
|
-
const stripped = stripTerminalSequences(line);
|
|
1043
|
-
return stripped.includes(GLYPH.up) || stripped.includes(GLYPH.down);
|
|
1044
|
-
}
|
|
1045
|
-
function normalizeThinkingHint(value) {
|
|
1046
|
-
return value.replace(/^think\s+/i, "").trim().toLowerCase();
|
|
1047
|
-
}
|
|
1048
|
-
function styledThinkingHint(theme, value) {
|
|
1049
|
-
const hint = normalizeThinkingHint(value);
|
|
1050
|
-
switch (hint) {
|
|
1051
|
-
case "off":
|
|
1052
|
-
return theme.fg("dim", hint);
|
|
1053
|
-
case "minimal":
|
|
1054
|
-
case "low":
|
|
1055
|
-
return theme.fg("muted", hint);
|
|
1056
|
-
case "xhigh":
|
|
1057
|
-
case "max":
|
|
1058
|
-
case "on":
|
|
1059
|
-
return theme.style("reason", hint, { bold: true });
|
|
1060
|
-
default:
|
|
1061
|
-
return theme.fg("reason", hint);
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
function styledRailLabel(theme, chrome, width) {
|
|
1065
|
-
const thinking = styledThinkingHint(theme, chrome.getThinkingLabel());
|
|
1066
|
-
const identity2 = chrome.getModelLabel();
|
|
1067
|
-
const room = Math.max(1, width - visibleWidth(thinking) - 3);
|
|
1068
|
-
const model = typeof identity2 === "string" ? fitIdentityLabel(identity2, room) : formatTargetLabel(identity2.targetId, identity2.modelId, { width: room });
|
|
1069
|
-
return `${theme.fg("dim", model)} ${theme.fg("dim", "\xB7")} ${thinking}`;
|
|
1070
|
-
}
|
|
1071
|
-
function composerMode(chrome, text) {
|
|
1072
|
-
if (chrome.isAwaitingApproval?.() ?? false) return "CONFIRM";
|
|
1073
|
-
if (!(chrome.isStreaming?.() ?? false)) {
|
|
1074
|
-
const preparation = chrome.getTurnPreparation?.() ?? "idle";
|
|
1075
|
-
if (preparation === "compacting") return "COMPACTING";
|
|
1076
|
-
if (preparation === "preparing") return "PREPARING";
|
|
1077
|
-
return "MESSAGE";
|
|
1078
|
-
}
|
|
1079
|
-
const willSteer = chrome.willEnterSteer?.(text) ?? text.trim().length > 0;
|
|
1080
|
-
return willSteer ? "STEER" : "FOLLOW-UP";
|
|
1081
|
-
}
|
|
1082
|
-
function lowerRailHint(theme, chrome) {
|
|
1083
|
-
return theme.fg(
|
|
1084
|
-
"dim",
|
|
1085
|
-
`${chrome.getSubmitKeyLabel?.() ?? "Enter"} send \xB7 ${chrome.getNewlineKeyLabel?.() ?? "Ctrl+J"} newline`
|
|
1086
|
-
);
|
|
1087
|
-
}
|
|
1088
|
-
function confirmRailHint(theme, width, hasDraft, inspection) {
|
|
1089
|
-
return theme.fg("warning", fitHintEntries(permissionHintEntries(hasDraft, inspection), Math.max(1, width - 3)));
|
|
1090
|
-
}
|
|
1091
|
-
function modeToken(mode) {
|
|
1092
|
-
if (mode === "STEER" || mode === "PREPARING" || mode === "COMPACTING") return "action";
|
|
1093
|
-
if (mode === "CONFIRM") return "warning";
|
|
1094
|
-
return "accentDeep";
|
|
1095
|
-
}
|
|
1096
|
-
function emptyPromptFor(mode) {
|
|
1097
|
-
if (mode === "CONFIRM") return CONFIRM_PROMPT;
|
|
1098
|
-
if (mode === "PREPARING") return PREPARING_PROMPT;
|
|
1099
|
-
if (mode === "COMPACTING") return COMPACTING_PROMPT;
|
|
1100
|
-
return EMPTY_PROMPT;
|
|
1101
|
-
}
|
|
1102
|
-
function renderEmptyPrompt(line, width, theme, text = EMPTY_PROMPT) {
|
|
1103
|
-
const cursorAt = line.indexOf(REVERSE_VIDEO_BLANK);
|
|
1104
|
-
if (cursorAt < 0) return line;
|
|
1105
|
-
const afterCursorAt = cursorAt + REVERSE_VIDEO_BLANK.length;
|
|
1106
|
-
const available = Math.max(0, width - 1);
|
|
1107
|
-
const prompt = truncateToWidth(theme.fg("dim", text), available, "\u2026", false);
|
|
1108
|
-
const consumed = visibleWidth(prompt);
|
|
1109
|
-
return `${line.slice(0, afterCursorAt)}${prompt}${line.slice(afterCursorAt + consumed)}`;
|
|
1110
|
-
}
|
|
1111
|
-
function findBottomRail(lines, width) {
|
|
1112
|
-
const rail = "\u2500".repeat(Math.max(0, width));
|
|
1113
|
-
for (let index = 1; index < lines.length; index += 1) {
|
|
1114
|
-
if (stripTerminalSequences(lines[index] ?? "") === rail) return index;
|
|
1115
|
-
}
|
|
1116
|
-
return -1;
|
|
1117
|
-
}
|
|
1118
|
-
function cursorEndsDirectoryPath(editor) {
|
|
1119
|
-
const cursor = editor.getCursor();
|
|
1120
|
-
const line = editor.getLines()[cursor.line] ?? "";
|
|
1121
|
-
return line.slice(0, cursor.col).endsWith("/");
|
|
1122
|
-
}
|
|
1123
|
-
function remapPastedBangOffsets(before, after, offsets, markInsertedAsPasted) {
|
|
1124
|
-
let prefix = 0;
|
|
1125
|
-
while (prefix < before.length && prefix < after.length && before[prefix] === after[prefix]) prefix += 1;
|
|
1126
|
-
let beforeEnd = before.length;
|
|
1127
|
-
let afterEnd = after.length;
|
|
1128
|
-
while (beforeEnd > prefix && afterEnd > prefix && before[beforeEnd - 1] === after[afterEnd - 1]) {
|
|
1129
|
-
beforeEnd -= 1;
|
|
1130
|
-
afterEnd -= 1;
|
|
1131
|
-
}
|
|
1132
|
-
const next = /* @__PURE__ */ new Set();
|
|
1133
|
-
const shift = afterEnd - prefix - (beforeEnd - prefix);
|
|
1134
|
-
for (const offset of offsets) {
|
|
1135
|
-
if (offset < prefix) next.add(offset);
|
|
1136
|
-
else if (offset >= beforeEnd) next.add(offset + shift);
|
|
1137
|
-
}
|
|
1138
|
-
if (markInsertedAsPasted) {
|
|
1139
|
-
for (let offset = prefix; offset < afterEnd; offset += 1) {
|
|
1140
|
-
if (after[offset] === "!") next.add(offset);
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
return next;
|
|
1144
|
-
}
|
|
1145
|
-
function startsWithPastedOperator(text, pastedBangOffsets) {
|
|
1146
|
-
const first = text.search(/\S/u);
|
|
1147
|
-
return first >= 0 && text[first] === "!" && pastedBangOffsets.has(first);
|
|
1148
|
-
}
|
|
1149
|
-
var ClioEditor = class extends Editor {
|
|
1150
|
-
constructor(tui, chrome) {
|
|
1151
|
-
super(tui, editorTheme(clioTheme()));
|
|
1152
|
-
this.chrome = chrome;
|
|
1153
|
-
}
|
|
1154
|
-
chrome;
|
|
1155
|
-
pastedBangOffsets = /* @__PURE__ */ new Set();
|
|
1156
|
-
bracketedPasteActive = false;
|
|
1157
|
-
revision = 0;
|
|
1158
|
-
pastedOperatorTokens = /* @__PURE__ */ new Set();
|
|
1159
|
-
get draftRevision() {
|
|
1160
|
-
return this.revision;
|
|
1161
|
-
}
|
|
1162
|
-
/** Restored queues and external buffers are literal editor content. */
|
|
1163
|
-
setLiteralText(text) {
|
|
1164
|
-
this.setText(text);
|
|
1165
|
-
this.pastedBangOffsets = new Set([...text.matchAll(/!/gu)].map((match) => match.index));
|
|
1166
|
-
}
|
|
1167
|
-
applyEdit(operation) {
|
|
1168
|
-
const before = this.getText();
|
|
1169
|
-
super.applyEdit(operation);
|
|
1170
|
-
this.revision += 1;
|
|
1171
|
-
this.pastedBangOffsets = remapPastedBangOffsets(before, this.getText(), this.pastedBangOffsets, operation === "undo");
|
|
1172
|
-
}
|
|
1173
|
-
render(width) {
|
|
1174
|
-
const lines = super.render(width);
|
|
1175
|
-
if (lines.length === 0) return lines;
|
|
1176
|
-
const theme = clioTheme();
|
|
1177
|
-
const safeWidth = Math.max(0, width);
|
|
1178
|
-
const text = this.getText();
|
|
1179
|
-
const mode = composerMode(this.chrome, text);
|
|
1180
|
-
if (hasScrollIndicator(lines[0] ?? "")) {
|
|
1181
|
-
const modeLabel = theme.style(modeToken(mode), mode, { bold: true });
|
|
1182
|
-
lines[0] = truncateToWidth(`${modeLabel} ${lines[0] ?? ""}`, safeWidth, "", true);
|
|
1183
|
-
} else {
|
|
1184
|
-
lines[0] = rule(theme, safeWidth, {
|
|
1185
|
-
left: mode,
|
|
1186
|
-
leftToken: modeToken(mode),
|
|
1187
|
-
right: styledRailLabel(theme, this.chrome, Math.max(1, safeWidth - visibleWidth(mode) - 5)),
|
|
1188
|
-
fillToken: "frameStrong",
|
|
1189
|
-
rightRaw: true,
|
|
1190
|
-
rightTail: theme.style("frameStrong", "\u2500", { bold: true })
|
|
1191
|
-
});
|
|
1192
|
-
}
|
|
1193
|
-
if (text.length === 0 && lines[1]) {
|
|
1194
|
-
lines[1] = renderEmptyPrompt(lines[1], safeWidth, theme, emptyPromptFor(mode));
|
|
1195
|
-
}
|
|
1196
|
-
const bottomRail = findBottomRail(lines, safeWidth);
|
|
1197
|
-
if (bottomRail >= 0 && mode === "CONFIRM") {
|
|
1198
|
-
lines[bottomRail] = rule(theme, safeWidth, {
|
|
1199
|
-
right: confirmRailHint(theme, safeWidth, text.length > 0, this.chrome.getPermissionInspection?.() ?? "none"),
|
|
1200
|
-
fillToken: "frameStrong",
|
|
1201
|
-
rightRaw: true,
|
|
1202
|
-
rightTail: theme.style("frameStrong", "\u2500", { bold: true })
|
|
1203
|
-
});
|
|
1204
|
-
} else if (bottomRail >= 0 && safeWidth >= MIN_HINT_WIDTH) {
|
|
1205
|
-
lines[bottomRail] = rule(theme, safeWidth, {
|
|
1206
|
-
right: lowerRailHint(theme, this.chrome),
|
|
1207
|
-
fillToken: "frameStrong",
|
|
1208
|
-
rightRaw: true,
|
|
1209
|
-
rightTail: theme.style("frameStrong", "\u2500", { bold: true })
|
|
1210
|
-
});
|
|
1211
|
-
}
|
|
1212
|
-
return lines;
|
|
1213
|
-
}
|
|
1214
|
-
/**
|
|
1215
|
-
* Preserve paste provenance for every immediate-send binding, including the
|
|
1216
|
-
* alternate paths that invoke the submit controller without an Editor Enter.
|
|
1217
|
-
*/
|
|
1218
|
-
getTextForSubmit() {
|
|
1219
|
-
const text = this.getExpandedText();
|
|
1220
|
-
return this.startsWithLiteralOperator() ? guardPastedEditorOperator(text) : text;
|
|
1221
|
-
}
|
|
1222
|
-
startsWithLiteralOperator() {
|
|
1223
|
-
const visible = this.getText();
|
|
1224
|
-
return startsWithPastedOperator(visible, this.pastedBangOffsets) || [...this.pastedOperatorTokens].some((token) => visible.trimStart().startsWith(token));
|
|
1225
|
-
}
|
|
1226
|
-
/** Paste is always literal; a later deliberate key submits it. */
|
|
1227
|
-
handleInput(data) {
|
|
1228
|
-
this.revision += 1;
|
|
1229
|
-
const openedPaste = data.includes("\x1B[200~");
|
|
1230
|
-
const closedPaste = data.includes("\x1B[201~");
|
|
1231
|
-
const pasteMutation = this.bracketedPasteActive || openedPaste;
|
|
1232
|
-
const textBeforeInput = this.getText();
|
|
1233
|
-
const keybindings = getKeybindings();
|
|
1234
|
-
if (this.startsWithLiteralOperator() && keybindings.matches(data, "tui.input.submit")) {
|
|
1235
|
-
const pastedText = this.getTextForSubmit();
|
|
1236
|
-
this.pastedBangOffsets.clear();
|
|
1237
|
-
this.bracketedPasteActive = false;
|
|
1238
|
-
super.setText(pastedText);
|
|
1239
|
-
super.handleInput(data);
|
|
1240
|
-
return;
|
|
1241
|
-
}
|
|
1242
|
-
const completingDirectory = this.isShowingAutocomplete() && (keybindings.matches(data, "tui.input.tab") || keybindings.matches(data, "tui.select.confirm"));
|
|
1243
|
-
const textBeforeCompletion = completingDirectory ? this.getText() : "";
|
|
1244
|
-
super.handleInput(data);
|
|
1245
|
-
if (completingDirectory && this.getText() !== textBeforeCompletion && cursorEndsDirectoryPath(this)) {
|
|
1246
|
-
super.handleInput(" ");
|
|
1247
|
-
}
|
|
1248
|
-
const textAfterInput = this.getText();
|
|
1249
|
-
this.pastedBangOffsets = remapPastedBangOffsets(
|
|
1250
|
-
textBeforeInput,
|
|
1251
|
-
textAfterInput,
|
|
1252
|
-
this.pastedBangOffsets,
|
|
1253
|
-
pasteMutation
|
|
1254
|
-
);
|
|
1255
|
-
if (openedPaste) this.bracketedPasteActive = true;
|
|
1256
|
-
if (closedPaste) this.bracketedPasteActive = false;
|
|
1257
|
-
if (pasteMutation && textAfterInput !== this.getExpandedText()) {
|
|
1258
|
-
let start = 0;
|
|
1259
|
-
while (start < textBeforeInput.length && start < textAfterInput.length && textBeforeInput[start] === textAfterInput[start])
|
|
1260
|
-
start++;
|
|
1261
|
-
let oldEnd = textBeforeInput.length, end = textAfterInput.length;
|
|
1262
|
-
while (oldEnd > start && end > start && textBeforeInput[oldEnd - 1] === textAfterInput[end - 1]) {
|
|
1263
|
-
oldEnd--;
|
|
1264
|
-
end--;
|
|
1265
|
-
}
|
|
1266
|
-
const token = textAfterInput.slice(start, end).trimStart();
|
|
1267
|
-
if (token && !token.startsWith("!")) this.pastedOperatorTokens.add(token);
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
setText(text) {
|
|
1271
|
-
this.revision += 1;
|
|
1272
|
-
this.pastedOperatorTokens.clear();
|
|
1273
|
-
this.pastedBangOffsets.clear();
|
|
1274
|
-
this.bracketedPasteActive = false;
|
|
1275
|
-
super.setText(text);
|
|
1276
|
-
}
|
|
1277
|
-
};
|
|
1278
|
-
|
|
1279
|
-
// src/interactive/interactive-shell.ts
|
|
1280
|
-
init_esm_shims();
|
|
1281
|
-
|
|
1282
|
-
// src/interactive/render-trace.ts
|
|
1283
|
-
init_esm_shims();
|
|
1284
|
-
import { mkdirSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
1285
|
-
import { appendFile } from "node:fs/promises";
|
|
1286
|
-
import { dirname, join } from "node:path";
|
|
1287
|
-
var RENDER_TRACE_VERSION = 2;
|
|
1288
|
-
var INPUT_WEDGE_RING_CAPACITY = 256;
|
|
1289
|
-
var INPUT_WEDGE_DUMP_DIRNAME = "input-wedge";
|
|
1290
|
-
var INPUT_WEDGE_DUMP_RETAINED = 5;
|
|
1291
|
-
function createRing(capacity) {
|
|
1292
|
-
const slots = [];
|
|
1293
|
-
let next = 0;
|
|
1294
|
-
return {
|
|
1295
|
-
push(value) {
|
|
1296
|
-
if (slots.length < capacity) slots.push(value);
|
|
1297
|
-
else slots[next] = value;
|
|
1298
|
-
next = (next + 1) % capacity;
|
|
1299
|
-
},
|
|
1300
|
-
toArray() {
|
|
1301
|
-
if (slots.length < capacity) return [...slots];
|
|
1302
|
-
return [...slots.slice(next), ...slots.slice(0, next)];
|
|
1303
|
-
}
|
|
1304
|
-
};
|
|
1305
|
-
}
|
|
1306
|
-
function classifyInputWedge(inputIngress, frames) {
|
|
1307
|
-
const newest = [...inputIngress].reverse().find((record) => record.visualExpected) ?? inputIngress.at(-1);
|
|
1308
|
-
if (newest === void 0) return "no-input-recorded";
|
|
1309
|
-
return frames.some((frame2) => frame2.inputHighWater >= newest.inputSeq) ? "input-committed" : "input-not-committed";
|
|
1310
|
-
}
|
|
1311
|
-
function writeInputWedgeDump(stateDir, snapshot) {
|
|
1312
|
-
const directory = join(stateDir, INPUT_WEDGE_DUMP_DIRNAME);
|
|
1313
|
-
mkdirSync(directory, { recursive: true });
|
|
1314
|
-
const stamp = new Date(snapshot.atEpochMs).toISOString().replace(/[:.]/gu, "-");
|
|
1315
|
-
const path = join(directory, `${stamp}-${snapshot.pid}.json`);
|
|
1316
|
-
writeFileSync(path, `${JSON.stringify(snapshot, null, 2)}
|
|
1317
|
-
`, "utf8");
|
|
1318
|
-
try {
|
|
1319
|
-
const existing = readdirSync(directory).filter((name) => name.endsWith(".json")).sort();
|
|
1320
|
-
for (const name of existing.slice(0, Math.max(0, existing.length - INPUT_WEDGE_DUMP_RETAINED))) {
|
|
1321
|
-
rmSync(join(directory, name), { force: true });
|
|
1322
|
-
}
|
|
1323
|
-
} catch {
|
|
1324
|
-
}
|
|
1325
|
-
return path;
|
|
1326
|
-
}
|
|
1327
|
-
function createAsyncTraceWriter(path, options = {}) {
|
|
1328
|
-
const maxRecords = options.maxRecords ?? 4096;
|
|
1329
|
-
const batchRecords = options.batchRecords ?? 128;
|
|
1330
|
-
const append = options.append ?? ((target, payload) => appendFile(target, payload, "utf8"));
|
|
1331
|
-
const recordTime = options.recordTime ?? (() => performance.now());
|
|
1332
|
-
const appendTimeoutMs = options.appendTimeoutMs ?? 5e3;
|
|
1333
|
-
const pending = [];
|
|
1334
|
-
let dropped = 0;
|
|
1335
|
-
let inFlight = false;
|
|
1336
|
-
let scheduled = false;
|
|
1337
|
-
let failed = false;
|
|
1338
|
-
let closing = false;
|
|
1339
|
-
let closePromise = null;
|
|
1340
|
-
let resolveClose = null;
|
|
1341
|
-
const settleClose = () => {
|
|
1342
|
-
if (closing && !inFlight && pending.length === 0) resolveClose?.();
|
|
1343
|
-
};
|
|
1344
|
-
const pump = () => {
|
|
1345
|
-
scheduled = false;
|
|
1346
|
-
if (failed || inFlight || pending.length === 0) {
|
|
1347
|
-
settleClose();
|
|
1348
|
-
return;
|
|
1349
|
-
}
|
|
1350
|
-
inFlight = true;
|
|
1351
|
-
const payload = pending.splice(0, batchRecords).join("");
|
|
1352
|
-
let appendTimer = null;
|
|
1353
|
-
const appendDeadline = new Promise((_resolve, reject) => {
|
|
1354
|
-
appendTimer = setTimeout(() => reject(new Error("render trace append timed out")), appendTimeoutMs);
|
|
1355
|
-
});
|
|
1356
|
-
void Promise.race([append(path, payload), appendDeadline]).catch(() => {
|
|
1357
|
-
failed = true;
|
|
1358
|
-
pending.length = 0;
|
|
1359
|
-
}).finally(() => {
|
|
1360
|
-
if (appendTimer) clearTimeout(appendTimer);
|
|
1361
|
-
inFlight = false;
|
|
1362
|
-
if (pending.length > 0 && !failed) queueMicrotask(pump);
|
|
1363
|
-
else settleClose();
|
|
1364
|
-
});
|
|
1365
|
-
};
|
|
1366
|
-
const schedule = () => {
|
|
1367
|
-
if (scheduled || inFlight || failed) return;
|
|
1368
|
-
scheduled = true;
|
|
1369
|
-
queueMicrotask(pump);
|
|
1370
|
-
};
|
|
1371
|
-
return {
|
|
1372
|
-
enqueue(record) {
|
|
1373
|
-
if (failed || closing) return;
|
|
1374
|
-
if (pending.length >= maxRecords) {
|
|
1375
|
-
pending.shift();
|
|
1376
|
-
dropped += 1;
|
|
1377
|
-
}
|
|
1378
|
-
pending.push(`${JSON.stringify(record)}
|
|
1379
|
-
`);
|
|
1380
|
-
schedule();
|
|
1381
|
-
},
|
|
1382
|
-
close() {
|
|
1383
|
-
if (closePromise) return closePromise;
|
|
1384
|
-
if (dropped > 0 && !failed) {
|
|
1385
|
-
pending.push(
|
|
1386
|
-
`${JSON.stringify({ type: "trace_drop", version: RENDER_TRACE_VERSION, at: recordTime(), records: dropped })}
|
|
1387
|
-
`
|
|
1388
|
-
);
|
|
1389
|
-
}
|
|
1390
|
-
closing = true;
|
|
1391
|
-
closePromise = new Promise((resolve) => {
|
|
1392
|
-
resolveClose = resolve;
|
|
1393
|
-
});
|
|
1394
|
-
if (failed) {
|
|
1395
|
-
pending.length = 0;
|
|
1396
|
-
resolveClose?.();
|
|
1397
|
-
} else {
|
|
1398
|
-
schedule();
|
|
1399
|
-
settleClose();
|
|
1400
|
-
}
|
|
1401
|
-
return closePromise;
|
|
1402
|
-
}
|
|
1403
|
-
};
|
|
1404
|
-
}
|
|
1405
|
-
function rounded(value) {
|
|
1406
|
-
return Math.round(value * 1e3) / 1e3;
|
|
1407
|
-
}
|
|
1408
|
-
function graphemeCount(text) {
|
|
1409
|
-
const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
1410
|
-
let count = 0;
|
|
1411
|
-
for (const _part of segmenter.segment(text)) count += 1;
|
|
1412
|
-
return count;
|
|
1413
|
-
}
|
|
1414
|
-
function renderTracePath(env = process.env) {
|
|
1415
|
-
const raw = env.CLIO_CODER_RENDER_TRACE?.trim();
|
|
1416
|
-
return raw && raw.length > 0 ? raw : null;
|
|
1417
|
-
}
|
|
1418
|
-
function createRenderTrace(path, now = () => performance.now(), writerOptions = {}) {
|
|
1419
|
-
if (path !== null) {
|
|
1420
|
-
mkdirSync(dirname(path), { recursive: true });
|
|
1421
|
-
writeFileSync(path, "", "utf8");
|
|
1422
|
-
}
|
|
1423
|
-
const openedAt = now();
|
|
1424
|
-
const openedAtEpochMs = Date.now();
|
|
1425
|
-
const at = () => rounded(now() - openedAt);
|
|
1426
|
-
const writer = path === null ? null : createAsyncTraceWriter(path, { ...writerOptions, recordTime: at });
|
|
1427
|
-
const inputRing = createRing(INPUT_WEDGE_RING_CAPACITY);
|
|
1428
|
-
const frameRing = createRing(INPUT_WEDGE_RING_CAPACITY);
|
|
1429
|
-
let frameSeq = 0;
|
|
1430
|
-
let writeSeq = 0;
|
|
1431
|
-
let eventSeq = 0;
|
|
1432
|
-
let inputSeq = 0;
|
|
1433
|
-
let generation = 0;
|
|
1434
|
-
let panelHighWater = 0;
|
|
1435
|
-
let inputHighWater = 0;
|
|
1436
|
-
let queueDepth = 0;
|
|
1437
|
-
let currentFrame = null;
|
|
1438
|
-
let pendingPanel = null;
|
|
1439
|
-
let lastCommitAt = null;
|
|
1440
|
-
let firstCommitListener = null;
|
|
1441
|
-
let firstCommitDelivered = false;
|
|
1442
|
-
const ranges = /* @__PURE__ */ new Map();
|
|
1443
|
-
const pendingDrains = /* @__PURE__ */ new Map();
|
|
1444
|
-
writer?.enqueue({ type: "trace_start", version: RENDER_TRACE_VERSION, at: 0 });
|
|
1445
|
-
const trace = {
|
|
1446
|
-
recordPanelRender(metrics) {
|
|
1447
|
-
pendingPanel = metrics;
|
|
1448
|
-
},
|
|
1449
|
-
beginGeneration() {
|
|
1450
|
-
generation += 1;
|
|
1451
|
-
ranges.clear();
|
|
1452
|
-
},
|
|
1453
|
-
recordVisibleEvent(fields) {
|
|
1454
|
-
eventSeq += 1;
|
|
1455
|
-
if (writer === null) return eventSeq;
|
|
1456
|
-
const key = `${generation}:${fields.kind}:${fields.contentIndex}`;
|
|
1457
|
-
const previous = ranges.get(key) ?? { codeUnits: 0, graphemes: 0 };
|
|
1458
|
-
const graphemes = graphemeCount(fields.delta);
|
|
1459
|
-
const next = { codeUnits: previous.codeUnits + fields.delta.length, graphemes: previous.graphemes + graphemes };
|
|
1460
|
-
ranges.set(key, next);
|
|
1461
|
-
writer?.enqueue({
|
|
1462
|
-
type: "event_ingress",
|
|
1463
|
-
version: RENDER_TRACE_VERSION,
|
|
1464
|
-
eventSeq,
|
|
1465
|
-
generation,
|
|
1466
|
-
kind: fields.kind,
|
|
1467
|
-
contentIndex: fields.contentIndex,
|
|
1468
|
-
at: at(),
|
|
1469
|
-
codeUnitStart: previous.codeUnits,
|
|
1470
|
-
codeUnitEnd: next.codeUnits,
|
|
1471
|
-
graphemeStart: previous.graphemes,
|
|
1472
|
-
graphemeEnd: next.graphemes,
|
|
1473
|
-
bytes: Buffer.byteLength(fields.delta, "utf8")
|
|
1474
|
-
});
|
|
1475
|
-
return eventSeq;
|
|
1476
|
-
},
|
|
1477
|
-
recordQueue(sequence, action) {
|
|
1478
|
-
queueDepth = Math.max(0, queueDepth + (action === "admit" ? 1 : -1));
|
|
1479
|
-
writer?.enqueue({
|
|
1480
|
-
type: "queue",
|
|
1481
|
-
version: RENDER_TRACE_VERSION,
|
|
1482
|
-
eventSeq: sequence,
|
|
1483
|
-
action,
|
|
1484
|
-
at: at(),
|
|
1485
|
-
depth: queueDepth
|
|
1486
|
-
});
|
|
1487
|
-
},
|
|
1488
|
-
recordPanelApplied(sequence) {
|
|
1489
|
-
panelHighWater = Math.max(panelHighWater, sequence);
|
|
1490
|
-
writer?.enqueue({
|
|
1491
|
-
type: "panel",
|
|
1492
|
-
version: RENDER_TRACE_VERSION,
|
|
1493
|
-
eventSeq: sequence,
|
|
1494
|
-
at: at(),
|
|
1495
|
-
highWater: panelHighWater
|
|
1496
|
-
});
|
|
1497
|
-
},
|
|
1498
|
-
recordInputIngress(action, bytes, visualExpected = action !== "no-visual-change") {
|
|
1499
|
-
inputSeq += 1;
|
|
1500
|
-
if (visualExpected) inputHighWater = inputSeq;
|
|
1501
|
-
const record = {
|
|
1502
|
-
type: "input_ingress",
|
|
1503
|
-
version: RENDER_TRACE_VERSION,
|
|
1504
|
-
inputSeq,
|
|
1505
|
-
action,
|
|
1506
|
-
at: at(),
|
|
1507
|
-
bytes,
|
|
1508
|
-
visualExpected
|
|
1509
|
-
};
|
|
1510
|
-
inputRing.push(record);
|
|
1511
|
-
writer?.enqueue(record);
|
|
1512
|
-
return inputSeq;
|
|
1513
|
-
},
|
|
1514
|
-
beginFrame(fields) {
|
|
1515
|
-
frameSeq += 1;
|
|
1516
|
-
const frame2 = {
|
|
1517
|
-
frameId: frameSeq,
|
|
1518
|
-
...fields,
|
|
1519
|
-
beginAt: at(),
|
|
1520
|
-
panelHighWater,
|
|
1521
|
-
inputHighWater,
|
|
1522
|
-
panel: pendingPanel,
|
|
1523
|
-
phases: { component: 0, overlay: 0, normalization: 0, cursor: 0 },
|
|
1524
|
-
commits: []
|
|
1525
|
-
};
|
|
1526
|
-
pendingPanel = null;
|
|
1527
|
-
currentFrame = frame2;
|
|
1528
|
-
return frame2;
|
|
1529
|
-
},
|
|
1530
|
-
endFrame(frameToken) {
|
|
1531
|
-
const frame2 = frameToken;
|
|
1532
|
-
const endAt = at();
|
|
1533
|
-
const terminalEnqueueMs = frame2.commits.reduce((sum, commit) => sum + commit.enqueueMs, 0);
|
|
1534
|
-
const measured = frame2.phases.component + frame2.phases.overlay + frame2.phases.normalization + frame2.phases.cursor + terminalEnqueueMs;
|
|
1535
|
-
const record = {
|
|
1536
|
-
type: "frame",
|
|
1537
|
-
version: RENDER_TRACE_VERSION,
|
|
1538
|
-
frameId: frame2.frameId,
|
|
1539
|
-
mode: frame2.mode,
|
|
1540
|
-
columns: frame2.columns,
|
|
1541
|
-
rows: frame2.rows,
|
|
1542
|
-
beginAt: frame2.beginAt,
|
|
1543
|
-
endAt,
|
|
1544
|
-
durationMs: rounded(Math.max(0, endAt - frame2.beginAt)),
|
|
1545
|
-
sinceLastCommitMs: lastCommitAt === null || frame2.commits.length === 0 ? null : rounded(Math.max(0, (frame2.commits[0]?.at ?? endAt) - lastCommitAt)),
|
|
1546
|
-
panelHighWater: frame2.panelHighWater,
|
|
1547
|
-
inputHighWater: frame2.inputHighWater,
|
|
1548
|
-
panel: frame2.panel,
|
|
1549
|
-
pipeline: {
|
|
1550
|
-
componentMs: rounded(frame2.phases.component),
|
|
1551
|
-
overlayCompositionMs: rounded(frame2.phases.overlay),
|
|
1552
|
-
normalizationMs: rounded(frame2.phases.normalization),
|
|
1553
|
-
cursorExtractionMs: rounded(frame2.phases.cursor),
|
|
1554
|
-
viewportDiffAnsiCursorMs: rounded(Math.max(0, endAt - frame2.beginAt - measured)),
|
|
1555
|
-
terminalEnqueueMs: rounded(terminalEnqueueMs)
|
|
1556
|
-
},
|
|
1557
|
-
commits: frame2.commits
|
|
1558
|
-
};
|
|
1559
|
-
writer?.enqueue(record);
|
|
1560
|
-
if (frame2.commits.length > 0) {
|
|
1561
|
-
frameRing.push(record);
|
|
1562
|
-
lastCommitAt = frame2.commits.at(-1)?.at ?? endAt;
|
|
1563
|
-
if (!firstCommitDelivered) {
|
|
1564
|
-
firstCommitDelivered = true;
|
|
1565
|
-
firstCommitListener?.(frame2.frameId);
|
|
1566
|
-
}
|
|
1567
|
-
}
|
|
1568
|
-
if (currentFrame === frame2) currentFrame = null;
|
|
1569
|
-
},
|
|
1570
|
-
beginPhase(_frame, _phase) {
|
|
1571
|
-
return now();
|
|
1572
|
-
},
|
|
1573
|
-
endPhase(frameToken, phase, phaseToken) {
|
|
1574
|
-
const frame2 = frameToken;
|
|
1575
|
-
frame2.phases[phase] += Math.max(0, now() - phaseToken);
|
|
1576
|
-
},
|
|
1577
|
-
beginComponentRender() {
|
|
1578
|
-
return currentFrame ? now() : null;
|
|
1579
|
-
},
|
|
1580
|
-
endComponentRender(token) {
|
|
1581
|
-
if (currentFrame === null || token === null) return;
|
|
1582
|
-
currentFrame.phases.component += Math.max(0, now() - token);
|
|
1583
|
-
},
|
|
1584
|
-
recordTerminalWrite(fields) {
|
|
1585
|
-
writeSeq += 1;
|
|
1586
|
-
const frameId = currentFrame?.frameId ?? null;
|
|
1587
|
-
const commit = {
|
|
1588
|
-
writeId: writeSeq,
|
|
1589
|
-
at: at(),
|
|
1590
|
-
bytes: fields.bytes,
|
|
1591
|
-
enqueueMs: rounded(fields.enqueueMs),
|
|
1592
|
-
returned: fields.returned,
|
|
1593
|
-
backpressured: !fields.returned
|
|
1594
|
-
};
|
|
1595
|
-
currentFrame?.commits.push(commit);
|
|
1596
|
-
if (writer === null) return writeSeq;
|
|
1597
|
-
writer.enqueue({ type: "terminal_write", version: RENDER_TRACE_VERSION, frameId, ...commit });
|
|
1598
|
-
if (!fields.returned) pendingDrains.set(writeSeq, { frameId, at: commit.at });
|
|
1599
|
-
return writeSeq;
|
|
1600
|
-
},
|
|
1601
|
-
recordTerminalDrain(writeId) {
|
|
1602
|
-
const pending = pendingDrains.get(writeId);
|
|
1603
|
-
if (!pending) return;
|
|
1604
|
-
pendingDrains.delete(writeId);
|
|
1605
|
-
const drainAt = at();
|
|
1606
|
-
writer?.enqueue({
|
|
1607
|
-
type: "terminal_drain",
|
|
1608
|
-
version: RENDER_TRACE_VERSION,
|
|
1609
|
-
writeId,
|
|
1610
|
-
frameId: pending.frameId,
|
|
1611
|
-
at: drainAt,
|
|
1612
|
-
waitMs: rounded(Math.max(0, drainAt - pending.at))
|
|
1613
|
-
});
|
|
1614
|
-
},
|
|
1615
|
-
currentFrameId: () => currentFrame?.frameId ?? null,
|
|
1616
|
-
onFirstFrameCommit(listener) {
|
|
1617
|
-
firstCommitListener = listener;
|
|
1618
|
-
},
|
|
1619
|
-
snapshotInputWedge() {
|
|
1620
|
-
const inputIngress = inputRing.toArray();
|
|
1621
|
-
const frames = frameRing.toArray();
|
|
1622
|
-
const nowAt = at();
|
|
1623
|
-
const lastIngressAt = inputIngress.at(-1)?.at;
|
|
1624
|
-
const lastFrame = frames.at(-1);
|
|
1625
|
-
const lastFrameCommitAt = lastFrame?.commits.at(-1)?.at ?? lastFrame?.endAt;
|
|
1626
|
-
return {
|
|
1627
|
-
version: RENDER_TRACE_VERSION,
|
|
1628
|
-
capacity: INPUT_WEDGE_RING_CAPACITY,
|
|
1629
|
-
pid: process.pid,
|
|
1630
|
-
openedAtEpochMs,
|
|
1631
|
-
atEpochMs: Date.now(),
|
|
1632
|
-
at: nowAt,
|
|
1633
|
-
classification: classifyInputWedge(inputIngress, frames),
|
|
1634
|
-
msSinceLastInputIngress: lastIngressAt === void 0 ? null : rounded(nowAt - lastIngressAt),
|
|
1635
|
-
msSinceLastCommittedFrame: lastFrameCommitAt === void 0 ? null : rounded(nowAt - lastFrameCommitAt),
|
|
1636
|
-
inputIngress,
|
|
1637
|
-
frames
|
|
1638
|
-
};
|
|
1639
|
-
},
|
|
1640
|
-
close: () => writer?.close() ?? Promise.resolve()
|
|
1641
|
-
};
|
|
1642
|
-
return trace;
|
|
1643
|
-
}
|
|
1644
|
-
function traceComponentRenders(component, trace) {
|
|
1645
|
-
const original = component.render;
|
|
1646
|
-
const wrapped = function(width) {
|
|
1647
|
-
const token = trace.beginComponentRender();
|
|
1648
|
-
try {
|
|
1649
|
-
return original.call(this, width);
|
|
1650
|
-
} finally {
|
|
1651
|
-
trace.endComponentRender(token);
|
|
1652
|
-
}
|
|
1653
|
-
};
|
|
1654
|
-
component.render = wrapped;
|
|
1655
|
-
return () => {
|
|
1656
|
-
if (component.render === wrapped) component.render = original;
|
|
1657
|
-
};
|
|
1658
|
-
}
|
|
1659
|
-
function traceProcessStdout(trace, now = () => performance.now(), stdout = process.stdout) {
|
|
1660
|
-
const original = stdout.write;
|
|
1661
|
-
const pendingDrainWrites = [];
|
|
1662
|
-
let drainListening = false;
|
|
1663
|
-
const wrapped = function(...args) {
|
|
1664
|
-
const chunk = args[0];
|
|
1665
|
-
const start = now();
|
|
1666
|
-
const returned = Reflect.apply(original, this, args);
|
|
1667
|
-
const enqueueMs = Math.max(0, now() - start);
|
|
1668
|
-
let bytes = 0;
|
|
1669
|
-
try {
|
|
1670
|
-
bytes = Buffer.isBuffer(chunk) ? chunk.byteLength : ArrayBuffer.isView(chunk) ? chunk.byteLength : Buffer.byteLength(String(chunk), typeof args[1] === "string" ? args[1] : "utf8");
|
|
1671
|
-
} catch {
|
|
1672
|
-
bytes = Buffer.byteLength(String(chunk), "utf8");
|
|
1673
|
-
}
|
|
1674
|
-
const writeId = trace.recordTerminalWrite({ bytes, enqueueMs, returned });
|
|
1675
|
-
if (!returned) {
|
|
1676
|
-
pendingDrainWrites.push(writeId);
|
|
1677
|
-
if (!drainListening) {
|
|
1678
|
-
drainListening = true;
|
|
1679
|
-
stdout.once("drain", () => {
|
|
1680
|
-
drainListening = false;
|
|
1681
|
-
for (const pendingWriteId of pendingDrainWrites.splice(0)) trace.recordTerminalDrain(pendingWriteId);
|
|
1682
|
-
});
|
|
1683
|
-
}
|
|
1684
|
-
}
|
|
1685
|
-
return returned;
|
|
1686
|
-
};
|
|
1687
|
-
stdout.write = wrapped;
|
|
1688
|
-
return () => {
|
|
1689
|
-
if (stdout.write === wrapped) stdout.write = original;
|
|
1690
|
-
};
|
|
1691
|
-
}
|
|
1692
|
-
|
|
1693
|
-
// src/interactive/stdout-backpressure.ts
|
|
1694
|
-
init_esm_shims();
|
|
1695
|
-
function installStdoutBackpressureGate(stdout = process.stdout) {
|
|
1696
|
-
const original = stdout.write;
|
|
1697
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
1698
|
-
let blocked = false;
|
|
1699
|
-
let observed = false;
|
|
1700
|
-
let restored = false;
|
|
1701
|
-
let drainListening = false;
|
|
1702
|
-
const notifyWritable = () => {
|
|
1703
|
-
drainListening = false;
|
|
1704
|
-
if (!blocked) return;
|
|
1705
|
-
blocked = false;
|
|
1706
|
-
for (const listener of [...listeners]) listener();
|
|
1707
|
-
};
|
|
1708
|
-
const listenForDrain = () => {
|
|
1709
|
-
if (drainListening || restored) return;
|
|
1710
|
-
drainListening = true;
|
|
1711
|
-
stdout.once("drain", notifyWritable);
|
|
1712
|
-
};
|
|
1713
|
-
const wrapped = function(...args) {
|
|
1714
|
-
const returned = Reflect.apply(original, this, args);
|
|
1715
|
-
if (!returned) {
|
|
1716
|
-
observed = true;
|
|
1717
|
-
blocked = true;
|
|
1718
|
-
listenForDrain();
|
|
1719
|
-
}
|
|
1720
|
-
return returned;
|
|
1721
|
-
};
|
|
1722
|
-
stdout.write = wrapped;
|
|
1723
|
-
return {
|
|
1724
|
-
get blocked() {
|
|
1725
|
-
return blocked;
|
|
1726
|
-
},
|
|
1727
|
-
get observed() {
|
|
1728
|
-
return observed;
|
|
1729
|
-
},
|
|
1730
|
-
onWritable(listener) {
|
|
1731
|
-
if (restored || !blocked) {
|
|
1732
|
-
queueMicrotask(listener);
|
|
1733
|
-
return () => {
|
|
1734
|
-
};
|
|
1735
|
-
}
|
|
1736
|
-
listeners.add(listener);
|
|
1737
|
-
return () => listeners.delete(listener);
|
|
1738
|
-
},
|
|
1739
|
-
whenWritable(timeoutMs) {
|
|
1740
|
-
if (restored || !blocked) return Promise.resolve(true);
|
|
1741
|
-
return new Promise((resolve) => {
|
|
1742
|
-
let timer;
|
|
1743
|
-
const release = this.onWritable(() => {
|
|
1744
|
-
if (timer) clearTimeout(timer);
|
|
1745
|
-
release();
|
|
1746
|
-
resolve(true);
|
|
1747
|
-
});
|
|
1748
|
-
if (timeoutMs !== void 0 && Number.isFinite(timeoutMs) && timeoutMs >= 0) {
|
|
1749
|
-
timer = setTimeout(() => {
|
|
1750
|
-
release();
|
|
1751
|
-
resolve(false);
|
|
1752
|
-
}, timeoutMs);
|
|
1753
|
-
}
|
|
1754
|
-
});
|
|
1755
|
-
},
|
|
1756
|
-
restore() {
|
|
1757
|
-
if (restored) return;
|
|
1758
|
-
restored = true;
|
|
1759
|
-
blocked = false;
|
|
1760
|
-
if (drainListening) {
|
|
1761
|
-
stdout.off("drain", notifyWritable);
|
|
1762
|
-
drainListening = false;
|
|
1763
|
-
}
|
|
1764
|
-
if (stdout.write === wrapped) stdout.write = original;
|
|
1765
|
-
for (const listener of [...listeners]) listener();
|
|
1766
|
-
listeners.clear();
|
|
1767
|
-
}
|
|
1768
|
-
};
|
|
1769
|
-
}
|
|
1770
|
-
|
|
1771
|
-
// src/interactive/interactive-shell.ts
|
|
1772
|
-
var KEEP_ALIVE_INTERVAL_MS = 1 << 30;
|
|
1773
|
-
function createInteractiveShell(deps) {
|
|
1774
|
-
const terminal = deps.createTerminal();
|
|
1775
|
-
const tui = deps.createTui(terminal);
|
|
1776
|
-
const scheduleInterval = deps.scheduleInterval ?? ((callback, intervalMs) => setInterval(callback, intervalMs));
|
|
1777
|
-
const clearScheduledInterval = deps.clearScheduledInterval ?? ((handle) => clearInterval(handle));
|
|
1778
|
-
let mounted = false;
|
|
1779
|
-
let keepAlive = null;
|
|
1780
|
-
let resolveRun = null;
|
|
1781
|
-
let run = null;
|
|
1782
|
-
let completedCode = null;
|
|
1783
|
-
let stopped = false;
|
|
1784
|
-
let stopSettlement = null;
|
|
1785
|
-
return {
|
|
1786
|
-
terminal,
|
|
1787
|
-
tui,
|
|
1788
|
-
mount(root, focus) {
|
|
1789
|
-
if (mounted) return;
|
|
1790
|
-
mounted = true;
|
|
1791
|
-
deps.prepareRoot?.(root);
|
|
1792
|
-
tui.addChild(root);
|
|
1793
|
-
if (tui.mode === "fullscreen") tui.setLayoutRoot?.(root);
|
|
1794
|
-
tui.setFocus(focus);
|
|
1795
|
-
tui.start();
|
|
1796
|
-
},
|
|
1797
|
-
anchor() {
|
|
1798
|
-
if (run) return run;
|
|
1799
|
-
run = new Promise((resolve) => {
|
|
1800
|
-
resolveRun = resolve;
|
|
1801
|
-
if (completedCode !== null) resolve(completedCode);
|
|
1802
|
-
});
|
|
1803
|
-
keepAlive = scheduleInterval(() => {
|
|
1804
|
-
}, KEEP_ALIVE_INTERVAL_MS);
|
|
1805
|
-
return run;
|
|
1806
|
-
},
|
|
1807
|
-
releaseAnchor() {
|
|
1808
|
-
if (!keepAlive) return;
|
|
1809
|
-
clearScheduledInterval(keepAlive);
|
|
1810
|
-
keepAlive = null;
|
|
1811
|
-
},
|
|
1812
|
-
stop() {
|
|
1813
|
-
if (stopped) return;
|
|
1814
|
-
stopped = true;
|
|
1815
|
-
try {
|
|
1816
|
-
tui.stop();
|
|
1817
|
-
} catch {
|
|
1818
|
-
} finally {
|
|
1819
|
-
try {
|
|
1820
|
-
stopSettlement = Promise.resolve(deps.onStop?.()).then(() => void 0);
|
|
1821
|
-
} catch {
|
|
1822
|
-
stopSettlement = Promise.resolve();
|
|
1823
|
-
}
|
|
1824
|
-
}
|
|
1825
|
-
},
|
|
1826
|
-
async commitCurrentFrame() {
|
|
1827
|
-
if (!tui.renderNow) {
|
|
1828
|
-
tui.requestRender();
|
|
1829
|
-
return null;
|
|
1830
|
-
}
|
|
1831
|
-
tui.renderNow(false);
|
|
1832
|
-
return null;
|
|
1833
|
-
},
|
|
1834
|
-
hasObservedBackpressure: () => false,
|
|
1835
|
-
setStreamPacingActive: () => {
|
|
1836
|
-
},
|
|
1837
|
-
settle() {
|
|
1838
|
-
return stopSettlement ?? Promise.resolve();
|
|
1839
|
-
},
|
|
1840
|
-
nextCommittedFrame() {
|
|
1841
|
-
return Promise.resolve(null);
|
|
1842
|
-
},
|
|
1843
|
-
complete(code) {
|
|
1844
|
-
if (completedCode !== null) return;
|
|
1845
|
-
completedCode = code;
|
|
1846
|
-
resolveRun?.(code);
|
|
1847
|
-
}
|
|
1848
|
-
};
|
|
1849
|
-
}
|
|
1850
|
-
var activeRenderTrace = null;
|
|
1851
|
-
function getActiveRenderTrace() {
|
|
1852
|
-
return activeRenderTrace;
|
|
1853
|
-
}
|
|
1854
|
-
async function settleLatestInteractiveFrame(gate, timeoutMs, renderFrame) {
|
|
1855
|
-
const writableBeforeRender = gate ? await gate.whenWritable(timeoutMs) : true;
|
|
1856
|
-
const frameId = await renderFrame();
|
|
1857
|
-
if (writableBeforeRender && gate) await gate.whenWritable(timeoutMs);
|
|
1858
|
-
return frameId;
|
|
1859
|
-
}
|
|
1860
|
-
function createProcessInteractiveShell(options = {}) {
|
|
1861
|
-
const tracePath = renderTracePath();
|
|
1862
|
-
let restoreStdout = null;
|
|
1863
|
-
let restoreFirstFrameStdout = null;
|
|
1864
|
-
let restoreRoot = null;
|
|
1865
|
-
let backpressure = null;
|
|
1866
|
-
let observedBackpressure = false;
|
|
1867
|
-
let candidate = null;
|
|
1868
|
-
try {
|
|
1869
|
-
candidate = createRenderTrace(tracePath);
|
|
1870
|
-
restoreStdout = traceProcessStdout(candidate);
|
|
1871
|
-
activeRenderTrace = candidate;
|
|
1872
|
-
} catch {
|
|
1873
|
-
restoreStdout?.();
|
|
1874
|
-
restoreStdout = null;
|
|
1875
|
-
void candidate?.close().catch(() => {
|
|
1876
|
-
});
|
|
1877
|
-
activeRenderTrace = null;
|
|
1878
|
-
}
|
|
1879
|
-
const trace = activeRenderTrace;
|
|
1880
|
-
if (trace && options.onFirstFrameCommit) trace.onFirstFrameCommit(options.onFirstFrameCommit);
|
|
1881
|
-
let firstFrameDelivered = false;
|
|
1882
|
-
let firstFrameSeq = 0;
|
|
1883
|
-
let firstFrameActive = false;
|
|
1884
|
-
let firstFrameWrote = false;
|
|
1885
|
-
if (!trace && options.onFirstFrameCommit) {
|
|
1886
|
-
const stdout = process.stdout;
|
|
1887
|
-
const original = stdout.write;
|
|
1888
|
-
const wrapped = function(...args) {
|
|
1889
|
-
const returned = Reflect.apply(original, this, args);
|
|
1890
|
-
if (firstFrameActive) firstFrameWrote = true;
|
|
1891
|
-
return returned;
|
|
1892
|
-
};
|
|
1893
|
-
stdout.write = wrapped;
|
|
1894
|
-
restoreFirstFrameStdout = () => {
|
|
1895
|
-
if (stdout.write === wrapped) stdout.write = original;
|
|
1896
|
-
};
|
|
1897
|
-
}
|
|
1898
|
-
const firstFrameOnlyObserver = {
|
|
1899
|
-
isEnabled: () => !firstFrameDelivered,
|
|
1900
|
-
beginFrame: () => {
|
|
1901
|
-
firstFrameSeq += 1;
|
|
1902
|
-
firstFrameActive = true;
|
|
1903
|
-
firstFrameWrote = false;
|
|
1904
|
-
return firstFrameSeq;
|
|
1905
|
-
},
|
|
1906
|
-
endFrame: (frame2) => {
|
|
1907
|
-
firstFrameActive = false;
|
|
1908
|
-
if (firstFrameDelivered || !firstFrameWrote) return;
|
|
1909
|
-
firstFrameDelivered = true;
|
|
1910
|
-
options.onFirstFrameCommit?.(frame2);
|
|
1911
|
-
restoreFirstFrameStdout?.();
|
|
1912
|
-
restoreFirstFrameStdout = null;
|
|
1913
|
-
},
|
|
1914
|
-
beginPhase: () => null,
|
|
1915
|
-
endPhase: () => {
|
|
1916
|
-
}
|
|
1917
|
-
};
|
|
1918
|
-
const primaryObserver = trace ?? (options.onFirstFrameCommit ? firstFrameOnlyObserver : null);
|
|
1919
|
-
let committedFrameSequence = 0;
|
|
1920
|
-
const frameWaiters = [];
|
|
1921
|
-
const renderObserver = {
|
|
1922
|
-
isEnabled: () => frameWaiters.length > 0 || primaryObserver !== null && (primaryObserver.isEnabled?.() ?? true),
|
|
1923
|
-
beginFrame: (fields) => ({
|
|
1924
|
-
primary: primaryObserver?.beginFrame(fields),
|
|
1925
|
-
primaryActive: primaryObserver !== null && (primaryObserver.isEnabled?.() ?? true),
|
|
1926
|
-
frameId: ++committedFrameSequence
|
|
1927
|
-
}),
|
|
1928
|
-
endFrame: (token) => {
|
|
1929
|
-
const frame2 = token;
|
|
1930
|
-
if (frame2.primaryActive) primaryObserver?.endFrame(frame2.primary);
|
|
1931
|
-
for (const waiter of frameWaiters.splice(0)) waiter.resolve(frame2.frameId);
|
|
1932
|
-
},
|
|
1933
|
-
beginPhase: (token, phase) => {
|
|
1934
|
-
const frame2 = token;
|
|
1935
|
-
return frame2.primaryActive ? primaryObserver?.beginPhase(frame2.primary, phase) : null;
|
|
1936
|
-
},
|
|
1937
|
-
endPhase: (token, phase, phaseToken) => {
|
|
1938
|
-
const frame2 = token;
|
|
1939
|
-
if (frame2.primaryActive) primaryObserver?.endPhase(frame2.primary, phase, phaseToken);
|
|
1940
|
-
}
|
|
1941
|
-
};
|
|
1942
|
-
const renderAdmission = {
|
|
1943
|
-
get blocked() {
|
|
1944
|
-
return backpressure?.blocked ?? false;
|
|
1945
|
-
},
|
|
1946
|
-
onWritable(listener) {
|
|
1947
|
-
if (backpressure) return backpressure.onWritable(listener);
|
|
1948
|
-
queueMicrotask(listener);
|
|
1949
|
-
return () => {
|
|
1950
|
-
};
|
|
1951
|
-
}
|
|
1952
|
-
};
|
|
1953
|
-
const setStreamPacingActive = (active) => {
|
|
1954
|
-
if (active) {
|
|
1955
|
-
backpressure ??= installStdoutBackpressureGate();
|
|
1956
|
-
return;
|
|
1957
|
-
}
|
|
1958
|
-
if (!backpressure) return;
|
|
1959
|
-
observedBackpressure ||= backpressure.observed;
|
|
1960
|
-
backpressure.restore();
|
|
1961
|
-
backpressure = null;
|
|
1962
|
-
};
|
|
1963
|
-
let instrumentationCleanupStarted = false;
|
|
1964
|
-
let instrumentationCleanupPromise = Promise.resolve();
|
|
1965
|
-
const cleanupInstrumentation = () => {
|
|
1966
|
-
if (instrumentationCleanupStarted) return instrumentationCleanupPromise;
|
|
1967
|
-
instrumentationCleanupStarted = true;
|
|
1968
|
-
const errors = [];
|
|
1969
|
-
const attempt = (operation) => {
|
|
1970
|
-
try {
|
|
1971
|
-
operation();
|
|
1972
|
-
} catch (error) {
|
|
1973
|
-
errors.push(error);
|
|
1974
|
-
}
|
|
1975
|
-
};
|
|
1976
|
-
attempt(() => setStreamPacingActive(false));
|
|
1977
|
-
attempt(() => restoreRoot?.());
|
|
1978
|
-
restoreRoot = null;
|
|
1979
|
-
attempt(() => restoreStdout?.());
|
|
1980
|
-
restoreStdout = null;
|
|
1981
|
-
attempt(() => restoreFirstFrameStdout?.());
|
|
1982
|
-
restoreFirstFrameStdout = null;
|
|
1983
|
-
if (activeRenderTrace === trace) activeRenderTrace = null;
|
|
1984
|
-
instrumentationCleanupPromise = (async () => {
|
|
1985
|
-
if (trace) {
|
|
1986
|
-
try {
|
|
1987
|
-
await trace.close();
|
|
1988
|
-
} catch (error) {
|
|
1989
|
-
errors.push(error);
|
|
1990
|
-
}
|
|
1991
|
-
}
|
|
1992
|
-
if (errors.length > 0) throw new AggregateError(errors, "interactive shell instrumentation cleanup failed");
|
|
1993
|
-
})();
|
|
1994
|
-
return instrumentationCleanupPromise;
|
|
1995
|
-
};
|
|
1996
|
-
let shell;
|
|
1997
|
-
try {
|
|
1998
|
-
setStreamPacingActive(options.streamPacingActive === true);
|
|
1999
|
-
shell = createInteractiveShell({
|
|
2000
|
-
createTerminal: options.testing?.createTerminal ?? (() => new ProcessTerminal()),
|
|
2001
|
-
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)),
|
|
2002
|
-
prepareRoot: (root) => {
|
|
2003
|
-
if (trace) restoreRoot = traceComponentRenders(root, trace);
|
|
2004
|
-
},
|
|
2005
|
-
onStop: cleanupInstrumentation
|
|
2006
|
-
});
|
|
2007
|
-
} catch (error) {
|
|
2008
|
-
void cleanupInstrumentation().catch(() => {
|
|
2009
|
-
});
|
|
2010
|
-
throw error;
|
|
2011
|
-
}
|
|
2012
|
-
return {
|
|
2013
|
-
...shell,
|
|
2014
|
-
nextCommittedFrame() {
|
|
2015
|
-
return new Promise((resolve) => {
|
|
2016
|
-
frameWaiters.push({ resolve });
|
|
2017
|
-
});
|
|
2018
|
-
},
|
|
2019
|
-
async commitCurrentFrame(timeoutMs = 3e4) {
|
|
2020
|
-
return await settleLatestInteractiveFrame(backpressure, timeoutMs, async () => {
|
|
2021
|
-
const tui = shell.tui;
|
|
2022
|
-
const waiter = { resolve: () => {
|
|
2023
|
-
} };
|
|
2024
|
-
const frame2 = new Promise((resolve) => {
|
|
2025
|
-
waiter.resolve = resolve;
|
|
2026
|
-
frameWaiters.push(waiter);
|
|
2027
|
-
});
|
|
2028
|
-
try {
|
|
2029
|
-
tui.renderNow(false);
|
|
2030
|
-
} catch (error) {
|
|
2031
|
-
const index = frameWaiters.indexOf(waiter);
|
|
2032
|
-
if (index >= 0) frameWaiters.splice(index, 1);
|
|
2033
|
-
throw error;
|
|
2034
|
-
}
|
|
2035
|
-
return await frame2;
|
|
2036
|
-
});
|
|
2037
|
-
},
|
|
2038
|
-
hasObservedBackpressure: () => observedBackpressure || backpressure?.observed === true,
|
|
2039
|
-
setStreamPacingActive
|
|
2040
|
-
};
|
|
2041
|
-
}
|
|
2042
|
-
|
|
2043
|
-
// src/interactive/keybinding-manager.ts
|
|
2044
|
-
init_esm_shims();
|
|
2045
|
-
|
|
2046
|
-
// src/domains/config/keybindings.ts
|
|
2047
|
-
init_esm_shims();
|
|
2048
|
-
var CLIO_APP_KEYBINDINGS = {
|
|
2049
|
-
"clio-coder.library.toggle": {
|
|
2050
|
-
defaultKeys: "alt+l",
|
|
2051
|
-
description: "Library",
|
|
2052
|
-
scope: "composer",
|
|
2053
|
-
kind: "toggle",
|
|
2054
|
-
repeat: false,
|
|
2055
|
-
leader: "l"
|
|
2056
|
-
},
|
|
2057
|
-
"clio-coder.model.select": {
|
|
2058
|
-
defaultKeys: "alt+m",
|
|
2059
|
-
description: "Model picker",
|
|
2060
|
-
scope: "composer",
|
|
2061
|
-
kind: "toggle",
|
|
2062
|
-
repeat: false,
|
|
2063
|
-
leader: "m"
|
|
2064
|
-
},
|
|
2065
|
-
"clio-coder.output.cycle": {
|
|
2066
|
-
defaultKeys: "alt+o",
|
|
2067
|
-
description: "Output style",
|
|
2068
|
-
scope: "composer",
|
|
2069
|
-
kind: "cycle",
|
|
2070
|
-
repeat: false,
|
|
2071
|
-
leader: "o"
|
|
2072
|
-
},
|
|
2073
|
-
"clio-coder.status.toggle": {
|
|
2074
|
-
defaultKeys: "alt+u",
|
|
2075
|
-
description: "Dashboard",
|
|
2076
|
-
scope: "composer",
|
|
2077
|
-
kind: "toggle",
|
|
2078
|
-
repeat: false,
|
|
2079
|
-
leader: "u"
|
|
2080
|
-
},
|
|
2081
|
-
"clio-coder.dispatchBoard.toggle": {
|
|
2082
|
-
defaultKeys: "alt+w",
|
|
2083
|
-
description: "Workers",
|
|
2084
|
-
scope: "composer",
|
|
2085
|
-
kind: "toggle",
|
|
2086
|
-
repeat: false,
|
|
2087
|
-
leader: "w"
|
|
2088
|
-
},
|
|
2089
|
-
"clio-coder.files.toggle": {
|
|
2090
|
-
defaultKeys: "alt+e",
|
|
2091
|
-
description: "Files (from Clio focus)",
|
|
2092
|
-
scope: "composer",
|
|
2093
|
-
kind: "toggle",
|
|
2094
|
-
repeat: false,
|
|
2095
|
-
leader: "e"
|
|
2096
|
-
},
|
|
2097
|
-
"clio-coder.thinking.cycle": {
|
|
2098
|
-
defaultKeys: "shift+tab",
|
|
2099
|
-
description: "Thinking effort",
|
|
2100
|
-
scope: "composer",
|
|
2101
|
-
kind: "cycle",
|
|
2102
|
-
repeat: false,
|
|
2103
|
-
leader: "t"
|
|
2104
|
-
},
|
|
2105
|
-
"clio-coder.message.followUp": {
|
|
2106
|
-
defaultKeys: "ctrl+q",
|
|
2107
|
-
description: "Send after the active run",
|
|
2108
|
-
scope: "composer",
|
|
2109
|
-
kind: "send",
|
|
2110
|
-
repeat: false,
|
|
2111
|
-
leader: "f"
|
|
2112
|
-
},
|
|
2113
|
-
"clio-coder.message.dequeue": {
|
|
2114
|
-
defaultKeys: "alt+q",
|
|
2115
|
-
description: "Restore queued messages",
|
|
2116
|
-
scope: "composer",
|
|
2117
|
-
kind: "send",
|
|
2118
|
-
repeat: false,
|
|
2119
|
-
leader: "q"
|
|
2120
|
-
},
|
|
2121
|
-
"clio-coder.exit": {
|
|
2122
|
-
defaultKeys: "ctrl+d",
|
|
2123
|
-
description: "Exit empty idle composer with no queued messages",
|
|
2124
|
-
scope: "composer",
|
|
2125
|
-
kind: "exit",
|
|
2126
|
-
repeat: false
|
|
2127
|
-
},
|
|
2128
|
-
"clio-coder.leader": {
|
|
2129
|
-
defaultKeys: "ctrl+g",
|
|
2130
|
-
description: "Open contextual action menu",
|
|
2131
|
-
scope: "composer",
|
|
2132
|
-
kind: "toggle",
|
|
2133
|
-
repeat: false
|
|
2134
|
-
},
|
|
2135
|
-
"clio-coder.tasks.open": {
|
|
2136
|
-
defaultKeys: [],
|
|
2137
|
-
description: "Tasks (/tasks)",
|
|
2138
|
-
scope: "composer",
|
|
2139
|
-
kind: "toggle",
|
|
2140
|
-
repeat: false
|
|
2141
|
-
},
|
|
2142
|
-
"clio-coder.decisions.open": {
|
|
2143
|
-
defaultKeys: [],
|
|
2144
|
-
description: "Decisions (/decisions)",
|
|
2145
|
-
scope: "composer",
|
|
2146
|
-
kind: "toggle",
|
|
2147
|
-
repeat: false
|
|
2148
|
-
},
|
|
2149
|
-
"clio-coder.session.tree": {
|
|
2150
|
-
defaultKeys: [],
|
|
2151
|
-
description: "Session tree (/tree)",
|
|
2152
|
-
scope: "composer",
|
|
2153
|
-
kind: "toggle",
|
|
2154
|
-
repeat: false
|
|
2155
|
-
},
|
|
2156
|
-
"clio-coder.model.cycleForward": {
|
|
2157
|
-
defaultKeys: [],
|
|
2158
|
-
description: "Next scoped model",
|
|
2159
|
-
scope: "composer",
|
|
2160
|
-
kind: "cycle",
|
|
2161
|
-
repeat: false
|
|
2162
|
-
},
|
|
2163
|
-
"clio-coder.model.cycleBackward": {
|
|
2164
|
-
defaultKeys: [],
|
|
2165
|
-
description: "Previous scoped model",
|
|
2166
|
-
scope: "composer",
|
|
2167
|
-
kind: "cycle",
|
|
2168
|
-
repeat: false
|
|
2169
|
-
},
|
|
2170
|
-
"clio-coder.dispatch.background": {
|
|
2171
|
-
defaultKeys: [],
|
|
2172
|
-
description: "Background attached dispatch",
|
|
2173
|
-
scope: "composer",
|
|
2174
|
-
kind: "send",
|
|
2175
|
-
repeat: false,
|
|
2176
|
-
leader: "s"
|
|
2177
|
-
},
|
|
2178
|
-
"clio-coder.message.interrupt": {
|
|
2179
|
-
defaultKeys: [],
|
|
2180
|
-
description: "Interrupt with draft",
|
|
2181
|
-
scope: "composer",
|
|
2182
|
-
kind: "send",
|
|
2183
|
-
repeat: false,
|
|
2184
|
-
leader: "i"
|
|
2185
|
-
},
|
|
2186
|
-
"clio-coder.editor.external": {
|
|
2187
|
-
defaultKeys: [],
|
|
2188
|
-
description: "Edit expanded draft externally",
|
|
2189
|
-
scope: "composer",
|
|
2190
|
-
kind: "edit",
|
|
2191
|
-
repeat: false,
|
|
2192
|
-
leader: "g"
|
|
2193
|
-
},
|
|
2194
|
-
"clio-coder.notifications.dismiss": {
|
|
2195
|
-
defaultKeys: [],
|
|
2196
|
-
description: "Dismiss oldest notification",
|
|
2197
|
-
scope: "composer",
|
|
2198
|
-
kind: "dismiss",
|
|
2199
|
-
repeat: false,
|
|
2200
|
-
leader: "x"
|
|
2201
|
-
}
|
|
2202
|
-
};
|
|
2203
|
-
var CLIO_KEYBINDINGS = {
|
|
2204
|
-
...TUI_KEYBINDINGS,
|
|
2205
|
-
"tui.editor.historyPrevious": { ...TUI_KEYBINDINGS["tui.editor.historyPrevious"], defaultKeys: "ctrl+p" },
|
|
2206
|
-
"tui.editor.historyNext": { ...TUI_KEYBINDINGS["tui.editor.historyNext"], defaultKeys: "ctrl+n" },
|
|
2207
|
-
"tui.editor.deleteWordBackward": {
|
|
2208
|
-
...TUI_KEYBINDINGS["tui.editor.deleteWordBackward"],
|
|
2209
|
-
defaultKeys: ["ctrl+w", "alt+backspace", "ctrl+backspace"]
|
|
2210
|
-
},
|
|
2211
|
-
"tui.editor.undo": { ...TUI_KEYBINDINGS["tui.editor.undo"], defaultKeys: "ctrl+_" },
|
|
2212
|
-
"tui.input.newLine": { ...TUI_KEYBINDINGS["tui.input.newLine"], defaultKeys: ["ctrl+j", "shift+enter"] },
|
|
2213
|
-
"tui.altScreen.top": { ...TUI_KEYBINDINGS["tui.altScreen.top"], defaultKeys: [] },
|
|
2214
|
-
"tui.altScreen.bottom": { ...TUI_KEYBINDINGS["tui.altScreen.bottom"], defaultKeys: [] },
|
|
2215
|
-
"tui.altScreen.previousPrompt": { ...TUI_KEYBINDINGS["tui.altScreen.previousPrompt"], defaultKeys: "ctrl+up" },
|
|
2216
|
-
"tui.altScreen.nextPrompt": { ...TUI_KEYBINDINGS["tui.altScreen.nextPrompt"], defaultKeys: "ctrl+down" },
|
|
2217
|
-
"tui.altScreen.search": { ...TUI_KEYBINDINGS["tui.altScreen.search"], defaultKeys: "ctrl+r" },
|
|
2218
|
-
"tui.altScreen.searchNext": { ...TUI_KEYBINDINGS["tui.altScreen.searchNext"], defaultKeys: "enter" },
|
|
2219
|
-
"tui.altScreen.searchPrevious": { ...TUI_KEYBINDINGS["tui.altScreen.searchPrevious"], defaultKeys: "up" },
|
|
2220
|
-
...CLIO_APP_KEYBINDINGS
|
|
2221
|
-
};
|
|
2222
|
-
var CLIO_APP_KEYBINDING_IDS = Object.keys(CLIO_APP_KEYBINDINGS);
|
|
2223
|
-
|
|
2224
|
-
// src/interactive/keybinding-manager.ts
|
|
2225
|
-
var BASE_SPECIAL_KEYS = /* @__PURE__ */ new Set([
|
|
2226
|
-
"escape",
|
|
2227
|
-
"esc",
|
|
2228
|
-
"enter",
|
|
2229
|
-
"return",
|
|
2230
|
-
"tab",
|
|
2231
|
-
"space",
|
|
2232
|
-
"backspace",
|
|
2233
|
-
"delete",
|
|
2234
|
-
"insert",
|
|
2235
|
-
"clear",
|
|
2236
|
-
"home",
|
|
2237
|
-
"end",
|
|
2238
|
-
"pageup",
|
|
2239
|
-
"pagedown",
|
|
2240
|
-
"up",
|
|
2241
|
-
"down",
|
|
2242
|
-
"left",
|
|
2243
|
-
"right",
|
|
2244
|
-
"f1",
|
|
2245
|
-
"f2",
|
|
2246
|
-
"f3",
|
|
2247
|
-
"f4",
|
|
2248
|
-
"f5",
|
|
2249
|
-
"f6",
|
|
2250
|
-
"f7",
|
|
2251
|
-
"f8",
|
|
2252
|
-
"f9",
|
|
2253
|
-
"f10",
|
|
2254
|
-
"f11",
|
|
2255
|
-
"f12"
|
|
2256
|
-
]);
|
|
2257
|
-
var BASE_SYMBOL_KEYS = /* @__PURE__ */ new Set([
|
|
2258
|
-
"`",
|
|
2259
|
-
"-",
|
|
2260
|
-
"=",
|
|
2261
|
-
"[",
|
|
2262
|
-
"]",
|
|
2263
|
-
"\\",
|
|
2264
|
-
";",
|
|
2265
|
-
"'",
|
|
2266
|
-
",",
|
|
2267
|
-
".",
|
|
2268
|
-
"/",
|
|
2269
|
-
"!",
|
|
2270
|
-
"@",
|
|
2271
|
-
"#",
|
|
2272
|
-
"$",
|
|
2273
|
-
"%",
|
|
2274
|
-
"^",
|
|
2275
|
-
"&",
|
|
2276
|
-
"*",
|
|
2277
|
-
"(",
|
|
2278
|
-
")",
|
|
2279
|
-
"_",
|
|
2280
|
-
"+",
|
|
2281
|
-
"|",
|
|
2282
|
-
"~",
|
|
2283
|
-
"{",
|
|
2284
|
-
"}",
|
|
2285
|
-
":",
|
|
2286
|
-
"<",
|
|
2287
|
-
">",
|
|
2288
|
-
"?"
|
|
2289
|
-
]);
|
|
2290
|
-
var MODIFIERS = /* @__PURE__ */ new Set(["ctrl", "shift", "alt", "super"]);
|
|
2291
|
-
function canonicalKey(key) {
|
|
2292
|
-
const parts = key.toLowerCase().split("+");
|
|
2293
|
-
let base = parts.pop() ?? "";
|
|
2294
|
-
if (base === "esc") base = "escape";
|
|
2295
|
-
if (base === "return") base = "enter";
|
|
2296
|
-
const modifiers = ["ctrl", "alt", "shift", "super"].filter((mod) => parts.includes(mod));
|
|
2297
|
-
return [...modifiers, base].join("+");
|
|
2298
|
-
}
|
|
2299
|
-
function isValidKeyId(keyId) {
|
|
2300
|
-
if (typeof keyId !== "string" || keyId.length === 0) return false;
|
|
2301
|
-
const parts = keyId.toLowerCase().split("+");
|
|
2302
|
-
if (parts.length === 0) return false;
|
|
2303
|
-
const base = parts[parts.length - 1];
|
|
2304
|
-
if (!base) return false;
|
|
2305
|
-
const mods = parts.slice(0, -1);
|
|
2306
|
-
const seen = /* @__PURE__ */ new Set();
|
|
2307
|
-
for (const mod of mods) {
|
|
2308
|
-
if (!MODIFIERS.has(mod)) return false;
|
|
2309
|
-
if (seen.has(mod)) return false;
|
|
2310
|
-
seen.add(mod);
|
|
2311
|
-
}
|
|
2312
|
-
if (base.length === 1) {
|
|
2313
|
-
const ch = base.charCodeAt(0);
|
|
2314
|
-
const isLetter = ch >= 97 && ch <= 122;
|
|
2315
|
-
const isDigit = ch >= 48 && ch <= 57;
|
|
2316
|
-
return isLetter || isDigit || BASE_SYMBOL_KEYS.has(base);
|
|
2317
|
-
}
|
|
2318
|
-
return BASE_SPECIAL_KEYS.has(base);
|
|
2319
|
-
}
|
|
2320
|
-
function validateKeybindings(raw) {
|
|
2321
|
-
const valid = {};
|
|
2322
|
-
const invalid = [];
|
|
2323
|
-
for (const [id, value] of Object.entries(raw)) {
|
|
2324
|
-
if (!Object.hasOwn(CLIO_KEYBINDINGS, id)) {
|
|
2325
|
-
invalid.push({ id, keys: ["unknown action ID; use /help"] });
|
|
2326
|
-
continue;
|
|
2327
|
-
}
|
|
2328
|
-
if (typeof value === "string") {
|
|
2329
|
-
if (isValidKeyId(value)) {
|
|
2330
|
-
valid[id] = canonicalKey(value);
|
|
2331
|
-
} else {
|
|
2332
|
-
invalid.push({ id, keys: [value] });
|
|
2333
|
-
}
|
|
2334
|
-
continue;
|
|
2335
|
-
}
|
|
2336
|
-
if (Array.isArray(value)) {
|
|
2337
|
-
const accepted = [];
|
|
2338
|
-
const rejected = [];
|
|
2339
|
-
for (const entry of value) {
|
|
2340
|
-
if (typeof entry !== "string") {
|
|
2341
|
-
rejected.push(String(entry));
|
|
2342
|
-
continue;
|
|
2343
|
-
}
|
|
2344
|
-
if (isValidKeyId(entry)) {
|
|
2345
|
-
accepted.push(canonicalKey(entry));
|
|
2346
|
-
} else {
|
|
2347
|
-
rejected.push(entry);
|
|
2348
|
-
}
|
|
2349
|
-
}
|
|
2350
|
-
if (accepted.length > 0 || value.length === 0) valid[id] = accepted;
|
|
2351
|
-
if (rejected.length > 0) invalid.push({ id, keys: rejected });
|
|
2352
|
-
}
|
|
2353
|
-
}
|
|
2354
|
-
return { valid, invalid };
|
|
2355
|
-
}
|
|
2356
|
-
function formatInvalidKeybindingNotice(invalid) {
|
|
2357
|
-
const count = invalid.reduce((sum, entry) => sum + entry.keys.length, 0);
|
|
2358
|
-
const detail = invalid.flatMap((entry) => entry.keys.map((key) => `${entry.id}="${key}"`)).join(", ");
|
|
2359
|
-
return `Clio Coder: ${count} invalid keybinding${count === 1 ? "" : "s"} in settings.yaml (defaults kept): ${detail}. Fix settings.yaml or run \`clio-coder doctor\`.
|
|
2360
|
-
`;
|
|
2361
|
-
}
|
|
2362
|
-
function envValue(env, key) {
|
|
2363
|
-
return env[key]?.trim() ?? "";
|
|
2364
|
-
}
|
|
2365
|
-
function detectTerminalKeySupport(env = process.env) {
|
|
2366
|
-
const term = envValue(env, "TERM");
|
|
2367
|
-
const termProgram = envValue(env, "TERM_PROGRAM");
|
|
2368
|
-
const kittyWindow = envValue(env, "KITTY_WINDOW_ID");
|
|
2369
|
-
const normalized = `${term} ${termProgram}`.toLowerCase();
|
|
2370
|
-
if (kittyWindow.length > 0 || normalized.includes("xterm-kitty") || normalized.includes("kitty")) {
|
|
2371
|
-
return { name: "kitty", supportsCsiU: true, reason: "Kitty keyboard protocol detected", altLetterMode: "meta" };
|
|
2372
|
-
}
|
|
2373
|
-
if (normalized.includes("wezterm") || normalized.includes("ghostty")) {
|
|
2374
|
-
return {
|
|
2375
|
-
name: termProgram || term || "modern terminal",
|
|
2376
|
-
supportsCsiU: true,
|
|
2377
|
-
reason: "CSI-u capable terminal",
|
|
2378
|
-
altLetterMode: "meta"
|
|
2379
|
-
};
|
|
2380
|
-
}
|
|
2381
|
-
if (termProgram === "Apple_Terminal") {
|
|
2382
|
-
return {
|
|
2383
|
-
name: termProgram,
|
|
2384
|
-
supportsCsiU: false,
|
|
2385
|
-
reason: "Terminal.app sends Option-letter as composed text unless Use Option as Meta key is enabled",
|
|
2386
|
-
altLetterMode: "text"
|
|
2387
|
-
};
|
|
2388
|
-
}
|
|
2389
|
-
if (termProgram === "iTerm.app") {
|
|
2390
|
-
return {
|
|
2391
|
-
name: termProgram,
|
|
2392
|
-
supportsCsiU: true,
|
|
2393
|
-
reason: "iTerm2 reports modified keys as Meta or CSI-u",
|
|
2394
|
-
altLetterMode: "meta"
|
|
2395
|
-
};
|
|
2396
|
-
}
|
|
2397
|
-
if (termProgram.toLowerCase() === "vscode") {
|
|
2398
|
-
return {
|
|
2399
|
-
name: "vscode",
|
|
2400
|
-
supportsCsiU: false,
|
|
2401
|
-
reason: "VS Code terminal does not reliably emit CSI-u",
|
|
2402
|
-
altLetterMode: "meta",
|
|
2403
|
-
ideReservedKeys: ["ctrl+p", "shift+ctrl+p", "ctrl+l"]
|
|
2404
|
-
};
|
|
2405
|
-
}
|
|
2406
|
-
if (term.startsWith("screen") || term.startsWith("tmux")) {
|
|
2407
|
-
return { name: term, supportsCsiU: false, reason: "terminal multiplexer may block CSI-u", altLetterMode: "meta" };
|
|
2408
|
-
}
|
|
2409
|
-
return {
|
|
2410
|
-
name: termProgram || term || "legacy terminal",
|
|
2411
|
-
supportsCsiU: false,
|
|
2412
|
-
reason: "CSI-u support not detected",
|
|
2413
|
-
altLetterMode: "meta"
|
|
2414
|
-
};
|
|
2415
|
-
}
|
|
2416
|
-
function keyRequiresCsiU(keyId) {
|
|
2417
|
-
const parts = keyId.toLowerCase().split("+");
|
|
2418
|
-
if (parts.length < 3) return false;
|
|
2419
|
-
const base = parts[parts.length - 1] ?? "";
|
|
2420
|
-
const modifiers = new Set(parts.slice(0, -1));
|
|
2421
|
-
if (!modifiers.has("shift") || !modifiers.has("ctrl")) return false;
|
|
2422
|
-
if (base.length !== 1) return false;
|
|
2423
|
-
const code = base.charCodeAt(0);
|
|
2424
|
-
const isLetter = code >= 97 && code <= 122;
|
|
2425
|
-
const isDigit = code >= 48 && code <= 57;
|
|
2426
|
-
return isLetter || isDigit || BASE_SYMBOL_KEYS.has(base);
|
|
2427
|
-
}
|
|
2428
|
-
function normalizeBindingValue(value) {
|
|
2429
|
-
if (value === void 0) return [];
|
|
2430
|
-
return (Array.isArray(value) ? value : [value]).map(String);
|
|
2431
|
-
}
|
|
2432
|
-
function defaultBindingValue(id) {
|
|
2433
|
-
const value = CLIO_APP_KEYBINDINGS[id].defaultKeys;
|
|
2434
|
-
return normalizeBindingValue(value);
|
|
2435
|
-
}
|
|
2436
|
-
function normalizeKeyForRisk(keyId) {
|
|
2437
|
-
return keyId.toLowerCase().replace(/^ctrl\+shift\+/, "shift+ctrl+");
|
|
2438
|
-
}
|
|
2439
|
-
function altLetterBase(keyId) {
|
|
2440
|
-
const parts = keyId.toLowerCase().split("+");
|
|
2441
|
-
if (parts.length !== 2 || parts[0] !== "alt") return null;
|
|
2442
|
-
const base = parts[1] ?? "";
|
|
2443
|
-
return base.length === 1 && base >= "a" && base <= "z" ? base : null;
|
|
2444
|
-
}
|
|
2445
|
-
function keyUsesAltLetter(keyId) {
|
|
2446
|
-
return altLetterBase(keyId) !== null;
|
|
2447
|
-
}
|
|
2448
|
-
function terminalReservedReason(keyId) {
|
|
2449
|
-
const key = normalizeKeyForRisk(keyId);
|
|
2450
|
-
if (key === "ctrl+s")
|
|
2451
|
-
return "an intermediary may intercept this chord; Node raw mode normally disables terminal flow control";
|
|
2452
|
-
if (key === "ctrl+z")
|
|
2453
|
-
return "an intermediary may intercept this chord; Node raw mode normally disables signal generation";
|
|
2454
|
-
return null;
|
|
2455
|
-
}
|
|
2456
|
-
function keyRiskReason(keyId, support) {
|
|
2457
|
-
const key = normalizeKeyForRisk(keyId);
|
|
2458
|
-
if (!support.supportsCsiU && keyRequiresCsiU(key)) return `needs CSI-u; ${support.reason}`;
|
|
2459
|
-
if (support.altLetterMode === "text" && keyUsesAltLetter(key)) return support.reason;
|
|
2460
|
-
if (support.ideReservedKeys?.map(normalizeKeyForRisk).includes(key)) return `${support.name} may reserve this chord`;
|
|
2461
|
-
return terminalReservedReason(key);
|
|
2462
|
-
}
|
|
2463
|
-
var MACOS_OPTION_DEFAULT_WARNING_ID = "clio-coder.macos.option-letter.defaults";
|
|
2464
|
-
function detectPlatformKeybindingWarnings(userBindings, support = detectTerminalKeySupport()) {
|
|
2465
|
-
const warnings = [];
|
|
2466
|
-
const macosDefaultAltKeys = [];
|
|
2467
|
-
for (const id of CLIO_APP_KEYBINDING_IDS) {
|
|
2468
|
-
const userValue = userBindings[id];
|
|
2469
|
-
const source = userValue === void 0 ? "default" : "user";
|
|
2470
|
-
const keys = userValue === void 0 ? defaultBindingValue(id) : normalizeBindingValue(userValue);
|
|
2471
|
-
const risky = keys.filter((key) => keyRiskReason(key, support) !== null);
|
|
2472
|
-
if (risky.length === 0) continue;
|
|
2473
|
-
const firstReason = keyRiskReason(risky[0] ?? "", support) ?? support.reason;
|
|
2474
|
-
if (source === "default" && support.name === "Apple_Terminal" && risky.every(keyUsesAltLetter)) {
|
|
2475
|
-
macosDefaultAltKeys.push(...risky);
|
|
2476
|
-
continue;
|
|
2477
|
-
}
|
|
2478
|
-
warnings.push({ id, keys: risky, terminal: support.name, reason: firstReason, source });
|
|
2479
|
-
}
|
|
2480
|
-
if (macosDefaultAltKeys.length > 0) {
|
|
2481
|
-
warnings.unshift({
|
|
2482
|
-
id: MACOS_OPTION_DEFAULT_WARNING_ID,
|
|
2483
|
-
keys: [...new Set(macosDefaultAltKeys)],
|
|
2484
|
-
terminal: support.name,
|
|
2485
|
-
reason: support.reason,
|
|
2486
|
-
source: "default"
|
|
2487
|
-
});
|
|
2488
|
-
}
|
|
2489
|
-
return warnings;
|
|
2490
|
-
}
|
|
2491
|
-
function isMacosOptionDefaultWarning(warning) {
|
|
2492
|
-
return warning.id === MACOS_OPTION_DEFAULT_WARNING_ID;
|
|
2493
|
-
}
|
|
2494
|
-
function formatPlatformKeybindingNotice(warnings) {
|
|
2495
|
-
const macosOption = warnings.find(isMacosOptionDefaultWarning);
|
|
2496
|
-
if (macosOption && warnings.length === 1) {
|
|
2497
|
-
const keys = macosOption.keys.map((key) => {
|
|
2498
|
-
const base = altLetterBase(key);
|
|
2499
|
-
return base ? `Alt+${base.toUpperCase()}` : key;
|
|
2500
|
-
}).join(", ");
|
|
2501
|
-
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.
|
|
2502
|
-
`;
|
|
2503
|
-
}
|
|
2504
|
-
const count = warnings.reduce((sum, entry) => sum + entry.keys.length, 0);
|
|
2505
|
-
const detail = warnings.flatMap((entry) => entry.keys.map((key) => `${entry.id}="${key}" (${entry.source}, ${entry.reason})`)).join(", ");
|
|
2506
|
-
return `Clio keybinding notice: ${count} keybinding${count === 1 ? "" : "s"} may not fire reliably in this terminal: ${detail}. Rebind in settings.yaml or inspect /help.
|
|
2507
|
-
`;
|
|
2508
|
-
}
|
|
2509
|
-
function joinKeys(keys) {
|
|
2510
|
-
if (keys.length === 0) return "(unbound)";
|
|
2511
|
-
if (keys.length === 1) return String(keys[0]);
|
|
2512
|
-
return keys.join(" / ");
|
|
2513
|
-
}
|
|
2514
|
-
var VIEWPORT_LEADER_TARGETS = [
|
|
2515
|
-
{ key: "z", id: "tui.editor.undo" },
|
|
2516
|
-
{ key: "r", id: "tui.altScreen.search" },
|
|
2517
|
-
{ key: "p", id: "tui.altScreen.pageUp" },
|
|
2518
|
-
{ key: "n", id: "tui.altScreen.pageDown" },
|
|
2519
|
-
{ key: "home", id: "tui.altScreen.top" },
|
|
2520
|
-
{ key: "end", id: "tui.altScreen.bottom" },
|
|
2521
|
-
{ key: "", id: "tui.altScreen.previousPrompt" },
|
|
2522
|
-
{ key: "", id: "tui.altScreen.nextPrompt" }
|
|
2523
|
-
];
|
|
2524
|
-
function keybindingScope(id) {
|
|
2525
|
-
if (id.startsWith("clio-coder.")) return "composer";
|
|
2526
|
-
if (id.startsWith("tui.select.")) return "selection";
|
|
2527
|
-
if (/tui.altScreen.search(Next|Previous|Close)/u.test(id)) return "search";
|
|
2528
|
-
if (id.startsWith("tui.altScreen.")) return "fullscreen composer";
|
|
2529
|
-
return "editable field";
|
|
2530
|
-
}
|
|
2531
|
-
function legacyKey(key) {
|
|
2532
|
-
const canonical = canonicalKey(key);
|
|
2533
|
-
return { "ctrl+i": "tab", "ctrl+m": "enter", "ctrl+[": "escape", "ctrl+_": "ctrl+-" }[canonical] ?? canonical;
|
|
2534
|
-
}
|
|
2535
|
-
function scopesOverlap(a, b) {
|
|
2536
|
-
const left = keybindingScope(a), right = keybindingScope(b);
|
|
2537
|
-
if (left === "selection" || right === "selection") return left === right;
|
|
2538
|
-
if (left === "search" || right === "search") return left === right;
|
|
2539
|
-
if (a === "clio-coder.exit" && b === "tui.editor.deleteCharForward" || b === "clio-coder.exit" && a === "tui.editor.deleteCharForward")
|
|
2540
|
-
return false;
|
|
2541
|
-
return true;
|
|
2542
|
-
}
|
|
2543
|
-
function effectiveConflicts(inner) {
|
|
2544
|
-
const keys = /* @__PURE__ */ new Map();
|
|
2545
|
-
for (const id of Object.keys(CLIO_KEYBINDINGS)) {
|
|
2546
|
-
for (const key of inner.getKeys(id)) {
|
|
2547
|
-
const canonical = legacyKey(key);
|
|
2548
|
-
const ids = keys.get(canonical) ?? [];
|
|
2549
|
-
if (!ids.includes(id)) ids.push(id);
|
|
2550
|
-
keys.set(canonical, ids);
|
|
2551
|
-
}
|
|
2552
|
-
}
|
|
2553
|
-
return [...keys].filter(
|
|
2554
|
-
([, ids]) => ids.length > 1 && ids.some((id, index) => ids.slice(index + 1).some((other) => scopesOverlap(id, other)))
|
|
2555
|
-
).map(([key, keybindings]) => ({
|
|
2556
|
-
key,
|
|
2557
|
-
keybindings: keybindings.filter((id) => keybindings.some((other) => other !== id && scopesOverlap(id, other)))
|
|
2558
|
-
}));
|
|
2559
|
-
}
|
|
2560
|
-
function buildManager(overrides, env, install) {
|
|
2561
|
-
let validated = validateKeybindings(overrides);
|
|
2562
|
-
const inner = new KeybindingsManager(CLIO_KEYBINDINGS, validated.valid);
|
|
2563
|
-
if (install) setKeybindings(inner);
|
|
2564
|
-
let generation = 0;
|
|
2565
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
2566
|
-
const isDisabled = (id) => {
|
|
2567
|
-
const value = inner.getUserBindings()[id];
|
|
2568
|
-
return Array.isArray(value) && value.length === 0;
|
|
2569
|
-
};
|
|
2570
|
-
const leaderTargets = () => {
|
|
2571
|
-
if (inner.getKeys("clio-coder.leader").length === 0) return [];
|
|
2572
|
-
const app = CLIO_APP_KEYBINDING_IDS.flatMap((id) => {
|
|
2573
|
-
const descriptor = CLIO_APP_KEYBINDINGS[id];
|
|
2574
|
-
return "leader" in descriptor ? [{ key: descriptor.leader, id }] : [];
|
|
2575
|
-
});
|
|
2576
|
-
return [...app, ...VIEWPORT_LEADER_TARGETS].filter(({ id }) => !isDisabled(id));
|
|
2577
|
-
};
|
|
2578
|
-
const actionLabel = (id) => {
|
|
2579
|
-
const keys = inner.getKeys(id);
|
|
2580
|
-
const suffix = leaderTargets().find((entry) => entry.id === id)?.key;
|
|
2581
|
-
return [keys.join(" / "), suffix ? `${inner.getKeys("clio-coder.leader")[0]} ${suffix}` : ""].filter(Boolean).join(" \xB7 ") || "unbound; see /help";
|
|
2582
|
-
};
|
|
2583
|
-
return {
|
|
2584
|
-
matches: (data, id) => inner.matches(data, id),
|
|
2585
|
-
getKeys: (id) => inner.getKeys(id),
|
|
2586
|
-
getDescription: (id) => inner.getDefinition(id).description ?? "",
|
|
2587
|
-
getConflicts: () => effectiveConflicts(inner),
|
|
2588
|
-
get generation() {
|
|
2589
|
-
return generation;
|
|
2590
|
-
},
|
|
2591
|
-
reload(next) {
|
|
2592
|
-
validated = validateKeybindings(next);
|
|
2593
|
-
inner.setUserBindings(validated.valid);
|
|
2594
|
-
if (install) setKeybindings(inner);
|
|
2595
|
-
generation += 1;
|
|
2596
|
-
for (const listener of listeners) listener();
|
|
2597
|
-
},
|
|
2598
|
-
onReload(listener) {
|
|
2599
|
-
listeners.add(listener);
|
|
2600
|
-
return () => {
|
|
2601
|
-
listeners.delete(listener);
|
|
2602
|
-
};
|
|
2603
|
-
},
|
|
2604
|
-
isDisabled,
|
|
2605
|
-
actionLabel,
|
|
2606
|
-
overrideCount: () => Object.keys(validated.valid).length,
|
|
2607
|
-
invalidCount: () => validated.invalid.reduce((sum, entry) => sum + entry.keys.length, 0),
|
|
2608
|
-
invalidBindings: () => validated.invalid,
|
|
2609
|
-
platformWarnings: () => detectPlatformKeybindingWarnings(validated.valid, detectTerminalKeySupport(env)),
|
|
2610
|
-
leaderTargets,
|
|
2611
|
-
hotkeyEntries: () => Object.keys(CLIO_KEYBINDINGS).map((id) => ({
|
|
2612
|
-
id,
|
|
2613
|
-
keys: joinKeys(inner.getKeys(id)),
|
|
2614
|
-
description: `${inner.getDefinition(id).description ?? ""} (${keybindingScope(id)}${isDisabled(id) ? "; disabled by user" : ""})${id === "tui.input.copy" ? "; composer Ctrl+C cancels; use native terminal clipboard" : ""}`,
|
|
2615
|
-
source: validated.valid[id] === void 0 ? "default" : "user"
|
|
2616
|
-
}))
|
|
2617
|
-
};
|
|
2618
|
-
}
|
|
2619
|
-
function createKeybindingManager(settings, env = process.env) {
|
|
2620
|
-
return buildManager(settings.interface.keybindings ?? {}, env, true);
|
|
2621
|
-
}
|
|
2622
|
-
|
|
2623
|
-
export {
|
|
2624
|
-
SelectList2 as SelectList,
|
|
2625
|
-
createAgentProgress,
|
|
2626
|
-
SGR_RESET,
|
|
2627
|
-
SGR_DIM,
|
|
2628
|
-
fgSequence,
|
|
2629
|
-
isClioToken,
|
|
2630
|
-
paintHex,
|
|
2631
|
-
GLYPH,
|
|
2632
|
-
spinnerFrame,
|
|
2633
|
-
brandMark,
|
|
2634
|
-
dotSep,
|
|
2635
|
-
barSep,
|
|
2636
|
-
sectionTag,
|
|
2637
|
-
screenTitle,
|
|
2638
|
-
listGroupHeader,
|
|
2639
|
-
joinChips,
|
|
2640
|
-
joinSections,
|
|
2641
|
-
markdownTheme,
|
|
2642
|
-
selectListTheme,
|
|
2643
|
-
editorTheme,
|
|
2644
|
-
fitIdentityLabel,
|
|
2645
|
-
abbreviateModelId,
|
|
2646
|
-
formatTargetLabel,
|
|
2647
|
-
formatCompactMs,
|
|
2648
|
-
formatContextPercent,
|
|
2649
|
-
collapseHomePath,
|
|
2650
|
-
padAnsi,
|
|
2651
|
-
fitUnits,
|
|
2652
|
-
rule,
|
|
2653
|
-
frame,
|
|
2654
|
-
innerDivider,
|
|
2655
|
-
clioTheme,
|
|
2656
|
-
MUTATION_PREVIEW_KEY,
|
|
2657
|
-
PERMISSION_TERMS_KEY,
|
|
2658
|
-
permissionHintEntries,
|
|
2659
|
-
keyboardOwner,
|
|
2660
|
-
focusedComponent,
|
|
2661
|
-
localKey,
|
|
2662
|
-
DEFAULT_SELECT_THEME,
|
|
2663
|
-
FocusBox,
|
|
2664
|
-
clioError,
|
|
2665
|
-
fitHintEntries,
|
|
2666
|
-
FILTER_HINT,
|
|
2667
|
-
buildHint,
|
|
2668
|
-
buildResponsiveHint,
|
|
2669
|
-
formatRuntimeResolutionDiagnostic,
|
|
2670
|
-
diagnosticSeverityToken,
|
|
2671
|
-
showClioOverlayFrame,
|
|
2672
|
-
unguardPastedEditorOperator,
|
|
2673
|
-
parseEditorBashCommand,
|
|
2674
|
-
bashExecutionEntryInput,
|
|
2675
|
-
CLIO_APP_KEYBINDING_IDS,
|
|
2676
|
-
ClioEditor,
|
|
2677
|
-
writeInputWedgeDump,
|
|
2678
|
-
getActiveRenderTrace,
|
|
2679
|
-
createProcessInteractiveShell,
|
|
2680
|
-
validateKeybindings,
|
|
2681
|
-
formatInvalidKeybindingNotice,
|
|
2682
|
-
detectTerminalKeySupport,
|
|
2683
|
-
detectPlatformKeybindingWarnings,
|
|
2684
|
-
formatPlatformKeybindingNotice,
|
|
2685
|
-
createKeybindingManager
|
|
2686
|
-
};
|
|
2687
|
-
//# sourceMappingURL=chunk-M6YLF66Z.js.map
|