@iowarp/clio-coder 0.4.6 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +283 -0
- package/CHANGELOG.md +79 -0
- package/CONTRIBUTING.md +178 -96
- package/NOTICE +8 -0
- package/README.md +100 -47
- package/dist/acp-JWPQZM2D.js +130 -0
- package/dist/agents-4GCDIRVX.js +149 -0
- package/dist/assets/codewiki.json +1 -1
- package/dist/assets/tui-notices/get-east-asian-width-LICENSE +9 -0
- package/dist/assets/tui-notices/marked-LICENSE +44 -0
- package/dist/assets/tui-notices/pi-tui-LICENSE +21 -0
- package/dist/assets/web-notices/@hono__node-server-LICENSE +21 -0
- package/dist/assets/web-notices/hono-LICENSE +21 -0
- package/dist/auth-SYAKTDQE.js +551 -0
- package/dist/background-OW67WMYR.js +37 -0
- package/dist/builtins-TKS63VNV.js +22 -0
- package/dist/chunk-2JSCCEKO.js +85 -0
- package/dist/chunk-2SXGG2IV.js +391 -0
- package/dist/chunk-2U2U5POA.js +59 -0
- package/dist/chunk-2ZWLMA3T.js +658 -0
- package/dist/chunk-36XSBPXL.js +579 -0
- package/dist/chunk-3IQOZRQ6.js +396 -0
- package/dist/chunk-3XE4NRLF.js +324 -0
- package/dist/chunk-44U2OUSM.js +243 -0
- package/dist/chunk-4P6M2TTE.js +119 -0
- package/dist/chunk-526ABLHD.js +1219 -0
- package/dist/chunk-5C2OQHLR.js +674 -0
- package/dist/chunk-5D2FNBMG.js +185 -0
- package/dist/chunk-5EQO5NWP.js +243 -0
- package/dist/chunk-5HULHKT2.js +32 -0
- package/dist/chunk-5UG6EZI3.js +66 -0
- package/dist/chunk-5W4FRA5Q.js +22283 -0
- package/dist/chunk-6R5MBXBJ.js +386 -0
- package/dist/chunk-6TKOFFGE.js +1058 -0
- package/dist/chunk-6UJ7RDI7.js +1143 -0
- package/dist/chunk-6X7VOCDY.js +44 -0
- package/dist/chunk-7QQRPB2E.js +915 -0
- package/dist/chunk-ARRUMZ7X.js +1377 -0
- package/dist/chunk-ATB3Q7YO.js +663 -0
- package/dist/chunk-AUHVBIDW.js +19 -0
- package/dist/chunk-BE4I3UJ2.js +668 -0
- package/dist/chunk-BFPHMSK7.js +169 -0
- package/dist/chunk-BHJMMCXS.js +466 -0
- package/dist/chunk-BIY22UUK.js +1322 -0
- package/dist/chunk-D55WO5J7.js +110 -0
- package/dist/chunk-DVJL77SO.js +162 -0
- package/dist/chunk-E2NSPYLC.js +814 -0
- package/dist/chunk-EFXMQYI6.js +4484 -0
- package/dist/chunk-EPYATQMG.js +2718 -0
- package/dist/chunk-EXKUF426.js +1801 -0
- package/dist/chunk-F7Y6QTPL.js +689 -0
- package/dist/chunk-FB3KTE2J.js +1710 -0
- package/dist/chunk-FNVPQQYT.js +117 -0
- package/dist/chunk-GEVQNST4.js +101 -0
- package/dist/chunk-GEYX2NZ5.js +697 -0
- package/dist/chunk-GJBJHJNY.js +2120 -0
- package/dist/chunk-GM4TY6VN.js +1233 -0
- package/dist/chunk-GVU4CXPJ.js +5191 -0
- package/dist/chunk-H5DPSUBB.js +637 -0
- package/dist/chunk-H77XBUBM.js +688 -0
- package/dist/chunk-HMGAKB7E.js +380 -0
- package/dist/chunk-HP7KJ5O2.js +797 -0
- package/dist/chunk-HVCAY2FH.js +67 -0
- package/dist/chunk-ICYIUNO4.js +35 -0
- package/dist/chunk-IILXVWJY.js +223 -0
- package/dist/chunk-JCVIL6TY.js +595 -0
- package/dist/chunk-JIMWEYWO.js +63 -0
- package/dist/chunk-JLBVCROW.js +562 -0
- package/dist/chunk-JOBN2YQQ.js +176 -0
- package/dist/chunk-JOL2QRLE.js +152 -0
- package/dist/chunk-JRA6OBHY.js +974 -0
- package/dist/chunk-JV25I7ID.js +1865 -0
- package/dist/chunk-JYKUMHCQ.js +705 -0
- package/dist/chunk-K3W6BF5C.js +283 -0
- package/dist/chunk-K45LHSCI.js +194 -0
- package/dist/chunk-K53E2PTW.js +1289 -0
- package/dist/chunk-K5UJD6MM.js +39 -0
- package/dist/chunk-KGP3UQGJ.js +200 -0
- package/dist/chunk-KKRXONXG.js +43 -0
- package/dist/chunk-KWJXCL2X.js +103 -0
- package/dist/chunk-L75H5B3B.js +446 -0
- package/dist/chunk-LLCGGVSW.js +108 -0
- package/dist/chunk-LZCCBLRC.js +57 -0
- package/dist/chunk-LZDLYSUN.js +197 -0
- package/dist/chunk-MATCRH3M.js +667 -0
- package/dist/chunk-MEHBW2SP.js +132 -0
- package/dist/chunk-MUXNDNMZ.js +659 -0
- package/dist/chunk-MWMW53WW.js +7346 -0
- package/dist/chunk-MZDPF35R.js +45 -0
- package/dist/chunk-MZKYVIWW.js +188 -0
- package/dist/chunk-O2QJDRWP.js +362 -0
- package/dist/chunk-O3HSB2YL.js +693 -0
- package/dist/chunk-OEMFEL26.js +891 -0
- package/dist/chunk-OH3YYA3B.js +15 -0
- package/dist/chunk-OPC4DQD6.js +634 -0
- package/dist/chunk-ORRNGQDV.js +207 -0
- package/dist/chunk-P4JS3MH5.js +165 -0
- package/dist/chunk-P7GTE4FX.js +308 -0
- package/dist/chunk-PAQVETLA.js +962 -0
- package/dist/chunk-PFZJMXIY.js +146 -0
- package/dist/chunk-PGEFOTJB.js +1974 -0
- package/dist/chunk-PJ5H5B7A.js +3151 -0
- package/dist/chunk-PMUUAABD.js +604 -0
- package/dist/chunk-Q32C6AWI.js +236 -0
- package/dist/chunk-QGIC5SX5.js +139 -0
- package/dist/chunk-QLAGXTTV.js +482 -0
- package/dist/chunk-QLKCCC2J.js +573 -0
- package/dist/chunk-QWUSS2QP.js +3630 -0
- package/dist/chunk-QYSAZMSH.js +47 -0
- package/dist/chunk-R5NRX5N4.js +123 -0
- package/dist/chunk-RAUOKUZV.js +1572 -0
- package/dist/chunk-RBES4TCZ.js +302 -0
- package/dist/chunk-RFCKPS2V.js +26 -0
- package/dist/chunk-RFULVPBX.js +318 -0
- package/dist/chunk-RKFNU5UA.js +404 -0
- package/dist/chunk-RM3XJX7P.js +1148 -0
- package/dist/chunk-RNLAPBJL.js +386 -0
- package/dist/chunk-RPMNIFRY.js +65 -0
- package/dist/chunk-RRZFRIJP.js +42 -0
- package/dist/chunk-RXI7K4J5.js +4493 -0
- package/dist/chunk-SER7RRAE.js +4271 -0
- package/dist/chunk-STC6CWUZ.js +402 -0
- package/dist/chunk-TEHVMHOK.js +97 -0
- package/dist/chunk-TOPICHGR.js +33 -0
- package/dist/chunk-U3TPUXOQ.js +2653 -0
- package/dist/chunk-UB33F3YW.js +709 -0
- package/dist/chunk-UDAK6GR2.js +175 -0
- package/dist/chunk-USBBEKHW.js +177 -0
- package/dist/chunk-V4ZKOKRB.js +13433 -0
- package/dist/chunk-W5RM7YAH.js +78 -0
- package/dist/chunk-W7KNI3F5.js +215 -0
- package/dist/chunk-WFTSK7N3.js +637 -0
- package/dist/chunk-WJWNZXRM.js +395 -0
- package/dist/chunk-WLHX3MM5.js +63 -0
- package/dist/chunk-WS4FOGLY.js +686 -0
- package/dist/chunk-WTZVSMQZ.js +52 -0
- package/dist/chunk-WWRV5RJI.js +165 -0
- package/dist/chunk-X6FLVUM5.js +141 -0
- package/dist/chunk-XC5POIL4.js +68 -0
- package/dist/chunk-XTLJDC2X.js +1013 -0
- package/dist/chunk-XW2UZICE.js +372 -0
- package/dist/chunk-Y3JU5RPK.js +8 -0
- package/dist/chunk-YGIV24MF.js +1018 -0
- package/dist/chunk-YJCCMYYT.js +125 -0
- package/dist/chunk-YKIIWURD.js +36 -0
- package/dist/chunk-YQ3GFEUY.js +341 -0
- package/dist/chunk-YXANQGCX.js +179 -0
- package/dist/chunk-YXFKLMX2.js +222 -0
- package/dist/chunk-ZST3FRCV.js +132 -0
- package/dist/cli/index.js +40 -40
- package/dist/clio-BPBAPZGA.js +26 -0
- package/dist/code-nav-KBQ3RIFK.js +686 -0
- package/dist/components-6DKAXWFN.js +674 -0
- package/dist/config-FWL5JK2H.js +270 -0
- package/dist/config-graph-ACDB26L2.js +156 -0
- package/dist/configure-ZIZ4YV62.js +85 -0
- package/dist/context-EZZPT2ZV.js +1074 -0
- package/dist/context-VIL5MFRH.js +282 -0
- package/dist/context-Z3GOBHDK.js +344 -0
- package/dist/context-clear-ZPB3L7MN.js +188 -0
- package/dist/context-index-W6A4V7OC.js +120 -0
- package/dist/context-map-DKL3QT6D.js +555 -0
- package/dist/context-working-set-2GLBVF7L.js +1559 -0
- package/dist/detail-VSBWYSGZ.js +119 -0
- package/dist/dispatch-runner-EEEHGKX4.js +2442 -0
- package/dist/docs-VMMWFVHL.js +101 -0
- package/dist/doctor-V5L4IQGP.js +812 -0
- package/dist/eval-VJYJ2BV3.js +5050 -0
- package/dist/eval-inventory-CX24K2JT.js +260 -0
- package/dist/evals-J2H5V6DD.js +104 -0
- package/dist/evidence-POWAEBEW.js +229 -0
- package/dist/evidence-XCCCLS36.js +242 -0
- package/dist/evidence-Y35YSXH6.js +388 -0
- package/dist/evolve-GPG72VB6.js +613 -0
- package/dist/extensions-YIZ7W3DA.js +308 -0
- package/dist/fleet-2MDCQ2VK.js +264 -0
- package/dist/fleet-W2AF3TOJ.js +919 -0
- package/dist/fleet-commands-WS56G26H.js +75 -0
- package/dist/fleet-decisions-MYGZ3JW7.js +52 -0
- package/dist/fleet-graph-ELTBXBAV.js +136 -0
- package/dist/fleet-inspect-45IK73L4.js +308 -0
- package/dist/fleet-preflight-T5NCZKHE.js +22 -0
- package/dist/fleet-validate-VG4JBLA4.js +91 -0
- package/dist/fleet-verify-VTSABAYO.js +206 -0
- package/dist/fleet-view-XC7WMKSS.js +123 -0
- package/dist/init-VTJNNTIP.js +329 -0
- package/dist/install-6PIF6F6W.js +19 -0
- package/dist/interop-IU6BNA7C.js +246 -0
- package/dist/inventory-QPQUTUUZ.js +123 -0
- package/dist/library-HUTAS57T.js +492 -0
- package/dist/library-LF7DLU6S.js +306 -0
- package/dist/library-Q3NWL5CM.js +75 -0
- package/dist/library-import-PPW4YUC5.js +183 -0
- package/dist/library-inventory-DIRVFRZU.js +56 -0
- package/dist/library-validation-XHUZ3INE.js +42 -0
- package/dist/memory-Z2LSKNV6.js +516 -0
- package/dist/models-3FTREYPY.js +302 -0
- package/dist/monitor-HF2MQRB3.js +781 -0
- package/dist/orchestrator-UYPA6W4S.js +41502 -0
- package/dist/panes-736XB73K.js +74 -0
- package/dist/panes-C4P3PIWT.js +103 -0
- package/dist/paths-JQ4QYIYB.js +67 -0
- package/dist/preload-XSLRYH3Y.js +120 -0
- package/dist/reset-V7QSPZYE.js +345 -0
- package/dist/resources-OJGDFHYT.js +181 -0
- package/dist/run-T354SMDW.js +892 -0
- package/dist/settings-MWZXO6RV.js +72 -0
- package/dist/share-Y5ZKJPND.js +293 -0
- package/dist/skills-4GLZC4LN.js +100 -0
- package/dist/skills-eval-L5T7GODM.js +1074 -0
- package/dist/skills-inventory-LASKXEZI.js +138 -0
- package/dist/slash-commands-OIMRU36D.js +95 -0
- package/dist/steer-KMAM2Y2C.js +77 -0
- package/dist/support-AWC3XKPX.js +38 -0
- package/dist/system-CD75NYBU.js +116 -0
- package/dist/targets-VSZX2J2S.js +1116 -0
- package/dist/tasks-AN567LYH.js +36 -0
- package/dist/terminal-lease-6KTWNHVY.js +418 -0
- package/dist/tools-AGRK3V5J.js +28 -0
- package/dist/trace-P4MQZD33.js +524 -0
- package/dist/tui-primitives-A6MUW32V.js +18 -0
- package/dist/uninstall-BRUTEPIC.js +432 -0
- package/dist/upgrade-SBCGHQGJ.js +307 -0
- package/dist/usage-BIDVTO6V.js +1061 -0
- package/dist/verifiers-LTGCAMXS.js +630 -0
- package/dist/verify-OZU4LLNP.js +30 -0
- package/dist/web/client/THIRD_PARTY_LICENSES.md +1809 -0
- package/dist/web/client/assets/abnfDiagram-VCTEODGH-C5wfoHm3.js +1 -0
- package/dist/web/client/assets/arc-oH91sfLl.js +1 -0
- package/dist/web/client/assets/architecture-7GRP2DOG-EGozsYEO.js +1 -0
- package/dist/web/client/assets/architectureDiagram-5GKGNRK7-z9FokbJl.js +36 -0
- package/dist/web/client/assets/array-BifhSqXX.js +1 -0
- package/dist/web/client/assets/atkinson-hyperlegible-next-latin-ext-wght-normal-C6vrW8VD.woff2 +0 -0
- package/dist/web/client/assets/atkinson-hyperlegible-next-latin-wght-normal-BcXVPD7q.woff2 +0 -0
- package/dist/web/client/assets/blockDiagram-I7D4REHJ-wi0_CYHL.js +129 -0
- package/dist/web/client/assets/c4Diagram-7LVT6UL2-DV7NYc2W.js +38 -0
- package/dist/web/client/assets/channel-CiUWbHN9.js +1 -0
- package/dist/web/client/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- package/dist/web/client/assets/chunk-4HAMMTFA-Bhsegh3F.js +62 -0
- package/dist/web/client/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- package/dist/web/client/assets/chunk-75Z2AOVW-RQCckcQG.js +2 -0
- package/dist/web/client/assets/chunk-DU6HZSFF-C5USiOAy.js +125 -0
- package/dist/web/client/assets/chunk-F27PBJKO-BcNqv2x1.js +1 -0
- package/dist/web/client/assets/chunk-FOHPRMQF-CoA4358r.js +161 -0
- package/dist/web/client/assets/chunk-GMAD6QVW-Bq8JWiZT.js +72 -0
- package/dist/web/client/assets/chunk-GVQU2GXP-DbchrAeJ.js +1 -0
- package/dist/web/client/assets/chunk-IMKFNOWR-DrpvjocK.js +231 -0
- package/dist/web/client/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- package/dist/web/client/assets/chunk-L3NEJ4N5-DHLmTnCe.js +1 -0
- package/dist/web/client/assets/chunk-OSK3NFVY-CsRbtN9n.js +10 -0
- package/dist/web/client/assets/chunk-P2QGCYS3-aqPbxoMh.js +1 -0
- package/dist/web/client/assets/chunk-POPQ4Y6H-Dl5vw0h0.js +1 -0
- package/dist/web/client/assets/chunk-PWAF6VOD-D7OBRSdO.js +1 -0
- package/dist/web/client/assets/chunk-SHT3W25Y-CdKCIwuB.js +168 -0
- package/dist/web/client/assets/chunk-SVP7TREG-B94Nu_1-.js +88 -0
- package/dist/web/client/assets/chunk-TICWLB2K-jjRQI_hk.js +206 -0
- package/dist/web/client/assets/chunk-XXDRQBXY-azkbKE37.js +1 -0
- package/dist/web/client/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/dist/web/client/assets/classDiagram-ZZMXUADV-CMODalmo.js +1 -0
- package/dist/web/client/assets/classDiagram-v2-VYDZK3BY-CMODalmo.js +1 -0
- package/dist/web/client/assets/commit-mono-latin-400-normal-s0S3qwFW.woff +0 -0
- package/dist/web/client/assets/commit-mono-latin-400-normal-wzhe4RuD.woff2 +0 -0
- package/dist/web/client/assets/cose-bilkent-JH36ORCC-RbQL23qS.js +1 -0
- package/dist/web/client/assets/cynefin-OW5HDTMX--i9RDU5f.js +1 -0
- package/dist/web/client/assets/cynefinDiagram-5FMLGOSQ-cRcvyBdp.js +62 -0
- package/dist/web/client/assets/cytoscape.esm-c2aL46s-.js +321 -0
- package/dist/web/client/assets/dagre-C-rnJpZF.js +1 -0
- package/dist/web/client/assets/dagre-GXQ25YYZ-C9mZmAPe.js +4 -0
- package/dist/web/client/assets/defaultLocale-BFoDCU3G.js +1 -0
- package/dist/web/client/assets/diagram-S7CK7UJ4-Oj_zlLDY.js +30 -0
- package/dist/web/client/assets/diagram-UQ7AKVKN-BWKbbfcR.js +41 -0
- package/dist/web/client/assets/diagram-VSXAHHWV-C3N3f7DO.js +3 -0
- package/dist/web/client/assets/diagram-VX7I27RA-CtDKDAWe.js +24 -0
- package/dist/web/client/assets/diagram-Z3DM3KII-B8bkBRCz.js +24 -0
- package/dist/web/client/assets/dist-D0_q-A2b.js +1 -0
- package/dist/web/client/assets/ebnfDiagram-PWID7BFC-CskW-Whx.js +1 -0
- package/dist/web/client/assets/erDiagram-RLTQ6QDP-C-83cgCW.js +99 -0
- package/dist/web/client/assets/eventmodeling-NTZA5JFV-DjVq8wKU.js +1 -0
- package/dist/web/client/assets/flowDiagram-HODETNUW-BUiCBGXt.js +1 -0
- package/dist/web/client/assets/ganttDiagram-EL5Y4UJY-B2lb8lvF.js +292 -0
- package/dist/web/client/assets/gitGraph-4MIJSDKK-B40cQtBE.js +1 -0
- package/dist/web/client/assets/gitGraphDiagram-WWUBYQGX-CH-7P7Di.js +106 -0
- package/dist/web/client/assets/graphlib-DS17s2tU.js +1 -0
- package/dist/web/client/assets/index-Dsi52apB.css +1 -0
- package/dist/web/client/assets/index-FSIC94pi.js +83 -0
- package/dist/web/client/assets/info-A6RAGUB7-eCCE9D_Q.js +1 -0
- package/dist/web/client/assets/infoDiagram-27XIBGKW-DRnvqMjM.js +2 -0
- package/dist/web/client/assets/init-C-OQMol4.js +1 -0
- package/dist/web/client/assets/ishikawaDiagram-5VMMS53U-DBA_55wp.js +70 -0
- package/dist/web/client/assets/journeyDiagram-3NMN7TZE-C-ewpNl7.js +139 -0
- package/dist/web/client/assets/kanban-definition-UXKFOSKX-B1taGsu0.js +89 -0
- package/dist/web/client/assets/katex-ZlcWpGUi.js +257 -0
- package/dist/web/client/assets/line-lZ0kyxDI.js +1 -0
- package/dist/web/client/assets/linear-DIc8FgZj.js +1 -0
- package/dist/web/client/assets/mermaid-parser.core-SXolxpXw.js +7 -0
- package/dist/web/client/assets/mermaid.core-DXgQtkNg.js +44 -0
- package/dist/web/client/assets/mindmap-definition-YA3MSWOX-DXJas9K7.js +96 -0
- package/dist/web/client/assets/newsreader-latin-ext-wght-normal-C-3rgBeH.woff2 +0 -0
- package/dist/web/client/assets/newsreader-latin-wght-normal-CCVVNp6i.woff2 +0 -0
- package/dist/web/client/assets/newsreader-vietnamese-wght-normal-Czsa-EzN.woff2 +0 -0
- package/dist/web/client/assets/ordinal-BDEzSJ7C.js +1 -0
- package/dist/web/client/assets/packet-AYTQ26CC-OqVl_07o.js +1 -0
- package/dist/web/client/assets/path-fybaL0A-.js +1 -0
- package/dist/web/client/assets/pegDiagram-XKGWAZYB-CPE_zdfN.js +1 -0
- package/dist/web/client/assets/pie-WAS4IAKB-DAxnMBLe.js +1 -0
- package/dist/web/client/assets/pieDiagram-E7YTZNPT-Uwjpufxv.js +39 -0
- package/dist/web/client/assets/prism-bash-D6zCJ74D.js +1 -0
- package/dist/web/client/assets/prism-c-04YixN25.js +1 -0
- package/dist/web/client/assets/prism-clike-DapgWyxx.js +1 -0
- package/dist/web/client/assets/prism-core-BngLtbUd.js +1 -0
- package/dist/web/client/assets/prism-cpp-C-lJbC-6.js +1 -0
- package/dist/web/client/assets/prism-css-CPgOzxXp.js +1 -0
- package/dist/web/client/assets/prism-diff-BF8m0_mq.js +3 -0
- package/dist/web/client/assets/prism-docker-DkT6yOFj.js +1 -0
- package/dist/web/client/assets/prism-fortran-Be5x3y1V.js +1 -0
- package/dist/web/client/assets/prism-go-C_8qAH5n.js +1 -0
- package/dist/web/client/assets/prism-ini-BESK3y0r.js +1 -0
- package/dist/web/client/assets/prism-javascript-BnO-swvr.js +1 -0
- package/dist/web/client/assets/prism-json-Dp_-W-Hv.js +1 -0
- package/dist/web/client/assets/prism-jsx-D-D0NWtC.js +1 -0
- package/dist/web/client/assets/prism-julia-DIjOgiAV.js +1 -0
- package/dist/web/client/assets/prism-latex-DNMbqcH_.js +1 -0
- package/dist/web/client/assets/prism-makefile-CRKWLQ8l.js +1 -0
- package/dist/web/client/assets/prism-markdown-C0FPJ1Iz.js +1 -0
- package/dist/web/client/assets/prism-markup-Cp04rIa1.js +1 -0
- package/dist/web/client/assets/prism-matlab-D-nk08al.js +1 -0
- package/dist/web/client/assets/prism-python-CfiSVtM6.js +1 -0
- package/dist/web/client/assets/prism-r-QmNGR8LX.js +1 -0
- package/dist/web/client/assets/prism-rust-Bu9N8X3N.js +1 -0
- package/dist/web/client/assets/prism-shell-session-Be4UuYoM.js +1 -0
- package/dist/web/client/assets/prism-sql-CYhVDMEE.js +1 -0
- package/dist/web/client/assets/prism-toml-DKb54GAT.js +1 -0
- package/dist/web/client/assets/prism-tsx-p6J2Kc_4.js +1 -0
- package/dist/web/client/assets/prism-typescript-BMqONzxf.js +1 -0
- package/dist/web/client/assets/prism-yaml-C0JHu8gr.js +1 -0
- package/dist/web/client/assets/purify.es-ChwZkWde.js +3 -0
- package/dist/web/client/assets/quadrantDiagram-AXDQQJYC-Bjs4yjgs.js +7 -0
- package/dist/web/client/assets/radar-RG4KPBEZ-CuCKjHM3.js +1 -0
- package/dist/web/client/assets/railroad-74A4TZTK-CnQK-Cc1.js +1 -0
- package/dist/web/client/assets/railroad-abnf-HS5TGJTU-BcW01NZG.js +1 -0
- package/dist/web/client/assets/railroad-ebnf-LZEXJU2U-B7YCEDDd.js +1 -0
- package/dist/web/client/assets/railroad-peg-WCYAUIDC-DjNZbSTZ.js +1 -0
- package/dist/web/client/assets/railroadDiagram-O6MQD6OU-BDDIPNLL.js +1 -0
- package/dist/web/client/assets/requirementDiagram-BXWQKSXE-B5Ydyxc1.js +84 -0
- package/dist/web/client/assets/rough.esm-Dy-Kn_BL.js +1 -0
- package/dist/web/client/assets/sankeyDiagram-P5KCCOFB-Bw2Qym75.js +40 -0
- package/dist/web/client/assets/sequenceDiagram-WJ2MYXX4-BZf36nO0.js +162 -0
- package/dist/web/client/assets/sizeCapture-INFHLROL-B0uUizjq.js +1 -0
- package/dist/web/client/assets/src-yeptRXpt.js +1 -0
- package/dist/web/client/assets/stateDiagram-D77RDMKH-DnH6JRkp.js +1 -0
- package/dist/web/client/assets/stateDiagram-v2-MP3YSRHH-C7QtHeK4.js +1 -0
- package/dist/web/client/assets/swimlanes-42K2YHIH-D9PZmtZg.js +1 -0
- package/dist/web/client/assets/swimlanesDiagram-VR7AAH4N-CBZlPFky.js +8 -0
- package/dist/web/client/assets/timeline-definition-24CTP7MA-CrkZZBo7.js +120 -0
- package/dist/web/client/assets/treeView-Q6P3EWNA-C9zDShoC.js +1 -0
- package/dist/web/client/assets/treemap-WGGIJYW6-B-plj9yK.js +1 -0
- package/dist/web/client/assets/vennDiagram-4TSXK5OY-VeOdaphN.js +34 -0
- package/dist/web/client/assets/wardley-WFR3VGLG-Wl1P_m6L.js +1 -0
- package/dist/web/client/assets/wardleyDiagram-VM6X3IG4-B85-R9t2.js +78 -0
- package/dist/web/client/assets/xychartDiagram-S5SC5T6Z-BrD8OW8m.js +7 -0
- package/dist/web/client/clio-coder-logo.webp +0 -0
- package/dist/web/client/icon-192.png +0 -0
- package/dist/web/client/icon-512.png +0 -0
- package/dist/web/client/index.html +4 -0
- package/dist/web/client/manifest.webmanifest +15 -0
- package/dist/web/client/offline.css +55 -0
- package/dist/web/client/offline.html +5 -0
- package/dist/web/client/offline.js +27 -0
- package/dist/web/client/sw.js +34 -0
- package/dist/web/ops-worker.js +37 -0
- package/dist/web/reads-worker.js +1726 -0
- package/dist/web/server.js +8499 -0
- package/dist/web-EU6ATJWA.js +13 -0
- package/dist/web-fetch-U22Q7HV4.js +788 -0
- package/dist/wiki-generate-LZRLFG6I.js +623 -0
- package/dist/with-panes-X5CZOGML.js +628 -0
- package/dist/worker/entry.js +300 -93
- package/docs/README.md +58 -14
- package/docs/architecture/acp.md +5 -9
- package/docs/architecture/alcf-provider.md +0 -3
- package/docs/architecture/architecture.md +8 -10
- package/docs/architecture/artifact-placement.md +0 -3
- package/docs/architecture/artifact-versions.md +3 -6
- package/docs/architecture/capacity-and-scheduling.md +0 -3
- package/docs/architecture/context-engine.md +35 -4
- package/docs/architecture/context-working-set.md +0 -3
- package/docs/architecture/dispatch-architecture-rationale.md +0 -3
- package/docs/architecture/dispatch-typed-intent.md +0 -3
- package/docs/architecture/evidence-and-memory.md +0 -3
- package/docs/architecture/library.md +30 -0
- package/docs/architecture/middleware-and-components.md +1 -4
- package/docs/architecture/model-catalog.md +21 -4
- package/docs/architecture/observability.md +0 -3
- package/docs/architecture/pi-boundary.md +23 -8
- package/docs/architecture/prompt-envelope-and-tools.md +6 -9
- package/docs/architecture/provider-adapter-cookbook.md +1 -4
- package/docs/architecture/safety-model.md +21 -5
- package/docs/architecture/session-lifecycle.md +12 -4
- package/docs/architecture/time-conventions.md +0 -3
- package/docs/architecture/trace-store.md +28 -20
- package/docs/architecture/tui-design.md +108 -12
- package/docs/architecture/worker-context.md +104 -0
- package/docs/architecture/worker-dispatch-mechanics.md +1 -4
- package/docs/guide/authoring-plugins.md +158 -0
- package/docs/guide/built-in-agents.md +5 -8
- package/docs/guide/commands-and-modes.md +162 -61
- package/docs/guide/configuration-and-targets.md +198 -5
- package/docs/guide/configuration-reference.md +36 -38
- package/docs/guide/environment-variables.md +2 -5
- package/docs/guide/exit-codes-and-output.md +1 -4
- package/docs/guide/extensions-and-sharing.md +92 -55
- package/docs/guide/fleet-dispatch.md +31 -7
- package/docs/guide/glossary.md +1 -4
- package/docs/guide/harness-extensions.md +289 -0
- package/docs/guide/installation-and-lifecycle.md +10 -13
- package/docs/guide/interop.md +241 -0
- package/docs/guide/panes-and-files.md +3 -6
- package/docs/guide/plugins.md +77 -0
- package/docs/guide/proactive-memory.md +0 -3
- package/docs/guide/resource-library.md +109 -45
- package/docs/guide/skills-marketplace.md +34 -73
- package/docs/guide/tool-usage.md +19 -10
- package/docs/guide/troubleshooting.md +1 -4
- package/docs/history/config-knobs-audit.md +0 -3
- package/docs/history/release-cut-checklist.md +0 -3
- package/docs/process/development-pipeline.md +14 -17
- package/docs/process/documentation-coverage.md +31 -4
- package/docs/process/documentation-guide.md +28 -27
- package/docs/process/eval-runner.md +8 -6
- package/docs/process/evals-internal.md +0 -3
- package/docs/process/evolution.md +0 -3
- package/docs/process/fleet-demo-runbook.md +0 -3
- package/docs/process/git-commit-provenance.md +0 -3
- package/docs/process/performance-methodology.md +2 -5
- package/docs/process/release-cut-checklist.md +114 -217
- package/docs/process/scientific-validation.md +23 -3
- package/evals/scalar-decision-machinery.ts +1 -1
- package/examples/extensions/README.md +67 -0
- package/examples/extensions/lab-status/clio-coder-extension.json +14 -0
- package/examples/extensions/lab-status/extension.mjs +68 -0
- package/examples/extensions/lab-status/jobs.synthetic.json +9 -0
- package/examples/extensions/measurements/clio-coder-extension.json +28 -0
- package/examples/extensions/measurements/summarize.cjs +23 -0
- package/library/README.md +109 -0
- package/library/_authoring/templates/agent/README.md +28 -0
- package/library/_authoring/templates/agent/agents/benchmark-scout.md +30 -0
- package/library/_authoring/templates/agent/plugin.json +23 -0
- package/library/_authoring/templates/fleet/README.md +29 -0
- package/library/_authoring/templates/fleet/fleets/pipeline-review.md +31 -0
- package/library/_authoring/templates/fleet/plugin.json +23 -0
- package/library/_authoring/templates/plugin/README.md +37 -0
- package/library/_authoring/templates/plugin/agents/data-curator.md +31 -0
- package/library/_authoring/templates/plugin/assets/curation-guide.md +22 -0
- package/library/_authoring/templates/plugin/plugin.json +42 -0
- package/library/_authoring/templates/plugin/prompts/inspect-dataset.md +15 -0
- package/library/_authoring/templates/plugin/skills/dataset-curation/SKILL.md +36 -0
- package/library/_authoring/templates/plugin/skills/dataset-curation/evals.md +17 -0
- package/library/_authoring/templates/prompt/README.md +28 -0
- package/library/_authoring/templates/prompt/plugin.json +23 -0
- package/library/_authoring/templates/prompt/prompts/paper-summary.md +26 -0
- package/library/_authoring/templates/skill/README.md +24 -0
- package/library/_authoring/templates/skill/SKILL.md +39 -0
- package/library/_authoring/templates/skill/evals.md +30 -0
- package/library/_authoring/templates/skill/plugin.json +23 -0
- package/library/agents/README.md +7 -0
- package/library/fleets/README.md +7 -0
- package/library/plugins/materio/README.md +137 -0
- package/library/plugins/materio/ai.iowarp.clio/agents/materio-lab-definer.md +208 -0
- package/library/plugins/materio/ai.iowarp.clio/agents/materio-literature-reviewer.md +308 -0
- package/library/plugins/materio/ai.iowarp.clio/agents/materio-research-explorer.md +249 -0
- package/library/plugins/materio/ai.iowarp.clio/agents/materio-task-executor.md +416 -0
- package/library/plugins/materio/ai.iowarp.clio/agents/materio-task-verifier.md +60 -0
- package/library/plugins/materio/ai.iowarp.clio/agents/materio-workflow-planner.md +238 -0
- package/library/plugins/materio/ai.iowarp.clio/fleets/materio-execute-task.md +50 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/add-task.md +66 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/archive-task.md +65 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/checkpoint.md +26 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/define-research-tasks.md +230 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/define-virtual-lab.md +181 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/execute-task.md +292 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/help.md +129 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/identify-research.md +206 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/literature-review.md +201 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/pause-research.md +12 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/progress.md +105 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/remove-task.md +63 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/resume-research.md +64 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/settings.md +16 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/status.md +92 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/upload-data.md +104 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/wtfp.md +145 -0
- package/library/plugins/materio/ai.iowarp.clio/references/execution.md +56 -0
- package/library/plugins/materio/ai.iowarp.portability/provenance.json +9 -0
- package/library/plugins/materio/assets/actions/add-task.md +86 -0
- package/library/plugins/materio/assets/actions/archive-task.md +84 -0
- package/library/plugins/materio/assets/actions/checkpoint.md +47 -0
- package/library/plugins/materio/assets/actions/define-research-tasks.md +228 -0
- package/library/plugins/materio/assets/actions/define-virtual-lab.md +179 -0
- package/library/plugins/materio/assets/actions/execute-task.md +290 -0
- package/library/plugins/materio/assets/actions/help.md +140 -0
- package/library/plugins/materio/assets/actions/identify-research.md +204 -0
- package/library/plugins/materio/assets/actions/literature-review.md +199 -0
- package/library/plugins/materio/assets/actions/pause-research.md +34 -0
- package/library/plugins/materio/assets/actions/progress.md +125 -0
- package/library/plugins/materio/assets/actions/remove-task.md +82 -0
- package/library/plugins/materio/assets/actions/resume-research.md +84 -0
- package/library/plugins/materio/assets/actions/settings.md +38 -0
- package/library/plugins/materio/assets/actions/status.md +112 -0
- package/library/plugins/materio/assets/actions/upload-data.md +123 -0
- package/library/plugins/materio/assets/actions/wtfp.md +179 -0
- package/library/plugins/materio/assets/references/research-domains.md +134 -0
- package/library/plugins/materio/assets/references/research-policy.md +77 -0
- package/library/plugins/materio/assets/references/traditional-workflows.md +146 -0
- package/library/plugins/materio/assets/scripts/check_physics.py +271 -0
- package/library/plugins/materio/assets/scripts/check_scripts.py +248 -0
- package/library/plugins/materio/assets/scripts/project_plugin.py +165 -0
- package/library/plugins/materio/assets/scripts/research_state.py +400 -0
- package/library/plugins/materio/assets/scripts/verify_citations.py +616 -0
- package/library/plugins/materio/assets/templates/RESEARCH.md +39 -0
- package/library/plugins/materio/assets/templates/VIRTUAL-LAB.md +120 -0
- package/library/plugins/materio/assets/templates/WORKFLOW.md +42 -0
- package/library/plugins/materio/assets/templates/config.json +5 -0
- package/library/plugins/materio/evals/scripts.yaml +29 -0
- package/library/plugins/materio/plugin.json +530 -0
- package/library/plugins/materio/skills/materio-lab-definer/SKILL.md +74 -0
- package/library/plugins/materio/skills/materio-literature-reviewer/SKILL.md +64 -0
- package/library/plugins/materio/skills/materio-research-explorer/SKILL.md +74 -0
- package/library/plugins/materio/skills/materio-task-executor/SKILL.md +214 -0
- package/library/plugins/materio/skills/materio-task-verifier/SKILL.md +46 -0
- package/library/plugins/materio/skills/materio-workflow-planner/SKILL.md +79 -0
- package/library/plugins/materio/tests/test_check_physics.py +139 -0
- package/library/plugins/materio/tests/test_check_scripts.py +140 -0
- package/library/plugins/materio/tests/test_research_state.py +291 -0
- package/library/plugins/materio/tests/test_verify_citations.py +337 -0
- package/library/prompts/README.md +7 -0
- package/library/registry.yaml +921 -0
- package/library/skills/README.md +120 -0
- package/library/skills/coding/ast-grep/SKILL.md +213 -0
- package/library/skills/coding/ast-grep/evals.md +82 -0
- package/library/skills/coding/ast-grep/plugin.json +23 -0
- package/library/skills/coding/coding-standards/SKILL.md +164 -0
- package/library/skills/coding/coding-standards/evals.md +57 -0
- package/library/skills/coding/coding-standards/plugin.json +23 -0
- package/library/skills/coding/prototype/SKILL.md +151 -0
- package/library/skills/coding/prototype/evals.md +61 -0
- package/library/skills/coding/prototype/plugin.json +23 -0
- package/library/skills/coding/tdd/SKILL.md +134 -0
- package/library/skills/coding/tdd/evals.md +61 -0
- package/library/skills/coding/tdd/plugin.json +23 -0
- package/library/skills/context/context-handoff/SKILL.md +176 -0
- package/library/skills/context/context-handoff/evals.md +101 -0
- package/library/skills/context/context-handoff/plugin.json +23 -0
- package/library/skills/context/context-prime/SKILL.md +131 -0
- package/library/skills/context/context-prime/evals.md +99 -0
- package/library/skills/context/context-prime/plugin.json +23 -0
- package/library/skills/git/branch-closeout/SKILL.md +132 -0
- package/library/skills/git/branch-closeout/plugin.json +23 -0
- package/library/skills/git/file-ticket/SKILL.md +126 -0
- package/library/skills/git/file-ticket/plugin.json +23 -0
- package/library/skills/git/fix-issue/SKILL.md +136 -0
- package/library/skills/git/fix-issue/plugin.json +23 -0
- package/library/skills/git/resolve-merge-conflicts/SKILL.md +151 -0
- package/library/skills/git/resolve-merge-conflicts/evals.md +85 -0
- package/library/skills/git/resolve-merge-conflicts/plugin.json +23 -0
- package/library/skills/git/ship/SKILL.md +134 -0
- package/library/skills/git/ship/plugin.json +23 -0
- package/library/skills/git/worktree-create/SKILL.md +127 -0
- package/library/skills/git/worktree-create/plugin.json +23 -0
- package/library/skills/git/worktree-merge/SKILL.md +147 -0
- package/library/skills/git/worktree-merge/plugin.json +23 -0
- package/library/skills/meta/clio-coder-dev/SKILL.md +101 -0
- package/library/skills/meta/clio-coder-dev/evals.md +46 -0
- package/library/skills/meta/clio-coder-dev/plugin.json +23 -0
- package/library/skills/meta/clio-coder-test/SKILL.md +156 -0
- package/library/skills/meta/clio-coder-test/evals.md +62 -0
- package/library/skills/meta/clio-coder-test/plugin.json +23 -0
- package/library/skills/meta/clio-coder-test/references/test-map.md +97 -0
- package/library/skills/meta/credentials/SKILL.md +132 -0
- package/library/skills/meta/credentials/evals.md +104 -0
- package/library/skills/meta/credentials/plugin.json +23 -0
- package/library/skills/meta/find-skills/SKILL.md +85 -0
- package/library/skills/meta/find-skills/evals.md +65 -0
- package/library/skills/meta/find-skills/plugin.json +23 -0
- package/library/skills/meta/herdr/SKILL.md +133 -0
- package/library/skills/meta/herdr/evals.md +38 -0
- package/library/skills/meta/herdr/plugin.json +23 -0
- package/library/skills/meta/skill-craft/SKILL.md +139 -0
- package/library/skills/meta/skill-craft/evals.md +49 -0
- package/library/skills/meta/skill-craft/plugin.json +23 -0
- package/library/skills/planning/archify/SKILL.md +196 -0
- package/library/skills/planning/archify/plugin.json +23 -0
- package/library/skills/planning/architecture/SKILL.md +184 -0
- package/library/skills/planning/architecture/evals.md +101 -0
- package/library/skills/planning/architecture/plugin.json +23 -0
- package/library/skills/planning/backlog/SKILL.md +212 -0
- package/library/skills/planning/backlog/evals.md +185 -0
- package/library/skills/planning/backlog/plugin.json +23 -0
- package/library/skills/planning/prd/SKILL.md +129 -0
- package/library/skills/planning/prd/evals.md +103 -0
- package/library/skills/planning/prd/plugin.json +23 -0
- package/library/skills/planning/product-intent/SKILL.md +173 -0
- package/library/skills/planning/product-intent/evals.md +106 -0
- package/library/skills/planning/product-intent/plugin.json +23 -0
- package/library/skills/planning/tech-spec/SKILL.md +172 -0
- package/library/skills/planning/tech-spec/evals.md +120 -0
- package/library/skills/planning/tech-spec/plugin.json +23 -0
- package/library/skills/registry.yaml +144 -0
- package/library/skills/remote.yaml +13 -0
- package/library/skills/research/arxiv-literature/SKILL.md +168 -0
- package/library/skills/research/arxiv-literature/evals.md +108 -0
- package/library/skills/research/arxiv-literature/plugin.json +23 -0
- package/library/skills/research/experiment-protocol/SKILL.md +148 -0
- package/library/skills/research/experiment-protocol/evals.md +114 -0
- package/library/skills/research/experiment-protocol/plugin.json +23 -0
- package/library/skills/research/scientific-debugging/SKILL.md +149 -0
- package/library/skills/research/scientific-debugging/evals.md +156 -0
- package/library/skills/research/scientific-debugging/plugin.json +23 -0
- package/library/skills/research/scientific-modernization/SKILL.md +170 -0
- package/library/skills/research/scientific-modernization/evals.md +111 -0
- package/library/skills/research/scientific-modernization/plugin.json +23 -0
- package/library/skills/skill-marketplace.json +507 -0
- package/library/skills/workflow/cut-it/SKILL.md +153 -0
- package/library/skills/workflow/cut-it/evals.md +143 -0
- package/library/skills/workflow/cut-it/plugin.json +23 -0
- package/library/skills/workflow/design-council/SKILL.md +233 -0
- package/library/skills/workflow/design-council/evals.md +258 -0
- package/library/skills/workflow/design-council/plugin.json +23 -0
- package/library/skills/workflow/grill-me/SKILL.md +267 -0
- package/library/skills/workflow/grill-me/evals.md +231 -0
- package/library/skills/workflow/grill-me/plugin.json +23 -0
- package/library/skills/workflow/workflow-distiller/SKILL.md +204 -0
- package/library/skills/workflow/workflow-distiller/evals.md +233 -0
- package/library/skills/workflow/workflow-distiller/plugin.json +23 -0
- package/package.json +23 -14
- package/src/cli/agents.ts +1 -1
- package/src/cli/config-inspect.ts +1 -1
- package/src/cli/configure.ts +2 -2
- package/src/cli/docs.ts +65 -328
- package/src/cli/eval.ts +40 -6
- package/src/cli/extensions.ts +74 -8
- package/src/cli/fleet-preflight.ts +2 -0
- package/src/cli/fleet.ts +2 -0
- package/src/cli/index.ts +4 -4
- package/src/cli/interop-inspect.ts +61 -33
- package/src/cli/interop.ts +79 -9
- package/src/cli/library-import.ts +139 -0
- package/src/cli/library.ts +418 -120
- package/src/cli/run.ts +26 -9
- package/src/cli/skills-eval.ts +43 -6
- package/src/cli/skills-inventory.ts +6 -2
- package/src/cli/skills.ts +44 -491
- package/src/cli/trace.ts +4 -65
- package/src/cli/uninstall.ts +26 -0
- package/src/cli/usage.ts +3 -0
- package/src/cli/web.ts +79 -0
- package/src/core/bus-events.ts +8 -4
- package/src/core/config.ts +71 -0
- package/src/core/defaults.ts +1 -1
- package/src/core/domain-loader.ts +37 -28
- package/src/core/recent-models.ts +2 -2
- package/src/core/session-routing.ts +3 -3
- package/src/core/state-file-lock.ts +1 -1
- package/src/core/termination.ts +13 -9
- package/src/core/tool-names.ts +5 -0
- package/src/domains/agents/contract.ts +1 -1
- package/src/domains/agents/extension.ts +53 -9
- package/src/domains/agents/fleet-commands.ts +92 -1
- package/src/domains/agents/fleet-contract.ts +87 -19
- package/src/domains/agents/recipe.ts +5 -4
- package/src/domains/agents/registry.ts +80 -24
- package/src/domains/config/extension.ts +5 -4
- package/src/domains/config/keybindings.ts +155 -95
- package/src/domains/context/worker/contract.ts +91 -0
- package/src/domains/context/worker/pressure.ts +120 -0
- package/src/domains/context/worker/recall.ts +62 -0
- package/src/domains/context/worker/select.ts +164 -0
- package/src/domains/context/worker/snapshot.ts +35 -0
- package/src/domains/context/worker/store.ts +16 -0
- package/src/domains/context/working-set/replay/synthetic.ts +2 -1
- package/src/domains/dispatch/active-route-planner.ts +2 -0
- package/src/domains/dispatch/backoff.ts +1 -0
- package/src/domains/dispatch/code-step.ts +12 -2
- package/src/domains/dispatch/contract.ts +3 -0
- package/src/domains/dispatch/execution-plan.ts +2 -0
- package/src/domains/dispatch/extension.ts +184 -39
- package/src/domains/dispatch/fleet-plan.ts +10 -0
- package/src/domains/dispatch/fleet-run.ts +1 -0
- package/src/domains/dispatch/index.ts +1 -0
- package/src/domains/dispatch/orphan-recovery.ts +2 -0
- package/src/domains/dispatch/receipt-integrity.ts +7 -0
- package/src/domains/dispatch/state.ts +2 -2
- package/src/domains/dispatch/types.ts +7 -0
- package/src/domains/dispatch/validation.ts +12 -0
- package/src/domains/dispatch/workspace-checkpoint.ts +1 -1
- package/src/domains/eval/metrics/tracked.ts +22 -2
- package/src/domains/evidence/failure-attribution.ts +1 -0
- package/src/domains/evidence/trust-status.ts +22 -3
- package/src/domains/extensions/command-schema.ts +145 -0
- package/src/domains/extensions/command-tools.ts +15 -0
- package/src/domains/extensions/compatibility.ts +7 -0
- package/src/domains/extensions/contract.ts +0 -4
- package/src/domains/extensions/discovery.ts +69 -205
- package/src/domains/extensions/extension.ts +0 -4
- package/src/domains/extensions/index.ts +1 -5
- package/src/domains/extensions/manager.ts +1 -6
- package/src/domains/extensions/operator-commands.ts +29 -0
- package/src/domains/extensions/operator-runtime.ts +485 -0
- package/src/domains/extensions/public-api.ts +53 -0
- package/src/domains/extensions/runtime-child.mjs +114 -0
- package/src/domains/extensions/runtime-process.ts +306 -0
- package/src/domains/extensions/runtime-schema.ts +146 -0
- package/src/domains/extensions/snapshot-access.ts +21 -0
- package/src/domains/extensions/snapshot.ts +4 -32
- package/src/domains/extensions/state.ts +5 -83
- package/src/domains/extensions/types.ts +33 -34
- package/src/domains/interop/adopt.ts +546 -0
- package/src/domains/interop/detect.ts +50 -12
- package/src/domains/interop/foreign.ts +554 -0
- package/src/domains/interop/import.ts +277 -0
- package/src/domains/interop/index.ts +24 -0
- package/src/domains/interop/install.ts +6 -0
- package/src/domains/interop/inventory.ts +351 -0
- package/src/domains/interop/projection.ts +360 -0
- package/src/domains/interop/registry.ts +106 -3
- package/src/domains/interop/types.ts +51 -0
- package/src/domains/lifecycle/migrations/index.ts +0 -2
- package/src/domains/lifecycle/naming-resources.ts +1 -1
- package/src/domains/middleware/hooks.ts +2 -2
- package/src/domains/middleware/marketplace-offer.ts +1 -1
- package/src/domains/mux/contract.ts +1 -1
- package/src/domains/observability/background-memory-usage.ts +3 -0
- package/src/domains/observability/compaction-usage.ts +2 -0
- package/src/domains/observability/cost.ts +5 -0
- package/src/domains/observability/extension.ts +1 -0
- package/src/domains/observability/out-of-turn-usage.ts +2 -0
- package/src/domains/observability/trace-store.ts +65 -5
- package/src/domains/plugins/catalog.ts +204 -0
- package/src/domains/plugins/contract.ts +24 -0
- package/src/domains/plugins/discovery.ts +316 -0
- package/src/domains/plugins/extension.ts +40 -0
- package/src/domains/plugins/index.ts +77 -0
- package/src/domains/plugins/integrity.ts +6 -0
- package/src/domains/plugins/manifest.ts +3 -0
- package/src/domains/plugins/resources.ts +102 -0
- package/src/domains/plugins/state.ts +753 -0
- package/src/domains/plugins/types.ts +217 -0
- package/src/domains/prompts/extension.ts +4 -10
- package/src/domains/prompts/fragments/operating/skills.md +10 -10
- package/src/domains/providers/cache-deployment.ts +147 -0
- package/src/domains/providers/catalog.ts +12 -7
- package/src/domains/providers/extension.ts +27 -5
- package/src/domains/providers/index.ts +1 -0
- package/src/domains/providers/plugins.ts +3 -13
- package/src/domains/providers/runtimes/common/local-synth.ts +4 -0
- package/src/domains/providers/types/target-descriptor.ts +17 -0
- package/src/domains/resources/common-loader.ts +9 -6
- package/src/domains/resources/index.ts +67 -0
- package/src/domains/resources/library-actions.ts +836 -0
- package/src/domains/resources/library-evals.ts +38 -0
- package/src/domains/resources/library-inventory.ts +1048 -0
- package/src/domains/resources/library-types.ts +50 -0
- package/src/domains/resources/library-validation.ts +634 -0
- package/src/domains/resources/library.ts +437 -156
- package/src/domains/resources/package-references.ts +66 -0
- package/src/domains/resources/prompts/loader.ts +75 -41
- package/src/domains/resources/skills/install.ts +2 -2
- package/src/domains/resources/skills/loader.ts +77 -22
- package/src/domains/resources/skills/marketplace.ts +48 -57
- package/src/domains/resources/skills/promotion.ts +2 -2
- package/src/domains/resources/skills/provenance-pin.ts +17 -4
- package/src/domains/safety/action-classifier.ts +2 -2
- package/src/domains/safety/default-path-policy.ts +3 -1
- package/src/domains/safety/policy-engine.ts +1 -1
- package/src/domains/safety/protected-artifacts.ts +21 -5
- package/src/domains/safety/skill-authority.ts +5 -2
- package/src/domains/session/compaction/compact.ts +4 -1
- package/src/domains/session/entries.ts +1 -0
- package/src/domains/session/usage.ts +6 -7
- package/src/domains/share/archive.ts +1 -1
- package/src/engine/acp/server.ts +11 -0
- package/src/engine/ai.ts +2 -0
- package/src/engine/apis/openai-completions.ts +61 -6
- package/src/engine/notices/pi-tui-LICENSE +21 -0
- package/src/engine/prewarm.ts +232 -0
- package/src/engine/provider-diagnostics.ts +6 -1
- package/src/engine/tui.ts +3 -0
- package/src/engine/worker-runtime.ts +58 -14
- package/src/engine/worker-tools.ts +5 -0
- package/src/entry/orchestrator.ts +46 -21
- package/src/entry/plugin-reload.ts +18 -0
- package/src/interactive/application-controller.ts +67 -21
- package/src/interactive/chat-loop-messages.ts +3 -0
- package/src/interactive/chat-loop.ts +32 -11
- package/src/interactive/chat-panel.ts +5 -1
- package/src/interactive/clio-editor.ts +53 -21
- package/src/interactive/command-output.ts +56 -1
- package/src/interactive/editor-submit.ts +65 -28
- package/src/interactive/fleet-run-preview.ts +2 -0
- package/src/interactive/follow-up-queue-panel.ts +3 -3
- package/src/interactive/footer/dashboard.ts +4 -1
- package/src/interactive/footer/notifications.ts +2 -2
- package/src/interactive/footer/widgets.ts +2 -2
- package/src/interactive/interactive-application.ts +209 -21
- package/src/interactive/interactive-input-runtime.ts +254 -7
- package/src/interactive/interactive-presentation.ts +41 -12
- package/src/interactive/interactive-slash-runtime.ts +37 -8
- package/src/interactive/keybinding-manager.ts +156 -79
- package/src/interactive/keyboard-owner.ts +37 -0
- package/src/interactive/leader-key.ts +49 -102
- package/src/interactive/leader-menu.ts +45 -0
- package/src/interactive/overlay-ask-user-lifecycle.ts +9 -1
- package/src/interactive/overlay-frame.ts +15 -0
- package/src/interactive/overlay-key-routing.ts +46 -47
- package/src/interactive/overlay-lifecycle.ts +30 -15
- package/src/interactive/overlay-resource-openers.ts +56 -46
- package/src/interactive/overlays/ask-user.ts +630 -556
- package/src/interactive/overlays/extension-panel.ts +70 -0
- package/src/interactive/overlays/extensions.ts +28 -5
- package/src/interactive/overlays/fleet-run-approval.ts +7 -3
- package/src/interactive/overlays/help-reference.ts +89 -40
- package/src/interactive/overlays/interop.ts +122 -3
- package/src/interactive/overlays/keybinding-detail.ts +2 -2
- package/src/interactive/overlays/library-lifecycle.ts +90 -0
- package/src/interactive/overlays/library-model.ts +574 -0
- package/src/interactive/overlays/library-review.ts +557 -0
- package/src/interactive/overlays/library-tabs.ts +3 -15
- package/src/interactive/overlays/library.ts +602 -0
- package/src/interactive/overlays/list-overlay.ts +218 -39
- package/src/interactive/overlays/model-selector.ts +28 -25
- package/src/interactive/overlays/session-selector.ts +9 -3
- package/src/interactive/overlays/settings.ts +25 -18
- package/src/interactive/overlays/tree-selector.ts +16 -11
- package/src/interactive/permission-hint.ts +13 -0
- package/src/interactive/permission-overlay.ts +77 -28
- package/src/interactive/prewarm.ts +11 -197
- package/src/interactive/prompt-source-label.ts +21 -0
- package/src/interactive/renderers/reference-card.ts +35 -0
- package/src/interactive/renderers/worker-entry.ts +35 -3
- package/src/interactive/session-usage-reseed.ts +2 -0
- package/src/interactive/side-question.ts +2 -0
- package/src/interactive/slash-autocomplete.ts +99 -1
- package/src/interactive/slash-commands.ts +390 -67
- package/src/interactive/slash-spec.ts +0 -1
- package/src/interactive/terminal-lease.ts +44 -12
- package/src/interactive/turn-context.ts +1 -0
- package/src/interactive/turn-persistence.ts +3 -0
- package/src/interactive/turn-prewarm.ts +126 -19
- package/src/interactive/turn-queues.ts +8 -7
- package/src/interactive/turn-runtime.ts +15 -1
- package/src/interactive/view/view-overlay.ts +19 -14
- package/src/interactive/welcome-dashboard.ts +525 -408
- package/src/tools/bootstrap.ts +8 -0
- package/src/tools/builtin-tool-catalog.ts +15 -6
- package/src/tools/context/index.ts +58 -5
- package/src/tools/context/library.ts +465 -0
- package/src/tools/context/surface.ts +20 -6
- package/src/tools/core-bootstrap.ts +3 -0
- package/src/tools/dispatch-admission.ts +24 -1
- package/src/tools/dispatch-arguments.ts +8 -0
- package/src/tools/dispatch-plan.ts +32 -0
- package/src/tools/dispatch-schema.ts +31 -1
- package/src/tools/dispatch-types.ts +3 -0
- package/src/tools/dispatch.ts +1 -1
- package/src/tools/harness-extensions.ts +169 -0
- package/src/tools/observation.ts +4 -0
- package/src/tools/policy.ts +7 -1
- package/src/tools/registry.ts +31 -3
- package/src/tools/worker-evidence.ts +5 -0
- package/src/worker/context-seed.ts +192 -0
- package/src/worker/entry.ts +1 -0
- package/src/worker/spec-contract.ts +35 -1
- package/dist/acp-UVEVWSDL.js +0 -130
- package/dist/agents-VWY37DTK.js +0 -148
- package/dist/auth-PCV2XQDV.js +0 -551
- package/dist/builtins-PD652MTK.js +0 -22
- package/dist/chunk-22PQ4TX4.js +0 -360
- package/dist/chunk-24T2YZ7A.js +0 -22648
- package/dist/chunk-2AKYFREM.js +0 -1008
- package/dist/chunk-2QPI3TR3.js +0 -162
- package/dist/chunk-3BJGMT2D.js +0 -324
- package/dist/chunk-3HQVBIKD.js +0 -308
- package/dist/chunk-3JLFK5MW.js +0 -193
- package/dist/chunk-3O2ZAUGQ.js +0 -283
- package/dist/chunk-3QKXHCGS.js +0 -59
- package/dist/chunk-3T4DXWP6.js +0 -668
- package/dist/chunk-3UW3KU4A.js +0 -21
- package/dist/chunk-3WBALRQH.js +0 -5076
- package/dist/chunk-4DU2TVI4.js +0 -108
- package/dist/chunk-4U4TKZFR.js +0 -5052
- package/dist/chunk-4VMV6OS6.js +0 -101
- package/dist/chunk-536HXRFE.js +0 -1257
- package/dist/chunk-5CMARGPF.js +0 -477
- package/dist/chunk-5CY4Q6QI.js +0 -141
- package/dist/chunk-5QRX7SLS.js +0 -1018
- package/dist/chunk-5VTJP36Q.js +0 -36
- package/dist/chunk-5ZSZEYJK.js +0 -119
- package/dist/chunk-6HAO6X5B.js +0 -197
- package/dist/chunk-6OII3LOK.js +0 -404
- package/dist/chunk-6RYDAVQT.js +0 -4338
- package/dist/chunk-6VRRJT7L.js +0 -146
- package/dist/chunk-6YA46L5A.js +0 -386
- package/dist/chunk-77CZRFTE.js +0 -634
- package/dist/chunk-7JSSKXG2.js +0 -1215
- package/dist/chunk-7WUZEB2M.js +0 -165
- package/dist/chunk-7YJWEF2L.js +0 -974
- package/dist/chunk-ACCKVSHU.js +0 -44
- package/dist/chunk-B3MOMLJ4.js +0 -433
- package/dist/chunk-BBV5TKE6.js +0 -35
- package/dist/chunk-BLTEAUCB.js +0 -668
- package/dist/chunk-BS4GAMUB.js +0 -233
- package/dist/chunk-BT7HGDOX.js +0 -3151
- package/dist/chunk-CBSKDFWL.js +0 -101
- package/dist/chunk-CXQ37WJH.js +0 -45
- package/dist/chunk-DXLUVUD4.js +0 -1490
- package/dist/chunk-DZK63TZJ.js +0 -1334
- package/dist/chunk-E7RF4KBO.js +0 -266
- package/dist/chunk-ECOMVOHP.js +0 -139
- package/dist/chunk-EHOSNVVM.js +0 -59
- package/dist/chunk-F5Z7EWMN.js +0 -4484
- package/dist/chunk-FQOOGXBH.js +0 -579
- package/dist/chunk-GLYBJ4RQ.js +0 -396
- package/dist/chunk-HHVJNVUJ.js +0 -179
- package/dist/chunk-HL26ADLH.js +0 -77
- package/dist/chunk-HPTJF6DG.js +0 -2465
- package/dist/chunk-HXHFDHB6.js +0 -962
- package/dist/chunk-HZ2T2YED.js +0 -1687
- package/dist/chunk-HZFBVU5X.js +0 -666
- package/dist/chunk-I2K2NCZQ.js +0 -659
- package/dist/chunk-IGLVVNEG.js +0 -402
- package/dist/chunk-IKRWLEDA.js +0 -1567
- package/dist/chunk-J2FYEQ5L.js +0 -33
- package/dist/chunk-JMPL7NUB.js +0 -108
- package/dist/chunk-K2HL3GBL.js +0 -998
- package/dist/chunk-KAFMW7WM.js +0 -386
- package/dist/chunk-KTFSFCVN.js +0 -46
- package/dist/chunk-LIN2K3EL.js +0 -66
- package/dist/chunk-LUL5Z66S.js +0 -221
- package/dist/chunk-LVFANMOH.js +0 -466
- package/dist/chunk-LY4N4TTL.js +0 -117
- package/dist/chunk-LZBMXNLP.js +0 -1196
- package/dist/chunk-M6TAYK66.js +0 -807
- package/dist/chunk-N2OKBREN.js +0 -243
- package/dist/chunk-NC4KV7EL.js +0 -39
- package/dist/chunk-NF3BK5WR.js +0 -42
- package/dist/chunk-NNWJYUNO.js +0 -573
- package/dist/chunk-NTK3WTHM.js +0 -141
- package/dist/chunk-ODUTYZIU.js +0 -688
- package/dist/chunk-OQM5IVJY.js +0 -1377
- package/dist/chunk-P5JMBPDJ.js +0 -7192
- package/dist/chunk-P5SC4DLJ.js +0 -47
- package/dist/chunk-P6M7RKMI.js +0 -97
- package/dist/chunk-PWWSIB2A.js +0 -52
- package/dist/chunk-PZN2LQY6.js +0 -674
- package/dist/chunk-Q7NNUHQV.js +0 -705
- package/dist/chunk-QCOV5DFY.js +0 -911
- package/dist/chunk-QNWRHOMF.js +0 -692
- package/dist/chunk-QRFXEO6Y.js +0 -17
- package/dist/chunk-QXFBABFJ.js +0 -380
- package/dist/chunk-RGZNQ5CT.js +0 -657
- package/dist/chunk-SRZOW5L2.js +0 -1865
- package/dist/chunk-SXQKNKRA.js +0 -223
- package/dist/chunk-T334FW2H.js +0 -362
- package/dist/chunk-T52TPHYC.js +0 -318
- package/dist/chunk-TJFDL26W.js +0 -658
- package/dist/chunk-TN5FW4XY.js +0 -172
- package/dist/chunk-U7H5WRG5.js +0 -123
- package/dist/chunk-UFYNOQK4.js +0 -302
- package/dist/chunk-URBGEOH3.js +0 -32
- package/dist/chunk-USZA7GWL.js +0 -341
- package/dist/chunk-UUQ5G6EZ.js +0 -697
- package/dist/chunk-VAHLPXPY.js +0 -399
- package/dist/chunk-VANN3GDP.js +0 -2488
- package/dist/chunk-VHMX7SXF.js +0 -1289
- package/dist/chunk-WJIMKGD6.js +0 -132
- package/dist/chunk-WKUYQBCG.js +0 -795
- package/dist/chunk-WNGF5AJX.js +0 -1911
- package/dist/chunk-WV6TDAPN.js +0 -3627
- package/dist/chunk-X3BI7HTV.js +0 -562
- package/dist/chunk-XWMSPJYN.js +0 -149
- package/dist/chunk-YPRSNUTC.js +0 -395
- package/dist/chunk-ZS43Y2FT.js +0 -438
- package/dist/clio-QQCMTUZE.js +0 -26
- package/dist/code-nav-GUPM6766.js +0 -686
- package/dist/components-TNIKXCBH.js +0 -674
- package/dist/config-IIM7YOD3.js +0 -621
- package/dist/configure-4ZM5HWJX.js +0 -73
- package/dist/context-44BZLJ3J.js +0 -344
- package/dist/context-AIDVQKMW.js +0 -278
- package/dist/context-OL5P3HEP.js +0 -1031
- package/dist/context-clear-OQV76MYP.js +0 -184
- package/dist/context-index-HP2JFUWA.js +0 -120
- package/dist/context-map-INTXD54D.js +0 -555
- package/dist/context-working-set-ZUW3EGLS.js +0 -1556
- package/dist/detail-UXPWRANG.js +0 -115
- package/dist/dispatch-runner-P3ZW6G77.js +0 -2438
- package/dist/docs-BL7ROUFN.js +0 -292
- package/dist/doctor-JJVGPZWT.js +0 -797
- package/dist/eval-V2RTN3UH.js +0 -4972
- package/dist/eval-inventory-QOYZERXJ.js +0 -315
- package/dist/evidence-35PYWGSO.js +0 -225
- package/dist/evidence-CIGGKI6J.js +0 -383
- package/dist/evolve-33SM3NJP.js +0 -609
- package/dist/extensions-YVRHX6ZI.js +0 -229
- package/dist/fleet-LFO7SIPC.js +0 -908
- package/dist/fleet-commands-RLK72GU3.js +0 -75
- package/dist/fleet-decisions-3SBSCTCW.js +0 -159
- package/dist/fleet-graph-JZIBCGMW.js +0 -134
- package/dist/fleet-inspect-2L5YGGZJ.js +0 -469
- package/dist/fleet-preflight-QRSHIIDE.js +0 -22
- package/dist/fleet-validate-LIAVKDUU.js +0 -92
- package/dist/fleet-verify-JIK3OQZR.js +0 -202
- package/dist/fleet-view-IWHYGQKK.js +0 -118
- package/dist/init-NJEDOTQW.js +0 -321
- package/dist/interop-RVCAYECG.js +0 -115
- package/dist/inventory-74UL7UHU.js +0 -118
- package/dist/library-CTKZA7K3.js +0 -226
- package/dist/memory-I76I5VUH.js +0 -512
- package/dist/models-D4YDIQZQ.js +0 -289
- package/dist/monitor-NKVD55HX.js +0 -775
- package/dist/orchestrator-I6OATVPK.js +0 -39518
- package/dist/panes-7BTYH3XQ.js +0 -103
- package/dist/panes-WPOMEMRH.js +0 -74
- package/dist/paths-J3KN7UAO.js +0 -67
- package/dist/preload-EJAWJEIO.js +0 -116
- package/dist/reset-4XMQKDNZ.js +0 -345
- package/dist/resources-TVYVXK3Q.js +0 -125
- package/dist/run-OWQNNSJU.js +0 -872
- package/dist/share-NPZZMUXG.js +0 -290
- package/dist/skills-OXFEAWMT.js +0 -510
- package/dist/skills-eval-J5TCKSJA.js +0 -1034
- package/dist/skills-inventory-7II4DM57.js +0 -133
- package/dist/slash-commands-MDSDSWYF.js +0 -92
- package/dist/steer-S7D7IKPU.js +0 -77
- package/dist/support-5VAEC32W.js +0 -38
- package/dist/targets-KILZEOCE.js +0 -1109
- package/dist/tasks-R6P6OV22.js +0 -36
- package/dist/terminal-lease-LZCG2KN3.js +0 -405
- package/dist/tools-6OCQ6SVB.js +0 -28
- package/dist/trace-JHLXWUMN.js +0 -572
- package/dist/tui-primitives-RCY2HN7G.js +0 -17
- package/dist/uninstall-FXYMFFRT.js +0 -407
- package/dist/upgrade-D2OZH6IQ.js +0 -307
- package/dist/usage-PIASNUS4.js +0 -1052
- package/dist/verifiers-LTHUY2PX.js +0 -630
- package/dist/verify-HYF7KBVE.js +0 -30
- package/dist/web-fetch-MQN4FH3X.js +0 -788
- package/dist/wiki-generate-RK7JQ5NP.js +0 -615
- package/dist/with-panes-OFTNAR4Y.js +0 -628
- package/skills/README.md +0 -418
- package/skills/coding/ast-grep/SKILL.md +0 -213
- package/skills/coding/ast-grep/evals.md +0 -82
- package/skills/coding/coding-standards/SKILL.md +0 -164
- package/skills/coding/coding-standards/evals.md +0 -57
- package/skills/coding/prototype/SKILL.md +0 -151
- package/skills/coding/prototype/evals.md +0 -61
- package/skills/coding/tdd/SKILL.md +0 -134
- package/skills/coding/tdd/evals.md +0 -61
- package/skills/context/context-handoff/SKILL.md +0 -176
- package/skills/context/context-handoff/evals.md +0 -101
- package/skills/context/context-prime/SKILL.md +0 -131
- package/skills/context/context-prime/evals.md +0 -99
- package/skills/git/branch-closeout/SKILL.md +0 -132
- package/skills/git/file-ticket/SKILL.md +0 -126
- package/skills/git/fix-issue/SKILL.md +0 -136
- package/skills/git/resolve-merge-conflicts/SKILL.md +0 -151
- package/skills/git/resolve-merge-conflicts/evals.md +0 -85
- package/skills/git/ship/SKILL.md +0 -134
- package/skills/git/worktree-create/SKILL.md +0 -127
- package/skills/git/worktree-merge/SKILL.md +0 -147
- package/skills/meta/clio-coder-dev/SKILL.md +0 -101
- package/skills/meta/clio-coder-dev/evals.md +0 -46
- package/skills/meta/clio-coder-test/SKILL.md +0 -146
- package/skills/meta/clio-coder-test/evals.md +0 -48
- package/skills/meta/clio-coder-test/references/test-map.md +0 -96
- package/skills/meta/credentials/SKILL.md +0 -132
- package/skills/meta/credentials/evals.md +0 -104
- package/skills/meta/find-skills/SKILL.md +0 -78
- package/skills/meta/find-skills/evals.md +0 -47
- package/skills/meta/herdr/SKILL.md +0 -133
- package/skills/meta/herdr/evals.md +0 -38
- package/skills/meta/skill-craft/SKILL.md +0 -125
- package/skills/meta/skill-craft/evals.md +0 -41
- package/skills/planning/archify/SKILL.md +0 -196
- package/skills/planning/architecture/SKILL.md +0 -184
- package/skills/planning/architecture/evals.md +0 -101
- package/skills/planning/backlog/SKILL.md +0 -212
- package/skills/planning/backlog/evals.md +0 -185
- package/skills/planning/prd/SKILL.md +0 -129
- package/skills/planning/prd/evals.md +0 -103
- package/skills/planning/product-intent/SKILL.md +0 -173
- package/skills/planning/product-intent/evals.md +0 -106
- package/skills/planning/tech-spec/SKILL.md +0 -172
- package/skills/planning/tech-spec/evals.md +0 -120
- package/skills/registry.yaml +0 -144
- package/skills/remote.yaml +0 -13
- package/skills/research/arxiv-literature/SKILL.md +0 -168
- package/skills/research/arxiv-literature/evals.md +0 -108
- package/skills/research/experiment-protocol/SKILL.md +0 -148
- package/skills/research/experiment-protocol/evals.md +0 -114
- package/skills/research/scientific-debugging/SKILL.md +0 -149
- package/skills/research/scientific-debugging/evals.md +0 -156
- package/skills/research/scientific-modernization/SKILL.md +0 -170
- package/skills/research/scientific-modernization/evals.md +0 -111
- package/skills/skill-marketplace.json +0 -507
- package/skills/workflow/cut-it/SKILL.md +0 -153
- package/skills/workflow/cut-it/evals.md +0 -143
- package/skills/workflow/design-council/SKILL.md +0 -233
- package/skills/workflow/design-council/evals.md +0 -258
- package/skills/workflow/grill-me/SKILL.md +0 -267
- package/skills/workflow/grill-me/evals.md +0 -231
- package/skills/workflow/workflow-distiller/SKILL.md +0 -201
- package/skills/workflow/workflow-distiller/evals.md +0 -225
- package/src/domains/extensions/resource-path.ts +0 -27
- package/src/domains/extensions/resources.ts +0 -37
- package/src/domains/lifecycle/migrations/2026-09-01-extension-install-digests.ts +0 -27
- package/src/interactive/overlays/agents.ts +0 -70
- package/src/interactive/overlays/library-install-confirm.ts +0 -152
- package/src/interactive/overlays/prompts.ts +0 -89
- package/src/interactive/overlays/skills-hub.ts +0 -615
- /package/{skills → library/skills}/coding/ast-grep/references/rule_reference.md +0 -0
- /package/{skills → library/skills}/coding/prototype/references/LOGIC.md +0 -0
- /package/{skills → library/skills}/coding/prototype/references/UI.md +0 -0
- /package/{skills → library/skills}/coding/tdd/references/mocking.md +0 -0
- /package/{skills → library/skills}/coding/tdd/references/tests.md +0 -0
- /package/{skills → library/skills}/context/context-handoff/scripts/new-handoff.sh +0 -0
- /package/{skills → library/skills}/git/branch-closeout/evals.md +0 -0
- /package/{skills → library/skills}/git/branch-closeout/references/closeout-checklist.md +0 -0
- /package/{skills → library/skills}/git/file-ticket/assets/issue-template.md +0 -0
- /package/{skills → library/skills}/git/file-ticket/evals.md +0 -0
- /package/{skills → library/skills}/git/file-ticket/references/issue-discovery.md +0 -0
- /package/{skills → library/skills}/git/fix-issue/evals.md +0 -0
- /package/{skills → library/skills}/git/fix-issue/references/diagnosis-and-rca.md +0 -0
- /package/{skills → library/skills}/git/resolve-merge-conflicts/references/conflict-matrix.md +0 -0
- /package/{skills → library/skills}/git/ship/assets/pr-template.md +0 -0
- /package/{skills → library/skills}/git/ship/evals.md +0 -0
- /package/{skills → library/skills}/git/ship/references/remote-and-branch-policy.md +0 -0
- /package/{skills → library/skills}/git/worktree-create/evals.md +0 -0
- /package/{skills → library/skills}/git/worktree-create/references/worktree-setup.md +0 -0
- /package/{skills → library/skills}/git/worktree-merge/evals.md +0 -0
- /package/{skills → library/skills}/git/worktree-merge/references/merge-strategies.md +0 -0
- /package/{skills → library/skills}/meta/clio-coder-test/references/harness.md +0 -0
- /package/{skills → library/skills}/planning/archify/evals.md +0 -0
|
@@ -0,0 +1,1726 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
readEvidenceIndex
|
|
4
|
+
} from "../chunk-XC5POIL4.js";
|
|
5
|
+
import {
|
|
6
|
+
listSessionsForCwd
|
|
7
|
+
} from "../chunk-K45LHSCI.js";
|
|
8
|
+
import {
|
|
9
|
+
TRACE_SCHEMA_VERSION,
|
|
10
|
+
TraceReader,
|
|
11
|
+
resolveTraceRetentionPolicy,
|
|
12
|
+
traceDatabasePath
|
|
13
|
+
} from "../chunk-GM4TY6VN.js";
|
|
14
|
+
import {
|
|
15
|
+
Id
|
|
16
|
+
} from "../chunk-KKRXONXG.js";
|
|
17
|
+
import {
|
|
18
|
+
runtimeInfo,
|
|
19
|
+
serveWorker,
|
|
20
|
+
toolchainAdapter
|
|
21
|
+
} from "../chunk-JOL2QRLE.js";
|
|
22
|
+
import "../chunk-32KJPXAM.js";
|
|
23
|
+
import "../chunk-5GZICIYO.js";
|
|
24
|
+
import {
|
|
25
|
+
restrictNetwork
|
|
26
|
+
} from "../chunk-AUHVBIDW.js";
|
|
27
|
+
import {
|
|
28
|
+
AppProblem
|
|
29
|
+
} from "../chunk-MZDPF35R.js";
|
|
30
|
+
import "../chunk-6R5MBXBJ.js";
|
|
31
|
+
import "../chunk-O3VV6IVK.js";
|
|
32
|
+
import "../chunk-EM2WNQS2.js";
|
|
33
|
+
import "../chunk-36XSBPXL.js";
|
|
34
|
+
import "../chunk-UHW5V7HC.js";
|
|
35
|
+
import "../chunk-DVJL77SO.js";
|
|
36
|
+
import "../chunk-KMF54VH3.js";
|
|
37
|
+
import {
|
|
38
|
+
value_exports
|
|
39
|
+
} from "../chunk-SER7RRAE.js";
|
|
40
|
+
import {
|
|
41
|
+
typebox_exports
|
|
42
|
+
} from "../chunk-GH5ZR6JP.js";
|
|
43
|
+
import "../chunk-TK2BMCBZ.js";
|
|
44
|
+
import "../chunk-XCUDZQLX.js";
|
|
45
|
+
import "../chunk-K2BLQC5E.js";
|
|
46
|
+
import {
|
|
47
|
+
clioStateDir
|
|
48
|
+
} from "../chunk-CTTI7G3T.js";
|
|
49
|
+
import "../chunk-ZZFWWYLX.js";
|
|
50
|
+
import {
|
|
51
|
+
resolvePackageRoot
|
|
52
|
+
} from "../chunk-E3LEPLQ2.js";
|
|
53
|
+
import {
|
|
54
|
+
init_esm_shims
|
|
55
|
+
} from "../chunk-ECBHH7LU.js";
|
|
56
|
+
|
|
57
|
+
// apps/clio-coder-web/server/worker/reads-main.ts
|
|
58
|
+
init_esm_shims();
|
|
59
|
+
import { workerData } from "node:worker_threads";
|
|
60
|
+
|
|
61
|
+
// apps/clio-coder-web/server/clio/adapters/docs.ts
|
|
62
|
+
init_esm_shims();
|
|
63
|
+
import { readdirSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
64
|
+
import { dirname, isAbsolute, posix, relative, resolve } from "node:path";
|
|
65
|
+
|
|
66
|
+
// node_modules/.pnpm/marked@18.0.11/node_modules/marked/lib/marked.esm.js
|
|
67
|
+
init_esm_shims();
|
|
68
|
+
function A() {
|
|
69
|
+
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
70
|
+
}
|
|
71
|
+
var R = A();
|
|
72
|
+
function j(l3) {
|
|
73
|
+
R = l3;
|
|
74
|
+
}
|
|
75
|
+
var z = { exec: () => null };
|
|
76
|
+
function I(l3) {
|
|
77
|
+
let e = [];
|
|
78
|
+
return (t) => {
|
|
79
|
+
let n = Math.max(0, Math.min(3, t - 1)), s = e[n];
|
|
80
|
+
return s || (s = l3(n), e[n] = s), s;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function k(l3, e = "") {
|
|
84
|
+
let t = typeof l3 == "string" ? l3 : l3.source, n = { replace: (s, r) => {
|
|
85
|
+
let i = typeof r == "string" ? r : r.source;
|
|
86
|
+
return i = i.replace(m.caret, "$1"), t = t.replace(s, i), n;
|
|
87
|
+
}, getRegex: () => new RegExp(t, e) };
|
|
88
|
+
return n;
|
|
89
|
+
}
|
|
90
|
+
var Oe = ((l3 = "") => {
|
|
91
|
+
try {
|
|
92
|
+
return !!new RegExp("(?<=1)(?<!1)" + l3);
|
|
93
|
+
} catch {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
})();
|
|
97
|
+
var m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l3) => new RegExp(`^( {0,3}${l3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: I((l3) => new RegExp(`^ {0,${l3}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: I((l3) => new RegExp(`^ {0,${l3}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: I((l3) => new RegExp(`^ {0,${l3}}(?:\`\`\`|~~~)`)), headingBeginRegex: I((l3) => new RegExp(`^ {0,${l3}}#`)), htmlBeginRegex: I((l3) => new RegExp(`^ {0,${l3}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: I((l3) => new RegExp(`^ {0,${l3}}>`)) };
|
|
98
|
+
var Te = /^(?:[ \t]*(?:\n|$))+/;
|
|
99
|
+
var we = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
|
|
100
|
+
var ye = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
|
|
101
|
+
var q = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
102
|
+
var Pe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
103
|
+
var U = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
|
|
104
|
+
var oe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
|
105
|
+
var ae = k(oe).replace(/bull/g, U).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
|
|
106
|
+
var Se = k(oe).replace(/bull/g, U).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
|
|
107
|
+
var K = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
|
|
108
|
+
var _e = /^[^\n]+/;
|
|
109
|
+
var W = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
|
|
110
|
+
var $e = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", W).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
|
|
111
|
+
var Le = k(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, U).getRegex();
|
|
112
|
+
var Q = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
|
|
113
|
+
var X = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
|
|
114
|
+
var Ee = k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", X).replace("tag", Q).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
|
|
115
|
+
var le = (l3) => k(K).replace("hr", q).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", l3).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Q).getRegex();
|
|
116
|
+
var ze = le(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
|
|
117
|
+
var Me = le(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
|
|
118
|
+
var Ae = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Me).getRegex();
|
|
119
|
+
var J = { blockquote: Ae, code: we, def: $e, fences: ye, heading: Pe, hr: q, html: Ee, lheading: ae, list: Le, newline: Te, paragraph: ze, table: z, text: _e };
|
|
120
|
+
var se = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", q).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Q).getRegex();
|
|
121
|
+
var Ie = { ...J, lheading: Se, table: se, paragraph: k(K).replace("hr", q).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", se).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Q).getRegex() };
|
|
122
|
+
var Ce = { ...J, html: k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", X).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: z, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: k(K).replace("hr", q).replace("heading", ` *#{1,6} *[^
|
|
123
|
+
]`).replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
|
|
124
|
+
var Be = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
|
|
125
|
+
var De = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
|
|
126
|
+
var ue = /^( {2,}|\\)\n(?!\s*$)/;
|
|
127
|
+
var qe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
|
|
128
|
+
var _ = /[\p{P}\p{S}]/u;
|
|
129
|
+
var C = /[\s\p{P}\p{S}]/u;
|
|
130
|
+
var v = /[^\s\p{P}\p{S}]/u;
|
|
131
|
+
var ve = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, C).getRegex();
|
|
132
|
+
var He = /[\p{Pi}\p{Ps}"']/u;
|
|
133
|
+
var pe = /(?!~)[\p{P}\p{S}]/u;
|
|
134
|
+
var Ze = /(?!~)[\s\p{P}\p{S}]/u;
|
|
135
|
+
var Ge = /(?:[^\s\p{P}\p{S}]|~)/u;
|
|
136
|
+
var Qe = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Oe ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
|
|
137
|
+
var ce = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
|
|
138
|
+
var Ne = k(ce, "u").replace(/punct/g, _).getRegex();
|
|
139
|
+
var je = k(ce, "u").replace(/punct/g, pe).getRegex();
|
|
140
|
+
var Fe = /^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/;
|
|
141
|
+
var Ue = k(Fe, "u").replace(/openQuote/g, He).replace(/punct/g, _).getRegex();
|
|
142
|
+
var he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
|
|
143
|
+
var Ke = k(he, "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, C).replace(/punct/g, _).getRegex();
|
|
144
|
+
var We = k(he, "gu").replace(/notPunctSpace/g, Ge).replace(/punctSpace/g, Ze).replace(/punct/g, pe).getRegex();
|
|
145
|
+
var Xe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)";
|
|
146
|
+
var Je = k(Xe, "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, C).replace(/punct/g, _).getRegex();
|
|
147
|
+
var Ve = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, C).replace(/punct/g, _).getRegex();
|
|
148
|
+
var Ye = "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)";
|
|
149
|
+
var et = k(Ye, "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, C).replace(/punct/g, _).getRegex();
|
|
150
|
+
var tt = k(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, _).getRegex();
|
|
151
|
+
var nt = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
|
|
152
|
+
var rt = k(nt, "gu").replace(/notPunctSpace/g, v).replace(/punctSpace/g, C).replace(/punct/g, _).getRegex();
|
|
153
|
+
var st = k(/\\(punct)/, "gu").replace(/punct/g, _).getRegex();
|
|
154
|
+
var it = k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
|
|
155
|
+
var ot = k(X).replace("(?:-->|$)", "-->").getRegex();
|
|
156
|
+
var at = k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", ot).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
|
|
157
|
+
var G = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/;
|
|
158
|
+
var lt = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", G).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
|
|
159
|
+
var ke = k(/^!?\[(label)\]\[(ref)\]/).replace("label", G).replace("ref", W).getRegex();
|
|
160
|
+
var de = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", W).getRegex();
|
|
161
|
+
var ut = k("reflink|nolink(?!\\()", "g").replace("reflink", ke).replace("nolink", de).getRegex();
|
|
162
|
+
var ie = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
|
|
163
|
+
var V = { _backpedal: z, anyPunctuation: st, autolink: it, blockSkip: Qe, br: ue, code: De, del: z, delLDelim: z, delRDelim: z, emStrongLDelim: Ne, emStrongRDelimAst: Ke, emStrongRDelimUnd: Ve, escape: Be, link: lt, nolink: de, punctuation: ve, reflink: ke, reflinkSearch: ut, tag: at, text: qe, url: z };
|
|
164
|
+
var pt = { ...V, emStrongLDelim: Ue, emStrongRDelimAst: Je, emStrongRDelimUnd: et, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", G).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", G).getRegex() };
|
|
165
|
+
var F = { ...V, emStrongRDelimAst: We, emStrongLDelim: je, delLDelim: tt, delRDelim: rt, url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ie).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: k(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ie).getRegex() };
|
|
166
|
+
var ct = { ...F, br: k(ue).replace("{2,}", "*").getRegex(), text: k(F.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
|
|
167
|
+
var H = { normal: J, gfm: Ie, pedantic: Ce };
|
|
168
|
+
var B = { normal: V, gfm: F, breaks: ct, pedantic: pt };
|
|
169
|
+
var ht = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
170
|
+
var ge = (l3) => ht[l3];
|
|
171
|
+
function T(l3, e) {
|
|
172
|
+
if (e) {
|
|
173
|
+
if (m.escapeTest.test(l3)) return l3.replace(m.escapeReplace, ge);
|
|
174
|
+
} else if (m.escapeTestNoEncode.test(l3)) return l3.replace(m.escapeReplaceNoEncode, ge);
|
|
175
|
+
return l3;
|
|
176
|
+
}
|
|
177
|
+
function Y(l3) {
|
|
178
|
+
try {
|
|
179
|
+
l3 = encodeURI(l3).replace(m.percentDecode, "%");
|
|
180
|
+
} catch {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
return l3;
|
|
184
|
+
}
|
|
185
|
+
function ee(l3, e) {
|
|
186
|
+
let t = l3.replace(m.findPipe, (r, i, o) => {
|
|
187
|
+
let u = false, a = i;
|
|
188
|
+
for (; --a >= 0 && o[a] === "\\"; ) u = !u;
|
|
189
|
+
return u ? "|" : " |";
|
|
190
|
+
}), n = t.split(m.splitPipe), s = 0;
|
|
191
|
+
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
|
|
192
|
+
else for (; n.length < e; ) n.push("");
|
|
193
|
+
for (; s < n.length; s++) n[s] = n[s].trim().replace(m.slashPipe, "|");
|
|
194
|
+
return n;
|
|
195
|
+
}
|
|
196
|
+
function $(l3, e, t) {
|
|
197
|
+
let n = l3.length;
|
|
198
|
+
if (n === 0) return "";
|
|
199
|
+
let s = 0;
|
|
200
|
+
for (; s < n; ) {
|
|
201
|
+
let r = l3.charAt(n - s - 1);
|
|
202
|
+
if (r === e && !t) s++;
|
|
203
|
+
else if (r !== e && t) s++;
|
|
204
|
+
else break;
|
|
205
|
+
}
|
|
206
|
+
return l3.slice(0, n - s);
|
|
207
|
+
}
|
|
208
|
+
function te(l3) {
|
|
209
|
+
let e = l3.split(`
|
|
210
|
+
`), t = e.length - 1;
|
|
211
|
+
for (; t >= 0 && m.blankLine.test(e[t]); ) t--;
|
|
212
|
+
return e.length - t <= 2 ? l3 : e.slice(0, t + 1).join(`
|
|
213
|
+
`);
|
|
214
|
+
}
|
|
215
|
+
function fe(l3, e) {
|
|
216
|
+
if (l3.indexOf(e[1]) === -1) return -1;
|
|
217
|
+
let t = 0;
|
|
218
|
+
for (let n = 0; n < l3.length; n++) if (l3[n] === "\\") n++;
|
|
219
|
+
else if (l3[n] === e[0]) t++;
|
|
220
|
+
else if (l3[n] === e[1] && (t--, t < 0)) return n;
|
|
221
|
+
return t > 0 ? -2 : -1;
|
|
222
|
+
}
|
|
223
|
+
function me(l3, e = 0) {
|
|
224
|
+
let t = e, n = "";
|
|
225
|
+
for (let s of l3) if (s === " ") {
|
|
226
|
+
let r = 4 - t % 4;
|
|
227
|
+
n += " ".repeat(r), t += r;
|
|
228
|
+
} else n += s, t++;
|
|
229
|
+
return n;
|
|
230
|
+
}
|
|
231
|
+
function xe(l3, e, t, n, s) {
|
|
232
|
+
let r = e.href, i = e.title || null, o = l3[1].replace(s.other.outputLinkReplace, "$1"), u = l3[0].charAt(0) === "!";
|
|
233
|
+
n.state.inLink = true;
|
|
234
|
+
let a = n.state.linkEmitted, p = n.state.inRawBlock;
|
|
235
|
+
n.state.linkEmitted = false;
|
|
236
|
+
let c = n.inlineTokens(o), h = n.state.linkEmitted;
|
|
237
|
+
if (n.state.linkEmitted = a, n.state.inLink = false, !u) {
|
|
238
|
+
if (h) {
|
|
239
|
+
n.state.inRawBlock = p;
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
n.state.linkEmitted = true;
|
|
243
|
+
}
|
|
244
|
+
return { type: u ? "image" : "link", raw: t, href: r, title: i, text: o, tokens: c };
|
|
245
|
+
}
|
|
246
|
+
function kt(l3, e, t) {
|
|
247
|
+
let n = l3.match(t.other.indentCodeCompensation);
|
|
248
|
+
if (n === null) return e;
|
|
249
|
+
let s = n[1];
|
|
250
|
+
return e.split(`
|
|
251
|
+
`).map((r) => {
|
|
252
|
+
let i = r.match(t.other.beginningSpace);
|
|
253
|
+
if (i === null) return r;
|
|
254
|
+
let [o] = i;
|
|
255
|
+
return o.length >= s.length ? r.slice(s.length) : r;
|
|
256
|
+
}).join(`
|
|
257
|
+
`);
|
|
258
|
+
}
|
|
259
|
+
var y = class {
|
|
260
|
+
options;
|
|
261
|
+
rules;
|
|
262
|
+
lexer;
|
|
263
|
+
constructor(e) {
|
|
264
|
+
this.options = e || R;
|
|
265
|
+
}
|
|
266
|
+
space(e) {
|
|
267
|
+
let t = this.rules.block.newline.exec(e);
|
|
268
|
+
if (t && t[0].length > 0) return { type: "space", raw: t[0] };
|
|
269
|
+
}
|
|
270
|
+
code(e) {
|
|
271
|
+
let t = this.rules.block.code.exec(e);
|
|
272
|
+
if (t) {
|
|
273
|
+
let n = this.options.pedantic ? t[0] : te(t[0]), s = n.replace(this.rules.other.codeRemoveIndent, "");
|
|
274
|
+
return { type: "code", raw: n, codeBlockStyle: "indented", text: s };
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
fences(e) {
|
|
278
|
+
let t = this.rules.block.fences.exec(e);
|
|
279
|
+
if (t) {
|
|
280
|
+
let n = t[0], s = kt(n, t[3] || "", this.rules);
|
|
281
|
+
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: s };
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
heading(e) {
|
|
285
|
+
let t = this.rules.block.heading.exec(e);
|
|
286
|
+
if (t) {
|
|
287
|
+
let n = t[2].trim();
|
|
288
|
+
if (this.rules.other.endingHash.test(n)) {
|
|
289
|
+
let s = $(n, "#");
|
|
290
|
+
(this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (n = s.trim());
|
|
291
|
+
}
|
|
292
|
+
return { type: "heading", raw: $(t[0], `
|
|
293
|
+
`), depth: t[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
hr(e) {
|
|
297
|
+
let t = this.rules.block.hr.exec(e);
|
|
298
|
+
if (t) return { type: "hr", raw: $(t[0], `
|
|
299
|
+
`) };
|
|
300
|
+
}
|
|
301
|
+
blockquote(e) {
|
|
302
|
+
let t = this.rules.block.blockquote.exec(e);
|
|
303
|
+
if (t) {
|
|
304
|
+
let n = $(t[0], `
|
|
305
|
+
`).split(`
|
|
306
|
+
`), s = "", r = "", i = [];
|
|
307
|
+
for (; n.length > 0; ) {
|
|
308
|
+
let o = false, u = [], a;
|
|
309
|
+
for (a = 0; a < n.length; a++) if (this.rules.other.blockquoteStart.test(n[a])) u.push(n[a]), o = true;
|
|
310
|
+
else if (!o) u.push(n[a]);
|
|
311
|
+
else break;
|
|
312
|
+
n = n.slice(a);
|
|
313
|
+
let p = u.join(`
|
|
314
|
+
`), c = p.replace(this.rules.other.blockquoteSetextReplace, `
|
|
315
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
316
|
+
s = s ? `${s}
|
|
317
|
+
${p}` : p, r = r ? `${r}
|
|
318
|
+
${c}` : c;
|
|
319
|
+
let h = this.lexer.state.top;
|
|
320
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(c, i, true), this.lexer.state.top = h, n.length === 0) break;
|
|
321
|
+
let d = i.at(-1);
|
|
322
|
+
if (d?.type === "code") break;
|
|
323
|
+
if (d?.type === "blockquote") {
|
|
324
|
+
let O = d, g = n.join(`
|
|
325
|
+
`), w = O.raw + `
|
|
326
|
+
` + g.replace(this.rules.other.blockquoteSetextReplace2, ""), E = this.blockquote(w);
|
|
327
|
+
i[i.length - 1] = E, s = `${s}
|
|
328
|
+
${g}`, r = r.substring(0, r.length - O.text.length) + E.text;
|
|
329
|
+
break;
|
|
330
|
+
} else if (d?.type === "list") {
|
|
331
|
+
let O = d, g = O.raw + `
|
|
332
|
+
` + n.join(`
|
|
333
|
+
`), w = this.list(g);
|
|
334
|
+
i[i.length - 1] = w, s = s.substring(0, s.length - d.raw.length) + w.raw, r = r.substring(0, r.length - O.raw.length) + w.raw, n = g.substring(i.at(-1).raw.length).split(`
|
|
335
|
+
`);
|
|
336
|
+
continue;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return { type: "blockquote", raw: s, tokens: i, text: r };
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
list(e) {
|
|
343
|
+
let t = this.rules.block.list.exec(e);
|
|
344
|
+
if (t) {
|
|
345
|
+
let n = t[1].trim(), s = n.length > 1, r = { type: "list", raw: "", ordered: s, start: s ? +n.slice(0, -1) : "", loose: false, items: [] };
|
|
346
|
+
n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
|
|
347
|
+
let i = this.rules.other.listItemRegex(n), o = false;
|
|
348
|
+
for (; e; ) {
|
|
349
|
+
let a = false, p = "", c = "";
|
|
350
|
+
if (!(t = i.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
351
|
+
p = t[0], e = e.substring(p.length);
|
|
352
|
+
let h = me(t[2].split(`
|
|
353
|
+
`, 1)[0], t[1].length), d = e.split(`
|
|
354
|
+
`, 1)[0], O = !h.trim(), g = 0;
|
|
355
|
+
if (this.options.pedantic ? (g = 2, c = h.trimStart()) : O ? g = t[1].length + 1 : (g = h.search(this.rules.other.nonSpaceChar), g = g > 4 ? 1 : g, c = h.slice(g), g += t[1].length), O && this.rules.other.blankLine.test(d) && (p += d + `
|
|
356
|
+
`, e = e.substring(d.length + 1), a = true), !a) {
|
|
357
|
+
let w = this.rules.other.nextBulletRegex(g), E = this.rules.other.hrRegex(g), ne = this.rules.other.fencesBeginRegex(g), re = this.rules.other.headingBeginRegex(g), be = this.rules.other.htmlBeginRegex(g), Re = this.rules.other.blockquoteBeginRegex(g);
|
|
358
|
+
for (; e; ) {
|
|
359
|
+
let N = e.split(`
|
|
360
|
+
`, 1)[0], D;
|
|
361
|
+
if (d = N, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), D = d) : D = d.replace(this.rules.other.tabCharGlobal, " "), ne.test(d) || re.test(d) || be.test(d) || Re.test(d) || w.test(d) || E.test(d)) break;
|
|
362
|
+
if (D.search(this.rules.other.nonSpaceChar) >= g || !d.trim()) c += `
|
|
363
|
+
` + D.slice(g);
|
|
364
|
+
else {
|
|
365
|
+
if (O || h.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ne.test(h) || re.test(h) || E.test(h)) break;
|
|
366
|
+
c += `
|
|
367
|
+
` + d;
|
|
368
|
+
}
|
|
369
|
+
O = !d.trim(), p += N + `
|
|
370
|
+
`, e = e.substring(N.length + 1), h = D.slice(g);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
r.loose || (o ? r.loose = true : this.rules.other.doubleBlankLine.test(p) && (o = true)), r.items.push({ type: "list_item", raw: p, task: !!this.options.gfm && this.rules.other.listIsTask.test(c), loose: false, text: c, tokens: [] }), r.raw += p;
|
|
374
|
+
}
|
|
375
|
+
let u = r.items.at(-1);
|
|
376
|
+
if (u) u.raw = u.raw.trimEnd(), u.text = u.text.trimEnd();
|
|
377
|
+
else return;
|
|
378
|
+
r.raw = r.raw.trimEnd();
|
|
379
|
+
for (let a of r.items) if (this.lexer.state.top = false, a.tokens = this.lexer.blockTokens(a.text, []), !r.loose) {
|
|
380
|
+
let p = a.tokens.filter((h) => h.type === "space"), c = p.length > 0 && p.some((h) => this.rules.other.anyLine.test(h.raw));
|
|
381
|
+
r.loose = c;
|
|
382
|
+
}
|
|
383
|
+
for (let a of r.items) {
|
|
384
|
+
let p = a.tokens[0];
|
|
385
|
+
if (a.task && (p?.type === "text" || p?.type === "paragraph")) {
|
|
386
|
+
a.text = a.text.replace(this.rules.other.listReplaceTask, ""), p.raw = p.raw.replace(this.rules.other.listReplaceTask, ""), p.text = p.text.replace(this.rules.other.listReplaceTask, "");
|
|
387
|
+
for (let h = this.lexer.inlineQueue.length - 1; h >= 0; h--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)) {
|
|
388
|
+
this.lexer.inlineQueue[h].src = this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask, "");
|
|
389
|
+
break;
|
|
390
|
+
}
|
|
391
|
+
let c = this.rules.other.listTaskCheckbox.exec(a.raw);
|
|
392
|
+
if (c) {
|
|
393
|
+
let h = { type: "checkbox", raw: c[0] + " ", checked: c[0] !== "[ ]" };
|
|
394
|
+
a.checked = h.checked, r.loose ? a.tokens[0] && ["paragraph", "text"].includes(a.tokens[0].type) && "tokens" in a.tokens[0] && a.tokens[0].tokens ? (a.tokens[0].raw = h.raw + a.tokens[0].raw, a.tokens[0].text = h.raw + a.tokens[0].text, a.tokens[0].tokens.unshift(h)) : a.tokens.unshift({ type: "paragraph", raw: h.raw, text: h.raw, tokens: [h] }) : a.tokens.unshift(h);
|
|
395
|
+
}
|
|
396
|
+
} else a.task && (a.task = false);
|
|
397
|
+
}
|
|
398
|
+
if (r.loose) for (let a of r.items) {
|
|
399
|
+
a.loose = true;
|
|
400
|
+
for (let p of a.tokens) p.type === "text" && (p.type = "paragraph");
|
|
401
|
+
}
|
|
402
|
+
return r;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
html(e) {
|
|
406
|
+
let t = this.rules.block.html.exec(e);
|
|
407
|
+
if (t) {
|
|
408
|
+
let n = te(t[0]);
|
|
409
|
+
return { type: "html", block: true, raw: n, pre: t[1] === "pre" || t[1] === "script" || t[1] === "style", text: n };
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
def(e) {
|
|
413
|
+
let t = this.rules.block.def.exec(e);
|
|
414
|
+
if (t) {
|
|
415
|
+
let n = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
|
|
416
|
+
return { type: "def", tag: n, raw: $(t[0], `
|
|
417
|
+
`), href: s, title: r };
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
table(e) {
|
|
421
|
+
let t = this.rules.block.table.exec(e);
|
|
422
|
+
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
423
|
+
let n = ee(t[1]), s = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
424
|
+
`) : [], i = { type: "table", raw: $(t[0], `
|
|
425
|
+
`), header: [], align: [], rows: [] };
|
|
426
|
+
if (n.length === s.length) {
|
|
427
|
+
for (let o of s) this.rules.other.tableAlignRight.test(o) ? i.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? i.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? i.align.push("left") : i.align.push(null);
|
|
428
|
+
for (let o = 0; o < n.length; o++) i.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: true, align: i.align[o] });
|
|
429
|
+
for (let o of r) i.rows.push(ee(o, i.header.length).map((u, a) => ({ text: u, tokens: this.lexer.inline(u), header: false, align: i.align[a] })));
|
|
430
|
+
return i;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
lheading(e) {
|
|
434
|
+
let t = this.rules.block.lheading.exec(e);
|
|
435
|
+
if (t) {
|
|
436
|
+
let n = t[1].trim();
|
|
437
|
+
return { type: "heading", raw: $(t[0], `
|
|
438
|
+
`), depth: t[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
paragraph(e) {
|
|
442
|
+
let t = this.rules.block.paragraph.exec(e);
|
|
443
|
+
if (t) {
|
|
444
|
+
let n = t[1].charAt(t[1].length - 1) === `
|
|
445
|
+
` ? t[1].slice(0, -1) : t[1];
|
|
446
|
+
return { type: "paragraph", raw: t[0], text: n, tokens: this.lexer.inline(n) };
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
text(e) {
|
|
450
|
+
let t = this.rules.block.text.exec(e);
|
|
451
|
+
if (t) return { type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0]) };
|
|
452
|
+
}
|
|
453
|
+
escape(e) {
|
|
454
|
+
let t = this.rules.inline.escape.exec(e);
|
|
455
|
+
if (t) return { type: "escape", raw: t[0], text: t[1] };
|
|
456
|
+
}
|
|
457
|
+
tag(e) {
|
|
458
|
+
let t = this.rules.inline.tag.exec(e);
|
|
459
|
+
if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t[0] };
|
|
460
|
+
}
|
|
461
|
+
link(e) {
|
|
462
|
+
let t = this.rules.inline.link.exec(e);
|
|
463
|
+
if (t) {
|
|
464
|
+
let n = t[2].trim();
|
|
465
|
+
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
466
|
+
if (!this.rules.other.endAngleBracket.test(n)) return;
|
|
467
|
+
let i = $(n.slice(0, -1), "\\");
|
|
468
|
+
if ((n.length - i.length) % 2 === 0) return;
|
|
469
|
+
} else {
|
|
470
|
+
let i = fe(t[2], "()");
|
|
471
|
+
if (i === -2) return;
|
|
472
|
+
if (i > -1) {
|
|
473
|
+
let u = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + i;
|
|
474
|
+
t[2] = t[2].substring(0, i), t[0] = t[0].substring(0, u).trim(), t[3] = "";
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
let s = t[2], r = "";
|
|
478
|
+
if (this.options.pedantic) {
|
|
479
|
+
let i = this.rules.other.pedanticHrefTitle.exec(s);
|
|
480
|
+
i && (s = i[1], r = i[3]);
|
|
481
|
+
} else r = t[3] ? t[3].slice(1, -1) : "";
|
|
482
|
+
return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? s = s.slice(1) : s = s.slice(1, -1)), xe(t, { href: s && s.replace(this.rules.inline.anyPunctuation, "$1"), title: r && r.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
reflink(e, t) {
|
|
486
|
+
let n;
|
|
487
|
+
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
488
|
+
let s = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), r = t[s.toLowerCase()];
|
|
489
|
+
if (!r) {
|
|
490
|
+
let i = n[0].charAt(0);
|
|
491
|
+
return { type: "text", raw: i, text: i };
|
|
492
|
+
}
|
|
493
|
+
return xe(n, r, n[0], this.lexer, this.rules);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
emStrong(e, t, n = "") {
|
|
497
|
+
let s = this.rules.inline.emStrongLDelim.exec(e);
|
|
498
|
+
if (!s || !s[1] && !s[2] && !s[3] && !s[4] || s[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
|
|
499
|
+
if (!(s[1] || s[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
500
|
+
let i = [...s[0]].length - 1, o, u, a = i, p = 0, c = s[0][0], h = n === c, d = c === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
501
|
+
for (d.lastIndex = 0, t = t.slice(-1 * e.length + i); (s = d.exec(t)) !== null; ) {
|
|
502
|
+
if (o = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !o) continue;
|
|
503
|
+
if (u = [...o].length, s[3] || s[4]) {
|
|
504
|
+
a += u;
|
|
505
|
+
continue;
|
|
506
|
+
} else if (s[5] || s[6]) {
|
|
507
|
+
if (i % 3 && !((i + u) % 3)) {
|
|
508
|
+
p += u;
|
|
509
|
+
continue;
|
|
510
|
+
}
|
|
511
|
+
if (h) break;
|
|
512
|
+
}
|
|
513
|
+
if (a -= u, a > 0) continue;
|
|
514
|
+
u = Math.min(u, u + a + p);
|
|
515
|
+
let O = [...s[0]][0].length, g = e.slice(0, i + s.index + O + u);
|
|
516
|
+
if (Math.min(i, u) % 2) {
|
|
517
|
+
let E = g.slice(1, -1);
|
|
518
|
+
return { type: "em", raw: g, text: E, tokens: this.lexer.inlineTokens(E) };
|
|
519
|
+
}
|
|
520
|
+
let w = g.slice(2, -2);
|
|
521
|
+
return { type: "strong", raw: g, text: w, tokens: this.lexer.inlineTokens(w) };
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
codespan(e) {
|
|
526
|
+
let t = this.rules.inline.code.exec(e);
|
|
527
|
+
if (t) {
|
|
528
|
+
let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(n), r = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
|
|
529
|
+
return s && r && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t[0], text: n };
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
br(e) {
|
|
533
|
+
let t = this.rules.inline.br.exec(e);
|
|
534
|
+
if (t) return { type: "br", raw: t[0] };
|
|
535
|
+
}
|
|
536
|
+
del(e, t, n = "") {
|
|
537
|
+
let s = this.rules.inline.delLDelim.exec(e);
|
|
538
|
+
if (!s) return;
|
|
539
|
+
if (!(s[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
540
|
+
let i = [...s[0]].length - 1, o, u, a = i, p = this.rules.inline.delRDelim;
|
|
541
|
+
for (p.lastIndex = 0, t = t.slice(-1 * e.length + i); (s = p.exec(t)) !== null; ) {
|
|
542
|
+
if (o = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !o || (u = [...o].length, u !== i)) continue;
|
|
543
|
+
if (s[3] || s[4]) {
|
|
544
|
+
a += u;
|
|
545
|
+
continue;
|
|
546
|
+
}
|
|
547
|
+
if (a -= u, a > 0) continue;
|
|
548
|
+
u = Math.min(u, u + a);
|
|
549
|
+
let c = [...s[0]][0].length, h = e.slice(0, i + s.index + c + u), d = h.slice(i, -i);
|
|
550
|
+
return { type: "del", raw: h, text: d, tokens: this.lexer.inlineTokens(d) };
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
autolink(e) {
|
|
555
|
+
let t = this.rules.inline.autolink.exec(e);
|
|
556
|
+
if (t) {
|
|
557
|
+
let n, s;
|
|
558
|
+
return t[2] === "@" ? (n = t[1], s = "mailto:" + n) : (n = t[1], s = n), { type: "link", raw: t[0], text: n, href: s, tokens: [{ type: "text", raw: n, text: n }] };
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
url(e) {
|
|
562
|
+
let t;
|
|
563
|
+
if (t = this.rules.inline.url.exec(e)) {
|
|
564
|
+
let n, s;
|
|
565
|
+
if (t[2] === "@") n = t[0], s = "mailto:" + n;
|
|
566
|
+
else {
|
|
567
|
+
let r;
|
|
568
|
+
do
|
|
569
|
+
r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
|
|
570
|
+
while (r !== t[0]);
|
|
571
|
+
n = t[0], t[1] === "www." ? s = "http://" + t[0] : s = t[0];
|
|
572
|
+
}
|
|
573
|
+
return { type: "link", raw: t[0], text: n, href: s, tokens: [{ type: "text", raw: n, text: n }] };
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
inlineText(e) {
|
|
577
|
+
let t = this.rules.inline.text.exec(e);
|
|
578
|
+
if (t) {
|
|
579
|
+
let n = this.lexer.state.inRawBlock;
|
|
580
|
+
return { type: "text", raw: t[0], text: t[0], escaped: n };
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
};
|
|
584
|
+
var x = class l {
|
|
585
|
+
tokens;
|
|
586
|
+
options;
|
|
587
|
+
state;
|
|
588
|
+
inlineQueue;
|
|
589
|
+
tokenizer;
|
|
590
|
+
constructor(e) {
|
|
591
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || R, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, linkEmitted: false, top: true };
|
|
592
|
+
let t = { other: m, block: H.normal, inline: B.normal };
|
|
593
|
+
this.options.pedantic ? (t.block = H.pedantic, t.inline = B.pedantic) : this.options.gfm && (t.block = H.gfm, this.options.breaks ? t.inline = B.breaks : t.inline = B.gfm), this.tokenizer.rules = t;
|
|
594
|
+
}
|
|
595
|
+
static get rules() {
|
|
596
|
+
return { block: H, inline: B };
|
|
597
|
+
}
|
|
598
|
+
static lex(e, t) {
|
|
599
|
+
return new l(t).lex(e);
|
|
600
|
+
}
|
|
601
|
+
static lexInline(e, t) {
|
|
602
|
+
return new l(t).inlineTokens(e);
|
|
603
|
+
}
|
|
604
|
+
lex(e) {
|
|
605
|
+
e = e.replace(m.carriageReturn, `
|
|
606
|
+
`), this.blockTokens(e, this.tokens);
|
|
607
|
+
for (let t = 0; t < this.inlineQueue.length; t++) {
|
|
608
|
+
let n = this.inlineQueue[t];
|
|
609
|
+
this.inlineTokens(n.src, n.tokens);
|
|
610
|
+
}
|
|
611
|
+
return this.inlineQueue = [], this.tokens;
|
|
612
|
+
}
|
|
613
|
+
blockTokens(e, t = [], n = false) {
|
|
614
|
+
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, ""));
|
|
615
|
+
let s = 1 / 0;
|
|
616
|
+
for (; e; ) {
|
|
617
|
+
if (e.length < s) s = e.length;
|
|
618
|
+
else {
|
|
619
|
+
this.infiniteLoopError(e.charCodeAt(0));
|
|
620
|
+
break;
|
|
621
|
+
}
|
|
622
|
+
let r;
|
|
623
|
+
if (this.options.extensions?.block?.some((o) => (r = o.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), true) : false)) continue;
|
|
624
|
+
if (r = this.tokenizer.space(e)) {
|
|
625
|
+
e = e.substring(r.raw.length);
|
|
626
|
+
let o = t.at(-1);
|
|
627
|
+
r.raw.length === 1 && o !== void 0 ? o.raw += `
|
|
628
|
+
` : t.push(r);
|
|
629
|
+
continue;
|
|
630
|
+
}
|
|
631
|
+
if (r = this.tokenizer.code(e)) {
|
|
632
|
+
e = e.substring(r.raw.length);
|
|
633
|
+
let o = t.at(-1);
|
|
634
|
+
o?.type === "paragraph" || o?.type === "text" ? (o.raw += (o.raw.endsWith(`
|
|
635
|
+
`) ? "" : `
|
|
636
|
+
`) + r.raw, o.text += `
|
|
637
|
+
` + r.text, this.inlineQueue.at(-1).src = o.text) : t.push(r);
|
|
638
|
+
continue;
|
|
639
|
+
}
|
|
640
|
+
if (r = this.tokenizer.fences(e)) {
|
|
641
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
642
|
+
continue;
|
|
643
|
+
}
|
|
644
|
+
if (r = this.tokenizer.heading(e)) {
|
|
645
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
646
|
+
continue;
|
|
647
|
+
}
|
|
648
|
+
if (r = this.tokenizer.hr(e)) {
|
|
649
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
650
|
+
continue;
|
|
651
|
+
}
|
|
652
|
+
if (r = this.tokenizer.blockquote(e)) {
|
|
653
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
654
|
+
continue;
|
|
655
|
+
}
|
|
656
|
+
if (r = this.tokenizer.list(e)) {
|
|
657
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
658
|
+
continue;
|
|
659
|
+
}
|
|
660
|
+
if (r = this.tokenizer.html(e)) {
|
|
661
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
662
|
+
continue;
|
|
663
|
+
}
|
|
664
|
+
if (r = this.tokenizer.def(e)) {
|
|
665
|
+
e = e.substring(r.raw.length);
|
|
666
|
+
let o = t.at(-1);
|
|
667
|
+
o?.type === "paragraph" || o?.type === "text" ? (o.raw += (o.raw.endsWith(`
|
|
668
|
+
`) ? "" : `
|
|
669
|
+
`) + r.raw, o.text += `
|
|
670
|
+
` + r.raw, this.inlineQueue.at(-1).src = o.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = { href: r.href, title: r.title }, t.push(r));
|
|
671
|
+
continue;
|
|
672
|
+
}
|
|
673
|
+
if (r = this.tokenizer.table(e)) {
|
|
674
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
675
|
+
continue;
|
|
676
|
+
}
|
|
677
|
+
if (r = this.tokenizer.lheading(e)) {
|
|
678
|
+
e = e.substring(r.raw.length), t.push(r);
|
|
679
|
+
continue;
|
|
680
|
+
}
|
|
681
|
+
let i = e;
|
|
682
|
+
if (this.options.extensions?.startBlock) {
|
|
683
|
+
let o = 1 / 0, u = e.slice(1), a;
|
|
684
|
+
this.options.extensions.startBlock.forEach((p) => {
|
|
685
|
+
a = p.call({ lexer: this }, u), typeof a == "number" && a >= 0 && (o = Math.min(o, a));
|
|
686
|
+
}), o < 1 / 0 && o >= 0 && (i = e.substring(0, o + 1));
|
|
687
|
+
}
|
|
688
|
+
if (this.state.top && (r = this.tokenizer.paragraph(i))) {
|
|
689
|
+
let o = t.at(-1);
|
|
690
|
+
n && o?.type === "paragraph" ? (o.raw += (o.raw.endsWith(`
|
|
691
|
+
`) ? "" : `
|
|
692
|
+
`) + r.raw, o.text += `
|
|
693
|
+
` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
|
|
694
|
+
continue;
|
|
695
|
+
}
|
|
696
|
+
if (r = this.tokenizer.text(e)) {
|
|
697
|
+
e = e.substring(r.raw.length);
|
|
698
|
+
let o = t.at(-1);
|
|
699
|
+
o?.type === "text" ? (o.raw += (o.raw.endsWith(`
|
|
700
|
+
`) ? "" : `
|
|
701
|
+
`) + r.raw, o.text += `
|
|
702
|
+
` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : t.push(r);
|
|
703
|
+
continue;
|
|
704
|
+
}
|
|
705
|
+
if (e) {
|
|
706
|
+
this.infiniteLoopError(e.charCodeAt(0));
|
|
707
|
+
break;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
return this.state.top = true, t;
|
|
711
|
+
}
|
|
712
|
+
inline(e, t = []) {
|
|
713
|
+
return this.inlineQueue.push({ src: e, tokens: t }), t;
|
|
714
|
+
}
|
|
715
|
+
linkInText(e) {
|
|
716
|
+
if (!e.includes("[")) return false;
|
|
717
|
+
let t = this.tokenizer.rules.inline.link;
|
|
718
|
+
for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return true;
|
|
719
|
+
for (let n of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
|
|
720
|
+
let s = n[0], r = s.lastIndexOf("[");
|
|
721
|
+
if (!(s.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, s.slice(r + 1, -1))) && !(r > 1 && this.linkInText(s.slice(1, r - 1)))) return true;
|
|
722
|
+
}
|
|
723
|
+
return false;
|
|
724
|
+
}
|
|
725
|
+
inlineTokens(e, t = []) {
|
|
726
|
+
this.tokenizer.lexer = this;
|
|
727
|
+
let n = e;
|
|
728
|
+
if (this.tokens.links && e.includes("[")) {
|
|
729
|
+
let o = this.tokenizer.rules.inline.reflinkSearch, u = (a) => {
|
|
730
|
+
let p = a.lastIndexOf("[");
|
|
731
|
+
if (!Object.hasOwn(this.tokens.links, a.slice(p + 1, -1))) return a;
|
|
732
|
+
if (p > 1 && a.charAt(0) !== "!") {
|
|
733
|
+
let c = a.slice(1, p - 1);
|
|
734
|
+
if (this.linkInText(c)) return "[" + c.replace(o, u) + "][" + "a".repeat(a.length - p - 2) + "]";
|
|
735
|
+
}
|
|
736
|
+
return "[" + "a".repeat(a.length - 2) + "]";
|
|
737
|
+
};
|
|
738
|
+
n = n.replace(o, u);
|
|
739
|
+
}
|
|
740
|
+
n = n.replace(this.tokenizer.rules.inline.anyPunctuation, (o) => "+".repeat(o.length)), n = n.replace(this.tokenizer.rules.inline.blockSkip, (o, u, a) => {
|
|
741
|
+
let p = a ? a.length : 0;
|
|
742
|
+
return o.slice(0, p) + "[" + "a".repeat(o.length - p - 2) + "]";
|
|
743
|
+
}), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
744
|
+
let s = false, r = "", i = 1 / 0;
|
|
745
|
+
for (; e; ) {
|
|
746
|
+
if (e.length < i) i = e.length;
|
|
747
|
+
else {
|
|
748
|
+
this.infiniteLoopError(e.charCodeAt(0));
|
|
749
|
+
break;
|
|
750
|
+
}
|
|
751
|
+
s || (r = ""), s = false;
|
|
752
|
+
let o;
|
|
753
|
+
if (this.options.extensions?.inline?.some((a) => (o = a.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
|
|
754
|
+
if (o = this.tokenizer.escape(e)) {
|
|
755
|
+
e = e.substring(o.raw.length), t.push(o);
|
|
756
|
+
continue;
|
|
757
|
+
}
|
|
758
|
+
if (o = this.tokenizer.tag(e)) {
|
|
759
|
+
e = e.substring(o.raw.length), t.push(o);
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
if (o = this.tokenizer.link(e)) {
|
|
763
|
+
e = e.substring(o.raw.length), t.push(o);
|
|
764
|
+
continue;
|
|
765
|
+
}
|
|
766
|
+
if (o = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
767
|
+
e = e.substring(o.raw.length);
|
|
768
|
+
let a = t.at(-1);
|
|
769
|
+
o.type === "text" && a?.type === "text" ? (a.raw += o.raw, a.text += o.text) : t.push(o);
|
|
770
|
+
continue;
|
|
771
|
+
}
|
|
772
|
+
if (o = this.tokenizer.emStrong(e, n, r)) {
|
|
773
|
+
e = e.substring(o.raw.length), t.push(o);
|
|
774
|
+
continue;
|
|
775
|
+
}
|
|
776
|
+
if (o = this.tokenizer.codespan(e)) {
|
|
777
|
+
e = e.substring(o.raw.length), t.push(o);
|
|
778
|
+
continue;
|
|
779
|
+
}
|
|
780
|
+
if (o = this.tokenizer.br(e)) {
|
|
781
|
+
e = e.substring(o.raw.length), t.push(o);
|
|
782
|
+
continue;
|
|
783
|
+
}
|
|
784
|
+
if (o = this.tokenizer.del(e, n, r)) {
|
|
785
|
+
e = e.substring(o.raw.length), t.push(o);
|
|
786
|
+
continue;
|
|
787
|
+
}
|
|
788
|
+
if (o = this.tokenizer.autolink(e)) {
|
|
789
|
+
e = e.substring(o.raw.length), t.push(o);
|
|
790
|
+
continue;
|
|
791
|
+
}
|
|
792
|
+
if (!this.state.inLink && (o = this.tokenizer.url(e))) {
|
|
793
|
+
e = e.substring(o.raw.length), t.push(o);
|
|
794
|
+
continue;
|
|
795
|
+
}
|
|
796
|
+
let u = e;
|
|
797
|
+
if (this.options.extensions?.startInline) {
|
|
798
|
+
let a = 1 / 0, p = e.slice(1), c;
|
|
799
|
+
this.options.extensions.startInline.forEach((h) => {
|
|
800
|
+
c = h.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (a = Math.min(a, c));
|
|
801
|
+
}), a < 1 / 0 && a >= 0 && (u = e.substring(0, a + 1));
|
|
802
|
+
}
|
|
803
|
+
if (o = this.tokenizer.inlineText(u)) {
|
|
804
|
+
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (r = o.raw.slice(-1)), s = true;
|
|
805
|
+
let a = t.at(-1);
|
|
806
|
+
a?.type === "text" ? (a.raw += o.raw, a.text += o.text) : t.push(o);
|
|
807
|
+
continue;
|
|
808
|
+
}
|
|
809
|
+
if (e) {
|
|
810
|
+
this.infiniteLoopError(e.charCodeAt(0));
|
|
811
|
+
break;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
return t;
|
|
815
|
+
}
|
|
816
|
+
infiniteLoopError(e) {
|
|
817
|
+
let t = "Infinite loop on byte: " + e;
|
|
818
|
+
if (this.options.silent) console.error(t);
|
|
819
|
+
else throw new Error(t);
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
var P = class {
|
|
823
|
+
options;
|
|
824
|
+
parser;
|
|
825
|
+
constructor(e) {
|
|
826
|
+
this.options = e || R;
|
|
827
|
+
}
|
|
828
|
+
space(e) {
|
|
829
|
+
return "";
|
|
830
|
+
}
|
|
831
|
+
code({ text: e, lang: t, escaped: n }) {
|
|
832
|
+
let s = (t || "").match(m.notSpaceStart)?.[0], r = e.replace(m.endingNewline, "") + `
|
|
833
|
+
`;
|
|
834
|
+
return s ? '<pre><code class="language-' + T(s) + '">' + (n ? r : T(r, true)) + `</code></pre>
|
|
835
|
+
` : "<pre><code>" + (n ? r : T(r, true)) + `</code></pre>
|
|
836
|
+
`;
|
|
837
|
+
}
|
|
838
|
+
blockquote({ tokens: e }) {
|
|
839
|
+
return `<blockquote>
|
|
840
|
+
${this.parser.parse(e)}</blockquote>
|
|
841
|
+
`;
|
|
842
|
+
}
|
|
843
|
+
html({ text: e }) {
|
|
844
|
+
return e;
|
|
845
|
+
}
|
|
846
|
+
def(e) {
|
|
847
|
+
return "";
|
|
848
|
+
}
|
|
849
|
+
heading({ tokens: e, depth: t }) {
|
|
850
|
+
return `<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
851
|
+
`;
|
|
852
|
+
}
|
|
853
|
+
hr(e) {
|
|
854
|
+
return `<hr>
|
|
855
|
+
`;
|
|
856
|
+
}
|
|
857
|
+
list(e) {
|
|
858
|
+
let t = e.ordered, n = e.start, s = "";
|
|
859
|
+
for (let o = 0; o < e.items.length; o++) {
|
|
860
|
+
let u = e.items[o];
|
|
861
|
+
s += this.listitem(u);
|
|
862
|
+
}
|
|
863
|
+
let r = t ? "ol" : "ul", i = t && n !== 1 ? ' start="' + n + '"' : "";
|
|
864
|
+
return "<" + r + i + `>
|
|
865
|
+
` + s + "</" + r + `>
|
|
866
|
+
`;
|
|
867
|
+
}
|
|
868
|
+
listitem(e) {
|
|
869
|
+
return `<li>${this.parser.parse(e.tokens)}</li>
|
|
870
|
+
`;
|
|
871
|
+
}
|
|
872
|
+
checkbox({ checked: e }) {
|
|
873
|
+
return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
|
|
874
|
+
}
|
|
875
|
+
paragraph({ tokens: e }) {
|
|
876
|
+
return `<p>${this.parser.parseInline(e)}</p>
|
|
877
|
+
`;
|
|
878
|
+
}
|
|
879
|
+
table(e) {
|
|
880
|
+
let t = "", n = "";
|
|
881
|
+
for (let r = 0; r < e.header.length; r++) n += this.tablecell(e.header[r]);
|
|
882
|
+
t += this.tablerow({ text: n });
|
|
883
|
+
let s = "";
|
|
884
|
+
for (let r = 0; r < e.rows.length; r++) {
|
|
885
|
+
let i = e.rows[r];
|
|
886
|
+
n = "";
|
|
887
|
+
for (let o = 0; o < i.length; o++) n += this.tablecell(i[o]);
|
|
888
|
+
s += this.tablerow({ text: n });
|
|
889
|
+
}
|
|
890
|
+
return s && (s = `<tbody>${s}</tbody>`), `<table>
|
|
891
|
+
<thead>
|
|
892
|
+
` + t + `</thead>
|
|
893
|
+
` + s + `</table>
|
|
894
|
+
`;
|
|
895
|
+
}
|
|
896
|
+
tablerow({ text: e }) {
|
|
897
|
+
return `<tr>
|
|
898
|
+
${e}</tr>
|
|
899
|
+
`;
|
|
900
|
+
}
|
|
901
|
+
tablecell(e) {
|
|
902
|
+
let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
|
|
903
|
+
return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
|
|
904
|
+
`;
|
|
905
|
+
}
|
|
906
|
+
strong({ tokens: e }) {
|
|
907
|
+
return `<strong>${this.parser.parseInline(e)}</strong>`;
|
|
908
|
+
}
|
|
909
|
+
em({ tokens: e }) {
|
|
910
|
+
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
911
|
+
}
|
|
912
|
+
codespan({ text: e }) {
|
|
913
|
+
return `<code>${T(e, true)}</code>`;
|
|
914
|
+
}
|
|
915
|
+
br(e) {
|
|
916
|
+
return "<br>";
|
|
917
|
+
}
|
|
918
|
+
del({ tokens: e }) {
|
|
919
|
+
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
920
|
+
}
|
|
921
|
+
link({ href: e, title: t, tokens: n }) {
|
|
922
|
+
let s = this.parser.parseInline(n), r = Y(e);
|
|
923
|
+
if (r === null) return s;
|
|
924
|
+
e = r;
|
|
925
|
+
let i = '<a href="' + e + '"';
|
|
926
|
+
return t && (i += ' title="' + T(t) + '"'), i += ">" + s + "</a>", i;
|
|
927
|
+
}
|
|
928
|
+
image({ href: e, title: t, text: n, tokens: s }) {
|
|
929
|
+
s && (n = this.parser.parseInline(s, this.parser.textRenderer));
|
|
930
|
+
let r = Y(e);
|
|
931
|
+
if (r === null) return T(n);
|
|
932
|
+
e = r;
|
|
933
|
+
let i = `<img src="${e}" alt="${T(n)}"`;
|
|
934
|
+
return t && (i += ` title="${T(t)}"`), i += ">", i;
|
|
935
|
+
}
|
|
936
|
+
text(e) {
|
|
937
|
+
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : T(e.text);
|
|
938
|
+
}
|
|
939
|
+
};
|
|
940
|
+
var L = class {
|
|
941
|
+
strong({ text: e }) {
|
|
942
|
+
return e;
|
|
943
|
+
}
|
|
944
|
+
em({ text: e }) {
|
|
945
|
+
return e;
|
|
946
|
+
}
|
|
947
|
+
codespan({ text: e }) {
|
|
948
|
+
return e;
|
|
949
|
+
}
|
|
950
|
+
del({ text: e }) {
|
|
951
|
+
return e;
|
|
952
|
+
}
|
|
953
|
+
html({ text: e }) {
|
|
954
|
+
return e;
|
|
955
|
+
}
|
|
956
|
+
text({ text: e }) {
|
|
957
|
+
return e;
|
|
958
|
+
}
|
|
959
|
+
link({ text: e }) {
|
|
960
|
+
return "" + e;
|
|
961
|
+
}
|
|
962
|
+
image({ text: e }) {
|
|
963
|
+
return "" + e;
|
|
964
|
+
}
|
|
965
|
+
br() {
|
|
966
|
+
return "";
|
|
967
|
+
}
|
|
968
|
+
checkbox({ raw: e }) {
|
|
969
|
+
return e;
|
|
970
|
+
}
|
|
971
|
+
};
|
|
972
|
+
var b = class l2 {
|
|
973
|
+
options;
|
|
974
|
+
renderer;
|
|
975
|
+
textRenderer;
|
|
976
|
+
constructor(e) {
|
|
977
|
+
this.options = e || R, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
|
|
978
|
+
}
|
|
979
|
+
static parse(e, t) {
|
|
980
|
+
return new l2(t).parse(e);
|
|
981
|
+
}
|
|
982
|
+
static parseInline(e, t) {
|
|
983
|
+
return new l2(t).parseInline(e);
|
|
984
|
+
}
|
|
985
|
+
parse(e) {
|
|
986
|
+
this.renderer.parser = this;
|
|
987
|
+
let t = "";
|
|
988
|
+
for (let n = 0; n < e.length; n++) {
|
|
989
|
+
let s = e[n];
|
|
990
|
+
if (this.options.extensions?.renderers?.[s.type]) {
|
|
991
|
+
let i = s, o = this.options.extensions.renderers[i.type].call({ parser: this }, i);
|
|
992
|
+
if (o !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "checkbox", "html", "def", "paragraph", "text"].includes(i.type)) {
|
|
993
|
+
t += o || "";
|
|
994
|
+
continue;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
let r = s;
|
|
998
|
+
switch (r.type) {
|
|
999
|
+
case "space": {
|
|
1000
|
+
t += this.renderer.space(r);
|
|
1001
|
+
break;
|
|
1002
|
+
}
|
|
1003
|
+
case "hr": {
|
|
1004
|
+
t += this.renderer.hr(r);
|
|
1005
|
+
break;
|
|
1006
|
+
}
|
|
1007
|
+
case "heading": {
|
|
1008
|
+
t += this.renderer.heading(r);
|
|
1009
|
+
break;
|
|
1010
|
+
}
|
|
1011
|
+
case "code": {
|
|
1012
|
+
t += this.renderer.code(r);
|
|
1013
|
+
break;
|
|
1014
|
+
}
|
|
1015
|
+
case "table": {
|
|
1016
|
+
t += this.renderer.table(r);
|
|
1017
|
+
break;
|
|
1018
|
+
}
|
|
1019
|
+
case "blockquote": {
|
|
1020
|
+
t += this.renderer.blockquote(r);
|
|
1021
|
+
break;
|
|
1022
|
+
}
|
|
1023
|
+
case "list": {
|
|
1024
|
+
t += this.renderer.list(r);
|
|
1025
|
+
break;
|
|
1026
|
+
}
|
|
1027
|
+
case "checkbox": {
|
|
1028
|
+
t += this.renderer.checkbox(r);
|
|
1029
|
+
break;
|
|
1030
|
+
}
|
|
1031
|
+
case "html": {
|
|
1032
|
+
t += this.renderer.html(r);
|
|
1033
|
+
break;
|
|
1034
|
+
}
|
|
1035
|
+
case "def": {
|
|
1036
|
+
t += this.renderer.def(r);
|
|
1037
|
+
break;
|
|
1038
|
+
}
|
|
1039
|
+
case "paragraph": {
|
|
1040
|
+
t += this.renderer.paragraph(r);
|
|
1041
|
+
break;
|
|
1042
|
+
}
|
|
1043
|
+
case "text": {
|
|
1044
|
+
t += this.renderer.text(r);
|
|
1045
|
+
break;
|
|
1046
|
+
}
|
|
1047
|
+
default: {
|
|
1048
|
+
let i = 'Token with "' + r.type + '" type was not found.';
|
|
1049
|
+
if (this.options.silent) return console.error(i), "";
|
|
1050
|
+
throw new Error(i);
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
return t;
|
|
1055
|
+
}
|
|
1056
|
+
parseInline(e, t = this.renderer) {
|
|
1057
|
+
this.renderer.parser = this;
|
|
1058
|
+
let n = "";
|
|
1059
|
+
for (let s = 0; s < e.length; s++) {
|
|
1060
|
+
let r = e[s];
|
|
1061
|
+
if (this.options.extensions?.renderers?.[r.type]) {
|
|
1062
|
+
let o = this.options.extensions.renderers[r.type].call({ parser: this }, r);
|
|
1063
|
+
if (o !== false || !["escape", "html", "link", "image", "checkbox", "strong", "em", "codespan", "br", "del", "text"].includes(r.type)) {
|
|
1064
|
+
n += o || "";
|
|
1065
|
+
continue;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
let i = r;
|
|
1069
|
+
switch (i.type) {
|
|
1070
|
+
case "escape": {
|
|
1071
|
+
n += t.text(i);
|
|
1072
|
+
break;
|
|
1073
|
+
}
|
|
1074
|
+
case "html": {
|
|
1075
|
+
n += t.html(i);
|
|
1076
|
+
break;
|
|
1077
|
+
}
|
|
1078
|
+
case "link": {
|
|
1079
|
+
n += t.link(i);
|
|
1080
|
+
break;
|
|
1081
|
+
}
|
|
1082
|
+
case "image": {
|
|
1083
|
+
n += t.image(i);
|
|
1084
|
+
break;
|
|
1085
|
+
}
|
|
1086
|
+
case "checkbox": {
|
|
1087
|
+
n += t.checkbox(i);
|
|
1088
|
+
break;
|
|
1089
|
+
}
|
|
1090
|
+
case "strong": {
|
|
1091
|
+
n += t.strong(i);
|
|
1092
|
+
break;
|
|
1093
|
+
}
|
|
1094
|
+
case "em": {
|
|
1095
|
+
n += t.em(i);
|
|
1096
|
+
break;
|
|
1097
|
+
}
|
|
1098
|
+
case "codespan": {
|
|
1099
|
+
n += t.codespan(i);
|
|
1100
|
+
break;
|
|
1101
|
+
}
|
|
1102
|
+
case "br": {
|
|
1103
|
+
n += t.br(i);
|
|
1104
|
+
break;
|
|
1105
|
+
}
|
|
1106
|
+
case "del": {
|
|
1107
|
+
n += t.del(i);
|
|
1108
|
+
break;
|
|
1109
|
+
}
|
|
1110
|
+
case "text": {
|
|
1111
|
+
n += t.text(i);
|
|
1112
|
+
break;
|
|
1113
|
+
}
|
|
1114
|
+
default: {
|
|
1115
|
+
let o = 'Token with "' + i.type + '" type was not found.';
|
|
1116
|
+
if (this.options.silent) return console.error(o), "";
|
|
1117
|
+
throw new Error(o);
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
return n;
|
|
1122
|
+
}
|
|
1123
|
+
};
|
|
1124
|
+
var S = class {
|
|
1125
|
+
options;
|
|
1126
|
+
block;
|
|
1127
|
+
constructor(e) {
|
|
1128
|
+
this.options = e || R;
|
|
1129
|
+
}
|
|
1130
|
+
static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
|
|
1131
|
+
static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
1132
|
+
preprocess(e) {
|
|
1133
|
+
return e;
|
|
1134
|
+
}
|
|
1135
|
+
postprocess(e) {
|
|
1136
|
+
return e;
|
|
1137
|
+
}
|
|
1138
|
+
processAllTokens(e) {
|
|
1139
|
+
return e;
|
|
1140
|
+
}
|
|
1141
|
+
emStrongMask(e) {
|
|
1142
|
+
return e;
|
|
1143
|
+
}
|
|
1144
|
+
provideLexer(e = this.block) {
|
|
1145
|
+
return e ? x.lex : x.lexInline;
|
|
1146
|
+
}
|
|
1147
|
+
provideParser(e = this.block) {
|
|
1148
|
+
return e ? b.parse : b.parseInline;
|
|
1149
|
+
}
|
|
1150
|
+
};
|
|
1151
|
+
var Z = class {
|
|
1152
|
+
defaults = A();
|
|
1153
|
+
options = this.setOptions;
|
|
1154
|
+
parse = this.parseMarkdown(true);
|
|
1155
|
+
parseInline = this.parseMarkdown(false);
|
|
1156
|
+
Parser = b;
|
|
1157
|
+
Renderer = P;
|
|
1158
|
+
TextRenderer = L;
|
|
1159
|
+
Lexer = x;
|
|
1160
|
+
Tokenizer = y;
|
|
1161
|
+
Hooks = S;
|
|
1162
|
+
constructor(...e) {
|
|
1163
|
+
this.use(...e);
|
|
1164
|
+
}
|
|
1165
|
+
walkTokens(e, t) {
|
|
1166
|
+
let n = [];
|
|
1167
|
+
for (let s of e) switch (n = n.concat(t.call(this, s)), s.type) {
|
|
1168
|
+
case "table": {
|
|
1169
|
+
let r = s;
|
|
1170
|
+
for (let i of r.header) n = n.concat(this.walkTokens(i.tokens, t));
|
|
1171
|
+
for (let i of r.rows) for (let o of i) n = n.concat(this.walkTokens(o.tokens, t));
|
|
1172
|
+
break;
|
|
1173
|
+
}
|
|
1174
|
+
case "list": {
|
|
1175
|
+
let r = s;
|
|
1176
|
+
n = n.concat(this.walkTokens(r.items, t));
|
|
1177
|
+
break;
|
|
1178
|
+
}
|
|
1179
|
+
default: {
|
|
1180
|
+
let r = s;
|
|
1181
|
+
this.defaults.extensions?.childTokens?.[r.type] ? this.defaults.extensions.childTokens[r.type].forEach((i) => {
|
|
1182
|
+
let o = r[i].flat(1 / 0);
|
|
1183
|
+
n = n.concat(this.walkTokens(o, t));
|
|
1184
|
+
}) : r.tokens && (n = n.concat(this.walkTokens(r.tokens, t)));
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
return n;
|
|
1188
|
+
}
|
|
1189
|
+
use(...e) {
|
|
1190
|
+
let t = this.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
1191
|
+
return e.forEach((n) => {
|
|
1192
|
+
let s = { ...n };
|
|
1193
|
+
if (s.async = this.defaults.async || s.async || false, n.extensions && (n.extensions.forEach((r) => {
|
|
1194
|
+
if (!r.name) throw new Error("extension name required");
|
|
1195
|
+
if ("renderer" in r) {
|
|
1196
|
+
let i = t.renderers[r.name];
|
|
1197
|
+
i ? t.renderers[r.name] = function(...o) {
|
|
1198
|
+
let u = r.renderer.apply(this, o);
|
|
1199
|
+
return u === false && (u = i.apply(this, o)), u;
|
|
1200
|
+
} : t.renderers[r.name] = r.renderer;
|
|
1201
|
+
}
|
|
1202
|
+
if ("tokenizer" in r) {
|
|
1203
|
+
if (!r.level || r.level !== "block" && r.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
|
|
1204
|
+
let i = t[r.level];
|
|
1205
|
+
i ? i.unshift(r.tokenizer) : t[r.level] = [r.tokenizer], r.start && (r.level === "block" ? t.startBlock ? t.startBlock.push(r.start) : t.startBlock = [r.start] : r.level === "inline" && (t.startInline ? t.startInline.push(r.start) : t.startInline = [r.start]));
|
|
1206
|
+
}
|
|
1207
|
+
"childTokens" in r && r.childTokens && (t.childTokens[r.name] = r.childTokens);
|
|
1208
|
+
}), s.extensions = t), n.renderer) {
|
|
1209
|
+
let r = this.defaults.renderer || new P(this.defaults);
|
|
1210
|
+
for (let i in n.renderer) {
|
|
1211
|
+
if (!(i in r)) throw new Error(`renderer '${i}' does not exist`);
|
|
1212
|
+
if (["options", "parser"].includes(i)) continue;
|
|
1213
|
+
let o = i, u = n.renderer[o], a = r[o];
|
|
1214
|
+
r[o] = (...p) => {
|
|
1215
|
+
let c = u.apply(r, p);
|
|
1216
|
+
return c === false && (c = a.apply(r, p)), c || "";
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
1219
|
+
s.renderer = r;
|
|
1220
|
+
}
|
|
1221
|
+
if (n.tokenizer) {
|
|
1222
|
+
let r = this.defaults.tokenizer || new y(this.defaults);
|
|
1223
|
+
for (let i in n.tokenizer) {
|
|
1224
|
+
if (!(i in r)) throw new Error(`tokenizer '${i}' does not exist`);
|
|
1225
|
+
if (["options", "rules", "lexer"].includes(i)) continue;
|
|
1226
|
+
let o = i, u = n.tokenizer[o], a = r[o];
|
|
1227
|
+
r[o] = (...p) => {
|
|
1228
|
+
let c = u.apply(r, p);
|
|
1229
|
+
return c === false && (c = a.apply(r, p)), c;
|
|
1230
|
+
};
|
|
1231
|
+
}
|
|
1232
|
+
s.tokenizer = r;
|
|
1233
|
+
}
|
|
1234
|
+
if (n.hooks) {
|
|
1235
|
+
let r = this.defaults.hooks || new S();
|
|
1236
|
+
for (let i in n.hooks) {
|
|
1237
|
+
if (!(i in r)) throw new Error(`hook '${i}' does not exist`);
|
|
1238
|
+
if (["options", "block"].includes(i)) continue;
|
|
1239
|
+
let o = i, u = n.hooks[o], a = r[o];
|
|
1240
|
+
S.passThroughHooks.has(i) ? r[o] = (p) => {
|
|
1241
|
+
if (this.defaults.async && S.passThroughHooksRespectAsync.has(i)) return (async () => {
|
|
1242
|
+
let h = await u.call(r, p);
|
|
1243
|
+
return a.call(r, h);
|
|
1244
|
+
})();
|
|
1245
|
+
let c = u.call(r, p);
|
|
1246
|
+
return a.call(r, c);
|
|
1247
|
+
} : r[o] = (...p) => {
|
|
1248
|
+
if (this.defaults.async) return (async () => {
|
|
1249
|
+
let h = await u.apply(r, p);
|
|
1250
|
+
return h === false && (h = await a.apply(r, p)), h;
|
|
1251
|
+
})();
|
|
1252
|
+
let c = u.apply(r, p);
|
|
1253
|
+
return c === false && (c = a.apply(r, p)), c;
|
|
1254
|
+
};
|
|
1255
|
+
}
|
|
1256
|
+
s.hooks = r;
|
|
1257
|
+
}
|
|
1258
|
+
if (n.walkTokens) {
|
|
1259
|
+
let r = this.defaults.walkTokens, i = n.walkTokens;
|
|
1260
|
+
s.walkTokens = function(o) {
|
|
1261
|
+
let u = [];
|
|
1262
|
+
return u.push(i.call(this, o)), r && (u = u.concat(r.call(this, o))), u;
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
this.defaults = { ...this.defaults, ...s };
|
|
1266
|
+
}), this;
|
|
1267
|
+
}
|
|
1268
|
+
setOptions(e) {
|
|
1269
|
+
return this.defaults = { ...this.defaults, ...e }, this;
|
|
1270
|
+
}
|
|
1271
|
+
lexer(e, t) {
|
|
1272
|
+
return x.lex(e, t ?? this.defaults);
|
|
1273
|
+
}
|
|
1274
|
+
parser(e, t) {
|
|
1275
|
+
return b.parse(e, t ?? this.defaults);
|
|
1276
|
+
}
|
|
1277
|
+
parseMarkdown(e) {
|
|
1278
|
+
return (n, s) => {
|
|
1279
|
+
let r = { ...s }, i = { ...this.defaults, ...r }, o = this.onError(!!i.silent, !!i.async);
|
|
1280
|
+
if (this.defaults.async === true && r.async === false) return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
1281
|
+
if (typeof n > "u" || n === null) return o(new Error("marked(): input parameter is undefined or null"));
|
|
1282
|
+
if (typeof n != "string") return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
1283
|
+
if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
|
|
1284
|
+
let u = i.hooks ? await i.hooks.preprocess(n) : n, p = await (i.hooks ? await i.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(u, i), c = i.hooks ? await i.hooks.processAllTokens(p) : p;
|
|
1285
|
+
i.walkTokens && await Promise.all(this.walkTokens(c, i.walkTokens));
|
|
1286
|
+
let d = await (i.hooks ? await i.hooks.provideParser(e) : e ? b.parse : b.parseInline)(c, i);
|
|
1287
|
+
return i.hooks ? await i.hooks.postprocess(d) : d;
|
|
1288
|
+
})().catch(o);
|
|
1289
|
+
try {
|
|
1290
|
+
i.hooks && (n = i.hooks.preprocess(n));
|
|
1291
|
+
let a = (i.hooks ? i.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(n, i);
|
|
1292
|
+
i.hooks && (a = i.hooks.processAllTokens(a)), i.walkTokens && this.walkTokens(a, i.walkTokens);
|
|
1293
|
+
let c = (i.hooks ? i.hooks.provideParser(e) : e ? b.parse : b.parseInline)(a, i);
|
|
1294
|
+
return i.hooks && (c = i.hooks.postprocess(c)), c;
|
|
1295
|
+
} catch (u) {
|
|
1296
|
+
return o(u);
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
onError(e, t) {
|
|
1301
|
+
return (n) => {
|
|
1302
|
+
if (n.message += `
|
|
1303
|
+
Please report this to https://github.com/markedjs/marked.`, e) {
|
|
1304
|
+
let s = "<p>An error occurred:</p><pre>" + T(n.message + "", true) + "</pre>";
|
|
1305
|
+
return t ? Promise.resolve(s) : s;
|
|
1306
|
+
}
|
|
1307
|
+
if (t) return Promise.reject(n);
|
|
1308
|
+
throw n;
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
};
|
|
1312
|
+
var M = new Z();
|
|
1313
|
+
function f(l3, e) {
|
|
1314
|
+
return M.parse(l3, e);
|
|
1315
|
+
}
|
|
1316
|
+
f.options = f.setOptions = function(l3) {
|
|
1317
|
+
return M.setOptions(l3), f.defaults = M.defaults, j(f.defaults), f;
|
|
1318
|
+
};
|
|
1319
|
+
f.getDefaults = A;
|
|
1320
|
+
f.defaults = R;
|
|
1321
|
+
function dt(...l3) {
|
|
1322
|
+
return M.use(...l3), f.defaults = M.defaults, j(f.defaults), f;
|
|
1323
|
+
}
|
|
1324
|
+
f.use = dt;
|
|
1325
|
+
f.walkTokens = function(l3, e) {
|
|
1326
|
+
return M.walkTokens(l3, e);
|
|
1327
|
+
};
|
|
1328
|
+
f.parseInline = M.parseInline;
|
|
1329
|
+
f.Parser = b;
|
|
1330
|
+
f.parser = b.parse;
|
|
1331
|
+
f.Renderer = P;
|
|
1332
|
+
f.TextRenderer = L;
|
|
1333
|
+
f.Lexer = x;
|
|
1334
|
+
f.lexer = x.lex;
|
|
1335
|
+
f.Tokenizer = y;
|
|
1336
|
+
f.Hooks = S;
|
|
1337
|
+
f.parse = f;
|
|
1338
|
+
var nn = f.options;
|
|
1339
|
+
var rn = f.setOptions;
|
|
1340
|
+
var sn = f.walkTokens;
|
|
1341
|
+
var on = f.parseInline;
|
|
1342
|
+
var ln = b.parse;
|
|
1343
|
+
var un = x.lex;
|
|
1344
|
+
|
|
1345
|
+
// apps/clio-coder-web/contracts/docs-headings.ts
|
|
1346
|
+
init_esm_shims();
|
|
1347
|
+
function documentHeadings(tokens) {
|
|
1348
|
+
const ids = /* @__PURE__ */ new Map();
|
|
1349
|
+
const counts = /* @__PURE__ */ new Map();
|
|
1350
|
+
f.walkTokens([...tokens], (token) => {
|
|
1351
|
+
if (token.type !== "heading") return;
|
|
1352
|
+
const text = token.text.replace(/<[^>]*>/g, "").replace(/[`*_~]/g, "");
|
|
1353
|
+
const base = text.toLowerCase().replace(/[^\p{L}\p{N}_\s-]/gu, "").replace(/\s/g, "-");
|
|
1354
|
+
const n = counts.get(base) ?? 0;
|
|
1355
|
+
counts.set(base, n + 1);
|
|
1356
|
+
ids.set(token, n ? `${base}-${n}` : base);
|
|
1357
|
+
});
|
|
1358
|
+
return ids;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
// apps/clio-coder-web/server/clio/adapters/docs.ts
|
|
1362
|
+
function within(root, target) {
|
|
1363
|
+
const rel = relative(root, target);
|
|
1364
|
+
return !isAbsolute(rel) && rel !== ".." && !rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`);
|
|
1365
|
+
}
|
|
1366
|
+
function contained(root, path) {
|
|
1367
|
+
if (!path || path.includes("\0") || path.includes("\\") || isAbsolute(path) || path.split("/").includes(".."))
|
|
1368
|
+
throw new AppProblem("unauthorized", "Documentation path is outside the allowed root.", 403);
|
|
1369
|
+
let target;
|
|
1370
|
+
try {
|
|
1371
|
+
target = realpathSync(resolve(root, path));
|
|
1372
|
+
} catch {
|
|
1373
|
+
throw new AppProblem("not_found", "Documentation file was not found.");
|
|
1374
|
+
}
|
|
1375
|
+
if (!within(root, target))
|
|
1376
|
+
throw new AppProblem("unauthorized", "Documentation path is outside the allowed root.", 403);
|
|
1377
|
+
return target;
|
|
1378
|
+
}
|
|
1379
|
+
function boundedRead(path, max) {
|
|
1380
|
+
const stat = statSync(path);
|
|
1381
|
+
if (!stat.isFile()) throw new AppProblem("not_found", "Documentation file was not found.");
|
|
1382
|
+
if (stat.size > max) throw new AppProblem("unavailable", "Documentation file exceeds the read limit.");
|
|
1383
|
+
return readFileSync(path);
|
|
1384
|
+
}
|
|
1385
|
+
function titleOf(path, markdown) {
|
|
1386
|
+
return /^#\s+(.+)$/m.exec(markdown)?.[1]?.replace(/[`*_]/g, "") ?? path.replace(/\.md$/i, "");
|
|
1387
|
+
}
|
|
1388
|
+
var DocsAdapter = class {
|
|
1389
|
+
constructor(packageRoot = resolvePackageRoot()) {
|
|
1390
|
+
this.packageRoot = packageRoot;
|
|
1391
|
+
}
|
|
1392
|
+
packageRoot;
|
|
1393
|
+
catalog;
|
|
1394
|
+
root;
|
|
1395
|
+
docsRoot() {
|
|
1396
|
+
this.root ??= contained(realpathSync(this.packageRoot), "docs");
|
|
1397
|
+
return this.root;
|
|
1398
|
+
}
|
|
1399
|
+
index() {
|
|
1400
|
+
if (this.catalog) return this.catalog;
|
|
1401
|
+
const root = this.docsRoot(), pages = /* @__PURE__ */ new Map(), visited = /* @__PURE__ */ new Set();
|
|
1402
|
+
let bytes = 0;
|
|
1403
|
+
const scan = (path) => {
|
|
1404
|
+
const directory = path ? contained(root, path) : root;
|
|
1405
|
+
if (visited.has(directory)) return;
|
|
1406
|
+
visited.add(directory);
|
|
1407
|
+
for (const entry of readdirSync(directory, { withFileTypes: true }).sort((a, b2) => a.name.localeCompare(b2.name))) {
|
|
1408
|
+
const name = path ? `${path}/${entry.name}` : entry.name;
|
|
1409
|
+
if (name === "html") continue;
|
|
1410
|
+
if (entry.isDirectory()) scan(name);
|
|
1411
|
+
else if (entry.isFile() && /\.md$/i.test(name)) {
|
|
1412
|
+
const markdown = boundedRead(contained(root, name), 1024 * 1024).toString("utf8");
|
|
1413
|
+
bytes += Buffer.byteLength(markdown);
|
|
1414
|
+
if (bytes > 16 * 1024 * 1024 || pages.size >= 1e4)
|
|
1415
|
+
throw new AppProblem("unavailable", "Documentation index exceeds its limit.");
|
|
1416
|
+
pages.set(name, {
|
|
1417
|
+
path: name,
|
|
1418
|
+
title: titleOf(name, markdown),
|
|
1419
|
+
markdown,
|
|
1420
|
+
anchors: new Set(documentHeadings(f.lexer(markdown)).values())
|
|
1421
|
+
});
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
};
|
|
1425
|
+
scan("");
|
|
1426
|
+
const groups = [];
|
|
1427
|
+
let group;
|
|
1428
|
+
for (const token of f.lexer(pages.get("README.md")?.markdown ?? "")) {
|
|
1429
|
+
if (token.type === "heading" && token.depth === 2) {
|
|
1430
|
+
group = { title: token.text, pages: [] };
|
|
1431
|
+
groups.push(group);
|
|
1432
|
+
}
|
|
1433
|
+
if (token.type === "table" && group) {
|
|
1434
|
+
const current = group;
|
|
1435
|
+
f.walkTokens([token], (child) => {
|
|
1436
|
+
if (child.type !== "link") return;
|
|
1437
|
+
const page = pages.get(posix.normalize(child.href.split("#")[0] ?? ""));
|
|
1438
|
+
if (page && !current.pages.some((row) => row.path === page.path))
|
|
1439
|
+
current.pages.push({ path: page.path, title: page.title });
|
|
1440
|
+
});
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
this.catalog = {
|
|
1444
|
+
pages,
|
|
1445
|
+
tree: {
|
|
1446
|
+
pages: [...pages.values()].map(({ path, title }) => ({ path, title })),
|
|
1447
|
+
groups: groups.filter((row) => row.pages.length)
|
|
1448
|
+
}
|
|
1449
|
+
};
|
|
1450
|
+
return this.catalog;
|
|
1451
|
+
}
|
|
1452
|
+
link(from, href) {
|
|
1453
|
+
const publicDocs = /^https:\/\/github\.com\/iowarp\/clio-coder\/(?:blob|tree)\/(?:main|v048)\/docs\/(.+)$/i.exec(
|
|
1454
|
+
href
|
|
1455
|
+
);
|
|
1456
|
+
if (publicDocs) href = `/${publicDocs[1]}`;
|
|
1457
|
+
if (/^(https?:|mailto:)/i.test(href)) return href;
|
|
1458
|
+
if (/^[a-z][a-z\d+.-]*:/i.test(href) || href.startsWith("//")) return null;
|
|
1459
|
+
let decoded;
|
|
1460
|
+
try {
|
|
1461
|
+
decoded = decodeURIComponent(href);
|
|
1462
|
+
} catch {
|
|
1463
|
+
return null;
|
|
1464
|
+
}
|
|
1465
|
+
if (/[\0\\]/.test(decoded)) return null;
|
|
1466
|
+
const [location = "", hash] = decoded.split("#", 2);
|
|
1467
|
+
const path = location.split("?")[0] || from;
|
|
1468
|
+
const normalized = posix.normalize(
|
|
1469
|
+
location ? path.startsWith("/") ? path.slice(1) : posix.join(dirname(from), path) : from
|
|
1470
|
+
);
|
|
1471
|
+
const pagePath = this.index().pages.has(normalized) ? normalized : `${normalized.replace(/\/$/, "")}/README.md`;
|
|
1472
|
+
const page = this.index().pages.get(pagePath);
|
|
1473
|
+
if (page) {
|
|
1474
|
+
if (hash && !page.anchors.has(hash)) return null;
|
|
1475
|
+
return `/docs/${pagePath.split("/").map(encodeURIComponent).join("/")}${hash ? `#${encodeURIComponent(hash)}` : ""}`;
|
|
1476
|
+
}
|
|
1477
|
+
const packagePath = posix.normalize(`docs/${normalized}`);
|
|
1478
|
+
try {
|
|
1479
|
+
contained(realpathSync(this.packageRoot), packagePath);
|
|
1480
|
+
} catch {
|
|
1481
|
+
return null;
|
|
1482
|
+
}
|
|
1483
|
+
return `https://github.com/iowarp/clio-coder/blob/main/${packagePath.split("/").map(encodeURIComponent).join("/")}${hash ? `#${encodeURIComponent(hash)}` : ""}`;
|
|
1484
|
+
}
|
|
1485
|
+
read(input) {
|
|
1486
|
+
if (input.kind === "tree") return this.index().tree;
|
|
1487
|
+
if (input.kind === "search") {
|
|
1488
|
+
const terms = input.q.toLowerCase().trim().split(/\s+/).filter(Boolean);
|
|
1489
|
+
if (!terms.length) return [];
|
|
1490
|
+
return [...this.index().pages.values()].map((page) => {
|
|
1491
|
+
const text = page.markdown.toLowerCase();
|
|
1492
|
+
const score = terms.reduce(
|
|
1493
|
+
(n, term) => n + (page.title.toLowerCase().includes(term) ? 100 : 0) + (page.path.toLowerCase().includes(term) ? 50 : 0) + Math.min(20, text.split(term).length - 1),
|
|
1494
|
+
0
|
|
1495
|
+
);
|
|
1496
|
+
const at2 = Math.max(0, text.indexOf(terms[0] ?? ""));
|
|
1497
|
+
return {
|
|
1498
|
+
path: page.path,
|
|
1499
|
+
title: page.title,
|
|
1500
|
+
excerpt: page.markdown.slice(Math.max(0, at2 - 50), at2 + 180).replace(/\s+/g, " "),
|
|
1501
|
+
score
|
|
1502
|
+
};
|
|
1503
|
+
}).filter((row) => row.score > 0).sort((a, b2) => b2.score - a.score || a.path.localeCompare(b2.path)).slice(0, 30).map(({ score: _score, ...row }) => row);
|
|
1504
|
+
}
|
|
1505
|
+
if (!/\.md$/i.test(input.path)) throw new AppProblem("validation", "Only Markdown document paths are accepted.");
|
|
1506
|
+
const markdown = boundedRead(contained(this.docsRoot(), input.path), 1024 * 1024).toString("utf8");
|
|
1507
|
+
const links = /* @__PURE__ */ Object.create(null);
|
|
1508
|
+
const tokens = f.lexer(markdown);
|
|
1509
|
+
f.walkTokens(tokens, (token) => {
|
|
1510
|
+
if (token.type === "link") links[token.href] = this.link(input.path, token.href);
|
|
1511
|
+
});
|
|
1512
|
+
return {
|
|
1513
|
+
path: input.path,
|
|
1514
|
+
title: titleOf(input.path, markdown),
|
|
1515
|
+
markdown,
|
|
1516
|
+
headings: [...documentHeadings(tokens)].map(([token, id]) => ({
|
|
1517
|
+
id,
|
|
1518
|
+
title: token.text.replace(/<[^>]*>/g, "").replace(/[`*_~]/g, ""),
|
|
1519
|
+
depth: token.depth
|
|
1520
|
+
})),
|
|
1521
|
+
links,
|
|
1522
|
+
unavailableLinks: Object.entries(links).filter(([, destination]) => destination === null).map(([href]) => href)
|
|
1523
|
+
};
|
|
1524
|
+
}
|
|
1525
|
+
};
|
|
1526
|
+
|
|
1527
|
+
// apps/clio-coder-web/server/clio/adapters/sessions.ts
|
|
1528
|
+
init_esm_shims();
|
|
1529
|
+
import { existsSync, readdirSync as readdirSync2, realpathSync as realpathSync2 } from "node:fs";
|
|
1530
|
+
import { isAbsolute as isAbsolute2, join, relative as relative2, sep } from "node:path";
|
|
1531
|
+
function sessionHistory(cwd) {
|
|
1532
|
+
const state = clioStateDir(), directory = join(state, "sessions");
|
|
1533
|
+
if (!existsSync(directory)) return [];
|
|
1534
|
+
const root = realpathSync2(state);
|
|
1535
|
+
const inspect = (path, depth) => {
|
|
1536
|
+
const resolved = realpathSync2(path), part = relative2(root, resolved);
|
|
1537
|
+
if (part === ".." || part.startsWith(`..${sep}`) || isAbsolute2(part))
|
|
1538
|
+
throw new AppProblem("validation", "Session storage escapes its state directory.");
|
|
1539
|
+
if (depth > 0)
|
|
1540
|
+
for (const child of readdirSync2(path, { withFileTypes: true })) {
|
|
1541
|
+
const target = join(path, child.name);
|
|
1542
|
+
if (child.isDirectory()) inspect(target, depth - 1);
|
|
1543
|
+
else {
|
|
1544
|
+
const file = realpathSync2(target), diff = relative2(root, file);
|
|
1545
|
+
if (diff === ".." || diff.startsWith(`..${sep}`) || isAbsolute2(diff))
|
|
1546
|
+
throw new AppProblem("validation", "Session storage escapes its state directory.");
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
};
|
|
1550
|
+
inspect(directory, 3);
|
|
1551
|
+
return listSessionsForCwd(cwd);
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
// apps/clio-coder-web/server/clio/adapters/traces.ts
|
|
1555
|
+
init_esm_shims();
|
|
1556
|
+
import { readFileSync as readFileSync2, realpathSync as realpathSync3, statSync as statSync2 } from "node:fs";
|
|
1557
|
+
import { isAbsolute as isAbsolute3, join as join2, relative as relative3 } from "node:path";
|
|
1558
|
+
var Cursor = typebox_exports.Object({ startedAt: typebox_exports.String({ maxLength: 64 }), runId: Id }, { additionalProperties: false });
|
|
1559
|
+
function cursorOf(encoded) {
|
|
1560
|
+
if (encoded === void 0) return null;
|
|
1561
|
+
try {
|
|
1562
|
+
const decoded = JSON.parse(Buffer.from(encoded, "base64url").toString("utf8"));
|
|
1563
|
+
if (!value_exports.Check(Cursor, decoded) || !Number.isFinite(Date.parse(decoded.startedAt))) throw new Error("cursor");
|
|
1564
|
+
return decoded;
|
|
1565
|
+
} catch {
|
|
1566
|
+
throw new AppProblem("validation", "Invalid trace pagination cursor.");
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
function inside(root, path) {
|
|
1570
|
+
const part = relative3(root, path);
|
|
1571
|
+
return part !== ".." && !part.startsWith("../") && !isAbsolute3(part);
|
|
1572
|
+
}
|
|
1573
|
+
function contained2(state, directory, filename) {
|
|
1574
|
+
const root = realpathSync3(state), base = realpathSync3(join2(state, directory)), path = realpathSync3(join2(base, filename));
|
|
1575
|
+
if (!inside(root, base) || !inside(base, path))
|
|
1576
|
+
throw new AppProblem("validation", "Trace path escapes its state directory.");
|
|
1577
|
+
return path;
|
|
1578
|
+
}
|
|
1579
|
+
var TraceAdapter = class {
|
|
1580
|
+
reader;
|
|
1581
|
+
identity = "";
|
|
1582
|
+
close() {
|
|
1583
|
+
this.reader?.close();
|
|
1584
|
+
this.reader = void 0;
|
|
1585
|
+
}
|
|
1586
|
+
open() {
|
|
1587
|
+
const state = clioStateDir();
|
|
1588
|
+
const path = contained2(state, ".", relative3(state, traceDatabasePath(state)));
|
|
1589
|
+
const info = statSync2(path), identity = `${info.dev}:${info.ino}`;
|
|
1590
|
+
if (this.reader && this.identity !== identity) this.close();
|
|
1591
|
+
if (!this.reader) {
|
|
1592
|
+
this.reader = new TraceReader(path);
|
|
1593
|
+
this.identity = identity;
|
|
1594
|
+
}
|
|
1595
|
+
const version = this.reader.db.prepare("SELECT value FROM meta WHERE key='schema_version'").get();
|
|
1596
|
+
if (Number(version?.value) !== TRACE_SCHEMA_VERSION) {
|
|
1597
|
+
this.close();
|
|
1598
|
+
throw new Error("Unsupported trace schema.");
|
|
1599
|
+
}
|
|
1600
|
+
return this.reader;
|
|
1601
|
+
}
|
|
1602
|
+
read(input) {
|
|
1603
|
+
const cursor = input.kind === "runs" ? cursorOf(input.query.cursor) : null;
|
|
1604
|
+
if ("runId" in input && (!value_exports.Check(Id, input.runId) || input.runId.includes("..")))
|
|
1605
|
+
throw new AppProblem("validation", "Invalid trace run identifier.");
|
|
1606
|
+
if (input.kind === "receipt") return this.receipt(input.runId, input.full ?? false);
|
|
1607
|
+
try {
|
|
1608
|
+
const reader = this.open();
|
|
1609
|
+
if (input.kind === "status")
|
|
1610
|
+
return { available: true, schemaVersion: TRACE_SCHEMA_VERSION, retentionPolicy: resolveTraceRetentionPolicy() };
|
|
1611
|
+
if (input.kind === "runs") {
|
|
1612
|
+
const { source, status, q: q2, limit } = input.query;
|
|
1613
|
+
const page = reader.runsPage({
|
|
1614
|
+
...cursor ? { before: cursor } : {},
|
|
1615
|
+
...limit !== void 0 ? { limit } : {},
|
|
1616
|
+
filter: { ...source ? { source } : {}, ...status ? { status } : {}, ...q2 ? { q: q2 } : {} }
|
|
1617
|
+
});
|
|
1618
|
+
return {
|
|
1619
|
+
runs: page.runs,
|
|
1620
|
+
nextCursor: page.nextBefore ? Buffer.from(JSON.stringify(page.nextBefore)).toString("base64url") : null
|
|
1621
|
+
};
|
|
1622
|
+
}
|
|
1623
|
+
const run = reader.run(input.runId);
|
|
1624
|
+
if (!run) throw new AppProblem("not_found", "Trace run was not found.");
|
|
1625
|
+
switch (input.kind) {
|
|
1626
|
+
case "run":
|
|
1627
|
+
return run;
|
|
1628
|
+
case "phases":
|
|
1629
|
+
return reader.phases(input.runId);
|
|
1630
|
+
case "gates":
|
|
1631
|
+
return reader.gateResults(input.runId);
|
|
1632
|
+
case "envelopes":
|
|
1633
|
+
return reader.envelopes(input.runId);
|
|
1634
|
+
case "processes":
|
|
1635
|
+
return reader.processes(input.runId);
|
|
1636
|
+
case "events":
|
|
1637
|
+
case "live": {
|
|
1638
|
+
const events = reader.events(input.runId, input.after, input.limit);
|
|
1639
|
+
return {
|
|
1640
|
+
...input.kind === "live" ? { run } : {},
|
|
1641
|
+
events,
|
|
1642
|
+
cursor: events.at(-1)?.rowid ?? input.after,
|
|
1643
|
+
hasMore: events.length === input.limit
|
|
1644
|
+
};
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
} catch (error) {
|
|
1648
|
+
this.close();
|
|
1649
|
+
if (error instanceof AppProblem) throw error;
|
|
1650
|
+
if (input.kind === "status")
|
|
1651
|
+
return { available: false, schemaVersion: null, retentionPolicy: resolveTraceRetentionPolicy() };
|
|
1652
|
+
throw new AppProblem("unavailable", "Trace database is unavailable or has an unsupported schema or journal mode.");
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
receipt(runId, full) {
|
|
1656
|
+
const state = clioStateDir();
|
|
1657
|
+
let receipt = null;
|
|
1658
|
+
let evidence = null;
|
|
1659
|
+
try {
|
|
1660
|
+
const path = contained2(state, "receipts", `${runId}.json`);
|
|
1661
|
+
const data = JSON.parse(readFileSync2(path, "utf8"));
|
|
1662
|
+
if (data && typeof data === "object" && !Array.isArray(data)) receipt = data;
|
|
1663
|
+
} catch (error) {
|
|
1664
|
+
if (error instanceof AppProblem) throw error;
|
|
1665
|
+
}
|
|
1666
|
+
try {
|
|
1667
|
+
contained2(state, ".", "evidence-index.json");
|
|
1668
|
+
evidence = readEvidenceIndex(state).find((row) => row.runId === runId) ?? null;
|
|
1669
|
+
} catch (error) {
|
|
1670
|
+
if (error instanceof AppProblem) throw error;
|
|
1671
|
+
}
|
|
1672
|
+
if (receipt && !full)
|
|
1673
|
+
for (const key of ["output", "upstreamResponses", "routeDecision", "briefing", "steering"]) delete receipt[key];
|
|
1674
|
+
return { receipt, evidence };
|
|
1675
|
+
}
|
|
1676
|
+
};
|
|
1677
|
+
|
|
1678
|
+
// apps/clio-coder-web/server/worker/reads-main.ts
|
|
1679
|
+
var settings = workerData;
|
|
1680
|
+
restrictNetwork();
|
|
1681
|
+
var fixture = false ? await null : void 0;
|
|
1682
|
+
var adapter = toolchainAdapter(fixture?.fixtureOptions(settings));
|
|
1683
|
+
var traces = new TraceAdapter();
|
|
1684
|
+
var docs = new DocsAdapter(settings.fixture ? settings.fixtureDocsPackageRoot : void 0);
|
|
1685
|
+
serveWorker(async (call) => {
|
|
1686
|
+
if (call.method === "runtime.info" && process.env.NODE_ENV === "test") return runtimeInfo(import.meta.url);
|
|
1687
|
+
if (call.method === "system.read" || call.method === "interop.read") {
|
|
1688
|
+
const { inspectSystem, inspectInterop } = await import("../system-CD75NYBU.js");
|
|
1689
|
+
return call.method === "system.read" ? inspectSystem() : inspectInterop(call.params.cwd, settings.fixture);
|
|
1690
|
+
}
|
|
1691
|
+
if (call.method === "library.read") {
|
|
1692
|
+
const { readLibrary } = await import("../library-Q3NWL5CM.js");
|
|
1693
|
+
return readLibrary(call.params);
|
|
1694
|
+
}
|
|
1695
|
+
if (call.method === "evals.read") {
|
|
1696
|
+
const { readEvals } = await import("../evals-J2H5V6DD.js");
|
|
1697
|
+
return readEvals(call.params);
|
|
1698
|
+
}
|
|
1699
|
+
if (call.method === "evidence.read") {
|
|
1700
|
+
const { readEvidence } = await import("../evidence-XCCCLS36.js");
|
|
1701
|
+
return readEvidence(call.params);
|
|
1702
|
+
}
|
|
1703
|
+
if (call.method === "fleet.read") {
|
|
1704
|
+
const { readFleet } = await import("../fleet-2MDCQ2VK.js");
|
|
1705
|
+
return readFleet(call.params);
|
|
1706
|
+
}
|
|
1707
|
+
if (call.method === "settings.read") {
|
|
1708
|
+
const { inspectSettings } = await import("../settings-MWZXO6RV.js");
|
|
1709
|
+
return inspectSettings(call.params.cwd);
|
|
1710
|
+
}
|
|
1711
|
+
if (call.method === "config.graph") {
|
|
1712
|
+
if (settings.fixture && settings.fixtureGraphDelayMs)
|
|
1713
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, settings.fixtureGraphDelayMs);
|
|
1714
|
+
const { inspectConfigGraph } = await import("../config-graph-ACDB26L2.js");
|
|
1715
|
+
return inspectConfigGraph(call.params.cwd);
|
|
1716
|
+
}
|
|
1717
|
+
if (call.method === "docs.read") return docs.read(call.params);
|
|
1718
|
+
if (call.method === "sessions.list") return sessionHistory(call.params.cwd);
|
|
1719
|
+
if (call.method === "traces.read") return traces.read(call.params);
|
|
1720
|
+
if (call.method !== "tools.list") throw new AppProblem("unsupported", "Method is not available in the reads worker.");
|
|
1721
|
+
if (settings.fixture && settings.readDelayMs)
|
|
1722
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, settings.readDelayMs);
|
|
1723
|
+
if (settings.fixture && settings.crashRead) process.exit(7);
|
|
1724
|
+
return adapter.list();
|
|
1725
|
+
});
|
|
1726
|
+
//# sourceMappingURL=reads-worker.js.map
|