@dylanpiercey/work 0.0.116 → 0.0.118
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/bin/work.mjs +7 -29
- package/dist/_BIDn_RW1.js +2 -0
- package/dist/{_BHPrqqev.js → _CeVZfkIY.js} +95 -79
- package/dist/{_CmheBYWi.js → _DE2RUdbF.js} +43 -26
- package/dist/{_CEKO5mam.js → _EzN3zMKL.js} +39 -39
- package/dist/index.mjs +555 -526
- package/dist/public/assets/{_C5GxdpIx.js → _5MxjuuKr.js} +1 -1
- package/dist/public/assets/_5MxjuuKr.js.br +0 -0
- package/dist/public/assets/{_CmwkZmX02.js → _6hN6Ymx42.js} +1 -1
- package/dist/public/assets/_6hN6Ymx42.js.br +0 -0
- package/dist/public/assets/{_DbphB3_Y.js → _6nWMLOH4.js} +1 -1
- package/dist/public/assets/_6nWMLOH4.js.br +0 -0
- package/dist/public/assets/{_BNuVdL222.js → _A2tLqg9y2.js} +1 -1
- package/dist/public/assets/_A2tLqg9y2.js.br +0 -0
- package/dist/public/assets/{_DJfRmyos.js → _Ar4UEz40.js} +1 -1
- package/dist/public/assets/_Ar4UEz40.js.br +0 -0
- package/dist/public/assets/{_DwnEEAN3.js → _B-wISkbs.js} +1 -1
- package/dist/public/assets/_B-wISkbs.js.br +0 -0
- package/dist/public/assets/{_DvlwodnH2.js → _B0HJN5ud2.js} +1 -1
- package/dist/public/assets/_B0HJN5ud2.js.br +0 -0
- package/dist/public/assets/{_BlLpqMok.js → _B6RbG5-A.js} +1 -1
- package/dist/public/assets/_B6RbG5-A.js.br +0 -0
- package/dist/public/assets/{_Cy6vUvOf.js → _B7cCygGe.js} +1 -1
- package/dist/public/assets/_B7cCygGe.js.br +0 -0
- package/dist/public/assets/{_CXfVimxX2.js → _B7n-BASn2.js} +1 -1
- package/dist/public/assets/{_BFDzSRUb.js → _BBPUNQgX.js} +1 -1
- package/dist/public/assets/_BBPUNQgX.js.br +0 -0
- package/dist/public/assets/{_BbZSZ8_I2.js → _BHhGmIxX2.js} +1 -1
- package/dist/public/assets/_BHhGmIxX2.js.br +0 -0
- package/dist/public/assets/{_bNejHwcl2.js → _BJjI-m6s2.js} +1 -1
- package/dist/public/assets/_BJjI-m6s2.js.br +0 -0
- package/dist/public/assets/{_BE2qRsPs.js → _BJz-Y1HI.js} +1 -1
- package/dist/public/assets/_BJz-Y1HI.js.br +0 -0
- package/dist/public/assets/{_CSBn-Hvt2.js → _BLeHC7zC2.js} +1 -1
- package/dist/public/assets/_BLeHC7zC2.js.br +0 -0
- package/dist/public/assets/{_zGSRZWQr.js → _BO_BKeKC.js} +1 -1
- package/dist/public/assets/_BO_BKeKC.js.br +0 -0
- package/dist/public/assets/{_DM1EXBbo.js → _BVhnP3T6.js} +1 -1
- package/dist/public/assets/_BVhnP3T6.js.br +0 -0
- package/dist/public/assets/{_DB_C0F-Z2.js → _BXK6LHvo2.js} +1 -1
- package/dist/public/assets/_BXK6LHvo2.js.br +0 -0
- package/dist/public/assets/{_CfRbL_Ta2.js → _BYPDDEEO2.js} +1 -1
- package/dist/public/assets/_BYPDDEEO2.js.br +0 -0
- package/dist/public/assets/{_BZou6DQD.js → _BbB3wFGa.js} +1 -1
- package/dist/public/assets/_BbB3wFGa.js.br +0 -0
- package/dist/public/assets/{_CASdx3AE.js → _BicOIlC8.js} +1 -1
- package/dist/public/assets/_BicOIlC8.js.br +0 -0
- package/dist/public/assets/{_DzazkU0O.js → _BjVuWYXf.js} +1 -1
- package/dist/public/assets/_BjVuWYXf.js.br +0 -0
- package/dist/public/assets/{_BYis3bU3.js → _BjeXgSse.js} +1 -1
- package/dist/public/assets/_BjeXgSse.js.br +0 -0
- package/dist/public/assets/{_DmHNNuUl2.js → _Bk7GDGa82.js} +1 -1
- package/dist/public/assets/_Bk7GDGa82.js.br +0 -0
- package/dist/public/assets/{_CDwswGat.js → _BmJ9IUv4.js} +1 -1
- package/dist/public/assets/_BmJ9IUv4.js.br +0 -0
- package/dist/public/assets/{_chJ5r2KH2.js → _BtxdHY0V2.js} +1 -1
- package/dist/public/assets/_BtxdHY0V2.js.br +0 -0
- package/dist/public/assets/{_DAcB8FCB.js → _Bu7Rb2KV.js} +1 -1
- package/dist/public/assets/_Bu7Rb2KV.js.br +0 -0
- package/dist/public/assets/{_R6H7Mgwp.js → _BzIW49zC.js} +1 -1
- package/dist/public/assets/_BzIW49zC.js.br +0 -0
- package/dist/public/assets/{_p7Nk6TN_.js → _C1oox0_T.js} +1 -1
- package/dist/public/assets/_C1oox0_T.js.br +0 -0
- package/dist/public/assets/{_BzAD6TBo.js → _C45kLCWD.js} +8 -8
- package/dist/public/assets/_C45kLCWD.js.br +0 -0
- package/dist/public/assets/{_ClccdQK9.js → _C4B_GVHB.js} +1 -1
- package/dist/public/assets/_C4B_GVHB.js.br +0 -0
- package/dist/public/assets/{_BqkNbZMs.js → _C4tiWhG4.js} +1 -1
- package/dist/public/assets/_C4tiWhG4.js.br +0 -0
- package/dist/public/assets/{_C9TtAENI.js → _C7wuWtJ1.js} +1 -1
- package/dist/public/assets/{_DAHhUiki.js → _CE6eJWkd.js} +1 -1
- package/dist/public/assets/_CE6eJWkd.js.br +0 -0
- package/dist/public/assets/{_BY4vFN-X.js → _CHWTX_c6.js} +1 -1
- package/dist/public/assets/_CHWTX_c6.js.br +0 -0
- package/dist/public/assets/{_B0e3Ak7A.js → _CK9tV5oJ.js} +1 -1
- package/dist/public/assets/_CK9tV5oJ.js.br +0 -0
- package/dist/public/assets/{_B5uwAcaB.js → _CQRIuNJi.js} +1 -1
- package/dist/public/assets/_CQRIuNJi.js.br +0 -0
- package/dist/public/assets/{_B4Nu-wag.js → _CUgERK7S.js} +1 -1
- package/dist/public/assets/_CUgERK7S.js.br +0 -0
- package/dist/public/assets/{_B_qJHbwz.js → _CV5RGu5i.js} +1 -1
- package/dist/public/assets/_CV5RGu5i.js.br +0 -0
- package/dist/public/assets/{_JMdaap6W.js → _CVtWHYIm.js} +21 -21
- package/dist/public/assets/_CVtWHYIm.js.br +0 -0
- package/dist/public/assets/{_BB3PfRLa2.js → _CYUpTPHg2.js} +1 -1
- package/dist/public/assets/_CYUpTPHg2.js.br +0 -0
- package/dist/public/assets/{_mbrwXzyQ.js → _CYemOBLN.js} +1 -1
- package/dist/public/assets/_CYemOBLN.js.br +0 -0
- package/dist/public/assets/{_Ht8V87dw2.js → _CZ0_xhSs2.js} +1 -1
- package/dist/public/assets/{_CMtRRt5X2.js → _C_mUeGVh2.js} +1 -1
- package/dist/public/assets/_C_mUeGVh2.js.br +0 -0
- package/dist/public/assets/{_D5BeGelx.js → _Cb-dgrCB.js} +1 -1
- package/dist/public/assets/_Cb-dgrCB.js.br +0 -0
- package/dist/public/assets/{_C2NMRiCh.js → _CdAkLhxG.js} +1 -1
- package/dist/public/assets/_CdAkLhxG.js.br +0 -0
- package/dist/public/assets/{_Da_nvZ5y.js → _Cf4M5kpG.js} +1 -1
- package/dist/public/assets/_Cf4M5kpG.js.br +0 -0
- package/dist/public/assets/{_BaJXK68-.js → _CoGdSkvu.js} +1 -1
- package/dist/public/assets/_CoGdSkvu.js.br +0 -0
- package/dist/public/assets/{_ChrrA5fF.js → _Cpm5RoWi.js} +1 -1
- package/dist/public/assets/_Cpm5RoWi.js.br +0 -0
- package/dist/public/assets/{_CbbUwTEJ.js → _CpuBCvd6.js} +1 -1
- package/dist/public/assets/_CpuBCvd6.js.br +0 -0
- package/dist/public/assets/{_CTlZ1Lkv2.js → _CsM5ftwz2.js} +1 -1
- package/dist/public/assets/_CsM5ftwz2.js.br +0 -0
- package/dist/public/assets/{_Ddq_uzCH2.js → _CtcH3ZyQ2.js} +1 -1
- package/dist/public/assets/_CtcH3ZyQ2.js.br +0 -0
- package/dist/public/assets/{_DN-QtD1c.js → _CyDfS08K.js} +1 -1
- package/dist/public/assets/_CyDfS08K.js.br +0 -0
- package/dist/public/assets/{_BshAqMBd2.js → _D5qcTAVE2.js} +1 -1
- package/dist/public/assets/_D5qcTAVE2.js.br +0 -0
- package/dist/public/assets/{_BbXYlhz_2.js → _DAGSDF8g2.js} +1 -1
- package/dist/public/assets/_DAGSDF8g2.js.br +0 -0
- package/dist/public/assets/{_CXKoguEA.js → _DIBThzVN.js} +1 -1
- package/dist/public/assets/_DIBThzVN.js.br +0 -0
- package/dist/public/assets/{_BVkMt2PY2.js → _DJEzPcA82.js} +1 -1
- package/dist/public/assets/_DJEzPcA82.js.br +0 -0
- package/dist/public/assets/{_DCM_uGbe.js → _DLBE7zID.js} +1 -1
- package/dist/public/assets/_DLBE7zID.js.br +0 -0
- package/dist/public/assets/{_C6_jrqyQ2.js → _DP-5FfqK2.js} +1 -1
- package/dist/public/assets/_DP-5FfqK2.js.br +0 -0
- package/dist/public/assets/{_Cj0z289t.js → _DglnXAKo.js} +1 -1
- package/dist/public/assets/_DglnXAKo.js.br +0 -0
- package/dist/public/assets/{_BynYlMA5.js → _Dh3HoKhq.js} +1 -1
- package/dist/public/assets/_Dh3HoKhq.js.br +0 -0
- package/dist/public/assets/{_NlAtY9z9.js → _DkxpDwXy.js} +1 -1
- package/dist/public/assets/_DkxpDwXy.js.br +0 -0
- package/dist/public/assets/{_BomcrPR22.js → _DoWF8ByT2.js} +1 -1
- package/dist/public/assets/_DoWF8ByT2.js.br +0 -0
- package/dist/public/assets/{_Rwpt_eYd.js → _HSgzwAmZ.js} +1 -1
- package/dist/public/assets/_HSgzwAmZ.js.br +0 -0
- package/dist/public/assets/{_BoLijUVS.js → _J22ldpof.js} +1 -1
- package/dist/public/assets/_J22ldpof.js.br +0 -0
- package/dist/public/assets/{_yu6_Donv2.js → _J98Rxkdb2.js} +1 -1
- package/dist/public/assets/_J98Rxkdb2.js.br +0 -0
- package/dist/public/assets/{_DZMpOq_k2.js → _JVw8w_7p2.js} +1 -1
- package/dist/public/assets/_JVw8w_7p2.js.br +0 -0
- package/dist/public/assets/{_BSIklgtS.js → _JoWlQVpX.js} +1 -1
- package/dist/public/assets/_JoWlQVpX.js.br +0 -0
- package/dist/public/assets/{_BvXxAv4T.js → _TbUx96Br.js} +1 -1
- package/dist/public/assets/_TbUx96Br.js.br +0 -0
- package/dist/public/assets/{_Dz1I8UR4.js → _akTAmktB.js} +1 -1
- package/dist/public/assets/_akTAmktB.js.br +0 -0
- package/dist/public/assets/{_BK6OZyLT2.js → _dFDJ9A9g2.js} +1 -1
- package/dist/public/assets/_dFDJ9A9g2.js.br +0 -0
- package/dist/public/assets/{_BhTLJW2Y.js → _gHuYn_71.js} +1 -1
- package/dist/public/assets/_gHuYn_71.js.br +0 -0
- package/dist/public/assets/{_Df3c1-mC.js → _j9TQP7q5.js} +1 -1
- package/dist/public/assets/_j9TQP7q5.js.br +0 -0
- package/dist/public/assets/_sWLklcDZ.js +1 -0
- package/dist/public/assets/{_Bp0PawFO.js → _tshHvoEk.js} +1 -1
- package/dist/public/assets/_tshHvoEk.js.br +0 -0
- package/dist/public/assets/{_2AY1cevg.js → _xVSWwNNy.js} +1 -1
- package/dist/public/assets/_xVSWwNNy.js.br +0 -0
- package/dist/public/assets/{_-3KGdeyo.js → _x_T0NsDl.js} +1 -1
- package/dist/public/assets/_x_T0NsDl.js.br +0 -0
- package/dist/public/assets/app-page-LDZ2KXKs.css +1 -0
- package/dist/public/assets/app-page-LDZ2KXKs.css.br +0 -0
- package/dist/public/assets/diff-view-0Uofj0Dv.css +1 -0
- package/dist/public/assets/diff-view-0Uofj0Dv.css.br +0 -0
- package/dist/public/assets/new-CwlftYMt.js +1 -0
- package/dist/public/assets/settings-CwlftYMt.js +1 -0
- package/dist/public/assets/shiki-wasm-stub-sWLklcDZ.js +1 -0
- package/dist/public/assets/w-CwlftYMt.js +1 -0
- package/dist/public/assets/w._-BGFF38Oe.js +1 -0
- package/dist/public/assets/w._-CwlftYMt.js +1 -0
- package/dist/public/assets/{worker-DZo603XT.js → worker-hTZla-j_.js} +1 -1
- package/dist/public/assets/worker-hTZla-j_.js.br +0 -0
- package/lib/setup/doctor.d.mts +0 -2
- package/lib/setup/doctor.mjs +17 -3
- package/lib/usage/format.d.mts +2 -0
- package/lib/usage/format.mjs +22 -0
- package/package.json +1 -1
- package/scripts/migrate.mjs +25 -0
- package/dist/_BBEL67Rf.js +0 -2
- package/dist/public/assets/_-3KGdeyo.js.br +0 -0
- package/dist/public/assets/_2AY1cevg.js.br +0 -0
- package/dist/public/assets/_B0e3Ak7A.js.br +0 -0
- package/dist/public/assets/_B4Nu-wag.js.br +0 -0
- package/dist/public/assets/_B5uwAcaB.js.br +0 -0
- package/dist/public/assets/_BB3PfRLa2.js.br +0 -0
- package/dist/public/assets/_BE2qRsPs.js.br +0 -0
- package/dist/public/assets/_BFDzSRUb.js.br +0 -0
- package/dist/public/assets/_BK6OZyLT2.js.br +0 -0
- package/dist/public/assets/_BNuVdL222.js.br +0 -0
- package/dist/public/assets/_BSIklgtS.js.br +0 -0
- package/dist/public/assets/_BVkMt2PY2.js.br +0 -0
- package/dist/public/assets/_BY4vFN-X.js.br +0 -0
- package/dist/public/assets/_BYis3bU3.js.br +0 -0
- package/dist/public/assets/_BZou6DQD.js.br +0 -0
- package/dist/public/assets/_B_qJHbwz.js.br +0 -0
- package/dist/public/assets/_BaJXK68-.js.br +0 -0
- package/dist/public/assets/_BbXYlhz_2.js.br +0 -0
- package/dist/public/assets/_BbZSZ8_I2.js.br +0 -0
- package/dist/public/assets/_BhTLJW2Y.js.br +0 -0
- package/dist/public/assets/_BlLpqMok.js.br +0 -0
- package/dist/public/assets/_BnjxR4X6.js +0 -1
- package/dist/public/assets/_BnjxR4X6.js.br +0 -0
- package/dist/public/assets/_BoLijUVS.js.br +0 -0
- package/dist/public/assets/_BomcrPR22.js.br +0 -0
- package/dist/public/assets/_Bp0PawFO.js.br +0 -0
- package/dist/public/assets/_BqkNbZMs.js.br +0 -0
- package/dist/public/assets/_BshAqMBd2.js.br +0 -0
- package/dist/public/assets/_BvXxAv4T.js.br +0 -0
- package/dist/public/assets/_BynYlMA5.js.br +0 -0
- package/dist/public/assets/_BzAD6TBo.js.br +0 -0
- package/dist/public/assets/_C2NMRiCh.js.br +0 -0
- package/dist/public/assets/_C5GxdpIx.js.br +0 -0
- package/dist/public/assets/_C6_jrqyQ2.js.br +0 -0
- package/dist/public/assets/_CASdx3AE.js.br +0 -0
- package/dist/public/assets/_CDwswGat.js.br +0 -0
- package/dist/public/assets/_CMtRRt5X2.js.br +0 -0
- package/dist/public/assets/_CSBn-Hvt2.js.br +0 -0
- package/dist/public/assets/_CTlZ1Lkv2.js.br +0 -0
- package/dist/public/assets/_CXKoguEA.js.br +0 -0
- package/dist/public/assets/_CbbUwTEJ.js.br +0 -0
- package/dist/public/assets/_CfRbL_Ta2.js.br +0 -0
- package/dist/public/assets/_ChrrA5fF.js.br +0 -0
- package/dist/public/assets/_Cj0z289t.js.br +0 -0
- package/dist/public/assets/_ClccdQK9.js.br +0 -0
- package/dist/public/assets/_CmwkZmX02.js.br +0 -0
- package/dist/public/assets/_Cy6vUvOf.js.br +0 -0
- package/dist/public/assets/_D5BeGelx.js.br +0 -0
- package/dist/public/assets/_DAHhUiki.js.br +0 -0
- package/dist/public/assets/_DAcB8FCB.js.br +0 -0
- package/dist/public/assets/_DB_C0F-Z2.js.br +0 -0
- package/dist/public/assets/_DCM_uGbe.js.br +0 -0
- package/dist/public/assets/_DJfRmyos.js.br +0 -0
- package/dist/public/assets/_DM1EXBbo.js.br +0 -0
- package/dist/public/assets/_DN-QtD1c.js.br +0 -0
- package/dist/public/assets/_DZMpOq_k2.js.br +0 -0
- package/dist/public/assets/_Da_nvZ5y.js.br +0 -0
- package/dist/public/assets/_DbphB3_Y.js.br +0 -0
- package/dist/public/assets/_Ddq_uzCH2.js.br +0 -0
- package/dist/public/assets/_Df3c1-mC.js.br +0 -0
- package/dist/public/assets/_DmHNNuUl2.js.br +0 -0
- package/dist/public/assets/_DvlwodnH2.js.br +0 -0
- package/dist/public/assets/_DwnEEAN3.js.br +0 -0
- package/dist/public/assets/_Dz1I8UR4.js.br +0 -0
- package/dist/public/assets/_DzazkU0O.js.br +0 -0
- package/dist/public/assets/_JMdaap6W.js.br +0 -0
- package/dist/public/assets/_NlAtY9z9.js.br +0 -0
- package/dist/public/assets/_R6H7Mgwp.js.br +0 -0
- package/dist/public/assets/_Rwpt_eYd.js.br +0 -0
- package/dist/public/assets/_bNejHwcl2.js.br +0 -0
- package/dist/public/assets/_chJ5r2KH2.js.br +0 -0
- package/dist/public/assets/_mbrwXzyQ.js.br +0 -0
- package/dist/public/assets/_p7Nk6TN_.js.br +0 -0
- package/dist/public/assets/_yu6_Donv2.js.br +0 -0
- package/dist/public/assets/_zGSRZWQr.js.br +0 -0
- package/dist/public/assets/app-page-xZ7ggaFZ.css +0 -1
- package/dist/public/assets/app-page-xZ7ggaFZ.css.br +0 -0
- package/dist/public/assets/diff-view-COEkSsJh.css +0 -1
- package/dist/public/assets/diff-view-COEkSsJh.css.br +0 -0
- package/dist/public/assets/new-B4TVUCf9.js +0 -1
- package/dist/public/assets/settings-B4TVUCf9.js +0 -1
- package/dist/public/assets/w-B4TVUCf9.js +0 -1
- package/dist/public/assets/w._-B4TVUCf9.js +0 -1
- package/dist/public/assets/w._-CJLLzbFK.js +0 -1
- package/dist/public/assets/wasm-S0UXjx1m.js +0 -1
- package/dist/public/assets/wasm-S0UXjx1m.js.br +0 -0
- package/dist/public/assets/worker-DZo603XT.js.br +0 -0
|
@@ -158,4 +158,4 @@ XID_Start XIDS`.split(/\s/).map(e=>[mo(e),e])),ns=new Map([[`s`,B(383)],[B(383),
|
|
|
158
158
|
`)),e}const El=Symbol(`no-token`),Dl=Symbol(`multiple-tokens`);function Ol(e){let t=kl(e);if(t!=null)return t;let n=El,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){jl(e,a);for(let t of e.children)Al(t)}else Al(e);r.push(e),i=[],a=void 0;return}for(let e of i)Al(e);r.push(Cl({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==El){if(e===Dl){n=Dl;return}if(n===El){n=e;return}n!==e&&(n=Dl)}};for(let t of e.children){let e=t.type===`element`?Ol(t):El;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function kl(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function Al(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)Al(t)}}function jl(e,t){e.properties[`data-char`]=t}function Ml(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=wl(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&Ol(a),i.push(Tl(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push(Pl,Nl),e&&r.push({line:e=>(e.type===`element`&&e.children.length===0&&e.children.push({type:`element`,tagName:`br`,properties:{},children:[]}),e)}),{state:n,transformers:r,toClass:Nl}}const Nl=Zc({classPrefix:`hl-`}),Pl={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function $(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}function Fl({theme:e=ul,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=sl(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${$(`global`)}fg:${a.fg};`,r+=`${$(`global`)}bg:${a.bg};`,r+=Il(i,n)}else{let n=t.getTheme(e.dark),i=sl(n);r+=`${$(`global`)}dark:${i.fg};`,r+=`${$(`global`)}dark-bg:${i.bg};`,r+=Il(n,`dark`),n=t.getTheme(e.light),i=sl(n),r+=`${$(`global`)}light:${i.fg};`,r+=`${$(`global`)}light-bg:${i.bg};`,r+=Il(n,`light`)}return r}function Il(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${$(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${$(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${$(`global`)}${t}modified-color:${a};`),n}function Ll(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}function Rl(e,t){return e-(t===0?0:1)}function zl(e,t){return Rl(e,t)+t}function Bl({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function Vl({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-zl(n.additionStart,n.additionCount),i=e.deletionLines.length-zl(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function Hl({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=Vl({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function Ul({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=Wl({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=e>0&&c.unifiedCount+e<=n,a=r>0&&c.splitCount+r<=n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=Rl(r.deletionStart,r.deletionCount),s=Rl(r.additionStart,r.additionCount),l=!e.isPartial&&r.deletionCount===0?o:r.deletionLineIndex,u=!e.isPartial&&r.additionCount===0?s:r.additionLineIndex,d=Bl({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),f=n===c.finalHunkIndex?Hl({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,p=d.fromStart+d.fromEnd;function m(e,n){return f==null||f.collapsedLines<=0||f.fromStart+f.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?f.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?f.collapsedLines:0}let h=d.collapsedLines===0;function g(){return h?0:(h=!0,d.collapsedLines)}if(c.shouldSkip(p,p))c.incrementCounts(p,p),g();else{let e=r.unifiedLineStart-d.rangeSize,i=r.splitLineStart-d.rangeSize,a=l-d.rangeSize,f=u-d.rangeSize,p=o+1-d.rangeSize,m=s+1-d.rangeSize;if(ql(c,d.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-d.fromEnd,i=r.splitLineStart-d.fromEnd,a=l-d.fromEnd,f=u-d.fromEnd,p=o+1-d.fromEnd,m=s+1-d.fromEnd,ql(c,d.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}),()=>{g()})))break hunkIterator}let _=r.unifiedLineStart,v=r.splitLineStart,y=l,b=u,x=o+1,S=s+1,C=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===C;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),g();else if(ql(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=_+t,s=v+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:m(o,s),type:`context`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:b+t,lineNumber:S+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{g()}))break hunkIterator;_+=e.lines,v+=e.lines,y+=e.lines,b+=e.lines,x+=e.lines,S+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=Jl(c,e,t);(s[0]?.[0]??0)>0&&g();for(let[l,u]of s)for(let s=l;s<u;s++){let l=m(_+s,t===`unified`?v+(s<e.deletions?s:s-e.deletions):v+s);if(c.emit(Yl({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:_,splitLineIndex:v,additionLineIndex:b,deletionLineIndex:y,additionLineNumber:S,deletionLineNumber:x,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}g(),c.incrementCounts(o,a),_+=o,v+=a,y+=e.deletions,b+=e.additions,x+=e.deletions,S+=e.additions}}if(f!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=f,a=r+i;if(ql(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:!1,unifiedLineIndex:_+t,splitLineIndex:v+t},additionLine:{unifiedLineIndex:_+t,splitLineIndex:v+t,lineIndex:b+t,lineNumber:S+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function Wl({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=Gl({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function Gl({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=Bl({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?Hl({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function Kl(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function ql(e,t,n,r,i,a){let[o,s]=Kl(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function Jl(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function Yl({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,ee=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,te=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,ne=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:ee}:void 0;if(te==null&&ne!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:ne};if(te!=null&&ne==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:te,additionLine:void 0};if(te==null||ne==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:te,additionLine:ne}}function Xl({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":``},alwaysWrap:!0}}function Zl({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}const Ql={forcePlainText:!1};function $l(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=Ql){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=Fl({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??tu();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}Ul({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:!c||h,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&eu({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=nu({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else f.deletionLines.push(...s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else f.additionLines.push(...c)}return{code:f,themeStyles:u,baseThemeType:l}}function eu({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=xl(e),t=xl(t),e.length>s||t.length>s))return;let c=o===`char`?Ac(e,t):qc(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(Zl({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),Zl({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?Zl({item:e,arr:l,enableJoin:d,isLastItem:t}):Zl({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(Xl({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(Xl({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function tu(){return{deletionContent:{push(e){this.value+=e,this.length++},value:``,length:0},additionContent:{push(e){this.value+=e,this.length++},value:``,length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function nu({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c=ul,...l}}){let u=s??yl(e.name),d=s??yl(t.name),{state:f,transformers:p}=Ml(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:$(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:$(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,Ll(i.codeToHast(xl(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,Ll(i.codeToHast(xl(t.contents),m)))}}function ru(e){let t=[0],n=e.indexOf(`\r`),r=e.indexOf(`
|
|
159
159
|
`),i=0,a=0;for(;n!==-1||r!==-1;){let o;if(n!==-1&&(r===-1||n<r)?r===n+1?(o=r+1,n=e.indexOf(`\r`,o),r=e.indexOf(`
|
|
160
160
|
`,o)):(o=n+1,n=e.indexOf(`\r`,o)):(o=r+1,r=e.indexOf(`
|
|
161
|
-
`,o)),t.push(o),++a===4){if(o-i<=40){for(let n=o;n<e.length;n++){let r=e.charCodeAt(n);(r===10||r===13)&&(r===13&&n+1<e.length&&e.charCodeAt(n+1)===10&&n++,t.push(n+1))}return t}i=o,a=0}}return t}function iu(e){let t=ru(e);return Array.from({length:t.length},(n,r)=>{let i=t[r],a=t[r+1]??e.length;return e.slice(i,a)})}const au={forcePlainText:!1};function ou(e,t,{theme:n=ul,tokenizeMaxLineLength:r,useTokenTransformer:i},{forcePlainText:a,startingLine:o,totalLines:s,lines:c}=au){a?(o??=0,s??=1/0):(o=0,s=1/0);let l=o>0||s<1/0,{state:u,transformers:d}=Ml(i),f=a?`text`:e.lang??yl(e.name),p=typeof n==`string`?t.getTheme(n).type:void 0,m=Fl({theme:n,highlighter:t});u.lineInfo=e=>({type:`context`,lineIndex:e-1+o,lineNumber:e+o});let h=typeof n==`string`?{lang:f,theme:n,transformers:d,defaultColor:!1,cssVariablePrefix:$(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0}:{lang:f,themes:n,transformers:d,defaultColor:!1,cssVariablePrefix:$(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0},g=Ll(t.codeToHast(l?su(c??iu(e.contents),o,s):e.contents,h)),_=l?Array(o):g;return l&&_.push(...g),{code:_,themeStyles:m,baseThemeType:p}}function su(e,t,n){if(e.length===0)return``;let r=Math.min(t+n,e.length);return e.slice(t,r).join(``)}let cu,lu={theme:ul,useTokenTransformer:!1,tokenizeMaxLineLength:1e3,lineDiffType:`word-alt`,maxLineDiffLength:1e3};const uu=/(?:)/;self.addEventListener(`error`,e=>{console.error(`[Shiki Worker] Unhandled error:`,e.error)}),self.addEventListener(`message`,e=>{du(e.data)});async function du(e){try{switch(e.type){case`initialize`:await fu(e);break;case`set-render-options`:await pu(e);break;case`file`:await mu(e);break;case`diff`:await hu(e);break;default:throw Error(`Unknown request type: ${e.type}`)}}catch(t){console.error(`Worker error:`,t),bu(e.id,t)}finally{uu.exec(``)}}async function fu({id:e,renderOptions:t,preferredHighlighter:n,resolvedThemes:r,resolvedLanguages:i,customExtensionsVersion:a,customExtensionMap:o}){let s=gu(n);`then`in s&&(s=await s),_u({customExtensionsVersion:a,customExtensionMap:o}),gl(r,s),i!=null&&pl(i,s),lu=t,postMessage({type:`success`,id:e,requestType:`initialize`,sentAt:Date.now()})}async function pu({id:e,renderOptions:t,resolvedThemes:n}){let r=gu();`then`in r&&(r=await r),gl(n,r),lu=t,postMessage({type:`success`,id:e,requestType:`set-render-options`,sentAt:Date.now()})}async function mu({id:e,file:t,resolvedLanguages:n,customExtensionsVersion:r,customExtensionMap:i}){let a=gu();`then`in a&&(a=await a),_u({customExtensionsVersion:r,customExtensionMap:i}),n!=null&&pl(n,a);let o={theme:lu.theme,useTokenTransformer:lu.useTokenTransformer,tokenizeMaxLineLength:lu.tokenizeMaxLineLength};vu(e,ou(t,a,o),o)}async function hu({id:e,diff:t,resolvedLanguages:n,customExtensionsVersion:r,customExtensionMap:i}){let a=gu();`then`in a&&(a=await a),_u({customExtensionsVersion:r,customExtensionMap:i}),n!=null&&pl(n,a),yu(e,$l(t,a,lu),lu)}function gu(e=`shiki-js`){return cu??=Vi({themes:[],langs:[],engine:e===`shiki-wasm`?Cc(import(`./wasm-
|
|
161
|
+
`,o)),t.push(o),++a===4){if(o-i<=40){for(let n=o;n<e.length;n++){let r=e.charCodeAt(n);(r===10||r===13)&&(r===13&&n+1<e.length&&e.charCodeAt(n+1)===10&&n++,t.push(n+1))}return t}i=o,a=0}}return t}function iu(e){let t=ru(e);return Array.from({length:t.length},(n,r)=>{let i=t[r],a=t[r+1]??e.length;return e.slice(i,a)})}const au={forcePlainText:!1};function ou(e,t,{theme:n=ul,tokenizeMaxLineLength:r,useTokenTransformer:i},{forcePlainText:a,startingLine:o,totalLines:s,lines:c}=au){a?(o??=0,s??=1/0):(o=0,s=1/0);let l=o>0||s<1/0,{state:u,transformers:d}=Ml(i),f=a?`text`:e.lang??yl(e.name),p=typeof n==`string`?t.getTheme(n).type:void 0,m=Fl({theme:n,highlighter:t});u.lineInfo=e=>({type:`context`,lineIndex:e-1+o,lineNumber:e+o});let h=typeof n==`string`?{lang:f,theme:n,transformers:d,defaultColor:!1,cssVariablePrefix:$(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0}:{lang:f,themes:n,transformers:d,defaultColor:!1,cssVariablePrefix:$(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0},g=Ll(t.codeToHast(l?su(c??iu(e.contents),o,s):e.contents,h)),_=l?Array(o):g;return l&&_.push(...g),{code:_,themeStyles:m,baseThemeType:p}}function su(e,t,n){if(e.length===0)return``;let r=Math.min(t+n,e.length);return e.slice(t,r).join(``)}let cu,lu={theme:ul,useTokenTransformer:!1,tokenizeMaxLineLength:1e3,lineDiffType:`word-alt`,maxLineDiffLength:1e3};const uu=/(?:)/;self.addEventListener(`error`,e=>{console.error(`[Shiki Worker] Unhandled error:`,e.error)}),self.addEventListener(`message`,e=>{du(e.data)});async function du(e){try{switch(e.type){case`initialize`:await fu(e);break;case`set-render-options`:await pu(e);break;case`file`:await mu(e);break;case`diff`:await hu(e);break;default:throw Error(`Unknown request type: ${e.type}`)}}catch(t){console.error(`Worker error:`,t),bu(e.id,t)}finally{uu.exec(``)}}async function fu({id:e,renderOptions:t,preferredHighlighter:n,resolvedThemes:r,resolvedLanguages:i,customExtensionsVersion:a,customExtensionMap:o}){let s=gu(n);`then`in s&&(s=await s),_u({customExtensionsVersion:a,customExtensionMap:o}),gl(r,s),i!=null&&pl(i,s),lu=t,postMessage({type:`success`,id:e,requestType:`initialize`,sentAt:Date.now()})}async function pu({id:e,renderOptions:t,resolvedThemes:n}){let r=gu();`then`in r&&(r=await r),gl(n,r),lu=t,postMessage({type:`success`,id:e,requestType:`set-render-options`,sentAt:Date.now()})}async function mu({id:e,file:t,resolvedLanguages:n,customExtensionsVersion:r,customExtensionMap:i}){let a=gu();`then`in a&&(a=await a),_u({customExtensionsVersion:r,customExtensionMap:i}),n!=null&&pl(n,a);let o={theme:lu.theme,useTokenTransformer:lu.useTokenTransformer,tokenizeMaxLineLength:lu.tokenizeMaxLineLength};vu(e,ou(t,a,o),o)}async function hu({id:e,diff:t,resolvedLanguages:n,customExtensionsVersion:r,customExtensionMap:i}){let a=gu();`then`in a&&(a=await a),_u({customExtensionsVersion:r,customExtensionMap:i}),n!=null&&pl(n,a),yu(e,$l(t,a,lu),lu)}function gu(e=`shiki-js`){return cu??=Vi({themes:[],langs:[],engine:e===`shiki-wasm`?Cc(import(`./shiki-wasm-stub-sWLklcDZ.js`)):ec()}),cu}function _u({customExtensionsVersion:e,customExtensionMap:t}){if(e!=null||t!=null){if(e==null||t==null)throw Error(`Worker request must include both customExtensionsVersion and customExtensionMap`);bl(e,t)}}function vu(e,t,n){postMessage({type:`success`,requestType:`file`,id:e,result:t,options:n,sentAt:Date.now()})}function yu(e,t,n){postMessage({type:`success`,requestType:`diff`,id:e,result:t,options:n,sentAt:Date.now()})}function bu(e,t){let n={type:`error`,id:e,error:t instanceof Error?t.message:String(t),stack:t instanceof Error?t.stack:void 0};postMessage(n)}
|
|
Binary file
|
package/lib/setup/doctor.d.mts
CHANGED
|
@@ -43,10 +43,8 @@ export interface Doctor {
|
|
|
43
43
|
}
|
|
44
44
|
export function setupPath(base?: string): string;
|
|
45
45
|
export function which(bin: string): string | null;
|
|
46
|
-
export function tilde(p: string): string;
|
|
47
46
|
export function miseVersions(): Promise<Record<string, string> | null>;
|
|
48
47
|
export function ghKnownHosts(): string[];
|
|
49
48
|
export function discoverAgents(): DoctorAgent[];
|
|
50
|
-
export function githubHostStatus(host: string): Promise<GithubHostStatus>;
|
|
51
49
|
export function doctor(opts?: { hosts?: string[] }): Promise<Doctor>;
|
|
52
50
|
export function formatDoctor(d: Doctor): string;
|
package/lib/setup/doctor.mjs
CHANGED
|
@@ -44,7 +44,7 @@ export function setupPath(base = process.env.PATH || "") {
|
|
|
44
44
|
|
|
45
45
|
/** `~/…` for anything under the home directory — every path here is for
|
|
46
46
|
* display (Settings rows, `work doctor`), never re-used to exec. */
|
|
47
|
-
|
|
47
|
+
function tilde(p) {
|
|
48
48
|
if (!p) return p;
|
|
49
49
|
return p === home ? "~" : p.startsWith(home + path.sep) ? "~" + p.slice(home.length) : p;
|
|
50
50
|
}
|
|
@@ -110,17 +110,31 @@ export function ghKnownHosts() {
|
|
|
110
110
|
*/
|
|
111
111
|
export function discoverAgents() {
|
|
112
112
|
const dirs = setupPath().split(path.delimiter);
|
|
113
|
+
// String dedupe in setupPath misses merged dirs (/usr/bin ≡ /bin on
|
|
114
|
+
// many hosts); realpath collapses those so each inode is read once.
|
|
115
|
+
const seenDirs = new Set();
|
|
113
116
|
const seen = new Map();
|
|
114
117
|
for (const dir of dirs) {
|
|
118
|
+
let real;
|
|
119
|
+
try {
|
|
120
|
+
real = fs.realpathSync(dir);
|
|
121
|
+
} catch {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (seenDirs.has(real)) continue;
|
|
125
|
+
seenDirs.add(real);
|
|
115
126
|
let names;
|
|
116
127
|
try {
|
|
117
|
-
names = fs.readdirSync(
|
|
128
|
+
names = fs.readdirSync(real);
|
|
118
129
|
} catch {
|
|
119
130
|
continue;
|
|
120
131
|
}
|
|
121
132
|
for (const name of names) {
|
|
122
133
|
const hit = AGENTS.find((a) => a.bins.some((b) => name === b || (name.startsWith(b) && /^\d+$/.test(name.slice(b.length)))));
|
|
123
134
|
if (!hit || seen.has(name)) continue;
|
|
135
|
+
// Join against the PATH entry, not the realpath — tilde() matches on
|
|
136
|
+
// $HOME, and on hosts where home is a symlink (/home → /var/home)
|
|
137
|
+
// the resolved path would print absolute while `which()` still shows ~.
|
|
124
138
|
const full = path.join(dir, name);
|
|
125
139
|
try {
|
|
126
140
|
if (!fs.statSync(full).isFile()) continue;
|
|
@@ -141,7 +155,7 @@ export function discoverAgents() {
|
|
|
141
155
|
}
|
|
142
156
|
|
|
143
157
|
/** Auth status for one host via gh (which owns the tokens). */
|
|
144
|
-
|
|
158
|
+
async function githubHostStatus(host) {
|
|
145
159
|
const isEnterprise = host !== DEFAULT_GITHUB_HOST;
|
|
146
160
|
if (!which("gh")) return { host, isEnterprise, authed: false, error: "gh not installed" };
|
|
147
161
|
const { ok, stdout, stderr } = await run("gh", ["auth", "status", "--hostname", host]);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Plan/quota numbers read the same in the web UI and in `work usage`: one
|
|
2
|
+
// copy of the two formatters, imported by both (see lib/review for the
|
|
3
|
+
// same idea applied to the review's markdown).
|
|
4
|
+
|
|
5
|
+
/** Percent, with a decimal only where rounding would lie: 99.6% must not
|
|
6
|
+
* read as a spent 100%, and 0.4% must not read as an untouched 0%. */
|
|
7
|
+
export function pctText(pct) {
|
|
8
|
+
const rounded = Math.round(pct);
|
|
9
|
+
return rounded !== pct && (rounded === 100 || rounded === 0)
|
|
10
|
+
? `${pct.toFixed(1)}%`
|
|
11
|
+
: `${rounded}%`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Coarse span — minutes, then hours, then days. Used for "resets in" and
|
|
15
|
+
* "n old", where a precise figure would imply freshness it doesn't have. */
|
|
16
|
+
export function duration(ms) {
|
|
17
|
+
const m = Math.round(ms / 60_000);
|
|
18
|
+
if (m < 60) return `${m}m`;
|
|
19
|
+
const h = Math.round(m / 60);
|
|
20
|
+
if (h < 48) return `${h}h`;
|
|
21
|
+
return `${Math.round(h / 24)}d`;
|
|
22
|
+
}
|
package/package.json
CHANGED
package/scripts/migrate.mjs
CHANGED
|
@@ -380,3 +380,28 @@ for (const { path: wsPath } of db.prepare("SELECT path FROM workspaces").all())
|
|
|
380
380
|
} catch {}
|
|
381
381
|
}
|
|
382
382
|
if (repoNoted) console.log(`==> migrate: required repo agents files in ${repoNoted} AGENTS.md`);
|
|
383
|
+
|
|
384
|
+
// Per-workspace UI prefs were never swept on delete; they ride every SSR
|
|
385
|
+
// document via allPrefs(). Prune orphans once — runtime delete handles new ones.
|
|
386
|
+
{
|
|
387
|
+
const wr = new DatabaseSync(dbPath);
|
|
388
|
+
try {
|
|
389
|
+
const live = new Set(
|
|
390
|
+
wr.prepare("SELECT id FROM workspaces").all().map((r) => r.id),
|
|
391
|
+
);
|
|
392
|
+
const prefixes = ["ui.tab:", "ui.diff-filter:", "ui.diff-pos:"];
|
|
393
|
+
let pruned = 0;
|
|
394
|
+
for (const prefix of prefixes) {
|
|
395
|
+
for (const { key } of wr
|
|
396
|
+
.prepare("SELECT key FROM settings WHERE key GLOB ?")
|
|
397
|
+
.all(prefix + "*")) {
|
|
398
|
+
if (live.has(key.slice(prefix.length))) continue;
|
|
399
|
+
wr.prepare("DELETE FROM settings WHERE key = ?").run(key);
|
|
400
|
+
pruned++;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
if (pruned) console.log(`==> migrate: pruned ${pruned} orphaned ui pref(s)`);
|
|
404
|
+
} finally {
|
|
405
|
+
wr.close();
|
|
406
|
+
}
|
|
407
|
+
}
|
package/dist/_BBEL67Rf.js
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|