@keystrokehq/cli 0.1.3 → 0.1.5
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/dist/alias-RTYYYW3D-CLFgrowj.mjs +98 -0
- package/dist/alias-RTYYYW3D-CLFgrowj.mjs.map +1 -0
- package/dist/awk2-LA3USKJP-BbsfXVlR.mjs +2737 -0
- package/dist/awk2-LA3USKJP-BbsfXVlR.mjs.map +1 -0
- package/dist/base64-C2AIWVNC-C0WIgu5V.mjs +123 -0
- package/dist/base64-C2AIWVNC-C0WIgu5V.mjs.map +1 -0
- package/dist/basename-UB3CIYNI-BgNN3bGm.mjs +53 -0
- package/dist/basename-UB3CIYNI-BgNN3bGm.mjs.map +1 -0
- package/dist/bash-YZ33HQZQ-N6YyKtUH.mjs +118 -0
- package/dist/bash-YZ33HQZQ-N6YyKtUH.mjs.map +1 -0
- package/dist/cat-TSFMZVYS-Dz3-oHsV.mjs +63 -0
- package/dist/cat-TSFMZVYS-Dz3-oHsV.mjs.map +1 -0
- package/dist/chmod-TFEPA42X-YF02QJUv.mjs +125 -0
- package/dist/chmod-TFEPA42X-YF02QJUv.mjs.map +1 -0
- package/dist/chunk-27JIFWUR-B6ZjjMMI.mjs +100 -0
- package/dist/chunk-27JIFWUR-B6ZjjMMI.mjs.map +1 -0
- package/dist/chunk-4I3HOE5Z-BixWWVkW.mjs +719 -0
- package/dist/chunk-4I3HOE5Z-BixWWVkW.mjs.map +1 -0
- package/dist/chunk-4RUAZWKT-D60fyWAB.mjs +22543 -0
- package/dist/chunk-4RUAZWKT-D60fyWAB.mjs.map +1 -0
- package/dist/chunk-4WKZNNJK-CiwxAWRf.mjs +69 -0
- package/dist/chunk-4WKZNNJK-CiwxAWRf.mjs.map +1 -0
- package/dist/chunk-5H5SCKJM-BvfXlL01.mjs +606 -0
- package/dist/chunk-5H5SCKJM-BvfXlL01.mjs.map +1 -0
- package/dist/chunk-AQ6FYS2X-CkVetjym.mjs +37 -0
- package/dist/chunk-AQ6FYS2X-CkVetjym.mjs.map +1 -0
- package/dist/chunk-BZUGFHVS-CPWRFwK8.mjs +34 -0
- package/dist/chunk-BZUGFHVS-CPWRFwK8.mjs.map +1 -0
- package/dist/chunk-CHFEPBH4-BUdgjFtD.mjs +594 -0
- package/dist/chunk-CHFEPBH4-BUdgjFtD.mjs.map +1 -0
- package/dist/chunk-DLL7UR66-BUYgzxnR.mjs +14 -0
- package/dist/chunk-DLL7UR66-BUYgzxnR.mjs.map +1 -0
- package/dist/chunk-DiodbrVj.mjs +27 -0
- package/dist/chunk-EBAPSGAO-Ctfslw2R.mjs +247 -0
- package/dist/chunk-EBAPSGAO-Ctfslw2R.mjs.map +1 -0
- package/dist/chunk-FOCWZZDE-BIntqBh2.mjs +19 -0
- package/dist/chunk-FOCWZZDE-BIntqBh2.mjs.map +1 -0
- package/dist/chunk-HBVMHTO5-CJyD-QZX.mjs +10 -0
- package/dist/chunk-HBVMHTO5-CJyD-QZX.mjs.map +1 -0
- package/dist/chunk-L2UW7DWF-B3tEHhPF.mjs +14 -0
- package/dist/chunk-L2UW7DWF-B3tEHhPF.mjs.map +1 -0
- package/dist/chunk-L64BMZUV-CyR7RKok.mjs +30 -0
- package/dist/chunk-L64BMZUV-CyR7RKok.mjs.map +1 -0
- package/dist/chunk-LEKBROJD-CJMrAyu9.mjs +3113 -0
- package/dist/chunk-LEKBROJD-CJMrAyu9.mjs.map +1 -0
- package/dist/chunk-NRSASXYY-CuWyREpD.mjs +41 -0
- package/dist/chunk-NRSASXYY-CuWyREpD.mjs.map +1 -0
- package/dist/chunk-QAYAQNCG-Bl0Kbd53.mjs +63 -0
- package/dist/chunk-QAYAQNCG-Bl0Kbd53.mjs.map +1 -0
- package/dist/chunk-QIQMJJZ4-BwKdslXs.mjs +93 -0
- package/dist/chunk-QIQMJJZ4-BwKdslXs.mjs.map +1 -0
- package/dist/chunk-SAI2SPQQ-CVRoDNs9.mjs +26 -0
- package/dist/chunk-SAI2SPQQ-CVRoDNs9.mjs.map +1 -0
- package/dist/chunk-SO6R3ZKN-tTw_RMDX.mjs +140 -0
- package/dist/chunk-SO6R3ZKN-tTw_RMDX.mjs.map +1 -0
- package/dist/chunk-STHBFACM-lyj-j2a-.mjs +8 -0
- package/dist/chunk-STHBFACM-lyj-j2a-.mjs.map +1 -0
- package/dist/chunk-SX2HC7SO-Cc4Hpis1.mjs +20 -0
- package/dist/chunk-SX2HC7SO-Cc4Hpis1.mjs.map +1 -0
- package/dist/chunk-TDD4NFYE-wsWW75MX.mjs +21 -0
- package/dist/chunk-TDD4NFYE-wsWW75MX.mjs.map +1 -0
- package/dist/chunk-TN7HHBQW-CSB_R-XD.mjs +1137 -0
- package/dist/chunk-TN7HHBQW-CSB_R-XD.mjs.map +1 -0
- package/dist/chunk-VPADYNBD-BKlA28GJ.mjs +122 -0
- package/dist/chunk-VPADYNBD-BKlA28GJ.mjs.map +1 -0
- package/dist/chunk-W5DWRFSU-lCyWk0ph.mjs +11 -0
- package/dist/chunk-W5DWRFSU-lCyWk0ph.mjs.map +1 -0
- package/dist/chunk-WNH3HOQA-BCZUOjCJ.mjs +34 -0
- package/dist/chunk-WNH3HOQA-BCZUOjCJ.mjs.map +1 -0
- package/dist/chunk-XRFHFXFP-BGxzVZgK.mjs +16 -0
- package/dist/chunk-XRFHFXFP-BGxzVZgK.mjs.map +1 -0
- package/dist/chunk-YCLFEX4T-COc1AThz.mjs +77 -0
- package/dist/chunk-YCLFEX4T-COc1AThz.mjs.map +1 -0
- package/dist/clear-HKGFEOF6-CekN2x-O.mjs +28 -0
- package/dist/clear-HKGFEOF6-CekN2x-O.mjs.map +1 -0
- package/dist/column-XT6UFXNQ-DHENV9D2.mjs +143 -0
- package/dist/column-XT6UFXNQ-DHENV9D2.mjs.map +1 -0
- package/dist/comm-VV2LDX2J-ppxDJFkY.mjs +87 -0
- package/dist/comm-VV2LDX2J-ppxDJFkY.mjs.map +1 -0
- package/dist/cp-BISAAS7A-CMWayU4n.mjs +106 -0
- package/dist/cp-BISAAS7A-CMWayU4n.mjs.map +1 -0
- package/dist/cut-OKARJCCV-Bt8b58eI.mjs +119 -0
- package/dist/cut-OKARJCCV-Bt8b58eI.mjs.map +1 -0
- package/dist/date-UUUPW43J-B7T5OTZZ.mjs +188 -0
- package/dist/date-UUUPW43J-B7T5OTZZ.mjs.map +1 -0
- package/dist/diff-MWJFIG7X-DhnPc_5r.mjs +755 -0
- package/dist/diff-MWJFIG7X-DhnPc_5r.mjs.map +1 -0
- package/dist/dirname-MPHRFUTI-Dkb3S4OX.mjs +43 -0
- package/dist/dirname-MPHRFUTI-Dkb3S4OX.mjs.map +1 -0
- package/dist/{dist-DWcRd4Se.mjs → dist-B9XaHV_2.mjs} +26 -73
- package/dist/dist-B9XaHV_2.mjs.map +1 -0
- package/dist/{dist-DjfxlOWX.mjs → dist-C3YClLXV.mjs} +285 -226
- package/dist/{dist-DjfxlOWX.mjs.map → dist-C3YClLXV.mjs.map} +1 -1
- package/dist/dist-D_-88U7y.mjs +1887 -0
- package/dist/dist-D_-88U7y.mjs.map +1 -0
- package/dist/dist-iKd6nzBK.mjs +3 -0
- package/dist/du-572XNP42-ClP4jXB1.mjs +176 -0
- package/dist/du-572XNP42-ClP4jXB1.mjs.map +1 -0
- package/dist/echo-NDWZZHPO-CCp_-MxA.mjs +137 -0
- package/dist/echo-NDWZZHPO-CCp_-MxA.mjs.map +1 -0
- package/dist/env-36M5BO7M-CsP_aiWr.mjs +119 -0
- package/dist/env-36M5BO7M-CsP_aiWr.mjs.map +1 -0
- package/dist/expand-JSPG6VOP-B-YUvYpu.mjs +145 -0
- package/dist/expand-JSPG6VOP-B-YUvYpu.mjs.map +1 -0
- package/dist/expr-5JAACS4X-1TBq84gG.mjs +153 -0
- package/dist/expr-5JAACS4X-1TBq84gG.mjs.map +1 -0
- package/dist/file-IPZJC3FQ-DcZNOWyY.mjs +4201 -0
- package/dist/file-IPZJC3FQ-DcZNOWyY.mjs.map +1 -0
- package/dist/find-INTH3OLC-6p47KeeT.mjs +1332 -0
- package/dist/find-INTH3OLC-6p47KeeT.mjs.map +1 -0
- package/dist/fold-4TQNYMSW-C54bHzLd.mjs +138 -0
- package/dist/fold-4TQNYMSW-C54bHzLd.mjs.map +1 -0
- package/dist/grep-V3LQVMRQ-D99Bq7Kj.mjs +335 -0
- package/dist/grep-V3LQVMRQ-D99Bq7Kj.mjs.map +1 -0
- package/dist/gzip-O5ASJAFY-CZDRROqP.mjs +592 -0
- package/dist/gzip-O5ASJAFY-CZDRROqP.mjs.map +1 -0
- package/dist/head-442HYESI-D96RMdki.mjs +36 -0
- package/dist/head-442HYESI-D96RMdki.mjs.map +1 -0
- package/dist/help-HZ6M2CKN--DK8mY2L.mjs +123 -0
- package/dist/help-HZ6M2CKN--DK8mY2L.mjs.map +1 -0
- package/dist/history-WYYKSLSZ-ACNQVupn.mjs +48 -0
- package/dist/history-WYYKSLSZ-ACNQVupn.mjs.map +1 -0
- package/dist/hostname-C4HQXXUP-CXVVFkUK.mjs +24 -0
- package/dist/hostname-C4HQXXUP-CXVVFkUK.mjs.map +1 -0
- package/dist/html-to-markdown-JW4MSQZO-DQOxFIvF.mjs +15890 -0
- package/dist/html-to-markdown-JW4MSQZO-DQOxFIvF.mjs.map +1 -0
- package/dist/index.mjs +431 -161
- package/dist/index.mjs.map +1 -1
- package/dist/join-TBRGI3LQ-B8I9tkJ5.mjs +198 -0
- package/dist/join-TBRGI3LQ-B8I9tkJ5.mjs.map +1 -0
- package/dist/jq-4XLYLOS5-wFZYfsfJ.mjs +257 -0
- package/dist/jq-4XLYLOS5-wFZYfsfJ.mjs.map +1 -0
- package/dist/js-exec-N5KEZBH7-CgtG-I6s.mjs +333 -0
- package/dist/js-exec-N5KEZBH7-CgtG-I6s.mjs.map +1 -0
- package/dist/lib-D4GpdNNK.mjs +45 -0
- package/dist/lib-D4GpdNNK.mjs.map +1 -0
- package/dist/ln-4LGSXXGD-Dg0R9i5G.mjs +101 -0
- package/dist/ln-4LGSXXGD-Dg0R9i5G.mjs.map +1 -0
- package/dist/ls-ZJGQER7M-DLDSfI4x.mjs +1891 -0
- package/dist/ls-ZJGQER7M-DLDSfI4x.mjs.map +1 -0
- package/dist/lzma-CTMDi254.mjs +1135 -0
- package/dist/lzma-CTMDi254.mjs.map +1 -0
- package/dist/{maybe-auto-update-Ou7H6dXT.mjs → maybe-auto-update-DHt-mVf1.mjs} +2 -2
- package/dist/{maybe-auto-update-Ou7H6dXT.mjs.map → maybe-auto-update-DHt-mVf1.mjs.map} +1 -1
- package/dist/md5sum-SPU24VSG-DQc8sqXO.mjs +16 -0
- package/dist/md5sum-SPU24VSG-DQc8sqXO.mjs.map +1 -0
- package/dist/mkdir-MEPGZOB6-BjUKzhdL.mjs +58 -0
- package/dist/mkdir-MEPGZOB6-BjUKzhdL.mjs.map +1 -0
- package/dist/mv-W5BIQ646-CdSIyY-U.mjs +93 -0
- package/dist/mv-W5BIQ646-CdSIyY-U.mjs.map +1 -0
- package/dist/nl-WSDW7I4O-DmtCnyKU.mjs +208 -0
- package/dist/nl-WSDW7I4O-DmtCnyKU.mjs.map +1 -0
- package/dist/od-WOKFDJTP-DZ2nxQNJ.mjs +73 -0
- package/dist/od-WOKFDJTP-DZ2nxQNJ.mjs.map +1 -0
- package/dist/paste-7JC6S4DX-CtmM5Qy8.mjs +113 -0
- package/dist/paste-7JC6S4DX-CtmM5Qy8.mjs.map +1 -0
- package/dist/printf-TWGXF445-B7cTysaa.mjs +880 -0
- package/dist/printf-TWGXF445-B7cTysaa.mjs.map +1 -0
- package/dist/pwd-WE6EN5AV-CO8o2WQS.mjs +34 -0
- package/dist/pwd-WE6EN5AV-CO8o2WQS.mjs.map +1 -0
- package/dist/python3-POMOR4OA-CKy80mpF.mjs +299 -0
- package/dist/python3-POMOR4OA-CKy80mpF.mjs.map +1 -0
- package/dist/readlink-OPJF4DL5-Rc1Mz_Xx.mjs +76 -0
- package/dist/readlink-OPJF4DL5-Rc1Mz_Xx.mjs.map +1 -0
- package/dist/rev-5EHFX4EJ-3dd9vwHW.mjs +66 -0
- package/dist/rev-5EHFX4EJ-3dd9vwHW.mjs.map +1 -0
- package/dist/rg-S4FXYXWB-BbXVo6JX.mjs +1539 -0
- package/dist/rg-S4FXYXWB-BbXVo6JX.mjs.map +1 -0
- package/dist/rm-SSGETQVQ-Ch53Rmrr.mjs +81 -0
- package/dist/rm-SSGETQVQ-Ch53Rmrr.mjs.map +1 -0
- package/dist/rmdir-OC4ZLPYA-D3QCHlIB.mjs +132 -0
- package/dist/rmdir-OC4ZLPYA-D3QCHlIB.mjs.map +1 -0
- package/dist/sed-S5UIK574-DE1KeTk3.mjs +1722 -0
- package/dist/sed-S5UIK574-DE1KeTk3.mjs.map +1 -0
- package/dist/seq-M5EC7Q57-BHfGjQvK.mjs +85 -0
- package/dist/seq-M5EC7Q57-BHfGjQvK.mjs.map +1 -0
- package/dist/sha1sum-2PTOAFR6-DNjSNcYK.mjs +16 -0
- package/dist/sha1sum-2PTOAFR6-DNjSNcYK.mjs.map +1 -0
- package/dist/sha256sum-NS7D3IXX-BMaCKkT5.mjs +16 -0
- package/dist/sha256sum-NS7D3IXX-BMaCKkT5.mjs.map +1 -0
- package/dist/sleep-X22JJINO-Do5hEQQW.mjs +67 -0
- package/dist/sleep-X22JJINO-Do5hEQQW.mjs.map +1 -0
- package/dist/sort-SW2YEO5B-B7j1zw8k.mjs +320 -0
- package/dist/sort-SW2YEO5B-B7j1zw8k.mjs.map +1 -0
- package/dist/split-4KKZZXXE-h8GD4HP4.mjs +248 -0
- package/dist/split-4KKZZXXE-h8GD4HP4.mjs.map +1 -0
- package/dist/sqlite3-CGOEFJAO-DvzzghDg.mjs +2879 -0
- package/dist/sqlite3-CGOEFJAO-DvzzghDg.mjs.map +1 -0
- package/dist/stat-CD34IZ4P-B5ZOJh4J.mjs +65 -0
- package/dist/stat-CD34IZ4P-B5ZOJh4J.mjs.map +1 -0
- package/dist/strings-6WDHLGMX-DdiEdoL-.mjs +179 -0
- package/dist/strings-6WDHLGMX-DdiEdoL-.mjs.map +1 -0
- package/dist/tac-2STMMJYW-DPyeWM9R.mjs +53 -0
- package/dist/tac-2STMMJYW-DPyeWM9R.mjs.map +1 -0
- package/dist/tail-R4PCA2C4-CUfroNeu.mjs +37 -0
- package/dist/tail-R4PCA2C4-CUfroNeu.mjs.map +1 -0
- package/dist/tar-STHHZTZ6-DRf60e-G.mjs +2838 -0
- package/dist/tar-STHHZTZ6-DRf60e-G.mjs.map +1 -0
- package/dist/tee-YUZ2FKCJ-po_dfyc_.mjs +46 -0
- package/dist/tee-YUZ2FKCJ-po_dfyc_.mjs.map +1 -0
- package/dist/time-D4LNBSWX-DVWhAldK.mjs +112 -0
- package/dist/time-D4LNBSWX-DVWhAldK.mjs.map +1 -0
- package/dist/timeout-YDCRSLPQ-B_yntmXU.mjs +113 -0
- package/dist/timeout-YDCRSLPQ-B_yntmXU.mjs.map +1 -0
- package/dist/touch-UA33VN3N-oW1SBT1r.mjs +104 -0
- package/dist/touch-UA33VN3N-oW1SBT1r.mjs.map +1 -0
- package/dist/tr-36LHWFRQ-CTq3z6wq.mjs +167 -0
- package/dist/tr-36LHWFRQ-CTq3z6wq.mjs.map +1 -0
- package/dist/tree-YLD52CNT-CIozNsLQ.mjs +186 -0
- package/dist/tree-YLD52CNT-CIozNsLQ.mjs.map +1 -0
- package/dist/true-FHQXJXBE-DsJOznSp.mjs +31 -0
- package/dist/true-FHQXJXBE-DsJOznSp.mjs.map +1 -0
- package/dist/unexpand-CADSA4VO-Cq9DTcUg.mjs +155 -0
- package/dist/unexpand-CADSA4VO-Cq9DTcUg.mjs.map +1 -0
- package/dist/uniq-XSIZR6PB-D5lt-IXF.mjs +92 -0
- package/dist/uniq-XSIZR6PB-D5lt-IXF.mjs.map +1 -0
- package/dist/{version-n-JpPeUF.mjs → version-BOm_5ar9.mjs} +2 -2
- package/dist/{version-n-JpPeUF.mjs.map → version-BOm_5ar9.mjs.map} +1 -1
- package/dist/wc-LF7NU4LA-BFPabrwD.mjs +111 -0
- package/dist/wc-LF7NU4LA-BFPabrwD.mjs.map +1 -0
- package/dist/which-XEM24D5D-2LvlkpUo.mjs +62 -0
- package/dist/which-XEM24D5D-2LvlkpUo.mjs.map +1 -0
- package/dist/whoami-XMTX52VE-24Kwqrk6.mjs +24 -0
- package/dist/whoami-XMTX52VE-24Kwqrk6.mjs.map +1 -0
- package/dist/xan-Y6WF3IRG-DjKO96Pj.mjs +2832 -0
- package/dist/xan-Y6WF3IRG-DjKO96Pj.mjs.map +1 -0
- package/dist/xan-view-HDVKHFC2-DhDNVE_V.mjs +12 -0
- package/dist/xan-view-HDVKHFC2-DhDNVE_V.mjs.map +1 -0
- package/dist/xargs-MGZPH7AX-D2bIgrdg.mjs +112 -0
- package/dist/xargs-MGZPH7AX-D2bIgrdg.mjs.map +1 -0
- package/dist/yq-4QJW3EQG-XhB3aACo.mjs +8610 -0
- package/dist/yq-4QJW3EQG-XhB3aACo.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/dist-DWcRd4Se.mjs.map +0 -1
- package/dist/dist-DitNZUHA.mjs +0 -3
- package/dist/dist-vwoMCz6d.mjs +0 -775
- package/dist/dist-vwoMCz6d.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-MWJFIG7X-DhnPc_5r.mjs","names":["p","u","c","s","o","a","g.createTwoFilesPatch"],"sources":["../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/base.js","../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/character.js","../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/util/string.js","../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/word.js","../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/line.js","../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/sentence.js","../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/css.js","../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/json.js","../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/diff/array.js","../../../node_modules/.pnpm/diff@8.0.4/node_modules/diff/libesm/patch/create.js","../../../node_modules/.pnpm/just-bash@3.0.1/node_modules/just-bash/dist/bundle/chunks/chunk-CBJVD2XA.js","../../../node_modules/.pnpm/just-bash@3.0.1/node_modules/just-bash/dist/bundle/chunks/diff-MWJFIG7X.js"],"sourcesContent":["export default class Diff {\n diff(oldStr, newStr, \n // Type below is not accurate/complete - see above for full possibilities - but it compiles\n options = {}) {\n let callback;\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n else if ('callback' in options) {\n callback = options.callback;\n }\n // Allow subclasses to massage the input prior to running\n const oldString = this.castInput(oldStr, options);\n const newString = this.castInput(newStr, options);\n const oldTokens = this.removeEmpty(this.tokenize(oldString, options));\n const newTokens = this.removeEmpty(this.tokenize(newString, options));\n return this.diffWithOptionsObj(oldTokens, newTokens, options, callback);\n }\n diffWithOptionsObj(oldTokens, newTokens, options, callback) {\n var _a;\n const done = (value) => {\n value = this.postProcess(value, options);\n if (callback) {\n setTimeout(function () { callback(value); }, 0);\n return undefined;\n }\n else {\n return value;\n }\n };\n const newLen = newTokens.length, oldLen = oldTokens.length;\n let editLength = 1;\n let maxEditLength = newLen + oldLen;\n if (options.maxEditLength != null) {\n maxEditLength = Math.min(maxEditLength, options.maxEditLength);\n }\n const maxExecutionTime = (_a = options.timeout) !== null && _a !== void 0 ? _a : Infinity;\n const abortAfterTimestamp = Date.now() + maxExecutionTime;\n const bestPath = [{ oldPos: -1, lastComponent: undefined }];\n // Seed editLength = 0, i.e. the content starts with the same values\n let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options);\n if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {\n // Identity per the equality and tokenizer\n return done(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens));\n }\n // Once we hit the right edge of the edit graph on some diagonal k, we can\n // definitely reach the end of the edit graph in no more than k edits, so\n // there's no point in considering any moves to diagonal k+1 any more (from\n // which we're guaranteed to need at least k+1 more edits).\n // Similarly, once we've reached the bottom of the edit graph, there's no\n // point considering moves to lower diagonals.\n // We record this fact by setting minDiagonalToConsider and\n // maxDiagonalToConsider to some finite value once we've hit the edge of\n // the edit graph.\n // This optimization is not faithful to the original algorithm presented in\n // Myers's paper, which instead pointlessly extends D-paths off the end of\n // the edit graph - see page 7 of Myers's paper which notes this point\n // explicitly and illustrates it with a diagram. This has major performance\n // implications for some common scenarios. For instance, to compute a diff\n // where the new text simply appends d characters on the end of the\n // original text of length n, the true Myers algorithm will take O(n+d^2)\n // time while this optimization needs only O(n+d) time.\n let minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;\n // Main worker method. checks all permutations of a given edit length for acceptance.\n const execEditLength = () => {\n for (let diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {\n let basePath;\n const removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];\n if (removePath) {\n // No one else is going to attempt to use this value, clear it\n // @ts-expect-error - perf optimisation. This type-violating value will never be read.\n bestPath[diagonalPath - 1] = undefined;\n }\n let canAdd = false;\n if (addPath) {\n // what newPos will be after we do an insertion:\n const addPathNewPos = addPath.oldPos - diagonalPath;\n canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;\n }\n const canRemove = removePath && removePath.oldPos + 1 < oldLen;\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n // @ts-expect-error - perf optimisation. This type-violating value will never be read.\n bestPath[diagonalPath] = undefined;\n continue;\n }\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the old string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canRemove || (canAdd && removePath.oldPos < addPath.oldPos)) {\n basePath = this.addToPath(addPath, true, false, 0, options);\n }\n else {\n basePath = this.addToPath(removePath, false, true, 1, options);\n }\n newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options);\n if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {\n // If we have hit the end of both strings, then we are done\n return done(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true;\n }\n else {\n bestPath[diagonalPath] = basePath;\n if (basePath.oldPos + 1 >= oldLen) {\n maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);\n }\n if (newPos + 1 >= newLen) {\n minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);\n }\n }\n }\n editLength++;\n };\n // Performs the length of edit iteration. Is a bit fugly as this has to support the\n // sync and async mode which is never fun. Loops over execEditLength until a value\n // is produced, or until the edit length exceeds options.maxEditLength (if given),\n // in which case it will return undefined.\n if (callback) {\n (function exec() {\n setTimeout(function () {\n if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {\n return callback(undefined);\n }\n if (!execEditLength()) {\n exec();\n }\n }, 0);\n }());\n }\n else {\n while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {\n const ret = execEditLength();\n if (ret) {\n return ret;\n }\n }\n }\n }\n addToPath(path, added, removed, oldPosInc, options) {\n const last = path.lastComponent;\n if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {\n return {\n oldPos: path.oldPos + oldPosInc,\n lastComponent: { count: last.count + 1, added: added, removed: removed, previousComponent: last.previousComponent }\n };\n }\n else {\n return {\n oldPos: path.oldPos + oldPosInc,\n lastComponent: { count: 1, added: added, removed: removed, previousComponent: last }\n };\n }\n }\n extractCommon(basePath, newTokens, oldTokens, diagonalPath, options) {\n const newLen = newTokens.length, oldLen = oldTokens.length;\n let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;\n while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options)) {\n newPos++;\n oldPos++;\n commonCount++;\n if (options.oneChangePerToken) {\n basePath.lastComponent = { count: 1, previousComponent: basePath.lastComponent, added: false, removed: false };\n }\n }\n if (commonCount && !options.oneChangePerToken) {\n basePath.lastComponent = { count: commonCount, previousComponent: basePath.lastComponent, added: false, removed: false };\n }\n basePath.oldPos = oldPos;\n return newPos;\n }\n equals(left, right, options) {\n if (options.comparator) {\n return options.comparator(left, right);\n }\n else {\n return left === right\n || (!!options.ignoreCase && left.toLowerCase() === right.toLowerCase());\n }\n }\n removeEmpty(array) {\n const ret = [];\n for (let i = 0; i < array.length; i++) {\n if (array[i]) {\n ret.push(array[i]);\n }\n }\n return ret;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n castInput(value, options) {\n return value;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n tokenize(value, options) {\n return Array.from(value);\n }\n join(chars) {\n // Assumes ValueT is string, which is the case for most subclasses.\n // When it's false, e.g. in diffArrays, this method needs to be overridden (e.g. with a no-op)\n // Yes, the casts are verbose and ugly, because this pattern - of having the base class SORT OF\n // assume tokens and values are strings, but not completely - is weird and janky.\n return chars.join('');\n }\n postProcess(changeObjects, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n options) {\n return changeObjects;\n }\n get useLongestToken() {\n return false;\n }\n buildValues(lastComponent, newTokens, oldTokens) {\n // First we convert our linked list of components in reverse order to an\n // array in the right order:\n const components = [];\n let nextComponent;\n while (lastComponent) {\n components.push(lastComponent);\n nextComponent = lastComponent.previousComponent;\n delete lastComponent.previousComponent;\n lastComponent = nextComponent;\n }\n components.reverse();\n const componentLen = components.length;\n let componentPos = 0, newPos = 0, oldPos = 0;\n for (; componentPos < componentLen; componentPos++) {\n const component = components[componentPos];\n if (!component.removed) {\n if (!component.added && this.useLongestToken) {\n let value = newTokens.slice(newPos, newPos + component.count);\n value = value.map(function (value, i) {\n const oldValue = oldTokens[oldPos + i];\n return oldValue.length > value.length ? oldValue : value;\n });\n component.value = this.join(value);\n }\n else {\n component.value = this.join(newTokens.slice(newPos, newPos + component.count));\n }\n newPos += component.count;\n // Common case\n if (!component.added) {\n oldPos += component.count;\n }\n }\n else {\n component.value = this.join(oldTokens.slice(oldPos, oldPos + component.count));\n oldPos += component.count;\n }\n }\n return components;\n }\n}\n","import Diff from './base.js';\nclass CharacterDiff extends Diff {\n}\nexport const characterDiff = new CharacterDiff();\nexport function diffChars(oldStr, newStr, options) {\n return characterDiff.diff(oldStr, newStr, options);\n}\n","export function longestCommonPrefix(str1, str2) {\n let i;\n for (i = 0; i < str1.length && i < str2.length; i++) {\n if (str1[i] != str2[i]) {\n return str1.slice(0, i);\n }\n }\n return str1.slice(0, i);\n}\nexport function longestCommonSuffix(str1, str2) {\n let i;\n // Unlike longestCommonPrefix, we need a special case to handle all scenarios\n // where we return the empty string since str1.slice(-0) will return the\n // entire string.\n if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) {\n return '';\n }\n for (i = 0; i < str1.length && i < str2.length; i++) {\n if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) {\n return str1.slice(-i);\n }\n }\n return str1.slice(-i);\n}\nexport function replacePrefix(string, oldPrefix, newPrefix) {\n if (string.slice(0, oldPrefix.length) != oldPrefix) {\n throw Error(`string ${JSON.stringify(string)} doesn't start with prefix ${JSON.stringify(oldPrefix)}; this is a bug`);\n }\n return newPrefix + string.slice(oldPrefix.length);\n}\nexport function replaceSuffix(string, oldSuffix, newSuffix) {\n if (!oldSuffix) {\n return string + newSuffix;\n }\n if (string.slice(-oldSuffix.length) != oldSuffix) {\n throw Error(`string ${JSON.stringify(string)} doesn't end with suffix ${JSON.stringify(oldSuffix)}; this is a bug`);\n }\n return string.slice(0, -oldSuffix.length) + newSuffix;\n}\nexport function removePrefix(string, oldPrefix) {\n return replacePrefix(string, oldPrefix, '');\n}\nexport function removeSuffix(string, oldSuffix) {\n return replaceSuffix(string, oldSuffix, '');\n}\nexport function maximumOverlap(string1, string2) {\n return string2.slice(0, overlapCount(string1, string2));\n}\n// Nicked from https://stackoverflow.com/a/60422853/1709587\nfunction overlapCount(a, b) {\n // Deal with cases where the strings differ in length\n let startA = 0;\n if (a.length > b.length) {\n startA = a.length - b.length;\n }\n let endB = b.length;\n if (a.length < b.length) {\n endB = a.length;\n }\n // Create a back-reference for each index\n // that should be followed in case of a mismatch.\n // We only need B to make these references:\n const map = Array(endB);\n let k = 0; // Index that lags behind j\n map[0] = 0;\n for (let j = 1; j < endB; j++) {\n if (b[j] == b[k]) {\n map[j] = map[k]; // skip over the same character (optional optimisation)\n }\n else {\n map[j] = k;\n }\n while (k > 0 && b[j] != b[k]) {\n k = map[k];\n }\n if (b[j] == b[k]) {\n k++;\n }\n }\n // Phase 2: use these references while iterating over A\n k = 0;\n for (let i = startA; i < a.length; i++) {\n while (k > 0 && a[i] != b[k]) {\n k = map[k];\n }\n if (a[i] == b[k]) {\n k++;\n }\n }\n return k;\n}\n/**\n * Returns true if the string consistently uses Windows line endings.\n */\nexport function hasOnlyWinLineEndings(string) {\n return string.includes('\\r\\n') && !string.startsWith('\\n') && !string.match(/[^\\r]\\n/);\n}\n/**\n * Returns true if the string consistently uses Unix line endings.\n */\nexport function hasOnlyUnixLineEndings(string) {\n return !string.includes('\\r\\n') && string.includes('\\n');\n}\n/**\n * Split a string into segments using a word segmenter, merging consecutive\n * segments if they are both whitespace segments. Whitespace segments can\n * appear adjacent to one another for two reasons:\n * - newlines always get their own segment\n * - where a diacritic is attached to a whitespace character in the text, the\n * segment ends after the diacritic, so e.g. \" \\u0300 \" becomes two segments.\n * This function therefore runs the segmenter's .segment() method and then\n * merges consecutive segments of whitespace into a single part.\n */\nexport function segment(string, segmenter) {\n const parts = [];\n for (const segmentObj of Array.from(segmenter.segment(string))) {\n const segment = segmentObj.segment;\n if (parts.length && (/\\s/).test(parts[parts.length - 1]) && (/\\s/).test(segment)) {\n parts[parts.length - 1] += segment;\n }\n else {\n parts.push(segment);\n }\n }\n return parts;\n}\n// The functions below take a `segmenter` argument so that, when called from\n// diffWords when it is using a segmenter, they can use a notion of what\n// constitutes \"whitespace\" that is consistent with the segmenter.\n//\n// USUALLY this will be identical to the result of the non-segmenter-based\n// logic, but it differs in at least one case: when whitespace characters are\n// modified by diacritics. A word segmenter considers these diacritics to be\n// part of the whitespace, whereas our non-segmenter-based logic does not.\n//\n// Because the segmenter-based approach necessarily requires segmenting the\n// entire string, we offer a leadingAndTrailingWs function to allow getting the\n// whitespace prefix AND whitespace suffix with a single call to the segmenter,\n// for efficiency's sake.\nexport function trailingWs(string, segmenter) {\n if (segmenter) {\n return leadingAndTrailingWs(string, segmenter)[1];\n }\n // Yes, this looks overcomplicated and dumb - why not replace the whole function with\n // return string.match(/\\s*$/)[0]\n // you ask? Because:\n // 1. the trap described at https://markamery.com/blog/quadratic-time-regexes/ would mean doing\n // this would cause this function to take O(n²) time in the worst case (specifically when\n // there is a massive run of NON-TRAILING whitespace in `string`), and\n // 2. the fix proposed in the same blog post, of using a negative lookbehind, is incompatible\n // with old Safari versions that we'd like to not break if possible (see\n // https://github.com/kpdecker/jsdiff/pull/550)\n // It feels absurd to do this with an explicit loop instead of a regex, but I really can't see a\n // better way that doesn't result in broken behaviour.\n let i;\n for (i = string.length - 1; i >= 0; i--) {\n if (!string[i].match(/\\s/)) {\n break;\n }\n }\n return string.substring(i + 1);\n}\nexport function leadingWs(string, segmenter) {\n if (segmenter) {\n return leadingAndTrailingWs(string, segmenter)[0];\n }\n // Thankfully the annoying considerations described in trailingWs don't apply here:\n const match = string.match(/^\\s*/);\n return match ? match[0] : '';\n}\nexport function leadingAndTrailingWs(string, segmenter) {\n if (!segmenter) {\n return [leadingWs(string), trailingWs(string)];\n }\n if (segmenter.resolvedOptions().granularity != 'word') {\n throw new Error('The segmenter passed must have a granularity of \"word\"');\n }\n const segments = segment(string, segmenter);\n const firstSeg = segments[0];\n const lastSeg = segments[segments.length - 1];\n const head = (/\\s/).test(firstSeg) ? firstSeg : '';\n const tail = (/\\s/).test(lastSeg) ? lastSeg : '';\n return [head, tail];\n}\n","import Diff from './base.js';\nimport { longestCommonPrefix, longestCommonSuffix, replacePrefix, replaceSuffix, removePrefix, removeSuffix, maximumOverlap, leadingWs, trailingWs, leadingAndTrailingWs, segment } from '../util/string.js';\n// Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode\n//\n// Chars/ranges counted as \"word\" characters by this regex are as follows:\n//\n// + U+00AD Soft hyphen\n// + 00C0–00FF (letters with diacritics from the Latin-1 Supplement), except:\n// - U+00D7 × Multiplication sign\n// - U+00F7 ÷ Division sign\n// + Latin Extended-A, 0100–017F\n// + Latin Extended-B, 0180–024F\n// + IPA Extensions, 0250–02AF\n// + Spacing Modifier Letters, 02B0–02FF, except:\n// - U+02C7 ˇ ˇ Caron\n// - U+02D8 ˘ ˘ Breve\n// - U+02D9 ˙ ˙ Dot Above\n// - U+02DA ˚ ˚ Ring Above\n// - U+02DB ˛ ˛ Ogonek\n// - U+02DC ˜ ˜ Small Tilde\n// - U+02DD ˝ ˝ Double Acute Accent\n// + Latin Extended Additional, 1E00–1EFF\nconst extendedWordChars = 'a-zA-Z0-9_\\\\u{AD}\\\\u{C0}-\\\\u{D6}\\\\u{D8}-\\\\u{F6}\\\\u{F8}-\\\\u{2C6}\\\\u{2C8}-\\\\u{2D7}\\\\u{2DE}-\\\\u{2FF}\\\\u{1E00}-\\\\u{1EFF}';\n// Each token is one of the following:\n// - A punctuation mark plus the surrounding whitespace\n// - A word plus the surrounding whitespace\n// - Pure whitespace (but only in the special case where the entire text\n// is just whitespace)\n//\n// We have to include surrounding whitespace in the tokens because the two\n// alternative approaches produce horribly broken results:\n// * If we just discard the whitespace, we can't fully reproduce the original\n// text from the sequence of tokens and any attempt to render the diff will\n// get the whitespace wrong.\n// * If we have separate tokens for whitespace, then in a typical text every\n// second token will be a single space character. But this often results in\n// the optimal diff between two texts being a perverse one that preserves\n// the spaces between words but deletes and reinserts actual common words.\n// See https://github.com/kpdecker/jsdiff/issues/160#issuecomment-1866099640\n// for an example.\n//\n// Keeping the surrounding whitespace of course has implications for .equals\n// and .join, not just .tokenize.\n// This regex does NOT fully implement the tokenization rules described above.\n// Instead, it gives runs of whitespace their own \"token\". The tokenize method\n// then handles stitching whitespace tokens onto adjacent word or punctuation\n// tokens.\nconst tokenizeIncludingWhitespace = new RegExp(`[${extendedWordChars}]+|\\\\s+|[^${extendedWordChars}]`, 'ug');\nclass WordDiff extends Diff {\n equals(left, right, options) {\n if (options.ignoreCase) {\n left = left.toLowerCase();\n right = right.toLowerCase();\n }\n return left.trim() === right.trim();\n }\n tokenize(value, options = {}) {\n let parts;\n if (options.intlSegmenter) {\n const segmenter = options.intlSegmenter;\n if (segmenter.resolvedOptions().granularity != 'word') {\n throw new Error('The segmenter passed must have a granularity of \"word\"');\n }\n // We want `parts` to be an array whose elements alternate between being\n // pure whitespace and being pure non-whitespace. This is ALMOST what the\n // segments returned by a word-based Intl.Segmenter already look like,\n // but not quite - see explanation in the docs of our custom segment()\n // function.\n parts = segment(value, segmenter);\n }\n else {\n parts = value.match(tokenizeIncludingWhitespace) || [];\n }\n const tokens = [];\n let prevPart = null;\n parts.forEach(part => {\n if ((/\\s/).test(part)) {\n if (prevPart == null) {\n tokens.push(part);\n }\n else {\n tokens.push(tokens.pop() + part);\n }\n }\n else if (prevPart != null && (/\\s/).test(prevPart)) {\n if (tokens[tokens.length - 1] == prevPart) {\n tokens.push(tokens.pop() + part);\n }\n else {\n tokens.push(prevPart + part);\n }\n }\n else {\n tokens.push(part);\n }\n prevPart = part;\n });\n return tokens;\n }\n join(tokens) {\n // Tokens being joined here will always have appeared consecutively in the\n // same text, so we can simply strip off the leading whitespace from all the\n // tokens except the first (and except any whitespace-only tokens - but such\n // a token will always be the first and only token anyway) and then join them\n // and the whitespace around words and punctuation will end up correct.\n return tokens.map((token, i) => {\n if (i == 0) {\n return token;\n }\n else {\n return token.replace((/^\\s+/), '');\n }\n }).join('');\n }\n postProcess(changes, options) {\n if (!changes || options.oneChangePerToken) {\n return changes;\n }\n let lastKeep = null;\n // Change objects representing any insertion or deletion since the last\n // \"keep\" change object. There can be at most one of each.\n let insertion = null;\n let deletion = null;\n changes.forEach(change => {\n if (change.added) {\n insertion = change;\n }\n else if (change.removed) {\n deletion = change;\n }\n else {\n if (insertion || deletion) { // May be false at start of text\n dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change, options.intlSegmenter);\n }\n lastKeep = change;\n insertion = null;\n deletion = null;\n }\n });\n if (insertion || deletion) {\n dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null, options.intlSegmenter);\n }\n return changes;\n }\n}\nexport const wordDiff = new WordDiff();\nexport function diffWords(oldStr, newStr, options) {\n // This option has never been documented and never will be (it's clearer to\n // just call `diffWordsWithSpace` directly if you need that behavior), but\n // has existed in jsdiff for a long time, so we retain support for it here\n // for the sake of backwards compatibility.\n if ((options === null || options === void 0 ? void 0 : options.ignoreWhitespace) != null && !options.ignoreWhitespace) {\n return diffWordsWithSpace(oldStr, newStr, options);\n }\n return wordDiff.diff(oldStr, newStr, options);\n}\nfunction dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep, segmenter) {\n // Before returning, we tidy up the leading and trailing whitespace of the\n // change objects to eliminate cases where trailing whitespace in one object\n // is repeated as leading whitespace in the next.\n // Below are examples of the outcomes we want here to explain the code.\n // I=insert, K=keep, D=delete\n // 1. diffing 'foo bar baz' vs 'foo baz'\n // Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz'\n // After cleanup, we want: K:'foo ' D:'bar ' K:'baz'\n //\n // 2. Diffing 'foo bar baz' vs 'foo qux baz'\n // Prior to cleanup, we have K:'foo ' D:' bar ' I:' qux ' K:' baz'\n // After cleanup, we want K:'foo ' D:'bar' I:'qux' K:' baz'\n //\n // 3. Diffing 'foo\\nbar baz' vs 'foo baz'\n // Prior to cleanup, we have K:'foo ' D:'\\nbar ' K:' baz'\n // After cleanup, we want K'foo' D:'\\nbar' K:' baz'\n //\n // 4. Diffing 'foo baz' vs 'foo\\nbar baz'\n // Prior to cleanup, we have K:'foo\\n' I:'\\nbar ' K:' baz'\n // After cleanup, we ideally want K'foo' I:'\\nbar' K:' baz'\n // but don't actually manage this currently (the pre-cleanup change\n // objects don't contain enough information to make it possible).\n //\n // 5. Diffing 'foo bar baz' vs 'foo baz'\n // Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz'\n // After cleanup, we want K:'foo ' D:' bar ' K:'baz'\n //\n // Our handling is unavoidably imperfect in the case where there's a single\n // indel between keeps and the whitespace has changed. For instance, consider\n // diffing 'foo\\tbar\\nbaz' vs 'foo baz'. Unless we create an extra change\n // object to represent the insertion of the space character (which isn't even\n // a token), we have no way to avoid losing information about the texts'\n // original whitespace in the result we return. Still, we do our best to\n // output something that will look sensible if we e.g. print it with\n // insertions in green and deletions in red.\n // Between two \"keep\" change objects (or before the first or after the last\n // change object), we can have either:\n // * A \"delete\" followed by an \"insert\"\n // * Just an \"insert\"\n // * Just a \"delete\"\n // We handle the three cases separately.\n if (deletion && insertion) {\n const [oldWsPrefix, oldWsSuffix] = leadingAndTrailingWs(deletion.value, segmenter);\n const [newWsPrefix, newWsSuffix] = leadingAndTrailingWs(insertion.value, segmenter);\n if (startKeep) {\n const commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix);\n startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix);\n deletion.value = removePrefix(deletion.value, commonWsPrefix);\n insertion.value = removePrefix(insertion.value, commonWsPrefix);\n }\n if (endKeep) {\n const commonWsSuffix = longestCommonSuffix(oldWsSuffix, newWsSuffix);\n endKeep.value = replacePrefix(endKeep.value, newWsSuffix, commonWsSuffix);\n deletion.value = removeSuffix(deletion.value, commonWsSuffix);\n insertion.value = removeSuffix(insertion.value, commonWsSuffix);\n }\n }\n else if (insertion) {\n // The whitespaces all reflect what was in the new text rather than\n // the old, so we essentially have no information about whitespace\n // insertion or deletion. We just want to dedupe the whitespace.\n // We do that by having each change object keep its trailing\n // whitespace and deleting duplicate leading whitespace where\n // present.\n if (startKeep) {\n const ws = leadingWs(insertion.value, segmenter);\n insertion.value = insertion.value.substring(ws.length);\n }\n if (endKeep) {\n const ws = leadingWs(endKeep.value, segmenter);\n endKeep.value = endKeep.value.substring(ws.length);\n }\n // otherwise we've got a deletion and no insertion\n }\n else if (startKeep && endKeep) {\n const newWsFull = leadingWs(endKeep.value, segmenter), [delWsStart, delWsEnd] = leadingAndTrailingWs(deletion.value, segmenter);\n // Any whitespace that comes straight after startKeep in both the old and\n // new texts, assign to startKeep and remove from the deletion.\n const newWsStart = longestCommonPrefix(newWsFull, delWsStart);\n deletion.value = removePrefix(deletion.value, newWsStart);\n // Any whitespace that comes straight before endKeep in both the old and\n // new texts, and hasn't already been assigned to startKeep, assign to\n // endKeep and remove from the deletion.\n const newWsEnd = longestCommonSuffix(removePrefix(newWsFull, newWsStart), delWsEnd);\n deletion.value = removeSuffix(deletion.value, newWsEnd);\n endKeep.value = replacePrefix(endKeep.value, newWsFull, newWsEnd);\n // If there's any whitespace from the new text that HASN'T already been\n // assigned, assign it to the start:\n startKeep.value = replaceSuffix(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length));\n }\n else if (endKeep) {\n // We are at the start of the text. Preserve all the whitespace on\n // endKeep, and just remove whitespace from the end of deletion to the\n // extent that it overlaps with the start of endKeep.\n const endKeepWsPrefix = leadingWs(endKeep.value, segmenter);\n const deletionWsSuffix = trailingWs(deletion.value, segmenter);\n const overlap = maximumOverlap(deletionWsSuffix, endKeepWsPrefix);\n deletion.value = removeSuffix(deletion.value, overlap);\n }\n else if (startKeep) {\n // We are at the END of the text. Preserve all the whitespace on\n // startKeep, and just remove whitespace from the start of deletion to\n // the extent that it overlaps with the end of startKeep.\n const startKeepWsSuffix = trailingWs(startKeep.value, segmenter);\n const deletionWsPrefix = leadingWs(deletion.value, segmenter);\n const overlap = maximumOverlap(startKeepWsSuffix, deletionWsPrefix);\n deletion.value = removePrefix(deletion.value, overlap);\n }\n}\nclass WordsWithSpaceDiff extends Diff {\n tokenize(value) {\n // Slightly different to the tokenizeIncludingWhitespace regex used above in\n // that this one treats each individual newline as a distinct token, rather\n // than merging them into other surrounding whitespace. This was requested\n // in https://github.com/kpdecker/jsdiff/issues/180 &\n // https://github.com/kpdecker/jsdiff/issues/211\n const regex = new RegExp(`(\\\\r?\\\\n)|[${extendedWordChars}]+|[^\\\\S\\\\n\\\\r]+|[^${extendedWordChars}]`, 'ug');\n return value.match(regex) || [];\n }\n}\nexport const wordsWithSpaceDiff = new WordsWithSpaceDiff();\nexport function diffWordsWithSpace(oldStr, newStr, options) {\n return wordsWithSpaceDiff.diff(oldStr, newStr, options);\n}\n","import Diff from './base.js';\nimport { generateOptions } from '../util/params.js';\nclass LineDiff extends Diff {\n constructor() {\n super(...arguments);\n this.tokenize = tokenize;\n }\n equals(left, right, options) {\n // If we're ignoring whitespace, we need to normalise lines by stripping\n // whitespace before checking equality. (This has an annoying interaction\n // with newlineIsToken that requires special handling: if newlines get their\n // own token, then we DON'T want to trim the *newline* tokens down to empty\n // strings, since this would cause us to treat whitespace-only line content\n // as equal to a separator between lines, which would be weird and\n // inconsistent with the documented behavior of the options.)\n if (options.ignoreWhitespace) {\n if (!options.newlineIsToken || !left.includes('\\n')) {\n left = left.trim();\n }\n if (!options.newlineIsToken || !right.includes('\\n')) {\n right = right.trim();\n }\n }\n else if (options.ignoreNewlineAtEof && !options.newlineIsToken) {\n if (left.endsWith('\\n')) {\n left = left.slice(0, -1);\n }\n if (right.endsWith('\\n')) {\n right = right.slice(0, -1);\n }\n }\n return super.equals(left, right, options);\n }\n}\nexport const lineDiff = new LineDiff();\nexport function diffLines(oldStr, newStr, options) {\n return lineDiff.diff(oldStr, newStr, options);\n}\nexport function diffTrimmedLines(oldStr, newStr, options) {\n options = generateOptions(options, { ignoreWhitespace: true });\n return lineDiff.diff(oldStr, newStr, options);\n}\n// Exported standalone so it can be used from jsonDiff too.\nexport function tokenize(value, options) {\n if (options.stripTrailingCr) {\n // remove one \\r before \\n to match GNU diff's --strip-trailing-cr behavior\n value = value.replace(/\\r\\n/g, '\\n');\n }\n const retLines = [], linesAndNewlines = value.split(/(\\n|\\r\\n)/);\n // Ignore the final empty token that occurs if the string ends with a new line\n if (!linesAndNewlines[linesAndNewlines.length - 1]) {\n linesAndNewlines.pop();\n }\n // Merge the content and line separators into single tokens\n for (let i = 0; i < linesAndNewlines.length; i++) {\n const line = linesAndNewlines[i];\n if (i % 2 && !options.newlineIsToken) {\n retLines[retLines.length - 1] += line;\n }\n else {\n retLines.push(line);\n }\n }\n return retLines;\n}\n","import Diff from './base.js';\nfunction isSentenceEndPunct(char) {\n return char == '.' || char == '!' || char == '?';\n}\nclass SentenceDiff extends Diff {\n tokenize(value) {\n var _a;\n // If in future we drop support for environments that don't support lookbehinds, we can replace\n // this entire function with:\n // return value.split(/(?<=[.!?])(\\s+|$)/);\n // but until then, for similar reasons to the trailingWs function in string.ts, we are forced\n // to do this verbosely \"by hand\" instead of using a regex.\n const result = [];\n let tokenStartI = 0;\n for (let i = 0; i < value.length; i++) {\n if (i == value.length - 1) {\n result.push(value.slice(tokenStartI));\n break;\n }\n if (isSentenceEndPunct(value[i]) && value[i + 1].match(/\\s/)) {\n // We've hit a sentence break - i.e. a punctuation mark followed by whitespace.\n // We now want to push TWO tokens to the result:\n // 1. the sentence\n result.push(value.slice(tokenStartI, i + 1));\n // 2. the whitespace\n i = tokenStartI = i + 1;\n while ((_a = value[i + 1]) === null || _a === void 0 ? void 0 : _a.match(/\\s/)) {\n i++;\n }\n result.push(value.slice(tokenStartI, i + 1));\n // Then the next token (a sentence) starts on the character after the whitespace.\n // (It's okay if this is off the end of the string - then the outer loop will terminate\n // here anyway.)\n tokenStartI = i + 1;\n }\n }\n return result;\n }\n}\nexport const sentenceDiff = new SentenceDiff();\nexport function diffSentences(oldStr, newStr, options) {\n return sentenceDiff.diff(oldStr, newStr, options);\n}\n","import Diff from './base.js';\nclass CssDiff extends Diff {\n tokenize(value) {\n return value.split(/([{}:;,]|\\s+)/);\n }\n}\nexport const cssDiff = new CssDiff();\nexport function diffCss(oldStr, newStr, options) {\n return cssDiff.diff(oldStr, newStr, options);\n}\n","import Diff from './base.js';\nimport { tokenize } from './line.js';\nclass JsonDiff extends Diff {\n constructor() {\n super(...arguments);\n this.tokenize = tokenize;\n }\n get useLongestToken() {\n // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a\n // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:\n return true;\n }\n castInput(value, options) {\n const { undefinedReplacement, stringifyReplacer = (k, v) => typeof v === 'undefined' ? undefinedReplacement : v } = options;\n return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), null, ' ');\n }\n equals(left, right, options) {\n return super.equals(left.replace(/,([\\r\\n])/g, '$1'), right.replace(/,([\\r\\n])/g, '$1'), options);\n }\n}\nexport const jsonDiff = new JsonDiff();\nexport function diffJson(oldStr, newStr, options) {\n return jsonDiff.diff(oldStr, newStr, options);\n}\n// This function handles the presence of circular references by bailing out when encountering an\n// object that is already on the \"stack\" of items being processed. Accepts an optional replacer\nexport function canonicalize(obj, stack, replacementStack, replacer, key) {\n stack = stack || [];\n replacementStack = replacementStack || [];\n if (replacer) {\n obj = replacer(key === undefined ? '' : key, obj);\n }\n let i;\n for (i = 0; i < stack.length; i += 1) {\n if (stack[i] === obj) {\n return replacementStack[i];\n }\n }\n let canonicalizedObj;\n if ('[object Array]' === Object.prototype.toString.call(obj)) {\n stack.push(obj);\n canonicalizedObj = new Array(obj.length);\n replacementStack.push(canonicalizedObj);\n for (i = 0; i < obj.length; i += 1) {\n canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, String(i));\n }\n stack.pop();\n replacementStack.pop();\n return canonicalizedObj;\n }\n if (obj && obj.toJSON) {\n obj = obj.toJSON();\n }\n if (typeof obj === 'object' && obj !== null) {\n stack.push(obj);\n canonicalizedObj = {};\n replacementStack.push(canonicalizedObj);\n const sortedKeys = [];\n let key;\n for (key in obj) {\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n sortedKeys.push(key);\n }\n }\n sortedKeys.sort();\n for (i = 0; i < sortedKeys.length; i += 1) {\n key = sortedKeys[i];\n canonicalizedObj[key] = canonicalize(obj[key], stack, replacementStack, replacer, key);\n }\n stack.pop();\n replacementStack.pop();\n }\n else {\n canonicalizedObj = obj;\n }\n return canonicalizedObj;\n}\n","import Diff from './base.js';\nclass ArrayDiff extends Diff {\n tokenize(value) {\n return value.slice();\n }\n join(value) {\n return value;\n }\n removeEmpty(value) {\n return value;\n }\n}\nexport const arrayDiff = new ArrayDiff();\nexport function diffArrays(oldArr, newArr, options) {\n return arrayDiff.diff(oldArr, newArr, options);\n}\n","import { diffLines } from '../diff/line.js';\nexport const INCLUDE_HEADERS = {\n includeIndex: true,\n includeUnderline: true,\n includeFileHeaders: true\n};\nexport const FILE_HEADERS_ONLY = {\n includeIndex: false,\n includeUnderline: false,\n includeFileHeaders: true\n};\nexport const OMIT_HEADERS = {\n includeIndex: false,\n includeUnderline: false,\n includeFileHeaders: false\n};\nexport function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {\n let optionsObj;\n if (!options) {\n optionsObj = {};\n }\n else if (typeof options === 'function') {\n optionsObj = { callback: options };\n }\n else {\n optionsObj = options;\n }\n if (typeof optionsObj.context === 'undefined') {\n optionsObj.context = 4;\n }\n // We copy this into its own variable to placate TypeScript, which thinks\n // optionsObj.context might be undefined in the callbacks below.\n const context = optionsObj.context;\n // @ts-expect-error (runtime check for something that is correctly a static type error)\n if (optionsObj.newlineIsToken) {\n throw new Error('newlineIsToken may not be used with patch-generation functions, only with diffing functions');\n }\n if (!optionsObj.callback) {\n return diffLinesResultToPatch(diffLines(oldStr, newStr, optionsObj));\n }\n else {\n const { callback } = optionsObj;\n diffLines(oldStr, newStr, Object.assign(Object.assign({}, optionsObj), { callback: (diff) => {\n const patch = diffLinesResultToPatch(diff);\n // TypeScript is unhappy without the cast because it does not understand that `patch` may\n // be undefined here only if `callback` is StructuredPatchCallbackAbortable:\n callback(patch);\n } }));\n }\n function diffLinesResultToPatch(diff) {\n // STEP 1: Build up the patch with no \"\\" lines and with the arrays\n // of lines containing trailing newline characters. We'll tidy up later...\n if (!diff) {\n return;\n }\n diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier\n function contextLines(lines) {\n return lines.map(function (entry) { return ' ' + entry; });\n }\n const hunks = [];\n let oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1;\n for (let i = 0; i < diff.length; i++) {\n const current = diff[i], lines = current.lines || splitLines(current.value);\n current.lines = lines;\n if (current.added || current.removed) {\n // If we have previous context, start with that\n if (!oldRangeStart) {\n const prev = diff[i - 1];\n oldRangeStart = oldLine;\n newRangeStart = newLine;\n if (prev) {\n curRange = context > 0 ? contextLines(prev.lines.slice(-context)) : [];\n oldRangeStart -= curRange.length;\n newRangeStart -= curRange.length;\n }\n }\n // Output our changes\n for (const line of lines) {\n curRange.push((current.added ? '+' : '-') + line);\n }\n // Track the updated file position\n if (current.added) {\n newLine += lines.length;\n }\n else {\n oldLine += lines.length;\n }\n }\n else {\n // Identical context lines. Track line changes\n if (oldRangeStart) {\n // Close out any changes that have been output (or join overlapping)\n if (lines.length <= context * 2 && i < diff.length - 2) {\n // Overlapping\n for (const line of contextLines(lines)) {\n curRange.push(line);\n }\n }\n else {\n // end the range and output\n const contextSize = Math.min(lines.length, context);\n for (const line of contextLines(lines.slice(0, contextSize))) {\n curRange.push(line);\n }\n const hunk = {\n oldStart: oldRangeStart,\n oldLines: (oldLine - oldRangeStart + contextSize),\n newStart: newRangeStart,\n newLines: (newLine - newRangeStart + contextSize),\n lines: curRange\n };\n hunks.push(hunk);\n oldRangeStart = 0;\n newRangeStart = 0;\n curRange = [];\n }\n }\n oldLine += lines.length;\n newLine += lines.length;\n }\n }\n // Step 2: eliminate the trailing `\\n` from each line of each hunk, and, where needed, add\n // \"\\".\n for (const hunk of hunks) {\n for (let i = 0; i < hunk.lines.length; i++) {\n if (hunk.lines[i].endsWith('\\n')) {\n hunk.lines[i] = hunk.lines[i].slice(0, -1);\n }\n else {\n hunk.lines.splice(i + 1, 0, '\\\');\n i++; // Skip the line we just added, then continue iterating\n }\n }\n }\n return {\n oldFileName: oldFileName, newFileName: newFileName,\n oldHeader: oldHeader, newHeader: newHeader,\n hunks: hunks\n };\n }\n}\n/**\n * creates a unified diff patch.\n * @param patch either a single structured patch object (as returned by `structuredPatch`) or an array of them (as returned by `parsePatch`)\n */\nexport function formatPatch(patch, headerOptions) {\n if (!headerOptions) {\n headerOptions = INCLUDE_HEADERS;\n }\n if (Array.isArray(patch)) {\n if (patch.length > 1 && !headerOptions.includeFileHeaders) {\n throw new Error('Cannot omit file headers on a multi-file patch. '\n + '(The result would be unparseable; how would a tool trying to apply '\n + 'the patch know which changes are to which file?)');\n }\n return patch.map(p => formatPatch(p, headerOptions)).join('\\n');\n }\n const ret = [];\n if (headerOptions.includeIndex && patch.oldFileName == patch.newFileName) {\n ret.push('Index: ' + patch.oldFileName);\n }\n if (headerOptions.includeUnderline) {\n ret.push('===================================================================');\n }\n if (headerOptions.includeFileHeaders) {\n ret.push('--- ' + patch.oldFileName + (typeof patch.oldHeader === 'undefined' ? '' : '\\t' + patch.oldHeader));\n ret.push('+++ ' + patch.newFileName + (typeof patch.newHeader === 'undefined' ? '' : '\\t' + patch.newHeader));\n }\n for (let i = 0; i < patch.hunks.length; i++) {\n const hunk = patch.hunks[i];\n // Unified Diff Format quirk: If the chunk size is 0,\n // the first number is one lower than one would expect.\n // https://www.artima.com/weblogs/viewpost.jsp?thread=164293\n if (hunk.oldLines === 0) {\n hunk.oldStart -= 1;\n }\n if (hunk.newLines === 0) {\n hunk.newStart -= 1;\n }\n ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines\n + ' +' + hunk.newStart + ',' + hunk.newLines\n + ' @@');\n for (const line of hunk.lines) {\n ret.push(line);\n }\n }\n return ret.join('\\n') + '\\n';\n}\nexport function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {\n if (typeof options === 'function') {\n options = { callback: options };\n }\n if (!(options === null || options === void 0 ? void 0 : options.callback)) {\n const patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);\n if (!patchObj) {\n return;\n }\n return formatPatch(patchObj, options === null || options === void 0 ? void 0 : options.headerOptions);\n }\n else {\n const { callback } = options;\n structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, Object.assign(Object.assign({}, options), { callback: patchObj => {\n if (!patchObj) {\n callback(undefined);\n }\n else {\n callback(formatPatch(patchObj, options.headerOptions));\n }\n } }));\n }\n}\nexport function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {\n return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);\n}\n/**\n * Split `text` into an array of lines, including the trailing newline character (where present)\n */\nfunction splitLines(text) {\n const hasTrailingNl = text.endsWith('\\n');\n const result = text.split('\\n').map(line => line + '\\n');\n if (hasTrailingNl) {\n result.pop();\n }\n else {\n result.push(result.pop().slice(0, -1));\n }\n return result;\n}\n","import{createRequire} from\"node:module\";const require=createRequire(import.meta.url);\nimport{c as a}from\"./chunk-NRSASXYY.js\";import{a as c}from\"./chunk-QIQMJJZ4.js\";import{a as u,b as p}from\"./chunk-QAYAQNCG.js\";import*as g from\"diff\";var b={name:\"diff\",summary:\"compare files line by line\",usage:\"diff [OPTION]... FILE1 FILE2\",options:[\"-u, --unified output unified diff format (default)\",\"-q, --brief report only whether files differ\",\"-s, --report-identical-files report when files are the same\",\"-i, --ignore-case ignore case differences\",\" --help display this help and exit\"]},C={unified:{short:\"u\",long:\"unified\",type:\"boolean\"},brief:{short:\"q\",long:\"brief\",type:\"boolean\"},reportSame:{short:\"s\",long:\"report-identical-files\",type:\"boolean\"},ignoreCase:{short:\"i\",long:\"ignore-case\",type:\"boolean\"}},L={name:\"diff\",async execute(d,e){if(p(d))return u(b);let t=c(\"diff\",d,C);if(!t.ok)return t.error;let m=t.result.flags.brief,h=t.result.flags.reportSame,y=t.result.flags.ignoreCase,l=t.result.positional;if(t.result.flags.unified,l.length<2)return{stdout:\"\",stderr:`diff: missing operand\n`,exitCode:2};let i,s,[r,o]=l;try{i=r===\"-\"?a(e.stdin):await e.fs.readFile(e.fs.resolvePath(e.cwd,r))}catch{return{stdout:\"\",stderr:`diff: ${r}: No such file or directory\n`,exitCode:2}}try{s=o===\"-\"?a(e.stdin):await e.fs.readFile(e.fs.resolvePath(e.cwd,o))}catch{return{stdout:\"\",stderr:`diff: ${o}: No such file or directory\n`,exitCode:2}}let f=i,n=s;return y&&(f=f.toLowerCase(),n=n.toLowerCase()),f===n?h?{stdout:`Files ${r} and ${o} are identical\n`,stderr:\"\",exitCode:0}:{stdout:\"\",stderr:\"\",exitCode:0}:m?{stdout:`Files ${r} and ${o} differ\n`,stderr:\"\",exitCode:1}:{stdout:g.createTwoFilesPatch(r,o,i,s,\"\",\"\",{context:3}),stderr:\"\",exitCode:1}}},P={name:\"diff\",flags:[{flag:\"-u\",type:\"boolean\"},{flag:\"-q\",type:\"boolean\"},{flag:\"-s\",type:\"boolean\"},{flag:\"-i\",type:\"boolean\"}],needsArgs:!0,minArgs:2};export{L as a,P as b};\n","import{createRequire} from\"node:module\";const require=createRequire(import.meta.url);\nimport{a,b}from\"./chunk-CBJVD2XA.js\";import\"./chunk-NRSASXYY.js\";import\"./chunk-QIQMJJZ4.js\";import\"./chunk-QAYAQNCG.js\";import\"./chunk-BZUGFHVS.js\";export{a as diffCommand,b as flagsForFuzzing};\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11],"mappings":";;;;;;;AAAA,IAAqB,OAArB,MAA0B;CACtB,KAAK,QAAQ,QAEb,UAAU,CAAC,GAAG;EACV,IAAI;EACJ,IAAI,OAAO,YAAY,YAAY;GAC/B,WAAW;GACX,UAAU,CAAC;EACf,OACK,IAAI,cAAc,SACnB,WAAW,QAAQ;EAGvB,MAAM,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 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { r as s, t as o } from "./chunk-QAYAQNCG-Bl0Kbd53.mjs";
|
|
3
|
+
import "./chunk-BZUGFHVS-CPWRFwK8.mjs";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
//#region ../../node_modules/.pnpm/just-bash@3.0.1/node_modules/just-bash/dist/bundle/chunks/chunk-FX4RBUYU.js
|
|
6
|
+
createRequire(import.meta.url);
|
|
7
|
+
var m = {
|
|
8
|
+
name: "dirname",
|
|
9
|
+
summary: "strip last component from file name",
|
|
10
|
+
usage: "dirname [OPTION] NAME...",
|
|
11
|
+
options: [" --help display this help and exit"]
|
|
12
|
+
}, p = {
|
|
13
|
+
name: "dirname",
|
|
14
|
+
async execute(t, l) {
|
|
15
|
+
if (o(t)) return s(m);
|
|
16
|
+
let r = t.filter((n) => !n.startsWith("-"));
|
|
17
|
+
if (r.length === 0) return {
|
|
18
|
+
stdout: "",
|
|
19
|
+
stderr: `dirname: missing operand
|
|
20
|
+
`,
|
|
21
|
+
exitCode: 1
|
|
22
|
+
};
|
|
23
|
+
let e = [];
|
|
24
|
+
for (let n of r) {
|
|
25
|
+
let a = n.replace(/\/+$/, ""), s = a.lastIndexOf("/");
|
|
26
|
+
s === -1 ? e.push(".") : s === 0 ? e.push("/") : e.push(a.slice(0, s));
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
stdout: `${e.join(`
|
|
30
|
+
`)}
|
|
31
|
+
`,
|
|
32
|
+
stderr: "",
|
|
33
|
+
exitCode: 0
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region ../../node_modules/.pnpm/just-bash@3.0.1/node_modules/just-bash/dist/bundle/chunks/dirname-MPHRFUTI.js
|
|
39
|
+
createRequire(import.meta.url);
|
|
40
|
+
//#endregion
|
|
41
|
+
export { p as dirnameCommand };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=dirname-MPHRFUTI-Dkb3S4OX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dirname-MPHRFUTI-Dkb3S4OX.mjs","names":["i","o"],"sources":["../../../node_modules/.pnpm/just-bash@3.0.1/node_modules/just-bash/dist/bundle/chunks/chunk-FX4RBUYU.js","../../../node_modules/.pnpm/just-bash@3.0.1/node_modules/just-bash/dist/bundle/chunks/dirname-MPHRFUTI.js"],"sourcesContent":["import{createRequire} from\"node:module\";const require=createRequire(import.meta.url);\nimport{a as o,b as i}from\"./chunk-QAYAQNCG.js\";var m={name:\"dirname\",summary:\"strip last component from file name\",usage:\"dirname [OPTION] NAME...\",options:[\" --help display this help and exit\"]},p={name:\"dirname\",async execute(t,l){if(i(t))return o(m);let r=t.filter(n=>!n.startsWith(\"-\"));if(r.length===0)return{stdout:\"\",stderr:`dirname: missing operand\n`,exitCode:1};let e=[];for(let n of r){let a=n.replace(/\\/+$/,\"\"),s=a.lastIndexOf(\"/\");s===-1?e.push(\".\"):s===0?e.push(\"/\"):e.push(a.slice(0,s))}return{stdout:`${e.join(`\n`)}\n`,stderr:\"\",exitCode:0}}},c={name:\"dirname\",flags:[],needsArgs:!0};export{p as a,c as b};\n","import{createRequire} from\"node:module\";const require=createRequire(import.meta.url);\nimport{a,b}from\"./chunk-FX4RBUYU.js\";import\"./chunk-QAYAQNCG.js\";import\"./chunk-BZUGFHVS.js\";export{a as dirnameCommand,b as flagsForFuzzing};\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;AAAsD,cAAc,OAAO,KAAK,GAAG;AACpC,IAAI,IAAE;CAAC,MAAK;CAAU,SAAQ;CAAsC,OAAM;CAA2B,SAAQ,CAAC,6CAA6C;AAAC,GAAE,IAAE;CAAC,MAAK;CAAU,MAAM,QAAQ,GAAE,GAAE;EAAC,IAAGA,EAAE,CAAC,GAAE,OAAOC,EAAE,CAAC;EAAE,IAAI,IAAE,EAAE,QAAO,MAAG,CAAC,EAAE,WAAW,GAAG,CAAC;EAAE,IAAG,EAAE,WAAS,GAAE,OAAM;GAAC,QAAO;GAAG,QAAO;;GAClV,UAAS;EAAC;EAAE,IAAI,IAAE,CAAC;EAAE,KAAI,IAAI,KAAK,GAAE;GAAC,IAAI,IAAE,EAAE,QAAQ,QAAO,EAAE,GAAE,IAAE,EAAE,YAAY,GAAG;GAAE,MAAI,KAAG,EAAE,KAAK,GAAG,IAAE,MAAI,IAAE,EAAE,KAAK,GAAG,IAAE,EAAE,KAAK,EAAE,MAAM,GAAE,CAAC,CAAC;EAAC;EAAC,OAAM;GAAC,QAAO,GAAG,EAAE,KAAK;CACxK,EAAE;;GACD,QAAO;GAAG,UAAS;EAAC;CAAC;AAAC;;;ACJ8B,cAAc,OAAO,KAAK,GAAG"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { L as entryIdFromFile, R as readKeystrokeIgnoreDirective, a as buildStoredRouteManifestForProject, z as shouldSkipKeystrokeModuleFile } from "./dist-vwoMCz6d.mjs";
|
|
2
|
+
import { A as entryIdFromFile, D as packAssetDirs, M as shouldSkipKeystrokeModuleFile, j as readKeystrokeIgnoreDirective, r as buildStoredRouteManifestForProject } from "./dist-D_-88U7y.mjs";
|
|
4
3
|
import { isBuiltin } from "node:module";
|
|
5
|
-
import {
|
|
4
|
+
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
6
5
|
import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
7
6
|
import { fileURLToPath } from "node:url";
|
|
8
7
|
import { createHash } from "node:crypto";
|
|
@@ -171,72 +170,6 @@ function walkProject(root, srcDirOrOptions = "src", maybeOptions) {
|
|
|
171
170
|
};
|
|
172
171
|
}
|
|
173
172
|
//#endregion
|
|
174
|
-
//#region ../../packages/sandbox/dist/files-DJf_h8XJ.mjs
|
|
175
|
-
const SandboxFileContentSchema = object({
|
|
176
|
-
path: string(),
|
|
177
|
-
file: string()
|
|
178
|
-
});
|
|
179
|
-
/** Destination path under `/workspace`. For `dir`, used as a prefix. */
|
|
180
|
-
const SandboxFileSchema = object({
|
|
181
|
-
path: string(),
|
|
182
|
-
/** Single file body — typically from a build-time import (`import doc from "./doc.md"`). */
|
|
183
|
-
file: string().optional(),
|
|
184
|
-
/** Directory contents — each path is relative to `path`. */
|
|
185
|
-
dir: array(SandboxFileContentSchema).optional()
|
|
186
|
-
});
|
|
187
|
-
object({
|
|
188
|
-
key: string().optional(),
|
|
189
|
-
files: array(SandboxFileSchema).optional()
|
|
190
|
-
});
|
|
191
|
-
const SKIP_DIRS$1 = new Set([".git", "node_modules"]);
|
|
192
|
-
/** Recursively read a host file or directory into sandbox-relative `{ path, file }` entries. */
|
|
193
|
-
function packDirFromDisk(rootPath) {
|
|
194
|
-
const stat = statSync(rootPath);
|
|
195
|
-
if (stat.isFile()) return [{
|
|
196
|
-
path: basename(rootPath),
|
|
197
|
-
file: readFileSync(rootPath, "utf8")
|
|
198
|
-
}];
|
|
199
|
-
if (!stat.isDirectory()) throw new Error(`Expected a file or directory at ${rootPath}`);
|
|
200
|
-
const files = [];
|
|
201
|
-
walkDir(rootPath, rootPath, files);
|
|
202
|
-
return files;
|
|
203
|
-
}
|
|
204
|
-
function walkDir(rootPath, currentPath, files) {
|
|
205
|
-
for (const name of readdirSync(currentPath)) {
|
|
206
|
-
if (SKIP_DIRS$1.has(name)) continue;
|
|
207
|
-
const entryPath = join(currentPath, name);
|
|
208
|
-
const stat = statSync(entryPath);
|
|
209
|
-
if (stat.isDirectory()) {
|
|
210
|
-
walkDir(rootPath, entryPath, files);
|
|
211
|
-
continue;
|
|
212
|
-
}
|
|
213
|
-
if (!stat.isFile()) continue;
|
|
214
|
-
files.push({
|
|
215
|
-
path: relative(rootPath, entryPath),
|
|
216
|
-
file: readFileSync(entryPath, "utf8")
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
const SKIP_DIRS = new Set([".git", "node_modules"]);
|
|
221
|
-
/** Pack every subdir under `src/skills/` and `src/files/` into an asset manifest. */
|
|
222
|
-
function packAssetDirs(appRoot, srcDir = "src") {
|
|
223
|
-
return {
|
|
224
|
-
skills: packAssetRoot(join(appRoot, srcDir, "skills")),
|
|
225
|
-
files: packAssetRoot(join(appRoot, srcDir, "files"))
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
function packAssetRoot(rootPath) {
|
|
229
|
-
if (!statSync(rootPath, { throwIfNoEntry: false })?.isDirectory()) return {};
|
|
230
|
-
const manifest = {};
|
|
231
|
-
for (const name of readdirSync(rootPath)) {
|
|
232
|
-
if (SKIP_DIRS.has(name)) continue;
|
|
233
|
-
const entryPath = join(rootPath, name);
|
|
234
|
-
if (!statSync(entryPath).isDirectory()) continue;
|
|
235
|
-
manifest[name] = packDirFromDisk(entryPath);
|
|
236
|
-
}
|
|
237
|
-
return manifest;
|
|
238
|
-
}
|
|
239
|
-
//#endregion
|
|
240
173
|
//#region ../../packages/tsdown-config/deps.js
|
|
241
174
|
/** Native addons kept external — resolved from the CLI runtime at app start. */
|
|
242
175
|
const NATIVE_RUNTIME_DEPS = [
|
|
@@ -244,6 +177,26 @@ const NATIVE_RUNTIME_DEPS = [
|
|
|
244
177
|
"better-sqlite3",
|
|
245
178
|
"@parcel/watcher"
|
|
246
179
|
];
|
|
180
|
+
/**
|
|
181
|
+
* Integration packages (`packages/integrations/*`) bundled into the user-app artifact so a
|
|
182
|
+
* project carries its own integration code/version. Their framework imports (`@keystrokehq/keystroke`,
|
|
183
|
+
* `@keystrokehq/action`, …) stay external and resolve from the runtime image. `slack` is excluded —
|
|
184
|
+
* it is a gateway integration the runtime mounts server-side, so it stays in the runtime image.
|
|
185
|
+
*/
|
|
186
|
+
const BUNDLED_INTEGRATION_PACKAGES = [
|
|
187
|
+
"exa",
|
|
188
|
+
"github",
|
|
189
|
+
"gong",
|
|
190
|
+
"googlesuper",
|
|
191
|
+
"slackbot",
|
|
192
|
+
"snowflake"
|
|
193
|
+
];
|
|
194
|
+
/** Matches framework `@keystrokehq/*` (everything except the bundled integration packages). */
|
|
195
|
+
const FRAMEWORK_KEYSTROKE_EXTERNAL = new RegExp(`^@keystrokehq\\/(?!(?:${BUNDLED_INTEGRATION_PACKAGES.join("|")})(?:\\/|$))`);
|
|
196
|
+
function isBundledIntegration(name) {
|
|
197
|
+
if (!name.startsWith("@keystrokehq/")) return false;
|
|
198
|
+
return BUNDLED_INTEGRATION_PACKAGES.includes(name.slice(13));
|
|
199
|
+
}
|
|
247
200
|
/** Kept external so .d.ts emission does not inline internal/inferred types. */
|
|
248
201
|
const LIBRARY_EXTERNAL_DEPS = [
|
|
249
202
|
"better-auth",
|
|
@@ -278,7 +231,7 @@ function packageName(id) {
|
|
|
278
231
|
function isRuntimeExternal(id) {
|
|
279
232
|
const name = packageName(id);
|
|
280
233
|
if (isNativeRuntimeDep(name)) return true;
|
|
281
|
-
if (name.startsWith("@keystrokehq/")) return
|
|
234
|
+
if (name.startsWith("@keystrokehq/")) return !isBundledIntegration(name);
|
|
282
235
|
if (name === "better-auth" || name.startsWith("@better-auth/")) return true;
|
|
283
236
|
return false;
|
|
284
237
|
}
|
|
@@ -303,7 +256,7 @@ function userAppBuildDepsConfig() {
|
|
|
303
256
|
},
|
|
304
257
|
neverBundle: [
|
|
305
258
|
...NATIVE_RUNTIME_DEPS,
|
|
306
|
-
|
|
259
|
+
FRAMEWORK_KEYSTROKE_EXTERNAL,
|
|
307
260
|
...LIBRARY_EXTERNAL_DEPS
|
|
308
261
|
],
|
|
309
262
|
onlyBundle: false
|
|
@@ -548,7 +501,7 @@ async function buildApp(options = {}) {
|
|
|
548
501
|
ignoredFiles: walked.ignoredFiles
|
|
549
502
|
}));
|
|
550
503
|
if (emitManifest) {
|
|
551
|
-
const { emitStoredRouteManifestForProject } = await import("./dist-
|
|
504
|
+
const { emitStoredRouteManifestForProject } = await import("./dist-iKd6nzBK.mjs");
|
|
552
505
|
await emitStoredRouteManifestForProject(root);
|
|
553
506
|
}
|
|
554
507
|
} finally {
|
|
@@ -573,4 +526,4 @@ async function watchApp(options = {}) {
|
|
|
573
526
|
//#endregion
|
|
574
527
|
export { buildApp, buildFilteredApp, resolveRuntimeBuildArtifact, watchApp };
|
|
575
528
|
|
|
576
|
-
//# sourceMappingURL=dist-
|
|
529
|
+
//# sourceMappingURL=dist-B9XaHV_2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dist-B9XaHV_2.mjs","names":["toPosix"],"sources":["../../../packages/build/dist/walk-project-eZ95LOUW.mjs","../../../packages/tsdown-config/deps.js","../../../packages/tsdown-config/index.js","../../../packages/build/dist/index.mjs"],"sourcesContent":["import { readFileSync, readdirSync, realpathSync, statSync } from \"node:fs\";\nimport { join, relative, resolve, sep } from \"node:path\";\nimport { createHash } from \"node:crypto\";\nimport { entryIdFromFile, readKeystrokeIgnoreDirective, shouldSkipKeystrokeModuleFile } from \"@keystrokehq/manifest/discovery\";\nimport { fileURLToPath } from \"node:url\";\n//#region src/ignore-guard-plugin.ts\nfunction toPosix$1(path) {\n\treturn path.split(sep).join(\"/\");\n}\nfunction projectRelativePath(root, filePath) {\n\treturn toPosix$1(relative(root, normalizeBuildFilePath(filePath)));\n}\n/** Normalize paths so /var and /private/var compare equal on macOS. */\nfunction normalizeBuildFilePath(filePath) {\n\tconst absolute = resolve(filePath);\n\ttry {\n\t\treturn realpathSync.native(absolute);\n\t} catch {\n\t\treturn absolute;\n\t}\n}\nfunction normalizeModuleId(id, root) {\n\tif (id.startsWith(\"\\0\")) return null;\n\tconst normalized = normalizeBuildFilePath(id.startsWith(\"file://\") ? fileURLToPath(id) : id);\n\tif (!normalized.startsWith(normalizeBuildFilePath(root))) return null;\n\treturn normalized;\n}\nfunction formatImportGuardError(root, ignoredPath, importer) {\n\tconst ignored = projectRelativePath(root, ignoredPath);\n\tif (importer) return `Cannot import \"${ignored}\" (@keystroke ignore) from \"${projectRelativePath(root, importer)}\". Remove the directive or stop importing it from a shipped module.`;\n\treturn `Cannot import \"${ignored}\" (@keystroke ignore). Remove the directive or stop importing it from a shipped module.`;\n}\n/** Throw when a built module imports a `@keystroke ignore` source file. */\nfunction keystrokeIgnoreGuardPlugin(options) {\n\tconst root = normalizeBuildFilePath(options.root);\n\tconst ignoredFiles = new Set(options.ignoredFiles.map((filePath) => normalizeBuildFilePath(filePath)));\n\tfunction assertNotIgnored(filePath, importer) {\n\t\tconst normalized = normalizeBuildFilePath(filePath);\n\t\tif (!ignoredFiles.has(normalized)) return;\n\t\tthrow new Error(formatImportGuardError(root, normalized, importer));\n\t}\n\treturn {\n\t\tname: \"keystroke-ignore-guard\",\n\t\tasync resolveId(source, importer, resolveOptions) {\n\t\t\tif (resolveOptions?.isEntry || !importer) return null;\n\t\t\tconst resolved = await this.resolve(source, importer, {\n\t\t\t\t...resolveOptions,\n\t\t\t\tskipSelf: true\n\t\t\t});\n\t\t\tif (!resolved) return null;\n\t\t\tassertNotIgnored(typeof resolved === \"string\" ? resolved : resolved.id, importer);\n\t\t\treturn null;\n\t\t},\n\t\tload(id) {\n\t\t\tconst normalized = normalizeModuleId(id, root);\n\t\t\tif (!normalized) return null;\n\t\t\tassertNotIgnored(normalized);\n\t\t\treturn null;\n\t\t}\n\t};\n}\n//#endregion\n//#region src/walk-project.ts\nconst IGNORED_DIRS = new Set([\n\t\"node_modules\",\n\t\"dist\",\n\t\".git\",\n\t\".turbo\",\n\t\"build\",\n\t\"coverage\",\n\t\".keystroke\",\n\t\".cache\",\n\t\"tmp\"\n]);\nconst IGNORED_ENV_FILE = /\\.env/;\nconst IGNORED_LOG_FILE = /\\.log$/;\nfunction isIgnoredFile(name) {\n\treturn IGNORED_ENV_FILE.test(name) || IGNORED_LOG_FILE.test(name);\n}\nfunction toPosix(path) {\n\treturn path.split(sep).join(\"/\");\n}\nfunction isProbablyBinary(buffer) {\n\tconst sampleLength = Math.min(buffer.length, 8e3);\n\tfor (let index = 0; index < sampleLength; index += 1) if (buffer[index] === 0) return true;\n\treturn false;\n}\nfunction classifyBuildEntry(root, srcRoot, filePath) {\n\tconst relativePath = toPosix(relative(root, filePath));\n\tconst agentsPrefix = `${toPosix(relative(root, join(srcRoot, \"agents\")))}/`;\n\tconst workflowsPrefix = `${toPosix(relative(root, join(srcRoot, \"workflows\")))}/`;\n\tconst triggersPrefix = `${toPosix(relative(root, join(srcRoot, \"triggers\")))}/`;\n\tif (relativePath.startsWith(agentsPrefix) && /\\.(ts|mts)$/.test(relativePath) && !/\\.(int\\.)?test\\.(ts|mts)$/.test(relativePath)) {\n\t\tconst id = entryIdFromFile(join(srcRoot, \"agents\"), filePath, { nestedEntry: \"agent\" });\n\t\treturn id ? {\n\t\t\tentryKey: `agents/${id}`,\n\t\t\tentryPath: filePath\n\t\t} : null;\n\t}\n\tif (relativePath.startsWith(workflowsPrefix) && /\\.(ts|mts)$/.test(relativePath) && !/\\.(int\\.)?test\\.(ts|mts)$/.test(relativePath)) {\n\t\tconst id = entryIdFromFile(join(srcRoot, \"workflows\"), filePath, { nestedEntry: \"workflow\" });\n\t\treturn id ? {\n\t\t\tentryKey: `workflows/${id}`,\n\t\t\tentryPath: filePath\n\t\t} : null;\n\t}\n\tif (relativePath.startsWith(triggersPrefix) && /\\.(ts|mts)$/.test(relativePath) && !/\\.(int\\.)?test\\.(ts|mts)$/.test(relativePath)) {\n\t\tconst id = entryIdFromFile(join(srcRoot, \"triggers\"), filePath, { nestedEntry: \"trigger\" });\n\t\treturn id ? {\n\t\t\tentryKey: `triggers/${id}`,\n\t\t\tentryPath: filePath\n\t\t} : null;\n\t}\n\treturn null;\n}\nfunction shouldSkipIgnoredModule(filePath, phase) {\n\treturn shouldSkipKeystrokeModuleFile(readKeystrokeIgnoreDirective(filePath), phase);\n}\nfunction isSrcTypeScriptFile(srcRoot, filePath) {\n\tconst relativePath = toPosix(relative(srcRoot, filePath));\n\tif (relativePath.startsWith(\"..\")) return false;\n\treturn /\\.(ts|mts)$/.test(relativePath);\n}\nfunction walkTree(root, dir, srcRoot, phase, collectSources, sourceFiles, buildEntries, ignoredFiles, totals) {\n\tfor (const name of readdirSync(dir).sort()) {\n\t\tif (collectSources && (sourceFiles.length >= 2e3 || totals.bytes >= 8388608)) return;\n\t\tconst absolute = join(dir, name);\n\t\tconst stats = statSync(absolute);\n\t\tif (stats.isDirectory()) {\n\t\t\tif (IGNORED_DIRS.has(name)) continue;\n\t\t\twalkTree(root, absolute, srcRoot, phase, collectSources, sourceFiles, buildEntries, ignoredFiles, totals);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!stats.isFile()) continue;\n\t\tconst isUnderSrc = isSrcTypeScriptFile(srcRoot, absolute);\n\t\tconst skipIgnored = isUnderSrc ? shouldSkipIgnoredModule(absolute, phase) : false;\n\t\tif (isUnderSrc && skipIgnored) ignoredFiles.push(normalizeBuildFilePath(absolute));\n\t\tconst buildEntry = classifyBuildEntry(root, srcRoot, absolute);\n\t\tif (buildEntry && !skipIgnored) buildEntries[buildEntry.entryKey] = buildEntry.entryPath;\n\t\tif (!collectSources) continue;\n\t\tif (stats.size > 262144 || isIgnoredFile(name)) continue;\n\t\tconst buffer = readFileSync(absolute);\n\t\tif (isProbablyBinary(buffer)) continue;\n\t\ttotals.bytes += buffer.byteLength;\n\t\tsourceFiles.push({\n\t\t\tpath: toPosix(relative(root, absolute)),\n\t\t\tcontents: buffer.toString(\"utf8\"),\n\t\t\thash: createHash(\"sha256\").update(buffer).digest(\"hex\")\n\t\t});\n\t}\n}\n/**\n* One full-tree walk of the project: classifies tsdown entries and optionally\n* collects deploy source files (path + contents + hash) under snapshot limits.\n*/\nfunction walkProject(root, srcDirOrOptions = \"src\", maybeOptions) {\n\tconst srcDir = typeof srcDirOrOptions === \"string\" ? srcDirOrOptions : srcDirOrOptions.srcDir ?? \"src\";\n\tconst options = typeof srcDirOrOptions === \"string\" ? maybeOptions ?? {} : srcDirOrOptions;\n\tconst collectSources = options.collectSources ?? false;\n\tconst phase = options.phase ?? \"build\";\n\tconst sourceFiles = [];\n\tconst buildEntries = {};\n\tconst ignoredFiles = [];\n\twalkTree(root, root, join(root, srcDir), phase, collectSources, sourceFiles, buildEntries, ignoredFiles, { bytes: 0 });\n\treturn {\n\t\tsourceFiles,\n\t\tbuildEntries,\n\t\tignoredFiles\n\t};\n}\n//#endregion\nexport { keystrokeIgnoreGuardPlugin as n, walkProject as t };\n\n//# sourceMappingURL=walk-project-eZ95LOUW.mjs.map","import { isBuiltin } from \"node:module\";\n\n/** Native addons kept external — resolved from the CLI runtime at app start. */\nexport const NATIVE_RUNTIME_DEPS = [\"pg\", \"better-sqlite3\", \"@parcel/watcher\"];\n\n/**\n * Integration packages (`packages/integrations/*`) bundled into the user-app artifact so a\n * project carries its own integration code/version. Their framework imports (`@keystrokehq/keystroke`,\n * `@keystrokehq/action`, …) stay external and resolve from the runtime image. `slack` is excluded —\n * it is a gateway integration the runtime mounts server-side, so it stays in the runtime image.\n */\nexport const BUNDLED_INTEGRATION_PACKAGES = [\n \"exa\",\n \"github\",\n \"gong\",\n \"googlesuper\",\n \"slackbot\",\n \"snowflake\",\n];\n\n/** Matches framework `@keystrokehq/*` (everything except the bundled integration packages). */\nexport const FRAMEWORK_KEYSTROKE_EXTERNAL = new RegExp(\n `^@keystrokehq\\\\/(?!(?:${BUNDLED_INTEGRATION_PACKAGES.join(\"|\")})(?:\\\\/|$))`,\n);\n\nfunction isBundledIntegration(name) {\n if (!name.startsWith(\"@keystrokehq/\")) {\n return false;\n }\n\n return BUNDLED_INTEGRATION_PACKAGES.includes(name.slice(\"@keystrokehq/\".length));\n}\n\n/** Kept external so .d.ts emission does not inline internal/inferred types. */\nexport const LIBRARY_EXTERNAL_DEPS = [\"better-auth\", /^@better-auth\\//, /^better-auth\\//];\n\n/** Non-auth runtime deps kept external for published entry bundles (platform, etc.). */\nexport const BUNDLED_ENTRY_RUNTIME_EXTERNAL_DEPS = [\n ...NATIVE_RUNTIME_DEPS,\n \"dockerode\",\n \"ssh2\",\n \"cpu-features\",\n \"microsandbox\",\n /^@aws-sdk\\//,\n /^@napi-rs\\//,\n \"hono\",\n /^@hono\\//,\n \"undici\",\n];\n\n/** Kept external when bundling published entry points (cli, keystroke, platform). */\nexport const BUNDLED_ENTRY_EXTERNAL_DEPS = [\n ...BUNDLED_ENTRY_RUNTIME_EXTERNAL_DEPS,\n ...LIBRARY_EXTERNAL_DEPS,\n];\n\n/** Bundle into CLI — device login uses Better Auth client only. */\nexport const BETTER_AUTH_CLIENT_BUNDLE_PATTERNS = [\n /^better-auth\\/client$/,\n /^better-auth\\/client\\//,\n];\n\n/** Server adapters and root entry — must not ship in the CLI bundle. */\nexport const BETTER_AUTH_SERVER_EXTERNAL_PATTERNS = [\n /^better-auth$/,\n /^@better-auth\\//,\n /^better-auth\\/(?!client(\\/|$)).+/,\n];\n\nexport function isNativeRuntimeDep(id) {\n return NATIVE_RUNTIME_DEPS.some((dep) => id === dep || id.startsWith(`${dep}/`));\n}\n\nfunction packageName(id) {\n if (id.startsWith(\"@\")) {\n const [scope, name] = id.split(\"/\");\n return name ? `${scope}/${name}` : id;\n }\n\n return id.split(\"/\")[0] ?? id;\n}\n\nfunction isRuntimeExternal(id) {\n const name = packageName(id);\n if (isNativeRuntimeDep(name)) {\n return true;\n }\n\n if (name.startsWith(\"@keystrokehq/\")) {\n return !isBundledIntegration(name);\n }\n\n if (name === \"better-auth\" || name.startsWith(\"@better-auth/\")) {\n return true;\n }\n\n return false;\n}\n\n/** Library packages resolve npm deps from node_modules at runtime. */\nexport function libraryBuildDepsConfig() {\n return {\n alwaysBundle: (_id) => null,\n neverBundle: [...NATIVE_RUNTIME_DEPS, /^@keystrokehq\\//, ...LIBRARY_EXTERNAL_DEPS],\n onlyBundle: false,\n };\n}\n\n/** Bundle npm deps into dist; resolve @keystrokehq/* and natives from the runtime. */\nexport function userAppBuildDepsConfig() {\n return {\n alwaysBundle: (id, _importer) => {\n if (id.startsWith(\".\") || id.startsWith(\"/\") || isBuiltin(id)) {\n return null;\n }\n\n return isRuntimeExternal(id) ? null : true;\n },\n neverBundle: [...NATIVE_RUNTIME_DEPS, FRAMEWORK_KEYSTROKE_EXTERNAL, ...LIBRARY_EXTERNAL_DEPS],\n onlyBundle: false,\n };\n}\n\n/**\n * Published entry packages (cli, keystroke, platform): declare bundled @keystrokehq/*\n * in dependencies (changesets release graph ignores devDependencies). Inlining is\n * driven by alwaysBundle below, not by dep kind. Runtime npm deps stay external.\n */\nexport function bundledEntryDepsConfig() {\n return {\n alwaysBundle: [/^@keystrokehq\\//],\n neverBundle: [...BUNDLED_ENTRY_EXTERNAL_DEPS],\n onlyBundle: false,\n };\n}\n\n/** Published CLI: inline better-auth client + @better-auth/*; keep server adapters external. */\nexport const BETTER_AUTH_CLI_BUNDLE_PATTERNS = [\n ...BETTER_AUTH_CLIENT_BUNDLE_PATTERNS,\n /^@better-auth\\//,\n];\n\nexport const BETTER_AUTH_CLI_EXTERNAL_PATTERNS = [\n /^better-auth$/,\n /^better-auth\\/(?!client(\\/|$)).+/,\n /^@better-auth\\/drizzle-adapter/,\n \"drizzle-orm\",\n];\n\n/** Rolldown/tsdown — native bindings; stay in CLI node_modules at runtime. */\nexport const CLI_BUILD_TOOL_EXTERNAL_PATTERNS = [\"tsdown\", \"rolldown\", /^@rolldown\\//, \"tsx\"];\n\n/** CLI: inline better-auth/client; keep server + drizzle adapters external. */\nexport function cliBundledEntryDepsConfig() {\n return {\n alwaysBundle: [/^@keystrokehq\\//, ...BETTER_AUTH_CLI_BUNDLE_PATTERNS],\n neverBundle: [\n ...BUNDLED_ENTRY_RUNTIME_EXTERNAL_DEPS,\n ...BETTER_AUTH_CLI_EXTERNAL_PATTERNS,\n ...CLI_BUILD_TOOL_EXTERNAL_PATTERNS,\n ],\n onlyBundle: false,\n };\n}\n","import { bundledEntryDepsConfig, libraryBuildDepsConfig, userAppBuildDepsConfig } from \"./deps.js\";\n\nexport {\n isNativeRuntimeDep,\n NATIVE_RUNTIME_DEPS,\n bundledEntryDepsConfig,\n cliBundledEntryDepsConfig,\n libraryBuildDepsConfig,\n userAppBuildDepsConfig,\n} from \"./deps.js\";\n\nexport const baseTsdownConfig = {\n format: [\"esm\", \"cjs\"],\n dts: true,\n clean: true,\n sourcemap: true,\n target: \"node20\",\n deps: libraryBuildDepsConfig(),\n};\n\n/** tsdown config for published bundles (cli, keystroke, platform). */\nexport const bundledEntryTsdownConfig = {\n format: [\"esm\", \"cjs\"],\n dts: true,\n clean: true,\n sourcemap: true,\n target: \"node20\",\n deps: bundledEntryDepsConfig(),\n};\n","import { n as keystrokeIgnoreGuardPlugin, t as walkProject } from \"./walk-project-eZ95LOUW.mjs\";\nimport { t as resolveModuleDirs } from \"./resolve-module-dirs-BPHQhRGy.mjs\";\nimport { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from \"node:fs\";\nimport { dirname, join, relative } from \"node:path\";\nimport { packAssetDirs } from \"@keystrokehq/sandbox/files\";\nimport { baseTsdownConfig, userAppBuildDepsConfig } from \"@keystrokehq/tsdown-config\";\nimport { build, mergeConfig } from \"tsdown\";\nimport { buildStoredRouteManifestForProject } from \"@keystrokehq/manifest\";\n//#region src/resolve-runtime-artifact.ts\nfunction packageRoot(nodeModules, scope, name) {\n\tconst direct = scope ? join(nodeModules, scope, name) : join(nodeModules, name);\n\tif (existsSync(join(direct, \"package.json\"))) return direct;\n\tconst pnpmDir = join(nodeModules, \".pnpm\");\n\tif (!existsSync(pnpmDir)) return null;\n\tfor (const entry of readdirSync(pnpmDir)) {\n\t\tconst candidate = scope ? join(pnpmDir, entry, \"node_modules\", scope, name) : join(pnpmDir, entry, \"node_modules\", name);\n\t\tif (existsSync(join(candidate, \"package.json\"))) return candidate;\n\t}\n\treturn null;\n}\n/** Resolve a file shipped with `@keystrokehq/build` inside the CLI runtime. */\nfunction resolveRuntimeBuildArtifact(runtimeNodeModules, relativePath) {\n\tconst pkgRoot = packageRoot(runtimeNodeModules, \"@keystrokehq\", \"build\");\n\tif (!pkgRoot) throw new Error(\"Keystroke runtime is missing @keystrokehq/build\");\n\tconst artifact = join(pkgRoot, relativePath);\n\tif (!existsSync(artifact)) throw new Error(`Keystroke runtime artifact not found: ${relativePath}`);\n\treturn artifact;\n}\n//#endregion\n//#region src/vitest-plugin.ts\nconst ASSETS_MODULE$1 = \"@keystrokehq/assets\";\nconst virtualPrefix = `\\0${ASSETS_MODULE$1}:`;\n/** Vitest plugin resolving `@keystrokehq/assets` from disk. */\nfunction agentAssetsVitestPlugin(appRoot = process.cwd()) {\n\tlet manifest = null;\n\treturn {\n\t\tname: \"keystroke-assets\",\n\t\tresolveId(source) {\n\t\t\tif (source !== ASSETS_MODULE$1) return null;\n\t\t\treturn `${virtualPrefix}manifest`;\n\t\t},\n\t\tload(id) {\n\t\t\tif (id !== `${virtualPrefix}manifest`) return null;\n\t\t\tmanifest ??= packAssetDirs(appRoot);\n\t\t\treturn `export default ${JSON.stringify(manifest)};`;\n\t\t}\n\t};\n}\nfunction findAppRootFromConfig(configFile) {\n\tif (!configFile) return process.cwd();\n\treturn dirname(configFile);\n}\nfunction agentAssetsVitestPluginFromConfig(configFile) {\n\treturn agentAssetsVitestPlugin(findAppRootFromConfig(configFile));\n}\n//#endregion\n//#region src/resolve-build-filter.ts\n/** Resolve exact build-entry keys for a filtered deploy build. */\nfunction resolveBuildFilter(filter, buildEntries) {\n\tif (filter.length === 0) throw new Error(\"At least one --filter entry is required\");\n\tconst matched = {};\n\tfor (const key of [...new Set(filter)]) {\n\t\tconst entryPath = buildEntries[key];\n\t\tif (!entryPath) throw new Error(`Unknown build entry \"${key}\". Use keys like agents/foo or workflows/bar from walkProject.`);\n\t\tmatched[key] = entryPath;\n\t}\n\treturn matched;\n}\n//#endregion\n//#region src/build-filtered.ts\nfunction toPosix(path) {\n\treturn path.replace(/\\\\/g, \"/\");\n}\nfunction distRelativePath(entryKey) {\n\treturn `${entryKey}.mjs`;\n}\nasync function buildSingleEntry(root, entryKey, entryPath, ignoredFiles) {\n\tmkdirSync(join(root, \".keystroke\"), { recursive: true });\n\tconst scratchRoot = mkdtempSync(join(root, \".keystroke\", \"filter-build-\"));\n\tconst outDir = join(scratchRoot, \"dist\");\n\tconst relativePath = distRelativePath(entryKey);\n\tawait build(mergeConfig(baseTsdownConfig, {\n\t\tentry: { [entryKey]: entryPath },\n\t\tformat: [\"esm\"],\n\t\toutDir,\n\t\tclean: true,\n\t\tdts: false,\n\t\tloader: { \".md\": \"text\" },\n\t\tdeps: userAppBuildDepsConfig(),\n\t\tplugins: [keystrokeIgnoreGuardPlugin({\n\t\t\troot,\n\t\t\tignoredFiles\n\t\t})]\n\t}));\n\treturn {\n\t\tscratchRoot,\n\t\trelativePath\n\t};\n}\nasync function manifestEntriesForBuiltModule(root, entryPath, relativePath, contents, sourceMap) {\n\tconst moduleFile = toPosix(relative(root, entryPath));\n\tconst distPath = join(root, \"dist\", relativePath);\n\tconst distMapPath = `${distPath}.map`;\n\tconst previousDist = existsSync(distPath) ? readFileSync(distPath) : void 0;\n\tconst hadMap = existsSync(distMapPath);\n\tconst previousMap = hadMap ? readFileSync(distMapPath) : void 0;\n\tmkdirSync(dirname(distPath), { recursive: true });\n\twriteFileSync(distPath, contents);\n\tif (sourceMap) writeFileSync(distMapPath, sourceMap);\n\ttry {\n\t\treturn (await buildStoredRouteManifestForProject(root, { reloadModules: true })).entries.filter((entry) => \"moduleFile\" in entry && entry.moduleFile === moduleFile);\n\t} finally {\n\t\tif (previousDist) writeFileSync(distPath, previousDist);\n\t\telse rmSync(distPath, { force: true });\n\t\tif (previousMap) writeFileSync(distMapPath, previousMap);\n\t\telse if (sourceMap || hadMap) rmSync(distMapPath, { force: true });\n\t}\n}\n/** Build selected modules in isolation for a filtered deploy merge. */\nasync function buildFilteredApp(options) {\n\tconst root = options.root ?? process.cwd();\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst phase = options.phase ?? \"deploy\";\n\tconst collectSources = options.collectSources ?? false;\n\tconst previous = process.cwd();\n\tconst walked = walkProject(root, {\n\t\tsrcDir,\n\t\tcollectSources,\n\t\tphase\n\t});\n\tconst matched = resolveBuildFilter(options.filter, walked.buildEntries);\n\tconst files = [];\n\tconst manifestEntries = [];\n\ttry {\n\t\tprocess.chdir(root);\n\t\tfor (const [entryKey, entryPath] of Object.entries(matched)) {\n\t\t\tconst { scratchRoot, relativePath } = await buildSingleEntry(root, entryKey, entryPath, walked.ignoredFiles);\n\t\t\ttry {\n\t\t\t\tconst builtPath = join(scratchRoot, \"dist\", relativePath);\n\t\t\t\tconst mapPath = `${builtPath}.map`;\n\t\t\t\tconst contents = readFileSync(builtPath);\n\t\t\t\tconst sourceMap = existsSync(mapPath) ? readFileSync(mapPath) : void 0;\n\t\t\t\tfiles.push({\n\t\t\t\t\tentryKey,\n\t\t\t\t\trelativePath,\n\t\t\t\t\tcontents,\n\t\t\t\t\tsourceMap\n\t\t\t\t});\n\t\t\t\tmanifestEntries.push(...await manifestEntriesForBuiltModule(root, entryPath, relativePath, contents, sourceMap));\n\t\t\t} finally {\n\t\t\t\trmSync(scratchRoot, {\n\t\t\t\t\trecursive: true,\n\t\t\t\t\tforce: true\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tprocess.chdir(previous);\n\t}\n\treturn {\n\t\tfiles,\n\t\tmanifestEntries,\n\t\tsourceFiles: walked.sourceFiles\n\t};\n}\n//#endregion\n//#region src/index.ts\nconst ASSETS_MODULE = \"@keystrokehq/assets\";\nconst VIRTUAL_PREFIX = `\\0${ASSETS_MODULE}:`;\nfunction renderAssetModule(manifest) {\n\treturn `export default ${JSON.stringify(manifest)};\\n`;\n}\n/** Rolldown plugin: pack src/skills + src/files and expose `@keystrokehq/assets`. */\nfunction agentAssetsPlugin(options) {\n\tconst srcDir = options.srcDir ?? \"src\";\n\tlet manifest = null;\n\treturn {\n\t\tname: \"keystroke-assets\",\n\t\tbuildStart() {\n\t\t\tmanifest = packAssetDirs(options.root, srcDir);\n\t\t},\n\t\tresolveId(source) {\n\t\t\tif (source !== ASSETS_MODULE) return null;\n\t\t\treturn `${VIRTUAL_PREFIX}manifest`;\n\t\t},\n\t\tload(id) {\n\t\t\tif (id !== `${VIRTUAL_PREFIX}manifest` || !manifest) return null;\n\t\t\treturn renderAssetModule(manifest);\n\t\t},\n\t\tbuildEnd() {\n\t\t\tif (!manifest) return;\n\t\t\tconst outDir = join(options.root, options.outDir ?? \"dist\", \".keystroke\");\n\t\t\tmkdirSync(outDir, { recursive: true });\n\t\t\twriteFileSync(join(outDir, \"assets.mjs\"), renderAssetModule(manifest));\n\t\t}\n\t};\n}\n/** Full tsdown config for user keystroke apps (config + discovered modules only). */\nfunction createAppBuildConfig(options = {}, walked) {\n\tconst root = options.root ?? process.cwd();\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst outDir = options.outDir ?? \"dist\";\n\tconst configEntry = existsSync(join(root, \"keystroke.config.ts\")) ? join(root, \"keystroke.config.ts\") : void 0;\n\tconst walkedResult = walked ?? walkProject(root, {\n\t\tsrcDir,\n\t\tphase: options.phase\n\t});\n\tconst discovered = walkedResult.buildEntries;\n\tconst ignoredFiles = walkedResult.ignoredFiles;\n\tconst entries = {\n\t\t...configEntry ? { config: configEntry } : {},\n\t\t...discovered\n\t};\n\tif (Object.keys(entries).length === 0) throw new Error(\"Nothing to build — add keystroke.config.ts or modules under src/\");\n\treturn mergeConfig(baseTsdownConfig, {\n\t\tentry: entries,\n\t\tformat: [\"esm\"],\n\t\toutDir: join(root, outDir),\n\t\tclean: options.clean ?? true,\n\t\tdts: false,\n\t\tloader: { \".md\": \"text\" },\n\t\tdeps: userAppBuildDepsConfig(),\n\t\tplugins: [keystrokeIgnoreGuardPlugin({\n\t\t\troot,\n\t\t\tignoredFiles\n\t\t}), agentAssetsPlugin({\n\t\t\troot,\n\t\t\tsrcDir,\n\t\t\toutDir\n\t\t})]\n\t});\n}\n/** Build user agents, workflows, triggers, and config to `dist/`. */\nasync function buildApp(options = {}) {\n\tconst root = options.root ?? process.cwd();\n\tconst srcDir = options.srcDir ?? \"src\";\n\tconst emitManifest = options.emitManifest ?? true;\n\tconst collectSources = options.collectSources ?? false;\n\tconst phase = options.phase ?? \"build\";\n\tconst previous = process.cwd();\n\tconst walked = walkProject(root, {\n\t\tsrcDir,\n\t\tcollectSources,\n\t\tphase\n\t});\n\ttry {\n\t\tprocess.chdir(root);\n\t\tawait build(createAppBuildConfig({\n\t\t\t...options,\n\t\t\troot\n\t\t}, {\n\t\t\tbuildEntries: walked.buildEntries,\n\t\t\tignoredFiles: walked.ignoredFiles\n\t\t}));\n\t\tif (emitManifest) {\n\t\t\tconst { emitStoredRouteManifestForProject } = await import(\"@keystrokehq/manifest\");\n\t\t\tawait emitStoredRouteManifestForProject(root);\n\t\t}\n\t} finally {\n\t\tprocess.chdir(previous);\n\t}\n\treturn { sourceFiles: walked.sourceFiles };\n}\n/**\n* Watch `src/` and rebuild `dist/` on change.\n*\n* NOT true hot reload — each change runs a full tsdown rebuild. Callers should\n* restart the API server in `onRebuild` so discovery picks up new/changed modules.\n*/\nasync function watchApp(options = {}) {\n\tconst { runWatchApp } = await import(\"./watch-app-DTIeKrbl.mjs\");\n\tawait runWatchApp((watchOptions) => buildApp({\n\t\t...watchOptions,\n\t\temitManifest: false,\n\t\tcollectSources: false\n\t}), options);\n}\n//#endregion\nexport { agentAssetsVitestPlugin, agentAssetsVitestPluginFromConfig, buildApp, buildFilteredApp, createAppBuildConfig, resolveBuildFilter, resolveModuleDirs, resolveRuntimeBuildArtifact, watchApp };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;AAMA,SAAS,UAAU,MAAM;CACxB,OAAO,KAAK,MAAM,GAAG,EAAE,KAAK,GAAG;AAChC;AACA,SAAS,oBAAoB,MAAM,UAAU;CAC5C,OAAO,UAAU,SAAS,MAAM,uBAAuB,QAAQ,CAAC,CAAC;AAClE;;AAEA,SAAS,uBAAuB,UAAU;CACzC,MAAM,WAAW,QAAQ,QAAQ;CACjC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