eser 4.1.37 → 4.1.40
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/chunks/add-V7YYHLFH.js +8 -0
- package/chunks/{anthropic-2MXDKLNX.js → anthropic-QBGNUIP3.js} +1 -1
- package/chunks/approve-HVIH2A3C.js +2 -0
- package/chunks/ask-PMB64QWG.js +3 -0
- package/chunks/block-JSK5CJPO.js +2 -0
- package/chunks/browser-JGBNWUEQ.js +2 -0
- package/chunks/{build-EJLFNB4I.js → build-HUKFUVPB.js} +2 -2
- package/chunks/bun-HIMXX54I.js +2 -0
- package/chunks/changelog-gen-JV3EHOMV.js +10 -0
- package/chunks/{chunk-GJ4LCA6D.js → chunk-2KKLYXSA.js} +1 -1
- package/chunks/{chunk-JYNHFD6B.js → chunk-2XNFZXHY.js} +1 -1
- package/chunks/{chunk-2EVWKUN6.js → chunk-3AA3RXKD.js} +1 -1
- package/chunks/{chunk-CUIMSX4V.js → chunk-3IZX4OZ7.js} +1 -1
- package/chunks/{chunk-KPWEJXPI.js → chunk-3QF3I2RD.js} +1 -1
- package/chunks/{chunk-K6H7JTIH.js → chunk-4EHAL3NK.js} +1 -1
- package/chunks/chunk-4FGLERUG.js +2 -0
- package/chunks/{chunk-IDMI5OBK.js → chunk-4QDEJUAF.js} +1 -1
- package/chunks/{chunk-4MVO4LD5.js → chunk-5224ZYEW.js} +1 -1
- package/chunks/{chunk-LCG4SK6K.js → chunk-5DWJ7WEE.js} +1 -1
- package/chunks/{chunk-LKF6GBNU.js → chunk-5RX5V5BA.js} +1 -1
- package/chunks/chunk-5WJ6AUNY.js +2 -0
- package/chunks/chunk-6E6JUBFH.js +2 -0
- package/chunks/chunk-7UASU4NU.js +10 -0
- package/chunks/chunk-A3JJKZ4C.js +4 -0
- package/chunks/chunk-A3MZV73T.js +32 -0
- package/chunks/chunk-A6K5L4SG.js +3 -0
- package/chunks/{chunk-YVIGHK4H.js → chunk-AHKNU2JM.js} +1 -1
- package/chunks/chunk-AMMTAUXC.js +66 -0
- package/chunks/{chunk-BCPCQHDL.js → chunk-BBOEAL63.js} +1 -1
- package/chunks/chunk-BQT5RJZB.js +2 -0
- package/chunks/{chunk-EBCQCAQ7.js → chunk-BWDCKK63.js} +1 -1
- package/chunks/{chunk-FORPNESQ.js → chunk-CMSPX2RN.js} +1 -1
- package/chunks/{chunk-H4SPMUT6.js → chunk-DKFL6XPX.js} +1 -1
- package/chunks/{chunk-HVLKXRPA.js → chunk-DWLFTRZS.js} +1 -1
- package/chunks/{chunk-PVPMHMKP.js → chunk-ECY4MUD3.js} +1 -1
- package/chunks/{chunk-IIIMOOFE.js → chunk-EGMYM4TM.js} +1 -1
- package/chunks/{chunk-I4C675WP.js → chunk-F35K7YVH.js} +1 -1
- package/chunks/{chunk-IZONBJSX.js → chunk-F5HQDZLN.js} +1 -1
- package/chunks/{chunk-A6RDYP6R.js → chunk-FFWPJP7A.js} +1 -1
- package/chunks/chunk-H2O5G3XB.js +2 -0
- package/chunks/{chunk-Y53YTL4C.js → chunk-HLKFDKLZ.js} +1 -1
- package/chunks/{chunk-SOBOSRJB.js → chunk-HP5W5XT6.js} +1 -1
- package/chunks/{chunk-BP3IFAPO.js → chunk-HTJLIAH4.js} +1 -1
- package/chunks/{chunk-7BFBOLLC.js → chunk-HVTJ5LVU.js} +1 -1
- package/chunks/{chunk-YQVWAWMO.js → chunk-ILROPD5P.js} +1 -1
- package/chunks/chunk-JI536JLJ.js +2 -0
- package/chunks/{chunk-UJPVEQX7.js → chunk-K2MKYDPY.js} +1 -1
- package/chunks/{chunk-T2DRBZ4X.js → chunk-KEOTIPA6.js} +1 -1
- package/chunks/chunk-L2E2H7YT.js +2 -0
- package/chunks/chunk-L7UCWRDZ.js +3 -0
- package/chunks/{chunk-4WQGB7NO.js → chunk-LBMJGMDD.js} +1 -1
- package/chunks/{chunk-2VEVVX6U.js → chunk-LFNUSULJ.js} +1 -1
- package/chunks/{chunk-5GGGQJ4P.js → chunk-MBCPGD5L.js} +1 -1
- package/chunks/chunk-MEZCXQAX.js +2 -0
- package/chunks/{chunk-B6EATLKL.js → chunk-MOY4CXAZ.js} +2 -2
- package/chunks/{chunk-P2DMLPKI.js → chunk-MQ4EMT35.js} +1 -1
- package/chunks/chunk-NEHZOG23.js +7 -0
- package/chunks/{chunk-QZ44TAIY.js → chunk-NJUIBCQR.js} +1 -1
- package/chunks/{chunk-5MWX3POX.js → chunk-NZRU3N6C.js} +1 -1
- package/chunks/{chunk-N2VBT43E.js → chunk-O2TA7OHJ.js} +1 -1
- package/chunks/{chunk-ER4ZWF4Y.js → chunk-OAFB4A6D.js} +1 -1
- package/chunks/chunk-OAT2D23A.js +2 -0
- package/chunks/{chunk-3QIPK7NI.js → chunk-OPPOHKNZ.js} +1 -1
- package/chunks/{chunk-ZNGLZECE.js → chunk-OWV223WQ.js} +1 -1
- package/chunks/{chunk-3BEX5FYF.js → chunk-P2MUEKFT.js} +1 -1
- package/chunks/{chunk-455V3AE5.js → chunk-P72TUTYK.js} +1 -1
- package/chunks/{chunk-Q2KSOC32.js → chunk-PPSDIDOI.js} +1 -1
- package/chunks/chunk-PXCM4FHO.js +2 -0
- package/chunks/{chunk-KVTG56GS.js → chunk-QFFGKP3M.js} +1 -1
- package/chunks/{chunk-PZNCE6QK.js → chunk-QXATB6Z5.js} +1 -1
- package/chunks/chunk-RGUPFAEE.js +68 -0
- package/chunks/{chunk-SP43S32B.js → chunk-RVJZFWN7.js} +1 -1
- package/chunks/{chunk-B5IPHVXT.js → chunk-SBAXURB7.js} +1 -1
- package/chunks/{chunk-7NUMDHE2.js → chunk-T4WKRBQZ.js} +1 -1
- package/chunks/{chunk-UJ6LH5FY.js → chunk-TEOMM3RD.js} +1 -1
- package/chunks/{chunk-QOX7VSID.js → chunk-TLVGNOK3.js} +1 -1
- package/chunks/{chunk-HYT26FYU.js → chunk-U5Q5MC74.js} +1 -1
- package/chunks/chunk-ULNEO3RY.js +4 -0
- package/chunks/{chunk-MXGRYONZ.js → chunk-UMKCOU3N.js} +1 -1
- package/chunks/{chunk-536RBSFU.js → chunk-UQ2BC7UA.js} +1 -1
- package/chunks/{chunk-HVOPUZOM.js → chunk-VIQLCQOI.js} +1 -1
- package/chunks/chunk-VWQLQJVX.js +2 -0
- package/chunks/{chunk-CKNA5LIK.js → chunk-WAEXOK7L.js} +1 -1
- package/chunks/{chunk-NP723K5L.js → chunk-WILZ4OR2.js} +1 -1
- package/chunks/chunk-WJKE6XHF.js +2 -0
- package/chunks/{chunk-KQE6FMKW.js → chunk-XYUJCTPP.js} +1 -1
- package/chunks/{chunk-P2TABZ4A.js → chunk-YEWODYET.js} +1 -1
- package/chunks/{chunk-3SXTMY75.js → chunk-YVN2NZL4.js} +1 -1
- package/chunks/{chunk-GBM3TZFD.js → chunk-ZC4F4MYU.js} +1 -1
- package/chunks/{chunk-KBFKBL6A.js → chunk-ZWMJQZQF.js} +1 -1
- package/chunks/claude-code-ELUDT5TV.js +2 -0
- package/chunks/{clone-H3UAEVVP.js → clone-YEBQK7CG.js} +1 -1
- package/chunks/cmd-2DAVTVOF.js +2 -0
- package/chunks/{commitmsg-7XZGGERO.js → commitmsg-FQ3IZ3TH.js} +2 -2
- package/chunks/concern-TIGYH5DX.js +2 -0
- package/chunks/deno-XQHOVHKR.js +2 -0
- package/chunks/dev-BNGJJR2O.js +4 -0
- package/chunks/dist-QVOR7USR.js +13 -0
- package/chunks/done-GGPPHJW2.js +2 -0
- package/chunks/file-tools-shared-KBTCO2FV.js +2 -0
- package/chunks/{gemini-F4KLO5VU.js → gemini-43AWJEWI.js} +1 -1
- package/chunks/gh-Q7VEABJS.js +4 -0
- package/chunks/gh-contributors-4KGARSNL.js +12 -0
- package/chunks/init-45ODFAV3.js +2 -0
- package/chunks/{init-J4IHOVZL.js → init-RV7K5JC4.js} +3 -3
- package/chunks/{install-KNZDCGIB.js → install-6XIQS5E7.js} +2 -2
- package/chunks/invoke-hook-Q3NMJXDO.js +11 -0
- package/chunks/kiro-NZ7LM6HA.js +2 -0
- package/chunks/list-BOLPKAEY.js +2 -0
- package/chunks/{list-N4ZKDFW7.js → list-NYLFIF2U.js} +1 -1
- package/chunks/list-UQMPOF5Y.js +2 -0
- package/chunks/load-config-G4DHKB5K.js +2 -0
- package/chunks/{main-HJQEBLLN.js → main-236QYA7G.js} +2 -2
- package/chunks/manifest-3VJ4O6HR.js +2 -0
- package/chunks/{mod-4ILLF5PK.js → mod-5JT4O5L3.js} +1 -1
- package/chunks/mod-BQJDMCYC.js +2 -0
- package/chunks/mod-DXA25A4J.js +2 -0
- package/chunks/mod-EWLBSEHA.js +2 -0
- package/chunks/mod-GSWVSC2C.js +28 -0
- package/chunks/mod-IHYN4TEM.js +3 -0
- package/chunks/mod-IXVUQHXS.js +2 -0
- package/chunks/mod-L26IBE5V.js +2 -0
- package/chunks/mod-PZSJGUM7.js +2 -0
- package/chunks/mod-QWYXFGRG.js +2 -0
- package/chunks/{mod-OS3BCM2G.js → mod-SXL6PDQM.js} +1 -1
- package/chunks/mod-YH5Z6G4Q.js +2 -0
- package/chunks/multipart-parser-SSRHOBFH.js +3 -0
- package/chunks/{new-BOGCXTIY.js → new-U5U4E6HR.js} +1 -1
- package/chunks/next-AQ4TIEL7.js +9 -0
- package/chunks/node-IN5OQP4N.js +68 -0
- package/chunks/node-ZGM6SXXI.js +2 -0
- package/chunks/ollama-LHWMXMLY.js +2 -0
- package/chunks/openai-2KONKHWL.js +2 -0
- package/chunks/openai-IRQY5SCR.js +24 -0
- package/chunks/opencode-24O2MW3L.js +2 -0
- package/chunks/purge-RM6OD5PV.js +5 -0
- package/chunks/recipe-applier-TTZEZGSC.js +2 -0
- package/chunks/registry-fetcher-SPENFEOH.js +2 -0
- package/chunks/release-UEX6YK4K.js +9 -0
- package/chunks/release-notes-GA7CTA54.js +4 -0
- package/chunks/release-tag-VJWBXG5G.js +2 -0
- package/chunks/reset-WHYTPTFB.js +2 -0
- package/chunks/rule-ZQOGLQQI.js +3 -0
- package/chunks/run-IX74MQTI.js +4 -0
- package/chunks/run-L35K3KRF.js +5 -0
- package/chunks/scripts-VI2TKQOH.js +2 -0
- package/chunks/sdk-L2SQCWYV.js +41 -0
- package/chunks/serve-AVVEYGQB.js +4 -0
- package/chunks/{server-KNWQV2HW.js → server-R347ON4B.js} +1 -1
- package/chunks/spec-KMKZDLV2.js +2 -0
- package/chunks/src-6SFGTAGT.js +4 -0
- package/chunks/status-MLX4O37A.js +2 -0
- package/chunks/sync-PB4KWB3R.js +2 -0
- package/chunks/system-BXJ2LV5O.js +2 -0
- package/chunks/system-KMRRIKMQ.js +2 -0
- package/chunks/{unstable_chmod-GDQI7NKH.js → unstable_chmod-2W47KJY3.js} +1 -1
- package/chunks/update-522VXIKX.js +6 -0
- package/chunks/validate-bom-JCMRVAUT.js +2 -0
- package/chunks/validate-case-conflict-WZQCMKSZ.js +2 -0
- package/chunks/validate-circular-deps-7R4F2YDV.js +2 -0
- package/chunks/validate-commit-msg-PH7Y3JEI.js +2 -0
- package/chunks/validate-docs-WCIOHNYP.js +2 -0
- package/chunks/validate-eof-KRYQLTFQ.js +2 -0
- package/chunks/validate-export-names-OCQ2XSY6.js +2 -0
- package/chunks/validate-filenames-46O7FCXF.js +2 -0
- package/chunks/validate-json-3EZ2L64H.js +2 -0
- package/chunks/validate-large-files-7YX6MSOB.js +2 -0
- package/chunks/validate-licenses-OC7JRVAH.js +2 -0
- package/chunks/validate-line-endings-2DM5UGCJ.js +2 -0
- package/chunks/validate-merge-conflict-UDMWYMJ5.js +2 -0
- package/chunks/validate-mod-exports-W24IV367.js +2 -0
- package/chunks/validate-package-configs-3Y55ZLUY.js +2 -0
- package/chunks/validate-secrets-66VXCCUF.js +2 -0
- package/chunks/validate-shebangs-AMEAHVLB.js +2 -0
- package/chunks/validate-submodules-DYCE27WK.js +2 -0
- package/chunks/validate-symlinks-QN744GUH.js +2 -0
- package/chunks/validate-toml-5K2XNHAE.js +2 -0
- package/chunks/validate-trailing-whitespace-QYWHHIAK.js +2 -0
- package/chunks/validate-yaml-VGKLHEAQ.js +2 -0
- package/chunks/versions-FYALONNL.js +2 -0
- package/chunks/{vertexai-EXTYPVHK.js → vertexai-2F2A3VTE.js} +1 -1
- package/chunks/watch-P56QT3Q2.js +9 -0
- package/chunks/workerd-LOWXXQEU.js +2 -0
- package/eser.js +1 -1
- package/package.json +1 -1
- package/chunks/add-5SDE43IH.js +0 -8
- package/chunks/approve-DNKMQSPX.js +0 -2
- package/chunks/ask-L3N6REQI.js +0 -3
- package/chunks/block-GRKMCTGR.js +0 -2
- package/chunks/browser-SG2DBNGS.js +0 -2
- package/chunks/bun-3AACRJXG.js +0 -2
- package/chunks/changelog-gen-MX6L2Z24.js +0 -10
- package/chunks/chunk-25FUVC3C.js +0 -13
- package/chunks/chunk-2HBVIH7V.js +0 -3
- package/chunks/chunk-32HV3K27.js +0 -2
- package/chunks/chunk-46ZWBKIW.js +0 -2
- package/chunks/chunk-4DOMGQOO.js +0 -2
- package/chunks/chunk-6FNHSIZJ.js +0 -2
- package/chunks/chunk-CBGABZ5E.js +0 -2
- package/chunks/chunk-CDPSH56U.js +0 -2
- package/chunks/chunk-CZS6DCUY.js +0 -61
- package/chunks/chunk-DAK2I7UC.js +0 -2
- package/chunks/chunk-DTO2YJWZ.js +0 -2
- package/chunks/chunk-DYRTLYTU.js +0 -3
- package/chunks/chunk-G6NAG2EK.js +0 -2
- package/chunks/chunk-JOTAKQMZ.js +0 -2
- package/chunks/chunk-MRCBHVSB.js +0 -2
- package/chunks/chunk-PE2TDUXD.js +0 -19
- package/chunks/chunk-RGUETQSC.js +0 -4
- package/chunks/chunk-STI6DX7K.js +0 -2
- package/chunks/chunk-STTKPXTW.js +0 -2
- package/chunks/chunk-TFPT4BDY.js +0 -15
- package/chunks/chunk-V3WALAAO.js +0 -4
- package/chunks/chunk-VD5ZJBSR.js +0 -7
- package/chunks/chunk-W3RVRCUB.js +0 -2
- package/chunks/chunk-Y4ARZGGL.js +0 -2
- package/chunks/claude-code-VUBEU7RR.js +0 -2
- package/chunks/concern-T2NW35XI.js +0 -2
- package/chunks/deno-7BSPHDRG.js +0 -2
- package/chunks/dev-PTMXZEVC.js +0 -4
- package/chunks/done-RZD34AZF.js +0 -2
- package/chunks/file-tools-shared-G36OYF5S.js +0 -2
- package/chunks/fileFromPath-MB3IRZVW.js +0 -7
- package/chunks/gh-L25JQWOY.js +0 -5
- package/chunks/gh-contributors-E7IZ2LFS.js +0 -12
- package/chunks/init-J46SBNIS.js +0 -2
- package/chunks/invoke-hook-YTLAPETS.js +0 -10
- package/chunks/kiro-HQLXD6ZU.js +0 -2
- package/chunks/list-5TGTYMAU.js +0 -2
- package/chunks/list-PY3A762R.js +0 -2
- package/chunks/load-config-FTQMJVEW.js +0 -2
- package/chunks/manifest-NF2EK757.js +0 -2
- package/chunks/mod-FEGQZ3ZY.js +0 -2
- package/chunks/mod-GY6YJWVP.js +0 -2
- package/chunks/mod-HKYPZOU7.js +0 -2
- package/chunks/mod-JI2A2546.js +0 -2
- package/chunks/mod-JZNE2HH6.js +0 -2
- package/chunks/mod-MLRQFSBE.js +0 -2
- package/chunks/mod-NCF6OSXO.js +0 -2
- package/chunks/mod-PFWQZF3T.js +0 -28
- package/chunks/mod-W3DBWTCY.js +0 -11
- package/chunks/mod-YX3JRMSI.js +0 -2
- package/chunks/next-HAAR572Z.js +0 -4
- package/chunks/node-KCQF6QQA.js +0 -60
- package/chunks/node-MFKYO4CY.js +0 -2
- package/chunks/ollama-36F5QAOO.js +0 -2
- package/chunks/openai-EU5TJZ5T.js +0 -2
- package/chunks/openai-IKXRJYI3.js +0 -20
- package/chunks/opencode-7J3JDC44.js +0 -2
- package/chunks/purge-7QJOGWHM.js +0 -5
- package/chunks/recipe-applier-6QZYAZ57.js +0 -2
- package/chunks/registry-fetcher-76ISLGRR.js +0 -2
- package/chunks/release-J3PVDROM.js +0 -9
- package/chunks/release-notes-AARDYXYA.js +0 -4
- package/chunks/release-tag-H2YWUXRU.js +0 -2
- package/chunks/reset-WSJ47SUR.js +0 -2
- package/chunks/rule-J4FRRKOE.js +0 -3
- package/chunks/run-K6PMBZEQ.js +0 -4
- package/chunks/run-RGEZUAPM.js +0 -5
- package/chunks/scripts-JK6W2MCO.js +0 -2
- package/chunks/sdk-MXV452BR.js +0 -19
- package/chunks/serve-XVAIQ37L.js +0 -4
- package/chunks/spec-KTBVG2EX.js +0 -2
- package/chunks/status-3C2T6QAE.js +0 -2
- package/chunks/sync-WLEELRJW.js +0 -2
- package/chunks/system-GTHT75OL.js +0 -2
- package/chunks/system-WTPEDJU6.js +0 -2
- package/chunks/update-4C4WNXCE.js +0 -6
- package/chunks/validate-bom-QVE5HNBO.js +0 -2
- package/chunks/validate-case-conflict-XFS3URQN.js +0 -2
- package/chunks/validate-circular-deps-BMPAT3PF.js +0 -2
- package/chunks/validate-commit-msg-BPESCI7P.js +0 -2
- package/chunks/validate-docs-ITL4L6KY.js +0 -2
- package/chunks/validate-eof-DTFV74VL.js +0 -2
- package/chunks/validate-export-names-HLOH7D73.js +0 -2
- package/chunks/validate-filenames-J4RTDEBD.js +0 -2
- package/chunks/validate-json-KMODGNSU.js +0 -2
- package/chunks/validate-large-files-X5YF7D7T.js +0 -2
- package/chunks/validate-licenses-OZ7DXQTY.js +0 -2
- package/chunks/validate-line-endings-PFF6QJ3W.js +0 -2
- package/chunks/validate-merge-conflict-KB2X6QLW.js +0 -2
- package/chunks/validate-mod-exports-VHK2NVKI.js +0 -2
- package/chunks/validate-package-configs-ZNCAIYRO.js +0 -2
- package/chunks/validate-secrets-RM6DMZVG.js +0 -2
- package/chunks/validate-shebangs-WC66D7RK.js +0 -2
- package/chunks/validate-submodules-SPAXASAG.js +0 -2
- package/chunks/validate-symlinks-4LOWK2MQ.js +0 -2
- package/chunks/validate-toml-SG4IITMN.js +0 -2
- package/chunks/validate-trailing-whitespace-GRE2PJ6T.js +0 -2
- package/chunks/validate-yaml-RA22QNW6.js +0 -2
- package/chunks/versions-ODYWYT7U.js +0 -2
- package/chunks/watch-NEFCEWP5.js +0 -9
- package/chunks/workerd-VVSAKLDZ.js +0 -2
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import"./chunk-5WJ6AUNY.js";function l(s,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?s!==e||!n:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(s,t):n?n.value=t:e.set(s,t),t}function i(s,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?s!==e||!r:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(s):r?r.value:e.get(s)}var It=function(){let{crypto:s}=globalThis;if(s?.randomUUID)return It=s.randomUUID.bind(s),s.randomUUID();let e=new Uint8Array(1),t=s?()=>s.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>(+r^t()&15>>+r/4).toString(16))};function $(s){return typeof s=="object"&&s!==null&&("name"in s&&s.name==="AbortError"||"message"in s&&String(s.message).includes("FetchRequestCanceledException"))}var Ee=s=>{if(s instanceof Error)return s;if(typeof s=="object"&&s!==null){try{if(Object.prototype.toString.call(s)==="[object Error]"){let e=new Error(s.message,s.cause?{cause:s.cause}:{});return s.stack&&(e.stack=s.stack),s.cause&&!e.cause&&(e.cause=s.cause),s.name&&(e.name=s.name),e}}catch{}try{return new Error(JSON.stringify(s))}catch{}}return new Error(s)};var h=class extends Error{},x=class s extends h{constructor(e,t,r,n){super(`${s.makeMessage(e,t,r)}`),this.status=e,this.headers=n,this.requestID=n?.get("request-id"),this.error=t}static makeMessage(e,t,r){let n=t?.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):t?JSON.stringify(t):r;return e&&n?`${e} ${n}`:e?`${e} status code (no body)`:n||"(no status code or body)"}static generate(e,t,r,n){if(!e||!n)return new W({message:r,cause:Ee(t)});let o=t;return e===400?new ie(e,o,r,n):e===401?new ae(e,o,r,n):e===403?new ce(e,o,r,n):e===404?new le(e,o,r,n):e===409?new ue(e,o,r,n):e===422?new he(e,o,r,n):e===429?new fe(e,o,r,n):e>=500?new de(e,o,r,n):new s(e,o,r,n)}},k=class extends x{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},W=class extends x{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}},oe=class extends W{constructor({message:e}={}){super({message:e??"Request timed out."})}},ie=class extends x{},ae=class extends x{},ce=class extends x{},le=class extends x{},ue=class extends x{},he=class extends x{},fe=class extends x{},de=class extends x{};var Zr=/^[a-z][a-z0-9+.-]*:/i,lr=s=>Zr.test(s),Ot=s=>(Ot=Array.isArray,Ot(s)),Bt=Ot;function Ze(s){return typeof s!="object"?{}:s??{}}function Nt(s){if(!s)return!0;for(let e in s)return!1;return!0}function ur(s,e){return Object.prototype.hasOwnProperty.call(s,e)}var hr=(s,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new h(`${s} must be an integer`);if(e<0)throw new h(`${s} must be a positive integer`);return e};var et=s=>{try{return JSON.parse(s)}catch{return}};var fr=s=>new Promise(e=>setTimeout(e,s));var D="0.80.0";var gr=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function es(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}var ts=()=>{let s=es();if(s==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":D,"X-Stainless-OS":pr(Deno.build.os),"X-Stainless-Arch":dr(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":D,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(s==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":D,"X-Stainless-OS":pr(globalThis.process.platform??"unknown"),"X-Stainless-Arch":dr(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=rs();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":D,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":D,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function rs(){if(typeof navigator>"u"||!navigator)return null;let s=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:t}of s){let r=t.exec(navigator.userAgent);if(r){let n=r[1]||0,o=r[2]||0,a=r[3]||0;return{browser:e,version:`${n}.${o}.${a}`}}}return null}var dr=s=>s==="x32"?"x32":s==="x86_64"||s==="x64"?"x64":s==="arm"?"arm":s==="aarch64"||s==="arm64"?"arm64":s?`other:${s}`:"unknown",pr=s=>(s=s.toLowerCase(),s.includes("ios")?"iOS":s==="android"?"Android":s==="darwin"?"MacOS":s==="win32"?"Windows":s==="freebsd"?"FreeBSD":s==="openbsd"?"OpenBSD":s==="linux"?"Linux":s?`Other:${s}`:"Unknown"),mr,_r=()=>mr??(mr=ts());function yr(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Ft(...s){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...s)}function tt(s){let e=Symbol.asyncIterator in s?s[Symbol.asyncIterator]():s[Symbol.iterator]();return Ft({start(){},async pull(t){let{done:r,value:n}=await e.next();r?t.close():t.enqueue(n)},async cancel(){await e.return?.()}})}function Ae(s){if(s[Symbol.asyncIterator])return s;let e=s.getReader();return{async next(){try{let t=await e.read();return t?.done&&e.releaseLock(),t}catch(t){throw e.releaseLock(),t}},async return(){let t=e.cancel();return e.releaseLock(),await t,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function br(s){if(s===null||typeof s!="object")return;if(s[Symbol.asyncIterator]){await s[Symbol.asyncIterator]().return?.();return}let e=s.getReader(),t=e.cancel();e.releaseLock(),await t}var wr=({headers:s,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});function xr(s){return Object.entries(s).filter(([e,t])=>typeof t<"u").map(([e,t])=>{if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(t===null)return`${encodeURIComponent(e)}=`;throw new h(`Cannot stringify type ${typeof t}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}function Pr(s){let e=0;for(let n of s)e+=n.length;let t=new Uint8Array(e),r=0;for(let n of s)t.set(n,r),r+=n.length;return t}var Sr;function Te(s){let e;return(Sr??(e=new globalThis.TextEncoder,Sr=e.encode.bind(e)))(s)}var kr;function vt(s){let e;return(kr??(e=new globalThis.TextDecoder,kr=e.decode.bind(e)))(s)}var M,R,L=class{constructor(){M.set(this,void 0),R.set(this,void 0),l(this,M,new Uint8Array,"f"),l(this,R,null,"f")}decode(e){if(e==null)return[];let t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Te(e):e;l(this,M,Pr([i(this,M,"f"),t]),"f");let r=[],n;for(;(n=os(i(this,M,"f"),i(this,R,"f")))!=null;){if(n.carriage&&i(this,R,"f")==null){l(this,R,n.index,"f");continue}if(i(this,R,"f")!=null&&(n.index!==i(this,R,"f")+1||n.carriage)){r.push(vt(i(this,M,"f").subarray(0,i(this,R,"f")-1))),l(this,M,i(this,M,"f").subarray(i(this,R,"f")),"f"),l(this,R,null,"f");continue}let o=i(this,R,"f")!==null?n.preceding-1:n.preceding,a=vt(i(this,M,"f").subarray(0,o));r.push(a),l(this,M,i(this,M,"f").subarray(n.index),"f"),l(this,R,null,"f")}return r}flush(){return i(this,M,"f").length?this.decode(`
|
|
3
|
+
`):[]}};M=new WeakMap,R=new WeakMap;L.NEWLINE_CHARS=new Set([`
|
|
4
|
+
`,"\r"]);L.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function os(s,e){for(let n=e??0;n<s.length;n++){if(s[n]===10)return{preceding:n,index:n+1,carriage:!1};if(s[n]===13)return{preceding:n,index:n+1,carriage:!0}}return null}function Mr(s){for(let r=0;r<s.length-1;r++){if(s[r]===10&&s[r+1]===10||s[r]===13&&s[r+1]===13)return r+2;if(s[r]===13&&s[r+1]===10&&r+3<s.length&&s[r+2]===13&&s[r+3]===10)return r+4}return-1}var st={off:0,error:200,warn:300,info:400,debug:500},$t=(s,e,t)=>{if(s){if(ur(st,s))return s;S(t).warn(`${e} was set to ${JSON.stringify(s)}, expected one of ${JSON.stringify(Object.keys(st))}`)}};function Ie(){}function rt(s,e,t){return!e||st[s]>st[t]?Ie:e[s].bind(e)}var is={error:Ie,warn:Ie,info:Ie,debug:Ie},Rr=new WeakMap;function S(s){let e=s.logger,t=s.logLevel??"off";if(!e)return is;let r=Rr.get(e);if(r&&r[0]===t)return r[1];let n={error:rt("error",e,t),warn:rt("warn",e,t),info:rt("info",e,t),debug:rt("debug",e,t)};return Rr.set(e,[t,n]),n}var j=s=>(s.options&&(s.options={...s.options},delete s.options.headers),s.headers&&(s.headers=Object.fromEntries((s.headers instanceof Headers?[...s.headers]:Object.entries(s.headers)).map(([e,t])=>[e,e.toLowerCase()==="x-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":t]))),"retryOfRequestLogID"in s&&(s.retryOfRequestLogID&&(s.retryOf=s.retryOfRequestLogID),delete s.retryOfRequestLogID),s);var Oe,F=class s{constructor(e,t,r){this.iterator=e,Oe.set(this,void 0),this.controller=t,l(this,Oe,r,"f")}static fromSSEResponse(e,t,r){let n=!1,o=r?S(r):console;async function*a(){if(n)throw new h("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let c=!1;try{for await(let u of as(e,t)){if(u.event==="completion")try{yield JSON.parse(u.data)}catch(d){throw o.error("Could not parse message into JSON:",u.data),o.error("From chunk:",u.raw),d}if(u.event==="message_start"||u.event==="message_delta"||u.event==="message_stop"||u.event==="content_block_start"||u.event==="content_block_delta"||u.event==="content_block_stop")try{yield JSON.parse(u.data)}catch(d){throw o.error("Could not parse message into JSON:",u.data),o.error("From chunk:",u.raw),d}if(u.event!=="ping"&&u.event==="error")throw new x(void 0,et(u.data)??u.data,void 0,e.headers)}c=!0}catch(u){if($(u))return;throw u}finally{c||t.abort()}}return new s(a,t,r)}static fromReadableStream(e,t,r){let n=!1;async function*o(){let c=new L,u=Ae(e);for await(let d of u)for(let b of c.decode(d))yield b;for(let d of c.flush())yield d}async function*a(){if(n)throw new h("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let c=!1;try{for await(let u of o())c||u&&(yield JSON.parse(u));c=!0}catch(u){if($(u))return;throw u}finally{c||t.abort()}}return new s(a,t,r)}[(Oe=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],t=[],r=this.iterator(),n=o=>({next:()=>{if(o.length===0){let a=r.next();e.push(a),t.push(a)}return o.shift()}});return[new s(()=>n(e),this.controller,i(this,Oe,"f")),new s(()=>n(t),this.controller,i(this,Oe,"f"))]}toReadableStream(){let e=this,t;return Ft({async start(){t=e[Symbol.asyncIterator]()},async pull(r){try{let{value:n,done:o}=await t.next();if(o)return r.close();let a=Te(JSON.stringify(n)+`
|
|
5
|
+
`);r.enqueue(a)}catch(n){r.error(n)}},async cancel(){await t.return?.()}})}};async function*as(s,e){if(!s.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new h("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new h("Attempted to iterate over a response with no body");let t=new Lt,r=new L,n=Ae(s.body);for await(let o of cs(n))for(let a of r.decode(o)){let c=t.decode(a);c&&(yield c)}for(let o of r.flush()){let a=t.decode(o);a&&(yield a)}}async function*cs(s){let e=new Uint8Array;for await(let t of s){if(t==null)continue;let r=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?Te(t):t,n=new Uint8Array(e.length+r.length);n.set(e),n.set(r,e.length),e=n;let o;for(;(o=Mr(e))!==-1;)yield e.slice(0,o),e=e.slice(o)}e.length>0&&(yield e)}var Lt=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(`
|
|
6
|
+
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],o}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,r,n]=ls(e,":");return n.startsWith(" ")&&(n=n.substring(1)),t==="event"?this.event=n:t==="data"&&this.data.push(n),null}};function ls(s,e){let t=s.indexOf(e);return t!==-1?[s.substring(0,t),e,s.substring(t+e.length)]:[s,"",""]}async function nt(s,e){let{response:t,requestLogID:r,retryOfRequestLogID:n,startTime:o}=e,a=await(async()=>{if(e.options.stream)return S(s).debug("response",t.status,t.url,t.headers,t.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(t,e.controller):F.fromSSEResponse(t,e.controller);if(t.status===204)return null;if(e.options.__binaryResponse)return t;let u=t.headers.get("content-type")?.split(";")[0]?.trim();if(u?.includes("application/json")||u?.endsWith("+json")){if(t.headers.get("content-length")==="0")return;let P=await t.json();return jt(P,t)}return await t.text()})();return S(s).debug(`[${r}] response parsed`,j({retryOfRequestLogID:n,url:t.url,status:t.status,body:a,durationMs:Date.now()-o})),a}function jt(s,e){return!s||typeof s!="object"||Array.isArray(s)?s:Object.defineProperty(s,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}var Be,z=class s extends Promise{constructor(e,t,r=nt){super(n=>{n(null)}),this.responsePromise=t,this.parseResponse=r,Be.set(this,void 0),l(this,Be,e,"f")}_thenUnwrap(e){return new s(i(this,Be,"f"),this.responsePromise,async(t,r)=>jt(e(await this.parseResponse(t,r),r),r.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(i(this,Be,"f"),e))),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};Be=new WeakMap;var ot,it=class{constructor(e,t,r,n){ot.set(this,void 0),l(this,ot,e,"f"),this.options=n,this.response=t,this.body=r}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new h("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await i(this,ot,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(ot=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}},Ne=class extends z{constructor(e,t,r){super(e,t,async(n,o)=>new r(n,o.response,await nt(n,o),o.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let t of e)yield t}},A=class extends it{constructor(e,t,r,n){super(e,t,r,n),this.data=r.data||[],this.has_more=r.has_more||!1,this.first_id=r.first_id||null,this.last_id=r.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let t=this.first_id;return t?{...this.options,query:{...Ze(this.options.query),before_id:t}}:null}let e=this.last_id;return e?{...this.options,query:{...Ze(this.options.query),after_id:e}}:null}};var pe=class extends it{constructor(e,t,r,n){super(e,t,r,n),this.data=r.data||[],this.has_more=r.has_more||!1,this.next_page=r.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...Ze(this.options.query),page:e}}:null}};var Ut=()=>{if(typeof File>"u"){let{process:s}=globalThis,e=typeof s?.versions?.node=="string"&&parseInt(s.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function Q(s,e,t){return Ut(),new File(s,e??"unknown_file",t)}function Fe(s,e){let t=typeof s=="object"&&s!==null&&("name"in s&&s.name&&String(s.name)||"url"in s&&s.url&&String(s.url)||"filename"in s&&s.filename&&String(s.filename)||"path"in s&&s.path&&String(s.path))||"";return e?t.split(/[\\/]/).pop()||void 0:t}var Ct=s=>s!=null&&typeof s=="object"&&typeof s[Symbol.asyncIterator]=="function";var me=async(s,e,t=!0)=>({...s,body:await fs(s.body,e,t)}),Er=new WeakMap;function hs(s){let e=typeof s=="function"?s:s.fetch,t=Er.get(e);if(t)return t;let r=(async()=>{try{let n="Response"in e?e.Response:(await e("data:,")).constructor,o=new FormData;return o.toString()!==await new n(o).text()}catch{return!0}})();return Er.set(e,r),r}var fs=async(s,e,t=!0)=>{if(!await hs(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let r=new FormData;return await Promise.all(Object.entries(s||{}).map(([n,o])=>qt(r,n,o,t))),r},ds=s=>s instanceof Blob&&"name"in s;var qt=async(s,e,t,r)=>{if(t!==void 0){if(t==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")s.append(e,String(t));else if(t instanceof Response){let n={},o=t.headers.get("Content-Type");o&&(n={type:o}),s.append(e,Q([await t.blob()],Fe(t,r),n))}else if(Ct(t))s.append(e,Q([await new Response(tt(t)).blob()],Fe(t,r)));else if(ds(t))s.append(e,Q([t],Fe(t,r),{type:t.type}));else if(Array.isArray(t))await Promise.all(t.map(n=>qt(s,e+"[]",n,r)));else if(typeof t=="object")await Promise.all(Object.entries(t).map(([n,o])=>qt(s,`${e}[${n}]`,o,r)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${t} instead`)}};var Ar=s=>s!=null&&typeof s=="object"&&typeof s.size=="number"&&typeof s.type=="string"&&typeof s.text=="function"&&typeof s.slice=="function"&&typeof s.arrayBuffer=="function",ps=s=>s!=null&&typeof s=="object"&&typeof s.name=="string"&&typeof s.lastModified=="number"&&Ar(s),ms=s=>s!=null&&typeof s=="object"&&typeof s.url=="string"&&typeof s.blob=="function";async function at(s,e,t){if(Ut(),s=await s,e||(e=Fe(s,!0)),ps(s))return s instanceof File&&e==null&&t==null?s:Q([await s.arrayBuffer()],e??s.name,{type:s.type,lastModified:s.lastModified,...t});if(ms(s)){let n=await s.blob();return e||(e=new URL(s.url).pathname.split(/[\\/]/).pop()),Q(await Ht(n),e,t)}let r=await Ht(s);if(!t?.type){let n=r.find(o=>typeof o=="object"&&"type"in o&&o.type);typeof n=="string"&&(t={...t,type:n})}return Q(r,e,t)}async function Ht(s){let e=[];if(typeof s=="string"||ArrayBuffer.isView(s)||s instanceof ArrayBuffer)e.push(s);else if(Ar(s))e.push(s instanceof Blob?s:await s.arrayBuffer());else if(Ct(s))for await(let t of s)e.push(...await Ht(t));else{let t=s?.constructor?.name;throw new Error(`Unexpected data type: ${typeof s}${t?`; constructor: ${t}`:""}${gs(s)}`)}return e}function gs(s){return typeof s!="object"||s===null?"":`; props: [${Object.getOwnPropertyNames(s).map(t=>`"${t}"`).join(", ")}]`}var m=class{constructor(e){this._client=e}};var Tr=Symbol.for("brand.privateNullableHeaders");function*ys(s){if(!s)return;if(Tr in s){let{values:r,nulls:n}=s;yield*r.entries();for(let o of n)yield[o,null];return}let e=!1,t;s instanceof Headers?t=s.entries():Bt(s)?t=s:(e=!0,t=Object.entries(s??{}));for(let r of t){let n=r[0];if(typeof n!="string")throw new TypeError("expected header name to be a string");let o=Bt(r[1])?r[1]:[r[1]],a=!1;for(let c of o)c!==void 0&&(e&&!a&&(a=!0,yield[n,null]),yield[n,c])}}var f=s=>{let e=new Headers,t=new Set;for(let r of s){let n=new Set;for(let[o,a]of ys(r)){let c=o.toLowerCase();n.has(c)||(e.delete(o),n.add(c)),a===null?(e.delete(o),t.add(c)):(e.append(o,a),t.delete(c))}}return{[Tr]:!0,values:e,nulls:t}};var ve=Symbol("anthropic.sdk.stainlessHelper");function ct(s){return typeof s=="object"&&s!==null&&ve in s}function Wt(s,e){let t=new Set;if(s)for(let r of s)ct(r)&&t.add(r[ve]);if(e){for(let r of e)if(ct(r)&&t.add(r[ve]),Array.isArray(r.content))for(let n of r.content)ct(n)&&t.add(n[ve])}return Array.from(t)}function lt(s,e){let t=Wt(s,e);return t.length===0?{}:{"x-stainless-helper":t.join(", ")}}function Ir(s){return ct(s)?{"x-stainless-helper":s[ve]}:{}}function Br(s){return s.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var Or=Object.freeze(Object.create(null)),bs=(s=Br)=>function(t,...r){if(t.length===1)return t[0];let n=!1,o=[],a=t.reduce((b,_,P)=>{/[?#]/.test(_)&&(n=!0);let p=r[P],O=(n?encodeURIComponent:s)(""+p);return P!==r.length&&(p==null||typeof p=="object"&&p.toString===Object.getPrototypeOf(Object.getPrototypeOf(p.hasOwnProperty??Or)??Or)?.toString)&&(O=p+"",o.push({start:b.length+_.length,length:O.length,error:`Value of type ${Object.prototype.toString.call(p).slice(8,-1)} is not a valid path parameter`})),b+_+(P===r.length?"":O)},""),c=a.split(/[?#]/,1)[0],u=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,d;for(;(d=u.exec(c))!==null;)o.push({start:d.index,length:d[0].length,error:`Value "${d[0]}" can't be safely passed as a path parameter`});if(o.sort((b,_)=>b.start-_.start),o.length>0){let b=0,_=o.reduce((P,p)=>{let O=" ".repeat(p.start-b),At="^".repeat(p.length);return b=p.start+p.length,P+O+At},"");throw new h(`Path parameters result in path with invalid segments:
|
|
7
|
+
${o.map(P=>P.error).join(`
|
|
8
|
+
`)}
|
|
9
|
+
${a}
|
|
10
|
+
${_}`)}return a},g=bs(Br);var ge=class extends m{list(e={},t){let{betas:r,...n}=e??{};return this._client.getAPIList("/v1/files",A,{query:n,...t,headers:f([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},t?.headers])})}delete(e,t={},r){let{betas:n}=t??{};return this._client.delete(g`/v1/files/${e}`,{...r,headers:f([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}download(e,t={},r){let{betas:n}=t??{};return this._client.get(g`/v1/files/${e}/content`,{...r,headers:f([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},r?.headers]),__binaryResponse:!0})}retrieveMetadata(e,t={},r){let{betas:n}=t??{};return this._client.get(g`/v1/files/${e}`,{...r,headers:f([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}upload(e,t){let{betas:r,...n}=e;return this._client.post("/v1/files",me({body:n,...t,headers:f([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},Ir(n.file),t?.headers])},this._client))}};var _e=class extends m{retrieve(e,t={},r){let{betas:n}=t??{};return this._client.get(g`/v1/models/${e}?beta=true`,{...r,headers:f([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}list(e={},t){let{betas:r,...n}=e??{};return this._client.getAPIList("/v1/models?beta=true",A,{query:n,...t,headers:f([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},t?.headers])})}};var ut={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};function Nr(s){return s?.output_format??s?.output_config?.format}function Dt(s,e,t){let r=Nr(e);return!e||!("parse"in(r??{}))?{...s,content:s.content.map(n=>{if(n.type==="text"){let o=Object.defineProperty({...n},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return t.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return n}),parsed_output:null}:Jt(s,e,t)}function Jt(s,e,t){let r=null,n=s.content.map(o=>{if(o.type==="text"){let a=Ss(e,o.text);r===null&&(r=a);let c=Object.defineProperty({...o},"parsed_output",{value:a,enumerable:!1});return Object.defineProperty(c,"parsed",{get(){return t.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),a},enumerable:!1})}return o});return{...s,content:n,parsed_output:r}}function Ss(s,e){let t=Nr(s);if(t?.type!=="json_schema")return null;try{return"parse"in t?t.parse(e):JSON.parse(e)}catch(r){throw new h(`Failed to parse structured output: ${r}`)}}var ks=s=>{let e=0,t=[];for(;e<s.length;){let r=s[e];if(r==="\\"){e++;continue}if(r==="{"){t.push({type:"brace",value:"{"}),e++;continue}if(r==="}"){t.push({type:"brace",value:"}"}),e++;continue}if(r==="["){t.push({type:"paren",value:"["}),e++;continue}if(r==="]"){t.push({type:"paren",value:"]"}),e++;continue}if(r===":"){t.push({type:"separator",value:":"}),e++;continue}if(r===","){t.push({type:"delimiter",value:","}),e++;continue}if(r==='"'){let c="",u=!1;for(r=s[++e];r!=='"';){if(e===s.length){u=!0;break}if(r==="\\"){if(e++,e===s.length){u=!0;break}c+=r+s[e],r=s[++e]}else c+=r,r=s[++e]}r=s[++e],u||t.push({type:"string",value:c});continue}if(r&&/\s/.test(r)){e++;continue}let o=/[0-9]/;if(r&&o.test(r)||r==="-"||r==="."){let c="";for(r==="-"&&(c+=r,r=s[++e]);r&&o.test(r)||r===".";)c+=r,r=s[++e];t.push({type:"number",value:c});continue}let a=/[a-z]/i;if(r&&a.test(r)){let c="";for(;r&&a.test(r)&&e!==s.length;)c+=r,r=s[++e];if(c=="true"||c=="false"||c==="null")t.push({type:"name",value:c});else{e++;continue}continue}e++}return t},ye=s=>{if(s.length===0)return s;let e=s[s.length-1];switch(e.type){case"separator":return s=s.slice(0,s.length-1),ye(s);break;case"number":let t=e.value[e.value.length-1];if(t==="."||t==="-")return s=s.slice(0,s.length-1),ye(s);case"string":let r=s[s.length-2];if(r?.type==="delimiter")return s=s.slice(0,s.length-1),ye(s);if(r?.type==="brace"&&r.value==="{")return s=s.slice(0,s.length-1),ye(s);break;case"delimiter":return s=s.slice(0,s.length-1),ye(s);break}return s},Ps=s=>{let e=[];return s.map(t=>{t.type==="brace"&&(t.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),t.type==="paren"&&(t.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(t=>{t==="}"?s.push({type:"brace",value:"}"}):t==="]"&&s.push({type:"paren",value:"]"})}),s},Ms=s=>{let e="";return s.map(t=>{switch(t.type){case"string":e+='"'+t.value+'"';break;default:e+=t.value;break}}),e},ht=s=>JSON.parse(Ms(Ps(ye(ks(s)))));var T,J,be,$e,ft,Le,je,dt,qe,q,Ue,pt,mt,Y,gt,_t,Ce,Xt,Fr,yt,Kt,Vt,Gt,vr,$r="__json_buf";function Lr(s){return s.type==="tool_use"||s.type==="server_tool_use"||s.type==="mcp_tool_use"}var bt=class s{constructor(e,t){T.add(this),this.messages=[],this.receivedMessages=[],J.set(this,void 0),be.set(this,null),this.controller=new AbortController,$e.set(this,void 0),ft.set(this,()=>{}),Le.set(this,()=>{}),je.set(this,void 0),dt.set(this,()=>{}),qe.set(this,()=>{}),q.set(this,{}),Ue.set(this,!1),pt.set(this,!1),mt.set(this,!1),Y.set(this,!1),gt.set(this,void 0),_t.set(this,void 0),Ce.set(this,void 0),yt.set(this,r=>{if(l(this,pt,!0,"f"),$(r)&&(r=new k),r instanceof k)return l(this,mt,!0,"f"),this._emit("abort",r);if(r instanceof h)return this._emit("error",r);if(r instanceof Error){let n=new h(r.message);return n.cause=r,this._emit("error",n)}return this._emit("error",new h(String(r)))}),l(this,$e,new Promise((r,n)=>{l(this,ft,r,"f"),l(this,Le,n,"f")}),"f"),l(this,je,new Promise((r,n)=>{l(this,dt,r,"f"),l(this,qe,n,"f")}),"f"),i(this,$e,"f").catch(()=>{}),i(this,je,"f").catch(()=>{}),l(this,be,e,"f"),l(this,Ce,t?.logger??console,"f")}get response(){return i(this,gt,"f")}get request_id(){return i(this,_t,"f")}async withResponse(){l(this,Y,!0,"f");let e=await i(this,$e,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let t=new s(null);return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,r,{logger:n}={}){let o=new s(t,{logger:n});for(let a of t.messages)o._addMessageParam(a);return l(o,be,{...t,stream:!0},"f"),o._run(()=>o._createMessage(e,{...t,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),o}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},i(this,yt,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){this.receivedMessages.push(e),t&&this._emit("message",e)}async _createMessage(e,t,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{i(this,T,"m",Kt).call(this);let{response:a,data:c}=await e.create({...t,stream:!0},{...r,signal:this.controller.signal}).withResponse();this._connected(a);for await(let u of c)i(this,T,"m",Vt).call(this,u);if(c.controller.signal?.aborted)throw new k;i(this,T,"m",Gt).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}_connected(e){this.ended||(l(this,gt,e,"f"),l(this,_t,e?.headers.get("request-id"),"f"),i(this,ft,"f").call(this,e),this._emit("connect"))}get ended(){return i(this,Ue,"f")}get errored(){return i(this,pt,"f")}get aborted(){return i(this,mt,"f")}abort(){this.controller.abort()}on(e,t){return(i(this,q,"f")[e]||(i(this,q,"f")[e]=[])).push({listener:t}),this}off(e,t){let r=i(this,q,"f")[e];if(!r)return this;let n=r.findIndex(o=>o.listener===t);return n>=0&&r.splice(n,1),this}once(e,t){return(i(this,q,"f")[e]||(i(this,q,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,r)=>{l(this,Y,!0,"f"),e!=="error"&&this.once("error",r),this.once(e,t)})}async done(){l(this,Y,!0,"f"),await i(this,je,"f")}get currentMessage(){return i(this,J,"f")}async finalMessage(){return await this.done(),i(this,T,"m",Xt).call(this)}async finalText(){return await this.done(),i(this,T,"m",Fr).call(this)}_emit(e,...t){if(i(this,Ue,"f"))return;e==="end"&&(l(this,Ue,!0,"f"),i(this,dt,"f").call(this));let r=i(this,q,"f")[e];if(r&&(i(this,q,"f")[e]=r.filter(n=>!n.once),r.forEach(({listener:n})=>n(...t))),e==="abort"){let n=t[0];!i(this,Y,"f")&&!r?.length&&Promise.reject(n),i(this,Le,"f").call(this,n),i(this,qe,"f").call(this,n),this._emit("end");return}if(e==="error"){let n=t[0];!i(this,Y,"f")&&!r?.length&&Promise.reject(n),i(this,Le,"f").call(this,n),i(this,qe,"f").call(this,n),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",i(this,T,"m",Xt).call(this))}async _fromReadableStream(e,t){let r=t?.signal,n;r&&(r.aborted&&this.controller.abort(),n=this.controller.abort.bind(this.controller),r.addEventListener("abort",n));try{i(this,T,"m",Kt).call(this),this._connected(null);let o=F.fromReadableStream(e,this.controller);for await(let a of o)i(this,T,"m",Vt).call(this,a);if(o.controller.signal?.aborted)throw new k;i(this,T,"m",Gt).call(this)}finally{r&&n&&r.removeEventListener("abort",n)}}[(J=new WeakMap,be=new WeakMap,$e=new WeakMap,ft=new WeakMap,Le=new WeakMap,je=new WeakMap,dt=new WeakMap,qe=new WeakMap,q=new WeakMap,Ue=new WeakMap,pt=new WeakMap,mt=new WeakMap,Y=new WeakMap,gt=new WeakMap,_t=new WeakMap,Ce=new WeakMap,yt=new WeakMap,T=new WeakSet,Xt=function(){if(this.receivedMessages.length===0)throw new h("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Fr=function(){if(this.receivedMessages.length===0)throw new h("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(t.length===0)throw new h("stream ended without producing a content block with type=text");return t.join(" ")},Kt=function(){this.ended||l(this,J,void 0,"f")},Vt=function(t){if(this.ended)return;let r=i(this,T,"m",vr).call(this,t);switch(this._emit("streamEvent",t,r),t.type){case"content_block_delta":{let n=r.content.at(-1);switch(t.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",t.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",t.delta.citation,n.citations??[]);break}case"input_json_delta":{Lr(n)&&n.input&&this._emit("inputJson",t.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",t.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}case"compaction_delta":{n.type==="compaction"&&n.content&&this._emit("compaction",n.content);break}default:t.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(Dt(r,i(this,be,"f"),{logger:i(this,Ce,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{l(this,J,r,"f");break}case"content_block_start":case"message_delta":break}},Gt=function(){if(this.ended)throw new h("stream has ended, this shouldn't happen");let t=i(this,J,"f");if(!t)throw new h("request ended without sending any chunks");return l(this,J,void 0,"f"),Dt(t,i(this,be,"f"),{logger:i(this,Ce,"f")})},vr=function(t){let r=i(this,J,"f");if(t.type==="message_start"){if(r)throw new h(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!r)throw new h(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return r;case"message_delta":return r.container=t.delta.container,r.stop_reason=t.delta.stop_reason,r.stop_sequence=t.delta.stop_sequence,r.usage.output_tokens=t.usage.output_tokens,r.context_management=t.context_management,t.usage.input_tokens!=null&&(r.usage.input_tokens=t.usage.input_tokens),t.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens),t.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens),t.usage.server_tool_use!=null&&(r.usage.server_tool_use=t.usage.server_tool_use),t.usage.iterations!=null&&(r.usage.iterations=t.usage.iterations),r;case"content_block_start":return r.content.push(t.content_block),r;case"content_block_delta":{let n=r.content.at(t.index);switch(t.delta.type){case"text_delta":{n?.type==="text"&&(r.content[t.index]={...n,text:(n.text||"")+t.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[t.index]={...n,citations:[...n.citations??[],t.delta.citation]});break}case"input_json_delta":{if(n&&Lr(n)){let o=n[$r]||"";o+=t.delta.partial_json;let a={...n};if(Object.defineProperty(a,$r,{value:o,enumerable:!1,writable:!0}),o)try{a.input=ht(o)}catch(c){let u=new h(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${c}. JSON: ${o}`);i(this,yt,"f").call(this,u)}r.content[t.index]=a}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[t.index]={...n,thinking:n.thinking+t.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[t.index]={...n,signature:t.delta.signature});break}case"compaction_delta":{n?.type==="compaction"&&(r.content[t.index]={...n,content:(n.content||"")+t.delta.content});break}default:t.delta}return r}case"content_block_stop":return r}},Symbol.asyncIterator)](){let e=[],t=[],r=!1;return this.on("streamEvent",n=>{let o=t.shift();o?o.resolve(n):e.push(n)}),this.on("end",()=>{r=!0;for(let n of t)n.resolve(void 0);t.length=0}),this.on("abort",n=>{r=!0;for(let o of t)o.reject(n);t.length=0}),this.on("error",n=>{r=!0;for(let o of t)o.reject(n);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((o,a)=>t.push({resolve:o,reject:a})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new F(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}};var Z=class extends Error{constructor(e){let t=typeof e=="string"?e:e.map(r=>r.type==="text"?r.text:`[${r.type}]`).join(" ");super(t),this.name="ToolError",this.content=e}};var jr=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
|
|
11
|
+
1. Task Overview
|
|
12
|
+
The user's core request and success criteria
|
|
13
|
+
Any clarifications or constraints they specified
|
|
14
|
+
2. Current State
|
|
15
|
+
What has been completed so far
|
|
16
|
+
Files created, modified, or analyzed (with paths if relevant)
|
|
17
|
+
Key outputs or artifacts produced
|
|
18
|
+
3. Important Discoveries
|
|
19
|
+
Technical constraints or requirements uncovered
|
|
20
|
+
Decisions made and their rationale
|
|
21
|
+
Errors encountered and how they were resolved
|
|
22
|
+
What approaches were tried that didn't work (and why)
|
|
23
|
+
4. Next Steps
|
|
24
|
+
Specific actions needed to complete the task
|
|
25
|
+
Any blockers or open questions to resolve
|
|
26
|
+
Priority order if multiple steps remain
|
|
27
|
+
5. Context to Preserve
|
|
28
|
+
User preferences or style requirements
|
|
29
|
+
Domain-specific details that aren't obvious
|
|
30
|
+
Any promises made to the user
|
|
31
|
+
Be concise but complete\u2014err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
|
|
32
|
+
Wrap your summary in <summary></summary> tags.`;var He,we,ee,w,We,E,U,X,De,qr,zt;function Ur(){let s,e;return{promise:new Promise((r,n)=>{s=r,e=n}),resolve:s,reject:e}}var xe=class{constructor(e,t,r){He.add(this),this.client=e,we.set(this,!1),ee.set(this,!1),w.set(this,void 0),We.set(this,void 0),E.set(this,void 0),U.set(this,void 0),X.set(this,void 0),De.set(this,0),l(this,w,{params:{...t,messages:structuredClone(t.messages)}},"f");let o=["BetaToolRunner",...Wt(t.tools,t.messages)].join(", ");l(this,We,{...r,headers:f([{"x-stainless-helper":o},r?.headers])},"f"),l(this,X,Ur(),"f")}async*[(we=new WeakMap,ee=new WeakMap,w=new WeakMap,We=new WeakMap,E=new WeakMap,U=new WeakMap,X=new WeakMap,De=new WeakMap,He=new WeakSet,qr=async function(){let t=i(this,w,"f").params.compactionControl;if(!t||!t.enabled)return!1;let r=0;if(i(this,E,"f")!==void 0)try{let d=await i(this,E,"f");r=d.usage.input_tokens+(d.usage.cache_creation_input_tokens??0)+(d.usage.cache_read_input_tokens??0)+d.usage.output_tokens}catch{return!1}let n=t.contextTokenThreshold??1e5;if(r<n)return!1;let o=t.model??i(this,w,"f").params.model,a=t.summaryPrompt??jr,c=i(this,w,"f").params.messages;if(c[c.length-1].role==="assistant"){let d=c[c.length-1];if(Array.isArray(d.content)){let b=d.content.filter(_=>_.type!=="tool_use");b.length===0?c.pop():d.content=b}}let u=await this.client.beta.messages.create({model:o,messages:[...c,{role:"user",content:[{type:"text",text:a}]}],max_tokens:i(this,w,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(u.content[0]?.type!=="text")throw new h("Expected text response for compaction");return i(this,w,"f").params.messages=[{role:"user",content:u.content}],!0},Symbol.asyncIterator)](){var e;if(i(this,we,"f"))throw new h("Cannot iterate over a consumed stream");l(this,we,!0,"f"),l(this,ee,!0,"f"),l(this,U,void 0,"f");try{for(;;){let t;try{if(i(this,w,"f").params.max_iterations&&i(this,De,"f")>=i(this,w,"f").params.max_iterations)break;l(this,ee,!1,"f"),l(this,U,void 0,"f"),l(this,De,(e=i(this,De,"f"),e++,e),"f"),l(this,E,void 0,"f");let{max_iterations:r,compactionControl:n,...o}=i(this,w,"f").params;if(o.stream?(t=this.client.beta.messages.stream({...o},i(this,We,"f")),l(this,E,t.finalMessage(),"f"),i(this,E,"f").catch(()=>{}),yield t):(l(this,E,this.client.beta.messages.create({...o,stream:!1},i(this,We,"f")),"f"),yield i(this,E,"f")),!await i(this,He,"m",qr).call(this)){if(!i(this,ee,"f")){let{role:u,content:d}=await i(this,E,"f");i(this,w,"f").params.messages.push({role:u,content:d})}let c=await i(this,He,"m",zt).call(this,i(this,w,"f").params.messages.at(-1));if(c)i(this,w,"f").params.messages.push(c);else if(!i(this,ee,"f"))break}}finally{t&&t.abort()}}if(!i(this,E,"f"))throw new h("ToolRunner concluded without a message from the server");i(this,X,"f").resolve(await i(this,E,"f"))}catch(t){throw l(this,we,!1,"f"),i(this,X,"f").promise.catch(()=>{}),i(this,X,"f").reject(t),l(this,X,Ur(),"f"),t}}setMessagesParams(e){typeof e=="function"?i(this,w,"f").params=e(i(this,w,"f").params):i(this,w,"f").params=e,l(this,ee,!0,"f"),l(this,U,void 0,"f")}async generateToolResponse(){let e=await i(this,E,"f")??this.params.messages.at(-1);return e?i(this,He,"m",zt).call(this,e):null}done(){return i(this,X,"f").promise}async runUntilDone(){if(!i(this,we,"f"))for await(let e of this);return this.done()}get params(){return i(this,w,"f").params}pushMessages(...e){this.setMessagesParams(t=>({...t,messages:[...t.messages,...e]}))}then(e,t){return this.runUntilDone().then(e,t)}};zt=async function(e){return i(this,U,"f")!==void 0?i(this,U,"f"):(l(this,U,Es(i(this,w,"f").params,e),"f"),i(this,U,"f"))};async function Es(s,e=s.messages.at(-1)){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let t=e.content.filter(n=>n.type==="tool_use");return t.length===0?null:{role:"user",content:await Promise.all(t.map(async n=>{let o=s.tools.find(a=>("name"in a?a.name:a.mcp_server_name)===n.name);if(!o||!("run"in o))return{type:"tool_result",tool_use_id:n.id,content:`Error: Tool '${n.name}' not found`,is_error:!0};try{let a=n.input;"parse"in o&&o.parse&&(a=o.parse(a));let c=await o.run(a);return{type:"tool_result",tool_use_id:n.id,content:c}}catch(a){return{type:"tool_result",tool_use_id:n.id,content:a instanceof Z?a.content:`Error: ${a instanceof Error?a.message:String(a)}`,is_error:!0}}}))}}var Se=class s{constructor(e,t){this.iterator=e,this.controller=t}async*decoder(){let e=new L;for await(let t of this.iterator)for(let r of e.decode(t))yield JSON.parse(r);for(let t of e.flush())yield JSON.parse(t)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,t){if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new h("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new h("Attempted to iterate over a response with no body");return new s(Ae(e.body),t)}};var ke=class extends m{create(e,t){let{betas:r,...n}=e;return this._client.post("/v1/messages/batches?beta=true",{body:n,...t,headers:f([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},t?.headers])})}retrieve(e,t={},r){let{betas:n}=t??{};return this._client.get(g`/v1/messages/batches/${e}?beta=true`,{...r,headers:f([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}list(e={},t){let{betas:r,...n}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",A,{query:n,...t,headers:f([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},t?.headers])})}delete(e,t={},r){let{betas:n}=t??{};return this._client.delete(g`/v1/messages/batches/${e}?beta=true`,{...r,headers:f([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}cancel(e,t={},r){let{betas:n}=t??{};return this._client.post(g`/v1/messages/batches/${e}/cancel?beta=true`,{...r,headers:f([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}async results(e,t={},r){let n=await this.retrieve(e);if(!n.results_url)throw new h(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);let{betas:o}=t??{};return this._client.get(n.results_url,{...r,headers:f([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((a,c)=>Se.fromResponse(c.response,c.controller))}};var Cr={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},Ts=["claude-opus-4-6"],C=class extends m{constructor(){super(...arguments),this.batches=new ke(this._client)}create(e,t){let r=Hr(e),{betas:n,...o}=r;o.model in Cr&&console.warn(`The model '${o.model}' is deprecated and will reach end-of-life on ${Cr[o.model]}
|
|
33
|
+
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),o.model in Ts&&o.thinking&&o.thinking.type==="enabled"&&console.warn(`Using Claude with ${o.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let a=this._client._options.timeout;if(!o.stream&&a==null){let u=ut[o.model]??void 0;a=this._client.calculateNonstreamingTimeout(o.max_tokens,u)}let c=lt(o.tools,o.messages);return this._client.post("/v1/messages?beta=true",{body:o,timeout:a??6e5,...t,headers:f([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},c,t?.headers]),stream:r.stream??!1})}parse(e,t){return t={...t,headers:f([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},t?.headers])},this.create(e,t).then(r=>Jt(r,e,{logger:this._client.logger??console}))}stream(e,t){return bt.createMessage(this,e,t)}countTokens(e,t){let r=Hr(e),{betas:n,...o}=r;return this._client.post("/v1/messages/count_tokens?beta=true",{body:o,...t,headers:f([{"anthropic-beta":[...n??[],"token-counting-2024-11-01"].toString()},t?.headers])})}toolRunner(e,t){return new xe(this._client,e,t)}};function Hr(s){if(!s.output_format)return s;if(s.output_config?.format)throw new h("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...t}=s;return{...t,output_config:{...s.output_config,format:e}}}C.Batches=ke;C.BetaToolRunner=xe;C.ToolError=Z;var Pe=class extends m{create(e,t={},r){let{betas:n,...o}=t??{};return this._client.post(g`/v1/skills/${e}/versions?beta=true`,me({body:o,...r,headers:f([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])},this._client))}retrieve(e,t,r){let{skill_id:n,betas:o}=t;return this._client.get(g`/v1/skills/${n}/versions/${e}?beta=true`,{...r,headers:f([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},r?.headers])})}list(e,t={},r){let{betas:n,...o}=t??{};return this._client.getAPIList(g`/v1/skills/${e}/versions?beta=true`,pe,{query:o,...r,headers:f([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,t,r){let{skill_id:n,betas:o}=t;return this._client.delete(g`/v1/skills/${n}/versions/${e}?beta=true`,{...r,headers:f([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},r?.headers])})}};var te=class extends m{constructor(){super(...arguments),this.versions=new Pe(this._client)}create(e={},t){let{betas:r,...n}=e??{};return this._client.post("/v1/skills?beta=true",me({body:n,...t,headers:f([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},t?.headers])},this._client,!1))}retrieve(e,t={},r){let{betas:n}=t??{};return this._client.get(g`/v1/skills/${e}?beta=true`,{...r,headers:f([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}list(e={},t){let{betas:r,...n}=e??{};return this._client.getAPIList("/v1/skills?beta=true",pe,{query:n,...t,headers:f([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},t?.headers])})}delete(e,t={},r){let{betas:n}=t??{};return this._client.delete(g`/v1/skills/${e}?beta=true`,{...r,headers:f([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}};te.Versions=Pe;var B=class extends m{constructor(){super(...arguments),this.models=new _e(this._client),this.messages=new C(this._client),this.files=new ge(this._client),this.skills=new te(this._client)}};B.Models=_e;B.Messages=C;B.Files=ge;B.Skills=te;var re=class extends m{create(e,t){let{betas:r,...n}=e;return this._client.post("/v1/complete",{body:n,timeout:this._client._options.timeout??6e5,...t,headers:f([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}};function Wr(s){return s?.output_config?.format}function Qt(s,e,t){let r=Wr(e);return!e||!("parse"in(r??{}))?{...s,content:s.content.map(n=>n.type==="text"?Object.defineProperty({...n},"parsed_output",{value:null,enumerable:!1}):n),parsed_output:null}:Yt(s,e,t)}function Yt(s,e,t){let r=null,n=s.content.map(o=>{if(o.type==="text"){let a=Ns(e,o.text);return r===null&&(r=a),Object.defineProperty({...o},"parsed_output",{value:a,enumerable:!1})}return o});return{...s,content:n,parsed_output:r}}function Ns(s,e){let t=Wr(s);if(t?.type!=="json_schema")return null;try{return"parse"in t?t.parse(e):JSON.parse(e)}catch(r){throw new h(`Failed to parse structured output: ${r}`)}}var I,K,Me,Je,wt,Xe,Ke,xt,Ve,H,Ge,St,kt,se,Pt,Mt,ze,Zt,Dr,er,tr,rr,sr,Jr,Xr="__json_buf";function Kr(s){return s.type==="tool_use"||s.type==="server_tool_use"}var Rt=class s{constructor(e,t){I.add(this),this.messages=[],this.receivedMessages=[],K.set(this,void 0),Me.set(this,null),this.controller=new AbortController,Je.set(this,void 0),wt.set(this,()=>{}),Xe.set(this,()=>{}),Ke.set(this,void 0),xt.set(this,()=>{}),Ve.set(this,()=>{}),H.set(this,{}),Ge.set(this,!1),St.set(this,!1),kt.set(this,!1),se.set(this,!1),Pt.set(this,void 0),Mt.set(this,void 0),ze.set(this,void 0),er.set(this,r=>{if(l(this,St,!0,"f"),$(r)&&(r=new k),r instanceof k)return l(this,kt,!0,"f"),this._emit("abort",r);if(r instanceof h)return this._emit("error",r);if(r instanceof Error){let n=new h(r.message);return n.cause=r,this._emit("error",n)}return this._emit("error",new h(String(r)))}),l(this,Je,new Promise((r,n)=>{l(this,wt,r,"f"),l(this,Xe,n,"f")}),"f"),l(this,Ke,new Promise((r,n)=>{l(this,xt,r,"f"),l(this,Ve,n,"f")}),"f"),i(this,Je,"f").catch(()=>{}),i(this,Ke,"f").catch(()=>{}),l(this,Me,e,"f"),l(this,ze,t?.logger??console,"f")}get response(){return i(this,Pt,"f")}get request_id(){return i(this,Mt,"f")}async withResponse(){l(this,se,!0,"f");let e=await i(this,Je,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let t=new s(null);return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,r,{logger:n}={}){let o=new s(t,{logger:n});for(let a of t.messages)o._addMessageParam(a);return l(o,Me,{...t,stream:!0},"f"),o._run(()=>o._createMessage(e,{...t,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),o}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},i(this,er,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){this.receivedMessages.push(e),t&&this._emit("message",e)}async _createMessage(e,t,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{i(this,I,"m",tr).call(this);let{response:a,data:c}=await e.create({...t,stream:!0},{...r,signal:this.controller.signal}).withResponse();this._connected(a);for await(let u of c)i(this,I,"m",rr).call(this,u);if(c.controller.signal?.aborted)throw new k;i(this,I,"m",sr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}_connected(e){this.ended||(l(this,Pt,e,"f"),l(this,Mt,e?.headers.get("request-id"),"f"),i(this,wt,"f").call(this,e),this._emit("connect"))}get ended(){return i(this,Ge,"f")}get errored(){return i(this,St,"f")}get aborted(){return i(this,kt,"f")}abort(){this.controller.abort()}on(e,t){return(i(this,H,"f")[e]||(i(this,H,"f")[e]=[])).push({listener:t}),this}off(e,t){let r=i(this,H,"f")[e];if(!r)return this;let n=r.findIndex(o=>o.listener===t);return n>=0&&r.splice(n,1),this}once(e,t){return(i(this,H,"f")[e]||(i(this,H,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,r)=>{l(this,se,!0,"f"),e!=="error"&&this.once("error",r),this.once(e,t)})}async done(){l(this,se,!0,"f"),await i(this,Ke,"f")}get currentMessage(){return i(this,K,"f")}async finalMessage(){return await this.done(),i(this,I,"m",Zt).call(this)}async finalText(){return await this.done(),i(this,I,"m",Dr).call(this)}_emit(e,...t){if(i(this,Ge,"f"))return;e==="end"&&(l(this,Ge,!0,"f"),i(this,xt,"f").call(this));let r=i(this,H,"f")[e];if(r&&(i(this,H,"f")[e]=r.filter(n=>!n.once),r.forEach(({listener:n})=>n(...t))),e==="abort"){let n=t[0];!i(this,se,"f")&&!r?.length&&Promise.reject(n),i(this,Xe,"f").call(this,n),i(this,Ve,"f").call(this,n),this._emit("end");return}if(e==="error"){let n=t[0];!i(this,se,"f")&&!r?.length&&Promise.reject(n),i(this,Xe,"f").call(this,n),i(this,Ve,"f").call(this,n),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",i(this,I,"m",Zt).call(this))}async _fromReadableStream(e,t){let r=t?.signal,n;r&&(r.aborted&&this.controller.abort(),n=this.controller.abort.bind(this.controller),r.addEventListener("abort",n));try{i(this,I,"m",tr).call(this),this._connected(null);let o=F.fromReadableStream(e,this.controller);for await(let a of o)i(this,I,"m",rr).call(this,a);if(o.controller.signal?.aborted)throw new k;i(this,I,"m",sr).call(this)}finally{r&&n&&r.removeEventListener("abort",n)}}[(K=new WeakMap,Me=new WeakMap,Je=new WeakMap,wt=new WeakMap,Xe=new WeakMap,Ke=new WeakMap,xt=new WeakMap,Ve=new WeakMap,H=new WeakMap,Ge=new WeakMap,St=new WeakMap,kt=new WeakMap,se=new WeakMap,Pt=new WeakMap,Mt=new WeakMap,ze=new WeakMap,er=new WeakMap,I=new WeakSet,Zt=function(){if(this.receivedMessages.length===0)throw new h("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Dr=function(){if(this.receivedMessages.length===0)throw new h("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(t.length===0)throw new h("stream ended without producing a content block with type=text");return t.join(" ")},tr=function(){this.ended||l(this,K,void 0,"f")},rr=function(t){if(this.ended)return;let r=i(this,I,"m",Jr).call(this,t);switch(this._emit("streamEvent",t,r),t.type){case"content_block_delta":{let n=r.content.at(-1);switch(t.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",t.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",t.delta.citation,n.citations??[]);break}case"input_json_delta":{Kr(n)&&n.input&&this._emit("inputJson",t.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",t.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}default:t.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(Qt(r,i(this,Me,"f"),{logger:i(this,ze,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{l(this,K,r,"f");break}case"content_block_start":case"message_delta":break}},sr=function(){if(this.ended)throw new h("stream has ended, this shouldn't happen");let t=i(this,K,"f");if(!t)throw new h("request ended without sending any chunks");return l(this,K,void 0,"f"),Qt(t,i(this,Me,"f"),{logger:i(this,ze,"f")})},Jr=function(t){let r=i(this,K,"f");if(t.type==="message_start"){if(r)throw new h(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!r)throw new h(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return r;case"message_delta":return r.stop_reason=t.delta.stop_reason,r.stop_sequence=t.delta.stop_sequence,r.usage.output_tokens=t.usage.output_tokens,t.usage.input_tokens!=null&&(r.usage.input_tokens=t.usage.input_tokens),t.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens),t.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens),t.usage.server_tool_use!=null&&(r.usage.server_tool_use=t.usage.server_tool_use),r;case"content_block_start":return r.content.push({...t.content_block}),r;case"content_block_delta":{let n=r.content.at(t.index);switch(t.delta.type){case"text_delta":{n?.type==="text"&&(r.content[t.index]={...n,text:(n.text||"")+t.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[t.index]={...n,citations:[...n.citations??[],t.delta.citation]});break}case"input_json_delta":{if(n&&Kr(n)){let o=n[Xr]||"";o+=t.delta.partial_json;let a={...n};Object.defineProperty(a,Xr,{value:o,enumerable:!1,writable:!0}),o&&(a.input=ht(o)),r.content[t.index]=a}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[t.index]={...n,thinking:n.thinking+t.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[t.index]={...n,signature:t.delta.signature});break}default:t.delta}return r}case"content_block_stop":return r}},Symbol.asyncIterator)](){let e=[],t=[],r=!1;return this.on("streamEvent",n=>{let o=t.shift();o?o.resolve(n):e.push(n)}),this.on("end",()=>{r=!0;for(let n of t)n.resolve(void 0);t.length=0}),this.on("abort",n=>{r=!0;for(let o of t)o.reject(n);t.length=0}),this.on("error",n=>{r=!0;for(let o of t)o.reject(n);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((o,a)=>t.push({resolve:o,reject:a})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new F(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}};var Re=class extends m{create(e,t){return this._client.post("/v1/messages/batches",{body:e,...t})}retrieve(e,t){return this._client.get(g`/v1/messages/batches/${e}`,t)}list(e={},t){return this._client.getAPIList("/v1/messages/batches",A,{query:e,...t})}delete(e,t){return this._client.delete(g`/v1/messages/batches/${e}`,t)}cancel(e,t){return this._client.post(g`/v1/messages/batches/${e}/cancel`,t)}async results(e,t){let r=await this.retrieve(e);if(!r.results_url)throw new h(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);return this._client.get(r.results_url,{...t,headers:f([{Accept:"application/binary"},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((n,o)=>Se.fromResponse(o.response,o.controller))}};var V=class extends m{constructor(){super(...arguments),this.batches=new Re(this._client)}create(e,t){e.model in Vr&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${Vr[e.model]}
|
|
34
|
+
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),e.model in vs&&e.thinking&&e.thinking.type==="enabled"&&console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let r=this._client._options.timeout;if(!e.stream&&r==null){let o=ut[e.model]??void 0;r=this._client.calculateNonstreamingTimeout(e.max_tokens,o)}let n=lt(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:r??6e5,...t,headers:f([n,t?.headers]),stream:e.stream??!1})}parse(e,t){return this.create(e,t).then(r=>Yt(r,e,{logger:this._client.logger??console}))}stream(e,t){return Rt.createMessage(this,e,t,{logger:this._client.logger??console})}countTokens(e,t){return this._client.post("/v1/messages/count_tokens",{body:e,...t})}},Vr={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026"},vs=["claude-opus-4-6"];V.Batches=Re;var ne=class extends m{retrieve(e,t={},r){let{betas:n}=t??{};return this._client.get(g`/v1/models/${e}`,{...r,headers:f([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}list(e={},t){let{betas:r,...n}=e??{};return this._client.getAPIList("/v1/models",A,{query:n,...t,headers:f([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},t?.headers])})}};var Qe=s=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[s]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(s)?.trim()};var nr,or,Et,Gr,zr="\\n\\nHuman:",Qr="\\n\\nAssistant:",y=class{constructor({baseURL:e=Qe("ANTHROPIC_BASE_URL"),apiKey:t=Qe("ANTHROPIC_API_KEY")??null,authToken:r=Qe("ANTHROPIC_AUTH_TOKEN")??null,...n}={}){nr.add(this),Et.set(this,void 0);let o={apiKey:t,authToken:r,...n,baseURL:e||"https://api.anthropic.com"};if(!o.dangerouslyAllowBrowser&&gr())throw new h(`It looks like you're running in a browser-like environment.
|
|
35
|
+
|
|
36
|
+
This is disabled by default, as it risks exposing your secret API credentials to attackers.
|
|
37
|
+
If you understand the risks and have appropriate mitigations in place,
|
|
38
|
+
you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
|
|
39
|
+
|
|
40
|
+
new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
|
|
41
|
+
`);this.baseURL=o.baseURL,this.timeout=o.timeout??or.DEFAULT_TIMEOUT,this.logger=o.logger??console;let a="warn";this.logLevel=a,this.logLevel=$t(o.logLevel,"ClientOptions.logLevel",this)??$t(Qe("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??a,this.fetchOptions=o.fetchOptions,this.maxRetries=o.maxRetries??2,this.fetch=o.fetch??yr(),l(this,Et,wr,"f"),this._options=o,this.apiKey=typeof t=="string"?t:null,this.authToken=r}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){if(!(e.get("x-api-key")||e.get("authorization"))&&!(this.apiKey&&e.get("x-api-key"))&&!t.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!t.has("authorization"))throw new Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(e){return f([await this.apiKeyAuth(e),await this.bearerAuth(e)])}async apiKeyAuth(e){if(this.apiKey!=null)return f([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return f([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return xr(e)}getUserAgent(){return`${this.constructor.name}/JS ${D}`}defaultIdempotencyKey(){return`stainless-node-retry-${It()}`}makeStatusError(e,t,r,n){return x.generate(e,t,r,n)}buildURL(e,t,r){let n=!i(this,nr,"m",Gr).call(this)&&r||this.baseURL,o=lr(e)?new URL(e):new URL(n+(n.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),a=this.defaultQuery(),c=Object.fromEntries(o.searchParams);return(!Nt(a)||!Nt(c))&&(t={...c,...a,...t}),typeof t=="object"&&t&&!Array.isArray(t)&&(o.search=this.stringifyQuery(t)),o.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new h("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(e){}async prepareRequest(e,{url:t,options:r}){}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,r){return this.request(Promise.resolve(r).then(n=>({method:e,path:t,...n})))}request(e,t=null){return new z(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,r){let n=await e,o=n.maxRetries??this.maxRetries;t==null&&(t=o),await this.prepareOptions(n);let{req:a,url:c,timeout:u}=await this.buildRequest(n,{retryCount:o-t});await this.prepareRequest(a,{url:c,options:n});let d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),b=r===void 0?"":`, retryOf: ${r}`,_=Date.now();if(S(this).debug(`[${d}] sending request`,j({retryOfRequestLogID:r,method:n.method,url:c,options:n,headers:a.headers})),n.signal?.aborted)throw new k;let P=new AbortController,p=await this.fetchWithTimeout(c,a,u,P).catch(Ee),O=Date.now();if(p instanceof globalThis.Error){let v=`retrying, ${t} attempts remaining`;if(n.signal?.aborted)throw new k;let N=$(p)||/timed? ?out/i.test(String(p)+("cause"in p?String(p.cause):""));if(t)return S(this).info(`[${d}] connection ${N?"timed out":"failed"} - ${v}`),S(this).debug(`[${d}] connection ${N?"timed out":"failed"} (${v})`,j({retryOfRequestLogID:r,url:c,durationMs:O-_,message:p.message})),this.retryRequest(n,t,r??d);throw S(this).info(`[${d}] connection ${N?"timed out":"failed"} - error; no more retries left`),S(this).debug(`[${d}] connection ${N?"timed out":"failed"} (error; no more retries left)`,j({retryOfRequestLogID:r,url:c,durationMs:O-_,message:p.message})),N?new oe:new W({cause:p})}let At=[...p.headers.entries()].filter(([v])=>v==="request-id").map(([v,N])=>", "+v+": "+JSON.stringify(N)).join(""),Tt=`[${d}${b}${At}] ${a.method} ${c} ${p.ok?"succeeded":"failed"} with status ${p.status} in ${O-_}ms`;if(!p.ok){let v=await this.shouldRetry(p);if(t&&v){let Ye=`retrying, ${t} attempts remaining`;return await br(p.body),S(this).info(`${Tt} - ${Ye}`),S(this).debug(`[${d}] response error (${Ye})`,j({retryOfRequestLogID:r,url:p.url,status:p.status,headers:p.headers,durationMs:O-_})),this.retryRequest(n,t,r??d,p.headers)}let N=v?"error; no more retries left":"error; not retryable";S(this).info(`${Tt} - ${N}`);let ir=await p.text().catch(Ye=>Ee(Ye).message),ar=et(ir),cr=ar?void 0:ir;throw S(this).debug(`[${d}] response error (${N})`,j({retryOfRequestLogID:r,url:p.url,status:p.status,headers:p.headers,message:cr,durationMs:Date.now()-_})),this.makeStatusError(p.status,ar,cr,p.headers)}return S(this).info(Tt),S(this).debug(`[${d}] response start`,j({retryOfRequestLogID:r,url:p.url,status:p.status,headers:p.headers,durationMs:O-_})),{response:p,options:n,controller:P,requestLogID:d,retryOfRequestLogID:r,startTime:_}}getAPIList(e,t,r){return this.requestAPIList(t,r&&"then"in r?r.then(n=>({method:"get",path:e,...n})):{method:"get",path:e,...r})}requestAPIList(e,t){let r=this.makeRequest(t,null,void 0);return new Ne(this,r,e)}async fetchWithTimeout(e,t,r,n){let{signal:o,method:a,...c}=t||{},u=this._makeAbort(n);o&&o.addEventListener("abort",u,{once:!0});let d=setTimeout(u,r),b=globalThis.ReadableStream&&c.body instanceof globalThis.ReadableStream||typeof c.body=="object"&&c.body!==null&&Symbol.asyncIterator in c.body,_={signal:n.signal,...b?{duplex:"half"}:{},method:"GET",...c};a&&(_.method=a.toUpperCase());try{return await this.fetch.call(void 0,e,_)}finally{clearTimeout(d)}}async shouldRetry(e){let t=e.headers.get("x-should-retry");return t==="true"?!0:t==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,t,r,n){let o,a=n?.get("retry-after-ms");if(a){let u=parseFloat(a);Number.isNaN(u)||(o=u)}let c=n?.get("retry-after");if(c&&!o){let u=parseFloat(c);Number.isNaN(u)?o=Date.parse(c)-Date.now():o=u*1e3}if(o===void 0){let u=e.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(t,u)}return await fr(o),this.makeRequest(e,t-1,r)}calculateDefaultRetryTimeoutMillis(e,t){let o=t-e,a=Math.min(.5*Math.pow(2,o),8),c=1-Math.random()*.25;return a*c*1e3}calculateNonstreamingTimeout(e,t){if(36e5*e/128e3>6e5||t!=null&&e>t)throw new h("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:t=0}={}){let r={...e},{method:n,path:o,query:a,defaultBaseURL:c}=r,u=this.buildURL(o,a,c);"timeout"in r&&hr("timeout",r.timeout),r.timeout=r.timeout??this.timeout;let{bodyHeaders:d,body:b}=this.buildBody({options:r}),_=await this.buildHeaders({options:e,method:n,bodyHeaders:d,retryCount:t});return{req:{method:n,headers:_,...r.signal&&{signal:r.signal},...globalThis.ReadableStream&&b instanceof globalThis.ReadableStream&&{duplex:"half"},...b&&{body:b},...this.fetchOptions??{},...r.fetchOptions??{}},url:u,timeout:r.timeout}}async buildHeaders({options:e,method:t,bodyHeaders:r,retryCount:n}){let o={};this.idempotencyHeader&&t!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),o[this.idempotencyHeader]=e.idempotencyKey);let a=f([o,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(n),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},..._r(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,r,e.headers]);return this.validateHeaders(a),a.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let r=f([t]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&r.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:tt(e)}:typeof e=="object"&&r.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:i(this,Et,"f").call(this,{body:e,headers:r})}};or=y,Et=new WeakMap,nr=new WeakSet,Gr=function(){return this.baseURL!=="https://api.anthropic.com"};y.Anthropic=or;y.HUMAN_PROMPT=zr;y.AI_PROMPT=Qr;y.DEFAULT_TIMEOUT=6e5;y.AnthropicError=h;y.APIError=x;y.APIConnectionError=W;y.APIConnectionTimeoutError=oe;y.APIUserAbortError=k;y.NotFoundError=le;y.ConflictError=ue;y.RateLimitError=fe;y.BadRequestError=ie;y.AuthenticationError=ae;y.InternalServerError=de;y.PermissionDeniedError=ce;y.UnprocessableEntityError=he;y.toFile=at;var G=class extends y{constructor(){super(...arguments),this.completions=new re(this),this.messages=new V(this),this.models=new ne(this),this.beta=new B(this)}};G.Completions=re;G.Messages=V;G.Models=ne;G.Beta=B;export{Qr as AI_PROMPT,W as APIConnectionError,oe as APIConnectionTimeoutError,x as APIError,z as APIPromise,k as APIUserAbortError,G as Anthropic,h as AnthropicError,ae as AuthenticationError,ie as BadRequestError,y as BaseAnthropic,ue as ConflictError,zr as HUMAN_PROMPT,de as InternalServerError,le as NotFoundError,Ne as PagePromise,ce as PermissionDeniedError,fe as RateLimitError,he as UnprocessableEntityError,G as default,at as toFile};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{f as l,h as a,k as i}from"./chunk-ZC4F4MYU.js";import{k as n}from"./chunk-YVN2NZL4.js";import"./chunk-PWLF3WXM.js";import{a as o}from"./chunk-QXATB6Z5.js";import"./chunk-MG65QJY6.js";import{a as t}from"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var v=["trace","debug","info","warn","error","fatal"],P=async m=>{let{flags:e}=o(m??[],[{name:"port",short:"p",type:"number",default:8e3,description:"Server port"},{name:"log-level",type:"string",default:"info",description:"Log level"}]),r=l({renderer:i.ansi(),sink:a.stdout()});r.writeln(n(`
|
|
3
|
+
\u{1F680} Serving production build...
|
|
4
|
+
`));let p=e.port,s=e["log-level"]??"info",u=v.includes(s.toLowerCase())?s.toLowerCase():"info",[{startServer:g},{reactRenderer:c,reactHtmlShellBuilder:d},{reactPlugin:L},{createTailwindPlugin:f}]=await Promise.all([import("./main-236QYA7G.js"),import("./mod-QWYXFGRG.js"),import("./mod-SXL6PDQM.js"),import("./mod-EWLBSEHA.js")]);return await r.close(),await g({mode:"serve",port:p,logLevel:u,hmr:!1,renderer:c,htmlShell:d,frameworkPlugin:L,cssPlugin:f({globalCssPath:"src/app/styles/global.css"})}),t(void 0)};export{P as main};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as L,b as Y,h as G,i as O,m as K,o as A,p as D}from"./chunk-
|
|
2
|
+
import{a as L,b as Y,h as G,i as O,m as K,o as A,p as D}from"./chunk-HVTJ5LVU.js";import{e as F}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{i as f}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import{b as I}from"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";function q(e,s){let a={...e,...s},i=[];a.description&&i.push(`<meta name="description" content="${j(a.description)}">`),a.keywords&&a.keywords.length>0&&i.push(`<meta name="keywords" content="${j(a.keywords.join(", "))}">`),a.author&&i.push(`<meta name="author" content="${j(a.author)}">`),a.themeColor&&i.push(`<meta name="theme-color" content="${a.themeColor}">`);let n=[];return a.noIndex&&n.push("noindex"),a.noFollow&&n.push("nofollow"),n.length>0&&i.push(`<meta name="robots" content="${n.join(", ")}">`),a.canonicalUrl&&i.push(`<link rel="canonical" href="${j(a.canonicalUrl)}">`),i.push(`<meta property="og:type" content="${a.ogType||"website"}">`),i.push(`<meta property="og:title" content="${j(a.title)}">`),a.description&&i.push(`<meta property="og:description" content="${j(a.description)}">`),a.siteUrl&&i.push(`<meta property="og:url" content="${j(a.siteUrl)}">`),a.siteName&&i.push(`<meta property="og:site_name" content="${j(a.siteName)}">`),a.locale&&i.push(`<meta property="og:locale" content="${a.locale}">`),a.ogImage&&(i.push(`<meta property="og:image" content="${j(a.ogImage)}">`),i.push(`<meta property="og:image:alt" content="${j(a.title)}">`)),i.push('<meta name="twitter:card" content="summary_large_image">'),i.push(`<meta name="twitter:title" content="${j(a.title)}">`),a.description&&i.push(`<meta name="twitter:description" content="${j(a.description)}">`),a.twitterHandle&&(i.push(`<meta name="twitter:site" content="${j(a.twitterHandle)}">`),i.push(`<meta name="twitter:creator" content="${j(a.twitterHandle)}">`)),a.ogImage&&i.push(`<meta name="twitter:image" content="${j(a.ogImage)}">`),a.favicon&&i.push(`<link rel="icon" href="${j(a.favicon)}">`),i.join(`
|
|
3
3
|
`)}function M(e,s){let a={...e,...s},i={"@context":"https://schema.org","@type":"WebSite",name:a.siteName,url:a.siteUrl,description:a.description},n={"@context":"https://schema.org","@type":"Organization",name:a.siteName,url:a.siteUrl,logo:a.ogImage},t=[i,n];return a.jsonLd&&t.push({"@context":"https://schema.org",...a.jsonLd}),t.map(p=>`<script type="application/ld+json">${JSON.stringify(p)}</script>`).join(`
|
|
4
4
|
`)}function j(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var V={title:"laroux.js 3.0",description:"Zero-configuration React Server Components on Deno 2.x. Modern, simple, and built with cutting-edge technology.",siteName:"laroux.js",siteUrl:"https://laroux.now",locale:"en_US",themeColor:"#7c3aed",favicon:"/favicon.svg",twitterHandle:"@eser",ogImage:"https://laroux.now/og-image.png",ogType:"website",keywords:["laroux","open source","community","development","react","server components","server actions","island architecture"],author:"Eser Ozvataf"};function Q(e){let s=e.entrypoint??"/client.js",a=e.chunkManifest?.buildId?`?v=${e.chunkManifest.buildId}`:`?v=${Date.now()}`,i=e.chunkManifest?.hmrEnabled?"":a,n=e.fontPreloads?.join(`
|
|
5
5
|
`)??"",t=e.fontCSS?`<style>${e.fontCSS}</style>`:"",p=e.criticalChunks?.map(v=>`<link rel="modulepreload" href="${v}${a}">`).join(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as O,d as z}from"./chunk-3AA3RXKD.js";import{b as T,k as U}from"./chunk-JI536JLJ.js";import{c as g,d as E,g as N,h as P,i as A,j as I,k as R,s as L}from"./chunk-NEHZOG23.js";import{b,c as k}from"./chunk-OAT2D23A.js";import"./chunk-2XNFZXHY.js";import{f as $,h as y,k as D}from"./chunk-ZC4F4MYU.js";import{c as l,d as c,f as m,g as S,h as x,k as C}from"./chunk-YVN2NZL4.js";import{a as f,b as h}from"./chunk-FFWPJP7A.js";import{i as u}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var _=async n=>{let e=n?.[0];if(e==="new")return await G(n?.slice(1));if(e==="list")return await B(n?.slice(1));if(e==="switch")return await q(n?.slice(1));let t=b(),r=$({renderer:D.ansi(),sink:y.stdout()});return r.writeln(`Usage: ${t} spec <new "description" | list | switch <name>>`),await r.close(),f(void 0)},G=async n=>{let e=$({renderer:D.ansi(),sink:y.stdout()}),t=u.process.cwd();if(!await L(t))return e.writeln(m("noskills is not initialized.")," Run: ",l(k("init"))),await e.close(),h({exitCode:1});let r=null,i=[];if(n!==void 0)for(let w of n)w.startsWith("--name=")?r=w.slice(7):w.startsWith("-")||i.push(w);let p=i.join(" ");if(p.length===0)return e.writeln(m("Please provide a description: "),l(`${b()} spec new "photo auto-listing"`)),await e.close(),h({exitCode:1});let o=r??W(p),a=await X(t,o),d=`spec/${a}`,s=await E(t);if(s.phase!=="IDLE"&&s.phase!=="DONE")return e.writeln(m(`Cannot start new spec in phase: ${s.phase}`),c(" \u2014 finish or reset the current spec first.")),await e.close(),h({exitCode:1});let v=T(s.phase==="DONE"?U(s):s,a,d);return await u.fs.mkdir(`${t}/${g.specDir(a)}`,{recursive:!0}),await N(t,v),await I(t,a,v),e.writeln(S("\u2714")," Spec started: ",l(a)),e.writeln(" Directory: ",c(g.specDir(a))),e.writeln(" Branch: ",c(d)),e.writeln(" Phase: ",x("DISCOVERY")),e.writeln(""),e.writeln("Run ",l(k("next"))," to begin discovery questions."),await e.close(),f(void 0)},W=n=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50).replace(/-$/,""),X=async(n,e)=>{let t=`${n}/${g.specsDir}`,r=async i=>{try{return await u.fs.stat(`${t}/${i}`),!0}catch{return!1}};if(!await r(e))return e;for(let i=2;i<=99;i++){let p=`${e}-${i}`;if(!await r(p))return p}return`${e}-${Date.now()}`},B=async n=>{let e=u.process.cwd(),t=O(n),r=await P(e),i=await R(e),p=`${e}/${g.specsDir}`,o=new Set(i.map(s=>s.name)),a=[];for(let s of i)a.push({name:s.name,phase:s.state.phase,iteration:s.state.execution.iteration,active:s.name===r});try{for await(let s of u.fs.readDir(p))s.isDirectory&&!o.has(s.name)&&a.push({name:s.name,phase:"IDLE",iteration:0,active:s.name===r})}catch{}if(t==="json")return await z(a,"json"),f(void 0);let d=$({renderer:D.ansi(),sink:y.stdout()});if(d.writeln(l("Specs")),d.writeln(""),a.length===0)d.writeln(c(" No specs yet."));else for(let s of a){let v=s.active?S("\u25CF"):c("\u25CB"),w=s.active?l(s.name):c(s.name),j=s.phase==="DONE"?S(s.phase):s.phase==="EXECUTING"?C(s.phase):s.phase==="BLOCKED"?m(s.phase):x(s.phase),F=s.phase==="EXECUTING"?c(` iteration ${s.iteration}`):"";d.writeln(" ",v," ",w," ",j,F)}return await d.close(),f(void 0)},q=async n=>{let e=$({renderer:D.ansi(),sink:y.stdout()}),t=u.process.cwd(),r=n?.[0];if(r===void 0||r.length===0)return e.writeln(m("Please provide a spec name: "),l(`${b()} spec switch my-feature`)),await e.close(),h({exitCode:1});let i=await P(t),p=await E(t);i!==null&&p.spec!==null&&await I(t,i,p);let o=await A(t,r),a=await u.fs.stat(`${t}/${g.specDir(r)}`).then(()=>!0).catch(()=>!1);return o.phase==="IDLE"&&!a?(e.writeln(m(`Spec "${r}" not found.`)),e.writeln(c(`Run \`${k("spec list")}\` to see available specs.`)),await e.close(),h({exitCode:1})):(await N(t,o),e.writeln(S("\u2714")," Switched to: ",l(r)," (",C(o.phase),")"),o.phase==="EXECUTING"&&(e.writeln(c(` Iteration: ${o.execution.iteration}`)),o.execution.lastProgress!==null&&e.writeln(c(` Progress: ${o.execution.lastProgress}`))),await e.close(),f(void 0))};export{_ as main};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as j,b as Ie,c as ze,d as I,e as ae,f as fe,g as Ne,h as De,i as Me,j as We,k as Ve}from"./chunk-A3MZV73T.js";import{b as y}from"./chunk-5WJ6AUNY.js";function Ge(r){if(!/^data:/i.test(r))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');r=r.replace(/\r?\n/g,"");let e=r.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let t=r.substring(5,e).split(";"),n="",o=!1,s=t[0]||"text/plain",i=s;for(let R=1;R<t.length;R++)t[R]==="base64"?o=!0:t[R]&&(i+=`;${t[R]}`,t[R].indexOf("charset=")===0&&(n=t[R].substring(8)));!t[0]&&!n.length&&(i+=";charset=US-ASCII",n="US-ASCII");let c=o?"base64":"ascii",l=unescape(r.substring(e+1)),a=Buffer.from(l,c);return a.type=s,a.typeFull=i,a.charset=n,a}var ce,le=y(()=>{ce=Ge});var U,M=y(()=>{U=class extends Error{constructor(e,t){super(e),Error.captureStackTrace(this,this.constructor),this.type=t}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}});var p,q=y(()=>{M();p=class extends U{constructor(e,t,n){super(e,t),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var W,ee,z,ue,he,de,V=y(()=>{W=Symbol.toStringTag,ee=r=>typeof r=="object"&&typeof r.append=="function"&&typeof r.delete=="function"&&typeof r.get=="function"&&typeof r.getAll=="function"&&typeof r.has=="function"&&typeof r.set=="function"&&typeof r.sort=="function"&&r[W]==="URLSearchParams",z=r=>r&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&typeof r.constructor=="function"&&/^(Blob|File)$/.test(r[W]),ue=r=>typeof r=="object"&&(r[W]==="AbortSignal"||r[W]==="EventTarget"),he=(r,e)=>{let t=new URL(e).hostname,n=new URL(r).hostname;return t===n||t.endsWith(`.${n}`)},de=(r,e)=>{let t=new URL(e).protocol,n=new URL(r).protocol;return t===n}});import v,{PassThrough as pe}from"node:stream";import{types as me,deprecate as te,promisify as Ke}from"node:util";import{Buffer as b}from"node:buffer";async function re(r){if(r[m].disturbed)throw new TypeError(`body used already for: ${r.url}`);if(r[m].disturbed=!0,r[m].error)throw r[m].error;let{body:e}=r;if(e===null)return b.alloc(0);if(!(e instanceof v))return b.alloc(0);let t=[],n=0;try{for await(let o of e){if(r.size>0&&n+o.length>r.size){let s=new p(`content size at ${r.url} over limit: ${r.size}`,"max-size");throw e.destroy(s),s}n+=o.length,t.push(o)}}catch(o){throw o instanceof U?o:new p(`Invalid response body while trying to fetch ${r.url}: ${o.message}`,"system",o)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return t.every(o=>typeof o=="string")?b.from(t.join("")):b.concat(t,n)}catch(o){throw new p(`Could not create Buffer from response body for ${r.url}: ${o.message}`,"system",o)}else throw new p(`Premature close of server response while trying to fetch ${r.url}`)}var Ye,m,E,F,Je,G,ye,ge,K=y(()=>{Ie();fe();q();M();V();Ye=Ke(v.pipeline),m=Symbol("Body internals"),E=class{constructor(e,{size:t=0}={}){let n=null;e===null?e=null:ee(e)?e=b.from(e.toString()):z(e)||b.isBuffer(e)||(me.isAnyArrayBuffer(e)?e=b.from(e):ArrayBuffer.isView(e)?e=b.from(e.buffer,e.byteOffset,e.byteLength):e instanceof v||(e instanceof I?(e=ae(e),n=e.type.split("=")[1]):e=b.from(String(e))));let o=e;b.isBuffer(e)?o=v.Readable.from(e):z(e)&&(o=v.Readable.from(e.stream())),this[m]={body:e,stream:o,boundary:n,disturbed:!1,error:null},this.size=t,e instanceof v&&e.on("error",s=>{let i=s instanceof U?s:new p(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[m].error=i})}get body(){return this[m].stream}get bodyUsed(){return this[m].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:t,byteLength:n}=await re(this);return e.slice(t,t+n)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let n=new I,o=new URLSearchParams(await this.text());for(let[s,i]of o)n.append(s,i);return n}let{toFormData:t}=await import("./multipart-parser-SSRHOBFH.js");return t(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[m].body&&this[m].body.type||"",t=await this.arrayBuffer();return new j([t],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await re(this);return new TextDecoder().decode(e)}buffer(){return re(this)}};E.prototype.buffer=te(E.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(E.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:te(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});F=(r,e)=>{let t,n,{body:o}=r[m];if(r.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof v&&typeof o.getBoundary!="function"&&(t=new pe({highWaterMark:e}),n=new pe({highWaterMark:e}),o.pipe(t),o.pipe(n),r[m].stream=t,o=n),o},Je=te(r=>r.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),G=(r,e)=>r===null?null:typeof r=="string"?"text/plain;charset=UTF-8":ee(r)?"application/x-www-form-urlencoded;charset=UTF-8":z(r)?r.type||null:b.isBuffer(r)||me.isAnyArrayBuffer(r)||ArrayBuffer.isView(r)?null:r instanceof I?`multipart/form-data; boundary=${e[m].boundary}`:r&&typeof r.getBoundary=="function"?`multipart/form-data;boundary=${Je(r)}`:r instanceof v?null:"text/plain;charset=UTF-8",ye=r=>{let{body:e}=r[m];return e===null?0:z(e)?e.size:b.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},ge=async(r,{body:e})=>{e===null?r.end():await Ye(e,r)}});import{types as we}from"node:util";import J from"node:http";function be(r=[]){return new g(r.reduce((e,t,n,o)=>(n%2===0&&e.push(o.slice(n,n+2)),e),[]).filter(([e,t])=>{try{return Y(e),oe(e,String(t)),!0}catch{return!1}}))}var Y,oe,g,_=y(()=>{Y=typeof J.validateHeaderName=="function"?J.validateHeaderName:r=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(r)){let e=new TypeError(`Header name must be a valid HTTP token [${r}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},oe=typeof J.validateHeaderValue=="function"?J.validateHeaderValue:(r,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let t=new TypeError(`Invalid character in header content ["${r}"]`);throw Object.defineProperty(t,"code",{value:"ERR_INVALID_CHAR"}),t}},g=class r extends URLSearchParams{constructor(e){let t=[];if(e instanceof r){let n=e.raw();for(let[o,s]of Object.entries(n))t.push(...s.map(i=>[o,i]))}else if(e!=null)if(typeof e=="object"&&!we.isBoxedPrimitive(e)){let n=e[Symbol.iterator];if(n==null)t.push(...Object.entries(e));else{if(typeof n!="function")throw new TypeError("Header pairs must be iterable");t=[...e].map(o=>{if(typeof o!="object"||we.isBoxedPrimitive(o))throw new TypeError("Each header pair must be an iterable object");return[...o]}).map(o=>{if(o.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...o]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return t=t.length>0?t.map(([n,o])=>(Y(n),oe(n,String(o)),[String(n).toLowerCase(),String(o)])):void 0,super(t),new Proxy(this,{get(n,o,s){switch(o){case"append":case"set":return(i,c)=>(Y(i),oe(i,String(c)),URLSearchParams.prototype[o].call(n,String(i).toLowerCase(),String(c)));case"delete":case"has":case"getAll":return i=>(Y(i),URLSearchParams.prototype[o].call(n,String(i).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,o,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let t=this.getAll(e);if(t.length===0)return null;let n=t.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,t=void 0){for(let n of this.keys())Reflect.apply(e,t,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,t)=>(e[t]=this.getAll(t),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,t)=>{let n=this.getAll(t);return t==="host"?e[t]=n[0]:e[t]=n.length>1?n:n[0],e},{})}};Object.defineProperties(g.prototype,["get","entries","forEach","values"].reduce((r,e)=>(r[e]={enumerable:!0},r),{}))});var _e,Z,ne=y(()=>{_e=new Set([301,302,303,307,308]),Z=r=>_e.has(r)});var T,S,Se=y(()=>{_();K();ne();T=Symbol("Response internals"),S=class r extends E{constructor(e=null,t={}){super(e,t);let n=t.status!=null?t.status:200,o=new g(t.headers);if(e!==null&&!o.has("Content-Type")){let s=G(e,this);s&&o.append("Content-Type",s)}this[T]={type:"default",url:t.url,status:n,statusText:t.statusText||"",headers:o,counter:t.counter,highWaterMark:t.highWaterMark}}get type(){return this[T].type}get url(){return this[T].url||""}get status(){return this[T].status}get ok(){return this[T].status>=200&&this[T].status<300}get redirected(){return this[T].counter>0}get statusText(){return this[T].statusText}get headers(){return this[T].headers}get highWaterMark(){return this[T].highWaterMark}clone(){return new r(F(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,t=302){if(!Z(t))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new r(null,{headers:{location:new URL(e).toString()},status:t})}static error(){let e=new r(null,{status:0,statusText:""});return e[T].type="error",e}static json(e=void 0,t={}){let n=JSON.stringify(e);if(n===void 0)throw new TypeError("data is not JSON serializable");let o=new g(t&&t.headers);return o.has("content-type")||o.set("content-type","application/json"),new r(n,{...t,headers:o})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(S.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var Te,Re=y(()=>{Te=r=>{if(r.search)return r.search;let e=r.href.length-1,t=r.hash||(r.href[e]==="#"?"#":"");return r.href[e-t.length]==="?"?"?":""}});import{isIP as Ze}from"node:net";function xe(r,e=!1){return r==null||(r=new URL(r),/^(about|blob|data):$/.test(r.protocol))?"no-referrer":(r.username="",r.password="",r.hash="",e&&(r.pathname="",r.search=""),r)}function Le(r){if(!Ee.has(r))throw new TypeError(`Invalid referrerPolicy: ${r}`);return r}function Qe(r){if(/^(http|ws)s:$/.test(r.protocol))return!0;let e=r.host.replace(/(^\[)|(]$)/g,""),t=Ze(e);return t===4&&/^127\./.test(e)||t===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:r.host==="localhost"||r.host.endsWith(".localhost")?!1:r.protocol==="file:"}function k(r){return/^about:(blank|srcdoc)$/.test(r)||r.protocol==="data:"||/^(blob|filesystem):$/.test(r.protocol)?!0:Qe(r)}function Ue(r,{referrerURLCallback:e,referrerOriginCallback:t}={}){if(r.referrer==="no-referrer"||r.referrerPolicy==="")return null;let n=r.referrerPolicy;if(r.referrer==="about:client")return"no-referrer";let o=r.referrer,s=xe(o),i=xe(o,!0);s.toString().length>4096&&(s=i),e&&(s=e(s)),t&&(i=t(i));let c=new URL(r.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return i;case"unsafe-url":return s;case"strict-origin":return k(s)&&!k(c)?"no-referrer":i.toString();case"strict-origin-when-cross-origin":return s.origin===c.origin?s:k(s)&&!k(c)?"no-referrer":i;case"same-origin":return s.origin===c.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===c.origin?s:i;case"no-referrer-when-downgrade":return k(s)&&!k(c)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function ve(r){let e=(r.get("referrer-policy")||"").split(/[,\s]+/),t="";for(let n of e)n&&Ee.has(n)&&(t=n);return t}var Ee,Pe,se=y(()=>{Ee=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),Pe="strict-origin-when-cross-origin"});import{format as Xe}from"node:url";import{deprecate as je}from"node:util";var u,N,qe,C,Be,Ae=y(()=>{_();K();V();Re();se();u=Symbol("Request internals"),N=r=>typeof r=="object"&&typeof r[u]=="object",qe=je(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),C=class r extends E{constructor(e,t={}){let n;if(N(e)?n=new URL(e.url):(n=new URL(e),e={}),n.username!==""||n.password!=="")throw new TypeError(`${n} is an url with embedded credentials.`);let o=t.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(o)&&(o=o.toUpperCase()),!N(t)&&"data"in t&&qe(),(t.body!=null||N(e)&&e.body!==null)&&(o==="GET"||o==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=t.body?t.body:N(e)&&e.body!==null?F(e):null;super(s,{size:t.size||e.size||0});let i=new g(t.headers||e.headers||{});if(s!==null&&!i.has("Content-Type")){let a=G(s,this);a&&i.set("Content-Type",a)}let c=N(e)?e.signal:null;if("signal"in t&&(c=t.signal),c!=null&&!ue(c))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let l=t.referrer==null?e.referrer:t.referrer;if(l==="")l="no-referrer";else if(l){let a=new URL(l);l=/^about:(\/\/)?client$/.test(a)?"client":a}else l=void 0;this[u]={method:o,redirect:t.redirect||e.redirect||"follow",headers:i,parsedURL:n,signal:c,referrer:l},this.follow=t.follow===void 0?e.follow===void 0?20:e.follow:t.follow,this.compress=t.compress===void 0?e.compress===void 0?!0:e.compress:t.compress,this.counter=t.counter||e.counter||0,this.agent=t.agent||e.agent,this.highWaterMark=t.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=t.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=t.referrerPolicy||e.referrerPolicy||""}get method(){return this[u].method}get url(){return Xe(this[u].parsedURL)}get headers(){return this[u].headers}get redirect(){return this[u].redirect}get signal(){return this[u].signal}get referrer(){if(this[u].referrer==="no-referrer")return"";if(this[u].referrer==="client")return"about:client";if(this[u].referrer)return this[u].referrer.toString()}get referrerPolicy(){return this[u].referrerPolicy}set referrerPolicy(e){this[u].referrerPolicy=Le(e)}clone(){return new r(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(C.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});Be=r=>{let{parsedURL:e}=r[u],t=new g(r[u].headers);t.has("Accept")||t.set("Accept","*/*");let n=null;if(r.body===null&&/^(post|put)$/i.test(r.method)&&(n="0"),r.body!==null){let c=ye(r);typeof c=="number"&&!Number.isNaN(c)&&(n=String(c))}n&&t.set("Content-Length",n),r.referrerPolicy===""&&(r.referrerPolicy=Pe),r.referrer&&r.referrer!=="no-referrer"?r[u].referrer=Ue(r):r[u].referrer="no-referrer",r[u].referrer instanceof URL&&t.set("Referer",r.referrer),t.has("User-Agent")||t.set("User-Agent","node-fetch"),r.compress&&!t.has("Accept-Encoding")&&t.set("Accept-Encoding","gzip, deflate, br");let{agent:o}=r;typeof o=="function"&&(o=o(e));let s=Te(e),i={path:e.pathname+s,method:r.method,headers:t[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:r.insecureHTTPParser,agent:o};return{parsedURL:e,options:i}}});var Q,Ce=y(()=>{M();Q=class extends U{constructor(e,t="aborted"){super(e,t)}}});import er from"node:http";import rr from"node:https";import O from"node:zlib";import $e,{PassThrough as Fe,pipeline as H}from"node:stream";import{Buffer as X}from"node:buffer";async function ke(r,e){return new Promise((t,n)=>{let o=new C(r,e),{parsedURL:s,options:i}=Be(o);if(!tr.has(s.protocol))throw new TypeError(`node-fetch cannot load ${r}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let f=ce(o.url),P=new S(f,{headers:{"Content-Type":f.typeFull}});t(P);return}let c=(s.protocol==="https:"?rr:er).request,{signal:l}=o,a=null,R=()=>{let f=new Q("The operation was aborted.");n(f),o.body&&o.body instanceof $e.Readable&&o.body.destroy(f),!(!a||!a.body)&&a.body.emit("error",f)};if(l&&l.aborted){R();return}let D=()=>{R(),A()},B=c(s.toString(),i);l&&l.addEventListener("abort",D);let A=()=>{B.abort(),l&&l.removeEventListener("abort",D)};B.on("error",f=>{n(new p(`request to ${o.url} failed, reason: ${f.message}`,"system",f)),A()}),or(B,f=>{a&&a.body&&a.body.destroy(f)}),process.version<"v14"&&B.on("socket",f=>{let P;f.prependListener("end",()=>{P=f._eventsCount}),f.prependListener("close",h=>{if(a&&P<f._eventsCount&&!h){let L=new Error("Premature close");L.code="ERR_STREAM_PREMATURE_CLOSE",a.body.emit("error",L)}})}),B.on("response",f=>{B.setTimeout(0);let P=be(f.rawHeaders);if(Z(f.statusCode)){let d=P.get("Location"),x=null;try{x=d===null?null:new URL(d,o.url)}catch{if(o.redirect!=="manual"){n(new p(`uri requested responds with an invalid redirect URL: ${d}`,"invalid-redirect")),A();return}}switch(o.redirect){case"error":n(new p(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),A();return;case"manual":break;case"follow":{if(x===null)break;if(o.counter>=o.follow){n(new p(`maximum redirect reached at: ${o.url}`,"max-redirect")),A();return}let w={headers:new g(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:F(o),signal:o.signal,size:o.size,referrer:o.referrer,referrerPolicy:o.referrerPolicy};if(!he(o.url,x)||!de(o.url,x))for(let He of["authorization","www-authenticate","cookie","cookie2"])w.headers.delete(He);if(f.statusCode!==303&&o.body&&e.body instanceof $e.Readable){n(new p("Cannot follow redirect with body being a readable stream","unsupported-redirect")),A();return}(f.statusCode===303||(f.statusCode===301||f.statusCode===302)&&o.method==="POST")&&(w.method="GET",w.body=void 0,w.headers.delete("content-length"));let ie=ve(P);ie&&(w.referrerPolicy=ie),t(ke(new C(x,w))),A();return}default:return n(new TypeError(`Redirect option '${o.redirect}' is not a valid value of RequestRedirect`))}}l&&f.once("end",()=>{l.removeEventListener("abort",D)});let h=H(f,new Fe,d=>{d&&n(d)});process.version<"v12.10"&&f.on("aborted",D);let L={url:o.url,status:f.statusCode,statusText:f.statusMessage,headers:P,size:o.size,counter:o.counter,highWaterMark:o.highWaterMark},$=P.get("Content-Encoding");if(!o.compress||o.method==="HEAD"||$===null||f.statusCode===204||f.statusCode===304){a=new S(h,L),t(a);return}let Oe={flush:O.Z_SYNC_FLUSH,finishFlush:O.Z_SYNC_FLUSH};if($==="gzip"||$==="x-gzip"){h=H(h,O.createGunzip(Oe),d=>{d&&n(d)}),a=new S(h,L),t(a);return}if($==="deflate"||$==="x-deflate"){let d=H(f,new Fe,x=>{x&&n(x)});d.once("data",x=>{(x[0]&15)===8?h=H(h,O.createInflate(),w=>{w&&n(w)}):h=H(h,O.createInflateRaw(),w=>{w&&n(w)}),a=new S(h,L),t(a)}),d.once("end",()=>{a||(a=new S(h,L),t(a))});return}if($==="br"){h=H(h,O.createBrotliDecompress(),d=>{d&&n(d)}),a=new S(h,L),t(a);return}a=new S(h,L),t(a)}),ge(B,o).catch(n)})}function or(r,e){let t=X.from(`0\r
|
|
3
|
+
\r
|
|
4
|
+
`),n=!1,o=!1,s;r.on("response",i=>{let{headers:c}=i;n=c["transfer-encoding"]==="chunked"&&!c["content-length"]}),r.on("socket",i=>{let c=()=>{if(n&&!o){let a=new Error("Premature close");a.code="ERR_STREAM_PREMATURE_CLOSE",e(a)}},l=a=>{o=X.compare(a.slice(-5),t)===0,!o&&s&&(o=X.compare(s.slice(-3),t.slice(0,3))===0&&X.compare(a.slice(-2),t.slice(3))===0),s=a};i.prependListener("close",c),i.on("data",l),r.on("close",()=>{i.removeListener("close",c),i.removeListener("data",l)})})}var tr,nr=y(()=>{le();K();Se();_();Ae();q();Ce();ne();fe();V();se();Ve();tr=new Set(["data:","http:","https:"])});nr();export{Q as AbortError,j as Blob,p as FetchError,ze as File,I as FormData,g as Headers,C as Request,S as Response,De as blobFrom,Ne as blobFromSync,ke as default,Me as fileFrom,We as fileFromSync,Z as isRedirect};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as f,d as S}from"./chunk-7UASU4NU.js";import"./chunk-OCPEFZBJ.js";import{a as k}from"./chunk-RGUPFAEE.js";import{a as v,d as w}from"./chunk-3AA3RXKD.js";import{e as y,f as I,l as D,p as O,s as R}from"./chunk-NEHZOG23.js";import{c as h}from"./chunk-OAT2D23A.js";import"./chunk-2XNFZXHY.js";import{f as d,h as m,k as u}from"./chunk-ZC4F4MYU.js";import{c as i,d as r,f as c,g as b,h as p,k as x}from"./chunk-YVN2NZL4.js";import{a as l,b as E}from"./chunk-FFWPJP7A.js";import{i as C}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var L=async g=>{let n=C.process.cwd(),o=v(g);if(!await R(n)){if(o==="json")await w({error:"noskills is not initialized"},o);else{let s=d({renderer:u.ansi(),sink:m.stdout()});s.writeln(c("noskills is not initialized.")," Run: ",i(h("init"))),await s.close()}return E({exitCode:1})}let P=I(g),e=await y(n,P),t=await D(n),V={phase:e.phase,spec:e.spec,branch:e.branch,discovery:e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REVIEW"?{answered:e.discovery.answers.length,total:f.length}:void 0,execution:e.phase==="EXECUTING"||e.phase==="BLOCKED"?{iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,debt:e.execution.debt?.items.length??0,verificationPassed:e.execution.lastVerification?.passed??null}:void 0,concerns:t?.concerns??[],tools:t?.tools??[],decisions:e.decisions.length};if(o==="json"){let a=(await O(n)).filter(F=>t!==null&&t.concerns.includes(F.id)),$=await k(n),j=S(e,a,$,t);return await w({...V,...j},"json"),l(void 0)}{let s=d({renderer:u.ansi(),sink:m.stdout()});s.writeln(i(`${h("status")}`)),s.writeln("");let a=e.phase==="DONE"?b(e.phase):e.phase==="BLOCKED"?c(e.phase):e.phase==="EXECUTING"?x(e.phase):p(e.phase);s.writeln(" Phase: ",a),e.spec!==null&&s.writeln(" Spec: ",i(e.spec)),e.branch!==null&&s.writeln(" Branch: ",e.branch),(e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REVIEW")&&s.writeln(` Discovery: ${e.discovery.answers.length}/${f.length} questions answered`),e.phase==="EXECUTING"&&(s.writeln(` Iteration: ${e.execution.iteration}`),e.execution.lastProgress!==null&&s.writeln(" Progress: ",r(e.execution.lastProgress)),e.execution.debt!==null&&s.writeln(p(` Debt: ${e.execution.debt.items.length} items`))),t!==null&&(s.writeln(""),t.concerns.length>0&&s.writeln(" Concerns: ",r(t.concerns.join(", "))),t.tools.length>0&&s.writeln(" Tools: ",r(t.tools.join(", ")))),e.decisions.length>0&&(s.writeln(""),s.writeln(` Decisions: ${e.decisions.length}`)),await s.close()}return l(void 0)};export{L as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as w}from"./chunk-RGUPFAEE.js";import{l as u}from"./chunk-NEHZOG23.js";import{c as g}from"./chunk-OAT2D23A.js";import"./chunk-2XNFZXHY.js";import{f as p,h as d,k as f}from"./chunk-ZC4F4MYU.js";import{c as m,d as r,f as c,g as n}from"./chunk-YVN2NZL4.js";import{a as o,b as a}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var v=async h=>{let s=p({renderer:f.ansi(),sink:d.stdout()}),t=l.process.cwd(),e=await u(t);if(e===null)return s.writeln(c("noskills is not initialized.")," Run: ",m(g("init"))),await s.close(),a({exitCode:1});s.writeln(r("Syncing tool files..."));let i=await w(t,e.tools,e);for(let y of i)s.writeln(" ",n("\u2714"),` ${y}`);return i.length===0&&s.writeln(r(" No tools configured.")),s.writeln(""),s.writeln(n("Done.")),await s.close(),o(void 0)};export{v as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{c as a,d as b,e as c,f as d}from"./chunk-MOY4CXAZ.js";import"./chunk-3QF3I2RD.js";import"./chunk-K2MKYDPY.js";import"./chunk-3IZX4OZ7.js";import"./chunk-A6K5L4SG.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import"./chunk-NBA6EFWU.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{b as build,a as createBuildContext,c as ensureBuildIsReady,d as watch};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as e,b as s,c as o,d as l,e as r,f as a,g as t}from"./chunk-AMMTAUXC.js";import"./chunk-MBCPGD5L.js";import"./chunk-J2Z7NG2X.js";import"./chunk-ZC4F4MYU.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-5RX5V5BA.js";import"./chunk-PWLF3WXM.js";import{b as n}from"./chunk-QXATB6Z5.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var d=new n("system").description("Commands related with this CLI").command(new n("install").description("Install eser CLI globally").run(e)).command(new n("uninstall").description("Uninstall eser CLI globally").run(s)).command(new n("update").description("Update eser CLI to the latest version").run(o)).command(new n("completions").description("Generate shell completion scripts").flag({name:"shell",type:"string",description:"Shell type: bash, zsh, or fish"}).run(l)).command(new n("version").description("Show version and check for updates").flag({name:"bare",type:"boolean",description:"Print version number only"}).run(r)).command(new n("doctor").description("Run diagnostic checks").run(a)).command(new n("info").description("Show runtime and execution context diagnostics").run(t));export{d as systemCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-5WJ6AUNY.js";var r=globalThis.navigator?.userAgent?.includes("Deno");function s(){return globalThis.process.getBuiltinModule("node:fs")}var c=r?Deno.errors.AlreadyExists:class extends Error{},d=r?Deno.errors.BadResource:class extends Error{},E=r?Deno.errors.BrokenPipe:class extends Error{},y=r?Deno.errors.Busy:class extends Error{},B=r?Deno.errors.Interrupted:class extends Error{},T=r?Deno.errors.InvalidData:class extends Error{},a=r?Deno.errors.NotFound:class extends Error{},P=r?Deno.errors.PermissionDenied:class extends Error{},F=r?Deno.errors.TimedOut:class extends Error{},S=r?Deno.errors.UnexpectedEof:class extends Error{},O=r?Deno.errors.WriteZero:class extends Error{};function n(e){return o=>Object.assign(new e(o.message),{stack:o.stack})}var l={EEXIST:n(c),ENOENT:n(a),EBADF:n(d)};function p(e){return e instanceof Error&&"code"in e}function i(e){return p(e)&&l[e.code]?.(e)||e}async function W(e,o){if(r)await Deno.chmod(e,o);else try{await s().promises.chmod(e,o)}catch(t){throw i(t)}}function Z(e,o){if(r)Deno.chmodSync(e,o);else try{s().chmodSync(e,o)}catch(t){throw i(t)}}export{W as chmod,Z as chmodSync};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{e as U}from"./chunk-F35K7YVH.js";import{a as R,d as w}from"./chunk-P2MUEKFT.js";import{k}from"./chunk-TEOMM3RD.js";import{f as y,h as g,k as f}from"./chunk-ZC4F4MYU.js";import{g as m,k as l}from"./chunk-YVN2NZL4.js";import{a as u}from"./chunk-MG65QJY6.js";import{a as o,b as n,c}from"./chunk-FFWPJP7A.js";import{i as d}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var b=r=>R(async s=>{try{let t=await k(r.registrySource,{verbose:r.verbose,local:r.local}),e=t.recipes.find(p=>p.name===r.recipeName);if(e===void 0)return n({_tag:"RecipeNotFound",message:`Recipe '${r.recipeName}' not found. Run \`eser kit list\` to see available recipes.`});let a=await U(e,{cwd:r.cwd,registryUrl:t.registryUrl,force:!0,dryRun:r.dryRun,verbose:r.verbose}),i=r.dryRun?"Would update":"Updated";s.out.writeln(m(`\u2713 ${i} ${a.written.length} file(s) from ${e.name}`));for(let p of a.written)s.out.writeln(` \u2192 ${p}`);return o({recipe:e,result:a})}catch(t){let e=t instanceof Error?t.message:String(t);return n({_tag:"ApplyError",message:e})}});var S=async r=>{let s=u(r??[],{string:["registry"],boolean:["dry-run","verbose","local"]}),t=s._[0],e=y({renderer:f.ansi(),sink:g.stdout()});if(t===void 0)return e.writeln("Usage: eser kit update <recipe> [--registry <url>] [--dry-run]"),e.writeln(),e.writeln("Re-fetches and re-applies a recipe, overwriting existing files."),await e.close(),o(void 0);let a=s["dry-run"]===!0;a?e.writeln(l(`
|
|
3
|
+
Dry run: updating ${t}
|
|
4
|
+
`)):e.writeln(l(`
|
|
5
|
+
Updating ${t}...
|
|
6
|
+
`));let i=await w(b({recipeName:t,cwd:d.process.cwd(),registrySource:s.registry,local:s.local===!0,dryRun:a,verbose:s.verbose===!0}),{out:e});return await e.close(),c(i)?o(void 0):n({exitCode:1})};export{S as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-WILZ4OR2.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-TLVGNOK3.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-F5HQDZLN.js";import"./chunk-ZWMJQZQF.js";import"./chunk-A6K5L4SG.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import"./chunk-LFNUSULJ.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-P2MUEKFT.js";import"./chunk-ZC4F4MYU.js";import"./chunk-YVN2NZL4.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as checkCircularDeps,b as checkCircularDepsHandler,c as handleCli,d as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b}from"./chunk-BWDCKK63.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{b as main,a as validateCommitMsg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-NJUIBCQR.js";import"./chunk-ZWMJQZQF.js";import"./chunk-A6K5L4SG.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import"./chunk-LFNUSULJ.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-P2MUEKFT.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as checkDocs,b as checkDocsHandler,c as handleCli,d as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-BBOEAL63.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-EGMYM4TM.js";import"./chunk-ZWMJQZQF.js";import"./chunk-A6K5L4SG.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import"./chunk-LFNUSULJ.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-P2MUEKFT.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as checkExportNames,b as checkExportNamesHandler,c as handleCli,d as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-OPPOHKNZ.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-VIQLCQOI.js";import"./chunk-3XJLLDR5.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-NZRU3N6C.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-DKFL6XPX.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-WAEXOK7L.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-CMSPX2RN.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-KEOTIPA6.js";import"./chunk-ZWMJQZQF.js";import"./chunk-A6K5L4SG.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import"./chunk-LFNUSULJ.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-P2MUEKFT.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as checkModExports,b as checkModExportsHandler,c as handleCli,d as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-2KKLYXSA.js";import"./chunk-A6K5L4SG.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import"./chunk-LFNUSULJ.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-S7S2I2K5.js";import"./chunk-P2MUEKFT.js";import"./chunk-ZC4F4MYU.js";import"./chunk-YVN2NZL4.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as checkPackageConfigs,b as checkPackageConfigsHandler,c as handleCli,d as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-T4WKRBQZ.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-OAFB4A6D.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-MEZCXQAX.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-O2TA7OHJ.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-U5Q5MC74.js";import"./chunk-P7WCO724.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-ILROPD5P.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-4EHAL3NK.js";import"./chunk-ULNEO3RY.js";import"./chunk-DWLFTRZS.js";import"./chunk-2XNFZXHY.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-L7UCWRDZ.js";import"./chunk-A6K5L4SG.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import"./chunk-LFNUSULJ.js";import"./chunk-4FGLERUG.js";import"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-P2MUEKFT.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{e as handleCli,f as main,a as readVersionFile,b as showVersions,c as versions,d as versionsHandler};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-UQ2BC7UA.js";import"./chunk-TDQRRGDJ.js";import"./chunk-BNQAZLIQ.js";import"./chunk-J7YTWK67.js";import"./chunk-5WJ6AUNY.js";export{a as VertexAIModel,b as vertexaiFactory};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as C,c as E}from"./chunk-3AA3RXKD.js";import{a as M,c as S}from"./chunk-4QDEJUAF.js";import{d as T,l as y,s as b}from"./chunk-NEHZOG23.js";import"./chunk-2XNFZXHY.js";import{a as x,b as k}from"./chunk-FFWPJP7A.js";import{i as m}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var D=async e=>{let s=await T(e),l=await y(e),d=await I(e),o=null,h=null,a=0,c=0;if(s.spec!==null){let i=await M(e,s.spec);if(i!==null){a=i.tasks.length,c=s.execution.completedTasks.length;let n=S(i.tasks,s.execution.completedTasks);n!==null&&(o=n.id,h=n.title)}}let $=null;return s.lastCalledAt!==null&&($=Math.floor((Date.now()-new Date(s.lastCalledAt).getTime())/1e3)),{spec:s.spec,phase:s.phase,iteration:s.execution.iteration,activeTaskId:o,activeTaskTitle:h,totalTasks:a,completedTaskCount:c,lastProgress:s.execution.lastProgress,lastCalledAt:s.lastCalledAt,modifiedFiles:s.execution.modifiedFiles,debt:s.execution.debt,concerns:l?.concerns??[],maxIterations:l?.maxIterationsBeforeRestart??15,awaitingStatusReport:s.execution.awaitingStatusReport,verificationPassed:s.execution.lastVerification?.passed??null,decisionsCount:s.decisions.length,discoveryAnswered:s.discovery.answers.length,discoveryTotal:6,trackedFiles:d,timeSinceUpdate:$}},I=async e=>{let s=`${e}/.eser/.state/files-changed.jsonl`;try{let d=(await m.fs.readTextFile(s)).trim().split(`
|
|
3
|
+
`).filter(Boolean),o=[];for(let h of d)try{let a=JSON.parse(h);o.includes(a.file)||o.push(a.file)}catch{}return o}catch{return[]}},L="\x1B[2J\x1B[H",F="\x1B[1m",r="\x1B[2m",t="\x1B[0m",p="\x1B[32m",f="\x1B[33m",w="\x1B[31m",P="\x1B[36m",O=e=>{switch(e){case"DONE":return p;case"BLOCKED":return w;case"EXECUTING":return P;default:return f}},R=(e,s,l)=>{if(s===0)return"\u2591".repeat(l);let d=Math.min(e/s,1),o=Math.round(d*l);return"\u2588".repeat(o)+"\u2591".repeat(l-o)},v=e=>e===null?"never":e<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:`${Math.floor(e/3600)}h ago`,A=e=>{let s=[],d="\u2500".repeat(52);s.push(`${r}\u256D${d}\u256E${t}`),s.push(`${r}\u2502${t} ${F}noskills watch${t} \u2014 ${e.spec??"no active spec"}${r}${" ".repeat(Math.max(0,34-(e.spec?.length??15)))}\u2502${t}`);let o=O(e.phase);if(s.push(`${r}\u2502${t} Phase: ${o}${e.phase}${t}${" ".repeat(Math.max(0,42-e.phase.length))}${r}\u2502${t}`),e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REVIEW")s.push(`${r}\u2502${t} Discovery: ${e.discoveryAnswered}/${e.discoveryTotal} questions answered${" ".repeat(Math.max(0,14))}${r}\u2502${t}`);else if(e.phase==="SPEC_DRAFT")s.push(`${r}\u2502${t} ${f}Awaiting approval${t}${" ".repeat(Math.max(0,33))}${r}\u2502${t}`);else if(e.phase==="EXECUTING"||e.phase==="BLOCKED"){let a=R(e.completedTaskCount,e.totalTasks,12),c=e.totalTasks>0?Math.round(e.completedTaskCount/e.totalTasks*100):0,$=`${a} ${e.completedTaskCount}/${e.totalTasks} tasks (${c}%)`;if(s.push(`${r}\u2502${t} Progress: ${p}${$}${t}${" ".repeat(Math.max(0,40-$.length))}${r}\u2502${t}`),s.push(`${r}\u2502${t} Iteration: ${e.iteration}${" ".repeat(Math.max(0,38-String(e.iteration).length))}${r}\u2502${t}`),e.activeTaskId!==null){let n=`${e.activeTaskId}${e.activeTaskTitle!==null?` (${e.activeTaskTitle})`:""}`.slice(0,36);s.push(`${r}\u2502${t} Active task: ${P}${n}${t}${" ".repeat(Math.max(0,36-n.length))}${r}\u2502${t}`)}if(e.phase==="BLOCKED"){let i=(e.lastProgress??"unknown").replace(/^BLOCKED:\s*/,"");s.push(`${r}\u2502${t} ${w}BLOCKED: ${i.slice(0,40)}${t}${" ".repeat(Math.max(0,40-i.slice(0,40).length))}${r}\u2502${t}`),s.push(`${r}\u2502${t} ${f}Human input needed${t}${" ".repeat(Math.max(0,32))}${r}\u2502${t}`)}}else e.phase==="DONE"&&s.push(`${r}\u2502${t} ${p}Complete!${t} ${e.iteration} iterations, ${e.decisionsCount} decisions${" ".repeat(Math.max(0,17-String(e.iteration).length-String(e.decisionsCount).length))}${r}\u2502${t}`);if(s.push(`${r}\u2502${"".padEnd(52)}\u2502${t}`),s.push(`${r}\u2502${t} Last update: ${v(e.timeSinceUpdate)}${" ".repeat(Math.max(0,36-v(e.timeSinceUpdate).length))}${r}\u2502${t}`),e.lastProgress!==null){let a=e.lastProgress.slice(0,48);s.push(`${r}\u2502${t} ${r}${a}${t}${" ".repeat(Math.max(0,50-a.length))}${r}\u2502${t}`)}if(e.awaitingStatusReport&&s.push(`${r}\u2502${t} ${f}Status report pending${t}${" ".repeat(Math.max(0,29))}${r}\u2502${t}`),e.verificationPassed===!1&&s.push(`${r}\u2502${t} ${w}Verification failed${t}${" ".repeat(Math.max(0,31))}${r}\u2502${t}`),s.push(`${r}\u2502${"".padEnd(52)}\u2502${t}`),e.debt!==null&&e.debt.items.length>0){s.push(`${r}\u2502${t} Debt: ${e.debt.items.length} item(s)${" ".repeat(Math.max(0,34))}${r}\u2502${t}`);for(let a of e.debt.items.slice(0,3)){let c=a.text.slice(0,44);s.push(`${r}\u2502${t} \u2514\u2500 ${c}${" ".repeat(Math.max(0,46-c.length))}${r}\u2502${t}`)}e.debt.items.length>3&&s.push(`${r}\u2502${t} \u2514\u2500 ... and ${e.debt.items.length-3} more${" ".repeat(Math.max(0,32))}${r}\u2502${t}`)}if(e.trackedFiles.length>0||e.modifiedFiles.length>0){let a=e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles;s.push(`${r}\u2502${t} Files changed: ${a.length}${" ".repeat(Math.max(0,34-String(a.length).length))}${r}\u2502${t}`);for(let c of a.slice(0,5)){let $=c.length>44?"..."+c.slice(-41):c;s.push(`${r}\u2502${t} \u2514\u2500 ${$}${" ".repeat(Math.max(0,46-$.length))}${r}\u2502${t}`)}a.length>5&&s.push(`${r}\u2502${t} \u2514\u2500 ... and ${a.length-5} more${" ".repeat(Math.max(0,32))}${r}\u2502${t}`)}if(s.push(`${r}\u2502${"".padEnd(52)}\u2502${t}`),e.concerns.length>0){let a=e.concerns.join(", ").slice(0,38);s.push(`${r}\u2502${t} Concerns: ${a}${" ".repeat(Math.max(0,40-a.length))}${r}\u2502${t}`)}let h=e.iteration>=e.maxIterations?`${w}RESTART RECOMMENDED${t}`:`${p}ok${t} (${e.iteration}/${e.maxIterations})`;return s.push(`${r}\u2502${t} Context: ${h}${" ".repeat(Math.max(0,41-h.replace(/\x1b\[[0-9;]*m/g,"").length))}${r}\u2502${t}`),s.push(`${r}\u2570${d}\u256F${t}`),s.push(` ${r}watching .eser/.state/ for changes... (ctrl+c to stop)${t}`),s.join(`
|
|
4
|
+
`)},W=e=>JSON.stringify({ts:new Date().toISOString(),phase:e.phase,spec:e.spec,iteration:e.iteration,activeTask:e.activeTaskId,tasks:{completed:e.completedTaskCount,total:e.totalTasks},progress:e.lastProgress,debt:e.debt?.items.length??0,filesChanged:e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles,timeSinceUpdate:e.timeSinceUpdate,verificationPassed:e.verificationPassed}),V=async e=>{let s=m.process.cwd(),l=C(e);if(!await b(s)){let i=new TextEncoder,n=m.process.stdout.getWriter();return await n.write(i.encode(`noskills not initialized.
|
|
5
|
+
`)),n.releaseLock(),k({exitCode:1})}let d=`${s}/.eser/.state`,o="",h=async()=>{let i=await D(s),n=l==="json"?W(i):l==="markdown"?E(i,"markdown"):A(i);if(l==="json"){let g=new TextEncoder,u=m.process.stdout.getWriter();await u.write(g.encode(n+`
|
|
6
|
+
`)),u.releaseLock()}else if(l==="markdown"){let g=new TextEncoder,u=m.process.stdout.getWriter();await u.write(g.encode(n+`
|
|
7
|
+
---
|
|
8
|
+
`)),u.releaseLock()}else if(n!==o){let g=new TextEncoder,u=m.process.stdout.getWriter();await u.write(g.encode(L+n+`
|
|
9
|
+
`)),u.releaseLock(),o=n}return i.phase==="DONE"};if(await h())return x(void 0);let c=1e3,$=0;for(;;){await new Promise(i=>setTimeout(i,c));try{let n=(await m.fs.stat(`${d}/state.json`)).mtime?.getTime()??0;if(n>$&&($=n,await new Promise(u=>setTimeout(u,100)),await h()))break}catch{}}return x(void 0)};export{D as buildSnapshot,V as main,W as renderJsonLine,A as renderTerminal};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as WORKERD_CAPABILITIES,c as clearEnv,d as createWorkerdRuntime,b as populateEnvFromContext};
|