@farm.js/core 0.1.51-beta.2 → 0.1.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp-handler-WWCC4GLG.mjs → agent-mcp-handler-7QMX2LUY.mjs} +7 -7
- package/dist/agent-mcp-handler-OV4WRFBL.cjs +18 -0
- package/dist/{agent-mcp.d-Z5DuwrqW.d.mts → agent-mcp.d-C-2S9bnP.d.mts} +1 -1
- package/dist/{agent-mcp.d-CR5Ov83o.d.ts → agent-mcp.d-SIoCUP1I.d.ts} +1 -1
- package/dist/agent-runtime.cjs +5 -5
- package/dist/agent-runtime.d.mts +2 -2
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/agent-runtime.mjs +4 -4
- package/dist/{analyzer-Z6TNEAET.mjs → analyzer-22BEYV7S.mjs} +126 -12
- package/dist/{analyzer-T76CN3S7.cjs → analyzer-LCSI3NSH.cjs} +132 -18
- package/dist/api/client.cjs +5 -4
- package/dist/api/client.d.mts +1 -1
- package/dist/api/client.d.ts +1 -1
- package/dist/api/client.mjs +3 -2
- package/dist/api/client.native.cjs +45 -0
- package/dist/api/client.native.d.mts +23 -0
- package/dist/api/client.native.d.ts +23 -0
- package/dist/api/client.native.mjs +45 -0
- package/dist/api/route-manager.cjs +7 -7
- package/dist/api/route-manager.d.mts +4 -4
- package/dist/api/route-manager.d.ts +4 -4
- package/dist/api/route-manager.mjs +6 -6
- package/dist/api/runtime.cjs +5 -5
- package/dist/api/runtime.d.mts +3 -3
- package/dist/api/runtime.d.ts +3 -3
- package/dist/api/runtime.mjs +4 -4
- package/dist/{api-client.d-CeA6tNA6.d.mts → api-client.d-BNLXNCXJ.d.mts} +1 -1
- package/dist/{api-client.d-BWcqZciH.d.ts → api-client.d-ddQBNGtu.d.ts} +1 -1
- package/dist/api.cjs +11 -11
- package/dist/api.d.mts +5 -5
- package/dist/api.d.ts +5 -5
- package/dist/api.mjs +10 -10
- package/dist/{app-manifest.d-CAHkOBFa.d.mts → app-manifest.d-DrSAHskY.d.mts} +1 -1
- package/dist/{app-manifest.d-DiWr_Jfx.d.ts → app-manifest.d-Tb3CJpL4.d.ts} +1 -1
- package/dist/app-markdown.cjs +7 -7
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +6 -6
- package/dist/{app.d-DmapqkbV.d.ts → app.d-CmWlYpZJ.d.ts} +9 -4
- package/dist/{app.d-BfgJCsTQ.d.mts → app.d-D6QQM_kk.d.mts} +9 -4
- package/dist/{chunk-SN5VSO3Q.mjs → chunk-25T5VXOE.mjs} +7 -9
- package/dist/{chunk-GUJTVM36.cjs → chunk-2FRLSDBT.cjs} +1 -1
- package/dist/{chunk-LM2YOGDK.mjs → chunk-2I6PUKWJ.mjs} +1 -1
- package/dist/{chunk-EIMK7D2D.mjs → chunk-2KTYMMWT.mjs} +34 -4
- package/dist/{chunk-B5BBTPJQ.cjs → chunk-2OF5RPVU.cjs} +14 -14
- package/dist/chunk-37PYUEK5.mjs +533 -0
- package/dist/chunk-3HLQTOVU.cjs +6 -0
- package/dist/{chunk-VSLM6BHX.cjs → chunk-3OJNNCDL.cjs} +9 -9
- package/dist/{chunk-X3JNB2TB.mjs → chunk-3PX4AIXO.mjs} +36 -5
- package/dist/{chunk-UQHIWZZ6.cjs → chunk-3TL3AH25.cjs} +12 -6
- package/dist/chunk-3YMLUNL2.cjs +251 -0
- package/dist/chunk-4JTQPOKO.cjs +137 -0
- package/dist/{chunk-QXPSWMUD.cjs → chunk-4P23B7DU.cjs} +5 -5
- package/dist/{chunk-YVJV7Q2X.mjs → chunk-55U5QIXQ.mjs} +1 -1
- package/dist/{chunk-5N7QAGEA.cjs → chunk-5JNUYGNF.cjs} +37 -7
- package/dist/{chunk-NJLTQR5P.cjs → chunk-6BJJYOFL.cjs} +7 -7
- package/dist/chunk-6UUH4N4J.mjs +251 -0
- package/dist/{chunk-2NHOYYUT.mjs → chunk-7H45IJWO.mjs} +2 -2
- package/dist/{chunk-NN3MOPSI.mjs → chunk-A2MN5PQJ.mjs} +7 -7
- package/dist/{chunk-KY32FWK7.mjs → chunk-BHJAYPYU.mjs} +2 -2
- package/dist/{chunk-VAHBCI6X.mjs → chunk-BQWBHWEW.mjs} +26 -1
- package/dist/{chunk-KJMWAUKE.mjs → chunk-C7GJDVN4.mjs} +1 -1
- package/dist/{chunk-OYNNA4DD.cjs → chunk-CBKRS3M4.cjs} +9 -9
- package/dist/{chunk-I2DQGS56.cjs → chunk-CBOEJ5Z4.cjs} +39 -41
- package/dist/{chunk-BOVGCUDZ.cjs → chunk-CI4UNQHO.cjs} +2 -2
- package/dist/{chunk-S5AQ7CAC.cjs → chunk-CNNBFGL5.cjs} +39 -14
- package/dist/chunk-D2X5MUF5.cjs +1457 -0
- package/dist/{chunk-LEIXUFJN.cjs → chunk-D4MRNBVF.cjs} +10 -9
- package/dist/{chunk-2KVDHNQS.mjs → chunk-D7LTCK3U.mjs} +2 -2
- package/dist/{chunk-J3LBO2O4.cjs → chunk-DPJ66FSI.cjs} +22 -22
- package/dist/{chunk-NYQSC4DX.cjs → chunk-DZPR2W6U.cjs} +5 -5
- package/dist/{chunk-GW4YUIHW.mjs → chunk-E72UD6ME.mjs} +1 -1
- package/dist/chunk-EFZGB7JC.cjs +114 -0
- package/dist/{chunk-XXXRRVY6.mjs → chunk-EGVC4LIG.mjs} +5 -5
- package/dist/{chunk-72NBDVWQ.mjs → chunk-EXUONJYV.mjs} +3 -3
- package/dist/{chunk-VS7EHLLW.mjs → chunk-EZ34EHQP.mjs} +1 -1
- package/dist/{chunk-FM2UEKS2.mjs → chunk-F6Y7ZAPQ.mjs} +2 -2
- package/dist/{chunk-LMFJCXDD.mjs → chunk-FN5UEC7I.mjs} +1 -1
- package/dist/{chunk-E6LTONL4.mjs → chunk-FORSVMEJ.mjs} +2 -2
- package/dist/{chunk-6CYQQQGR.mjs → chunk-HPWB57PZ.mjs} +1 -1
- package/dist/{chunk-Y2G5SJFB.mjs → chunk-IFHPDLIS.mjs} +1 -1
- package/dist/{chunk-GNJIYJMS.cjs → chunk-IFXSBJPN.cjs} +16 -16
- package/dist/{chunk-74Z5KX4A.mjs → chunk-ILMTRGBG.mjs} +309 -56
- package/dist/{chunk-NXBHYO7S.cjs → chunk-JBK7UJOI.cjs} +14 -11
- package/dist/chunk-JI5D7MXY.mjs +137 -0
- package/dist/{chunk-QXJADAQB.cjs → chunk-JIBEFLQ7.cjs} +6 -2
- package/dist/{chunk-LZ4SB57H.mjs → chunk-JPIUGDK4.mjs} +1 -1
- package/dist/{chunk-Y3N5BFRJ.mjs → chunk-JSDV2NUN.mjs} +1 -1
- package/dist/{chunk-IRSS4HS4.mjs → chunk-K3RU5MOR.mjs} +1 -1
- package/dist/chunk-KPOMS5RO.cjs +237 -0
- package/dist/{chunk-LAZK6UV7.mjs → chunk-KVW2M6PI.mjs} +1 -1
- package/dist/{chunk-5IONBVJY.cjs → chunk-LB3DPQP6.cjs} +22 -22
- package/dist/{chunk-CZ35L6PL.mjs → chunk-LJVNMGE3.mjs} +10 -4
- package/dist/chunk-LLZSYFOM.mjs +6 -0
- package/dist/{chunk-X2AMN2WV.cjs → chunk-LQNW3ABP.cjs} +10 -10
- package/dist/{chunk-6ONBZGVH.cjs → chunk-LRB5OVRT.cjs} +3 -3
- package/dist/{chunk-WJFFPXCV.cjs → chunk-LT4VAF5Z.cjs} +12 -10
- package/dist/{chunk-F6TLUMH7.mjs → chunk-M53MIIXY.mjs} +1 -1
- package/dist/{chunk-HIFIG6HL.cjs → chunk-MEQN6DDA.cjs} +5 -5
- package/dist/{chunk-XLRLSTJ6.cjs → chunk-MGKW5XZE.cjs} +7 -7
- package/dist/{chunk-B3GZAQSC.cjs → chunk-MHLNWRCJ.cjs} +3 -3
- package/dist/{chunk-5ENW27SL.mjs → chunk-MMK4MZUN.mjs} +1 -1
- package/dist/{chunk-DTU4PX7V.cjs → chunk-MTWXOEI4.cjs} +927 -629
- package/dist/chunk-NHD7BAKD.mjs +1457 -0
- package/dist/{chunk-NPQLMP7M.cjs → chunk-NQJDO7K7.cjs} +32 -31
- package/dist/{chunk-76GHW3WI.cjs → chunk-O27PLNQZ.cjs} +10 -10
- package/dist/{chunk-PIHKO25G.mjs → chunk-OM7WILES.mjs} +1 -1
- package/dist/{chunk-7UPCJDB5.mjs → chunk-PCXIJKPM.mjs} +8 -8
- package/dist/{chunk-IWFV5ZED.cjs → chunk-PMJSG4JS.cjs} +1 -1
- package/dist/{chunk-JATTVAHA.cjs → chunk-PRFNLQSP.cjs} +4 -4
- package/dist/{chunk-SBABQKPT.cjs → chunk-QAS7KE7J.cjs} +7 -7
- package/dist/chunk-QGOZLGVP.mjs +0 -0
- package/dist/{chunk-VQJYGZNX.cjs → chunk-QMNWKQL4.cjs} +1 -1
- package/dist/{chunk-XB24LZWI.cjs → chunk-QRX4JRBO.cjs} +3 -3
- package/dist/{chunk-LNM57D3H.cjs → chunk-R53QDV6T.cjs} +4 -4
- package/dist/{chunk-SUV6YO4Q.cjs → chunk-RAWWCDCT.cjs} +5 -5
- package/dist/{chunk-LJDIFIJ2.mjs → chunk-RPUJHJHE.mjs} +4 -4
- package/dist/{chunk-G2KTRMWA.mjs → chunk-RSEAX5MW.mjs} +4 -0
- package/dist/chunk-SJRCWF4Z.mjs +237 -0
- package/dist/{chunk-IBSAYAWB.mjs → chunk-SX7EECTS.mjs} +8 -5
- package/dist/{chunk-KBRZAYI7.mjs → chunk-T4TBK5NY.mjs} +2 -2
- package/dist/{chunk-4SSRBCBR.mjs → chunk-T7I62A4C.mjs} +619 -321
- package/dist/{chunk-E36C43IX.cjs → chunk-U4BJKNIR.cjs} +6 -6
- package/dist/{chunk-YU42A5MA.cjs → chunk-UDJY2ZGY.cjs} +533 -280
- package/dist/{chunk-SHS6KXOZ.mjs → chunk-UR25Z5Z6.mjs} +1 -1
- package/dist/{chunk-WZW6LEHM.cjs → chunk-UYSTTPYJ.cjs} +1590 -1019
- package/dist/{chunk-KRRZJ77U.mjs → chunk-UZZ6IEQP.mjs} +3 -3
- package/dist/{chunk-EKJYE4Y7.cjs → chunk-VGG74PSU.cjs} +25 -25
- package/dist/{chunk-CTM4SPB3.mjs → chunk-VPTWKOCY.mjs} +20 -19
- package/dist/{chunk-UN6N623E.mjs → chunk-VQJHT2ND.mjs} +2 -2
- package/dist/{chunk-SJ23LJ3N.cjs → chunk-VVTJTMGQ.cjs} +3 -3
- package/dist/{chunk-KHXAJ2KA.cjs → chunk-W2RZ73IU.cjs} +12 -12
- package/dist/{chunk-JWI5PUO2.mjs → chunk-W2ZXMMHA.mjs} +2 -1
- package/dist/{chunk-BLD5GVCG.mjs → chunk-W6QLRQ3V.mjs} +1 -1
- package/dist/{chunk-AV26KHTG.mjs → chunk-X2CZTWQA.mjs} +2 -2
- package/dist/chunk-XPIPMWY3.cjs +1 -0
- package/dist/chunk-XTG73QZA.cjs +533 -0
- package/dist/{chunk-XPMC4E2G.cjs → chunk-XVSBALOY.cjs} +3 -3
- package/dist/{chunk-XYL4HSVC.cjs → chunk-YI6FKTTN.cjs} +38 -7
- package/dist/{chunk-N77JBPLC.mjs → chunk-YSXTNSXS.mjs} +10 -8
- package/dist/{chunk-EHB77D5U.cjs → chunk-ZDAEHG2O.cjs} +3 -3
- package/dist/{chunk-PMKUU273.mjs → chunk-ZFUKPWFC.mjs} +1226 -655
- package/dist/{chunk-E73PGHSR.mjs → chunk-ZMHAFH4R.mjs} +8 -8
- package/dist/{chunk-ZOWNWHK6.cjs → chunk-ZNH6NR3H.cjs} +2 -2
- package/dist/chunk-ZNXTU4YH.mjs +114 -0
- package/dist/{chunk-PFV2KPDZ.cjs → chunk-ZOYKJBP5.cjs} +3 -3
- package/dist/{chunk-CECUDGXQ.cjs → chunk-ZP32GNJQ.cjs} +13 -13
- package/dist/{chunk-72D2NX77.mjs → chunk-ZZ2QKCKW.mjs} +1 -1
- package/dist/{client-plugins.d-Bx3FXpqm.d.mts → client-plugins.d-CgQQ-EAv.d.mts} +25 -4
- package/dist/{client-plugins.d-TiLbS5j4.d.ts → client-plugins.d-vXrbcfJ1.d.ts} +25 -4
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client.cjs +9 -9
- package/dist/client.d.mts +9 -9
- package/dist/client.d.ts +9 -9
- package/dist/client.mjs +9 -9
- package/dist/{config.d-iRPI16ku.d.mts → config.d-DqZkLwef.d.mts} +146 -1
- package/dist/{config.d-iRPI16ku.d.ts → config.d-DqZkLwef.d.ts} +146 -1
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/cron.cjs +3 -3
- package/dist/cron.d.mts +10 -0
- package/dist/cron.d.ts +10 -0
- package/dist/cron.mjs +2 -2
- package/dist/desktop.d.mts +3 -3
- package/dist/desktop.d.ts +3 -3
- package/dist/{devtools-UQLDAOEI.mjs → devtools-KQZ6SRCJ.mjs} +16 -16
- package/dist/{devtools-6XWCZIGO.cjs → devtools-UF6JYHUN.cjs} +18 -18
- package/dist/docs.cjs +19 -19
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +18 -18
- package/dist/index.cjs +99 -95
- package/dist/{index.d-yueUNipJ.d.ts → index.d-DlCELfhf.d.ts} +1 -1
- package/dist/{index.d-YxJ2AiDF.d.mts → index.d-Dmfb7Kb_.d.mts} +1 -1
- package/dist/index.d.mts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.mjs +139 -135
- package/dist/integrations.cjs +5 -5
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/integrations.mjs +4 -4
- package/dist/internal/app-markdown-runtime.cjs +6 -6
- package/dist/internal/app-markdown-runtime.d.mts +3 -3
- package/dist/internal/app-markdown-runtime.d.ts +3 -3
- package/dist/internal/app-markdown-runtime.mjs +5 -5
- package/dist/internal/build-runtime.cjs +52 -50
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +51 -49
- package/dist/internal/cli-runtime.cjs +28 -28
- package/dist/internal/cli-runtime.mjs +28 -28
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +20 -15
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/client-runtime.mjs +8 -3
- package/dist/internal/compression-runtime.d.mts +2 -2
- package/dist/internal/compression-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.cjs +18 -18
- package/dist/internal/config-runtime.d.mts +119 -7
- package/dist/internal/config-runtime.d.ts +119 -7
- package/dist/internal/config-runtime.mjs +17 -17
- package/dist/internal/infra-analytics-runtime.cjs +11 -11
- package/dist/internal/infra-analytics-runtime.mjs +9 -9
- package/dist/internal/islands-boot.cjs +211 -0
- package/dist/internal/islands-boot.d.mts +8 -0
- package/dist/internal/islands-boot.d.ts +8 -0
- package/dist/internal/islands-boot.mjs +211 -0
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +42 -28
- package/dist/internal/production-runtime.d.mts +50 -12
- package/dist/internal/production-runtime.d.ts +50 -12
- package/dist/internal/production-runtime.mjs +52 -38
- package/dist/markdown.cjs +7 -5
- package/dist/markdown.d.mts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.mjs +6 -4
- package/dist/middleware.cjs +10 -10
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/middleware.mjs +9 -9
- package/dist/mobile.d.mts +43 -5
- package/dist/mobile.d.ts +43 -5
- package/dist/modules-VHD7BELU.mjs +13 -0
- package/dist/modules-WT5D3AWY.cjs +13 -0
- package/dist/native-specs-BD7HOTMJ.mjs +15 -0
- package/dist/native-specs-IQQRJOOW.cjs +15 -0
- package/dist/native-tree-6G5O53O3.cjs +27 -0
- package/dist/native-tree-VWNW2MQ2.mjs +27 -0
- package/dist/native.cjs +87 -0
- package/dist/native.d.mts +72 -0
- package/dist/native.d.ts +72 -0
- package/dist/native.mjs +87 -0
- package/dist/{navigation-delegate.d-HnDXhlyP.d.mts → navigation-delegate.d-CnOTWOyi.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BY1e_Xrh.d.ts → navigation-delegate.d-JXx40JzR.d.ts} +1 -1
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/navigation.mjs +4 -4
- package/dist/{nitro-R444AF3O.mjs → nitro-FLN6DRGJ.mjs} +7 -7
- package/dist/{nitro-CK7M4RMY.cjs → nitro-HXAZZQKY.cjs} +12 -12
- package/dist/plugin.cjs +43 -42
- package/dist/plugin.d.mts +5 -4
- package/dist/plugin.d.ts +5 -4
- package/dist/plugin.mjs +42 -41
- package/dist/port-C6GBH4C6.cjs +419 -0
- package/dist/port-WOOQ3V56.mjs +419 -0
- package/dist/{production-runtime.d-BpJUDzP8.d.mts → production-runtime.d-CP5s6RuY.d.mts} +1 -1
- package/dist/{production-runtime.d-lMjvE9cf.d.ts → production-runtime.d-N-cE3pmy.d.ts} +1 -1
- package/dist/{programmatic-routes-client.d-BlFp5hv4.d.ts → programmatic-routes-client.d-CLG2N1yH.d.ts} +2 -2
- package/dist/{programmatic-routes-client.d-6CGQ3TCk.d.mts → programmatic-routes-client.d-CPbNqtIi.d.mts} +2 -2
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan.d-DhP0mTHF.d.ts → render-plan.d-B9lAP3uX.d.ts} +1 -1
- package/dist/{render-plan.d-BH9edqKs.d.mts → render-plan.d-DZ-qjjdG.d.mts} +1 -1
- package/dist/renderer/react/server.cjs +2 -2
- package/dist/renderer/react/server.mjs +3 -3
- package/dist/renderer-client.cjs +6 -6
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/renderer-client.mjs +2 -2
- package/dist/{request.d-BVZrsR1v.d.ts → request.d-BiicaNxb.d.ts} +1 -1
- package/dist/{request.d-DJFRdKi8.d.mts → request.d-DV0oeUit.d.mts} +1 -1
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/{route-rendering.d-Bpmw7PED.d.mts → route-rendering.d-BrIKA51A.d.mts} +1 -1
- package/dist/{route-rendering.d-B00JtK_-.d.ts → route-rendering.d-Iss0C7GR.d.ts} +1 -1
- package/dist/{router.d-Bd1x9XxQ.d.ts → router.d-DjGn_al7.d.ts} +1 -1
- package/dist/{router.d-e0jQ3jQ-.d.mts → router.d-mNTbOGV_.d.mts} +1 -1
- package/dist/{routes.d-D96Dq9lz.d.ts → routes.d-BKSjHuH9.d.ts} +27 -4
- package/dist/{routes.d-Cmv8TgVq.d.mts → routes.d-qd8Qf4LG.d.mts} +27 -4
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/{rsc-pipeline-DX4OC5FN.cjs → rsc-pipeline-SVLBTY7H.cjs} +21 -21
- package/dist/{rsc-pipeline-ZQ4CTVEG.mjs → rsc-pipeline-WBLBDQXA.mjs} +20 -20
- package/dist/{runtime-NQ3EDSA7.cjs → runtime-DGUOWSMF.cjs} +307 -48
- package/dist/{runtime-NPDRDV6R.mjs → runtime-HFZTVNFF.mjs} +298 -39
- package/dist/{runtime.d-CgB3IJDq.d.mts → runtime.d-BNVbojF1.d.mts} +1 -1
- package/dist/{runtime.d-D-td-RR3.d.ts → runtime.d-Bm_4hP5T.d.ts} +1 -1
- package/dist/{schema-dev-notice-F6QYSOAI.mjs → schema-dev-notice-JMXEQWIQ.mjs} +3 -3
- package/dist/{schema-dev-notice-UU7DMZEU.cjs → schema-dev-notice-PLBFDTOF.cjs} +6 -6
- package/dist/server-fn-client.d.mts +1 -1
- package/dist/server-fn-client.d.ts +1 -1
- package/dist/server-plugins.cjs +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server-plugins.mjs +1 -1
- package/dist/server.cjs +82 -81
- package/dist/server.d.mts +12 -11
- package/dist/server.d.ts +12 -11
- package/dist/server.mjs +65 -64
- package/dist/session-2Q72D4QV.cjs +23 -0
- package/dist/{session-IGEDQ5PY.mjs → session-QZXZOPR2.mjs} +2 -2
- package/dist/shell-render.d-CG6bPiiA.d.mts +41 -0
- package/dist/shell-render.d-CG6bPiiA.d.ts +41 -0
- package/dist/{spa-router.d-CO01mVOM.d.ts → spa-router.d-DAtnNoBe.d.ts} +11 -2
- package/dist/{spa-router.d-BWDhS0FK.d.mts → spa-router.d-DHDoXxDE.d.mts} +11 -2
- package/dist/testing.cjs +7 -7
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.mjs +6 -6
- package/dist/{utils.d-B77__yh8.d.ts → utils.d-DwZ-KLSB.d.ts} +7 -1
- package/dist/{utils.d-DRDazhCA.d.mts → utils.d-uKZcKJk4.d.mts} +7 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +43 -42
- package/dist/vite.d.mts +17 -6
- package/dist/vite.d.ts +17 -6
- package/dist/vite.mjs +42 -41
- package/dist/workflows.cjs +3 -3
- package/dist/workflows.mjs +2 -2
- package/package.json +17 -3
- package/dist/agent-mcp-handler-RT3COCEL.cjs +0 -18
- package/dist/session-AAU7RNRO.cjs +0 -23
- package/dist/{chunk-7FVVQEVL.cjs → chunk-4BS3HSY7.cjs} +2 -2
- package/dist/{chunk-N7JQXQAV.cjs → chunk-5OJVKXFV.cjs} +2 -2
- package/dist/{chunk-WSDKXV4E.mjs → chunk-72KABRWN.mjs} +4 -4
- package/dist/{chunk-C3BOESDW.mjs → chunk-B4CWYGCG.mjs} +3 -3
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkD2X5MUF5cjs = require('./chunk-D2X5MUF5.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunkLT4VAF5Zcjs = require('./chunk-LT4VAF5Z.cjs');
|
|
14
|
+
|
|
15
|
+
// src/mobile/native-tree.ts
|
|
16
|
+
var VIEW_TAGS = new Set(
|
|
17
|
+
"div section main article header footer nav aside figure ul ol li hr".split(" ")
|
|
18
|
+
);
|
|
19
|
+
var BLOCK_TEXT_TAGS = new Set("p h1 h2 h3 h4 h5 h6".split(" "));
|
|
20
|
+
var INLINE_TAGS = new Set("span strong em b i small label code br a".split(" "));
|
|
21
|
+
var VOID_TAGS = new Set(
|
|
22
|
+
"area base br col embed hr img input link meta source track wbr".split(" ")
|
|
23
|
+
);
|
|
24
|
+
var SKIPPED_TAGS = new Set("link meta template title".split(" "));
|
|
25
|
+
var INLINE_DEFAULTS = {
|
|
26
|
+
strong: { fontWeight: 700 },
|
|
27
|
+
b: { fontWeight: 700 },
|
|
28
|
+
em: { fontStyle: "italic" },
|
|
29
|
+
i: { fontStyle: "italic" },
|
|
30
|
+
code: { fontFamily: "mono" }
|
|
31
|
+
};
|
|
32
|
+
var ENTITIES = {
|
|
33
|
+
amp: "&",
|
|
34
|
+
lt: "<",
|
|
35
|
+
gt: ">",
|
|
36
|
+
quot: '"',
|
|
37
|
+
apos: "'",
|
|
38
|
+
nbsp: "\xA0"
|
|
39
|
+
};
|
|
40
|
+
function decode(text) {
|
|
41
|
+
return text.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi, (entity, name) => {
|
|
42
|
+
if (name[0] === "#") {
|
|
43
|
+
const code = name[1] === "x" || name[1] === "X" ? parseInt(name.slice(2), 16) : Number(name.slice(1));
|
|
44
|
+
return Number.isFinite(code) ? String.fromCodePoint(code) : entity;
|
|
45
|
+
}
|
|
46
|
+
return _nullishCoalesce(ENTITIES[name.toLowerCase()], () => ( entity));
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function parseHtml(html) {
|
|
50
|
+
const root = { tag: "#root", attributes: {}, children: [] };
|
|
51
|
+
const stack = [root];
|
|
52
|
+
const tag = /<(\/?)([a-zA-Z][\w:-]*)((?:[^>"']|"[^"]*"|'[^']*')*?)(\/?)>/g;
|
|
53
|
+
let cursor = 0;
|
|
54
|
+
let match;
|
|
55
|
+
while (match = tag.exec(html)) {
|
|
56
|
+
if (match.index > cursor) stack.at(-1).children.push(decode(html.slice(cursor, match.index)));
|
|
57
|
+
cursor = tag.lastIndex;
|
|
58
|
+
const name = match[2].toLowerCase();
|
|
59
|
+
if (match[1]) {
|
|
60
|
+
let open = stack.length - 1;
|
|
61
|
+
while (open > 0 && stack[open].tag !== name) open -= 1;
|
|
62
|
+
if (open > 0) stack.length = open;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
const attributes = {};
|
|
66
|
+
for (const attribute of match[3].matchAll(
|
|
67
|
+
/([^\s=/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g
|
|
68
|
+
)) {
|
|
69
|
+
attributes[attribute[1].toLowerCase()] = decode(
|
|
70
|
+
_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(attribute[2], () => ( attribute[3])), () => ( attribute[4])), () => ( ""))
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
const parent = stack.at(-1);
|
|
74
|
+
let previous;
|
|
75
|
+
for (let index = parent.children.length - 1; index >= 0 && !previous; index -= 1) {
|
|
76
|
+
const child = parent.children[index];
|
|
77
|
+
if (typeof child !== "string") previous = child;
|
|
78
|
+
}
|
|
79
|
+
const element = { tag: name, attributes, children: [], parent, previous };
|
|
80
|
+
parent.children.push(element);
|
|
81
|
+
if (!match[4] && !VOID_TAGS.has(name)) stack.push(element);
|
|
82
|
+
}
|
|
83
|
+
if (cursor < html.length) stack.at(-1).children.push(decode(html.slice(cursor)));
|
|
84
|
+
const markLast = (element) => {
|
|
85
|
+
const elements = element.children.filter(
|
|
86
|
+
(child) => typeof child !== "string"
|
|
87
|
+
);
|
|
88
|
+
const last = elements[elements.length - 1];
|
|
89
|
+
if (last) last.last = true;
|
|
90
|
+
elements.forEach(markLast);
|
|
91
|
+
};
|
|
92
|
+
markLast(root);
|
|
93
|
+
return root;
|
|
94
|
+
}
|
|
95
|
+
function find(element, test) {
|
|
96
|
+
if (test(element)) return element;
|
|
97
|
+
for (const child of element.children) {
|
|
98
|
+
if (typeof child === "string") continue;
|
|
99
|
+
const found = find(child, test);
|
|
100
|
+
if (found) return found;
|
|
101
|
+
}
|
|
102
|
+
return void 0;
|
|
103
|
+
}
|
|
104
|
+
function textOnly(style) {
|
|
105
|
+
return Object.fromEntries(
|
|
106
|
+
Object.entries(style).filter(([key]) => _chunkD2X5MUF5cjs.FARM_NATIVE_TEXT_KEYS.has(key))
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
function withoutText(style) {
|
|
110
|
+
const rest = Object.entries(style).filter(([key]) => !_chunkD2X5MUF5cjs.FARM_NATIVE_TEXT_KEYS.has(key));
|
|
111
|
+
return rest.length > 0 ? Object.fromEntries(rest) : void 0;
|
|
112
|
+
}
|
|
113
|
+
function settleLineHeight(style) {
|
|
114
|
+
const { lineHeightScale, lineHeightPx, ...rest } = style;
|
|
115
|
+
if (lineHeightPx !== void 0) rest.lineHeight = lineHeightPx;
|
|
116
|
+
else if (typeof lineHeightScale === "number") {
|
|
117
|
+
rest.lineHeight = Math.round(lineHeightScale * Number(_nullishCoalesce(rest.fontSize, () => ( 16))) * 100) / 100;
|
|
118
|
+
}
|
|
119
|
+
return rest;
|
|
120
|
+
}
|
|
121
|
+
var Converter = class {
|
|
122
|
+
/**
|
|
123
|
+
* `sheets`: the page's stylesheets. Without them, a class the Tailwind table does not know is
|
|
124
|
+
* reported; with them, only one a layered (Tailwind) rule styles is, since a class no rule
|
|
125
|
+
* styles has no effect in a browser either.
|
|
126
|
+
*/
|
|
127
|
+
constructor(pageUrl, sheets) {
|
|
128
|
+
this.pageUrl = pageUrl;
|
|
129
|
+
this.sheets = sheets;
|
|
130
|
+
this.unsupported = [];
|
|
131
|
+
/** Off while reading the ancestors above the page, which pass down text styles only. */
|
|
132
|
+
this.reporting = true;
|
|
133
|
+
}
|
|
134
|
+
problem(message) {
|
|
135
|
+
if (this.reporting && !this.unsupported.includes(message)) this.unsupported.push(message);
|
|
136
|
+
}
|
|
137
|
+
stylesOf(element) {
|
|
138
|
+
const classes = _chunkD2X5MUF5cjs.resolveFarmNativeClasses.call(void 0, _nullishCoalesce(element.attributes.class, () => ( "")));
|
|
139
|
+
const cascade = this.sheets ? _chunkD2X5MUF5cjs.cascadeFarmNativeStylesheets.call(void 0, this.sheets, element) : void 0;
|
|
140
|
+
for (const token of classes.unsupported) {
|
|
141
|
+
if (!cascade || cascade.layered.includes(token.split(":").pop())) {
|
|
142
|
+
this.problem(`<${element.tag}> class "${token}"`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
for (const problem of _nullishCoalesce(_optionalChain([cascade, 'optionalAccess', _ => _.unsupported]), () => ( []))) {
|
|
146
|
+
this.problem(`<${element.tag}> ${problem}`);
|
|
147
|
+
}
|
|
148
|
+
const inline = _chunkD2X5MUF5cjs.resolveFarmNativeInlineStyle.call(void 0, _nullishCoalesce(element.attributes.style, () => ( "")));
|
|
149
|
+
for (const declaration of inline.unsupported) {
|
|
150
|
+
this.problem(`<${element.tag}> style "${declaration}"`);
|
|
151
|
+
}
|
|
152
|
+
const style = {
|
|
153
|
+
...INLINE_DEFAULTS[element.tag],
|
|
154
|
+
...classes.style,
|
|
155
|
+
..._optionalChain([cascade, 'optionalAccess', _2 => _2.style]),
|
|
156
|
+
...inline.style
|
|
157
|
+
};
|
|
158
|
+
const dark = { ...classes.dark, ..._optionalChain([cascade, 'optionalAccess', _3 => _3.dark]) };
|
|
159
|
+
for (const target of [style, dark]) {
|
|
160
|
+
if (target.display === "flex" && target.flexDirection === void 0 && !style.flexDirection) {
|
|
161
|
+
target.flexDirection = "row";
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return { style, dark };
|
|
165
|
+
}
|
|
166
|
+
url(value) {
|
|
167
|
+
if (!value) return void 0;
|
|
168
|
+
try {
|
|
169
|
+
return new URL(value, this.pageUrl).href;
|
|
170
|
+
} catch (e) {
|
|
171
|
+
this.problem(`URL "${value}"`);
|
|
172
|
+
return void 0;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
node(type, element, style, dark) {
|
|
176
|
+
const changed = dark && Object.fromEntries(Object.entries(dark).filter(([key, value]) => _optionalChain([style, 'optionalAccess', _4 => _4[key]]) !== value));
|
|
177
|
+
return {
|
|
178
|
+
type,
|
|
179
|
+
tag: element.tag,
|
|
180
|
+
...style && Object.keys(style).length > 0 ? { style } : {},
|
|
181
|
+
...changed && Object.keys(changed).length > 0 ? { dark: changed } : {}
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/** Inline content: runs of text, nested inline elements, and line breaks. */
|
|
185
|
+
inline(content, inherited) {
|
|
186
|
+
const runs = [];
|
|
187
|
+
for (const child of content) {
|
|
188
|
+
if (typeof child === "string") {
|
|
189
|
+
runs.push(child);
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
if (SKIPPED_TAGS.has(child.tag)) continue;
|
|
193
|
+
if (child.tag === "br") {
|
|
194
|
+
runs.push("\n");
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
if (!INLINE_TAGS.has(child.tag)) {
|
|
198
|
+
this.problem(`<${child.tag}> inside text`);
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
const own = this.stylesOf(child);
|
|
202
|
+
if (own.style.display === "none") continue;
|
|
203
|
+
const run = this.node(
|
|
204
|
+
"Text",
|
|
205
|
+
child,
|
|
206
|
+
settleLineHeight(textOnly(own.style)),
|
|
207
|
+
textOnly(own.dark)
|
|
208
|
+
);
|
|
209
|
+
if (withoutText(own.style)) this.problem(`<${child.tag}> inside text has box styles`);
|
|
210
|
+
if (child.tag === "a") run.href = this.url(child.attributes.href);
|
|
211
|
+
const children = this.inline(child.children, inherited);
|
|
212
|
+
if (children.length > 0) run.children = children;
|
|
213
|
+
runs.push(run);
|
|
214
|
+
}
|
|
215
|
+
return runs;
|
|
216
|
+
}
|
|
217
|
+
/** A text block: its runs, with the text style its ancestors pass down. */
|
|
218
|
+
text(element, content, inherited, box) {
|
|
219
|
+
const runs = this.inline(content, inherited);
|
|
220
|
+
const trimmed = collapse(runs);
|
|
221
|
+
if (trimmed.length === 0) return void 0;
|
|
222
|
+
const style = settleLineHeight({ ...inherited.style, ..._optionalChain([box, 'optionalAccess', _5 => _5.style]) });
|
|
223
|
+
const dark = {
|
|
224
|
+
...inherited.dark,
|
|
225
|
+
...box ? textOnly(box.style) : {},
|
|
226
|
+
..._optionalChain([box, 'optionalAccess', _6 => _6.dark])
|
|
227
|
+
};
|
|
228
|
+
const node = this.node("Text", element, style, dark);
|
|
229
|
+
node.children = trimmed;
|
|
230
|
+
return node;
|
|
231
|
+
}
|
|
232
|
+
/** A link drawn as a box: it holds blocks, or has a box style such as a background. */
|
|
233
|
+
isBlockLink(element) {
|
|
234
|
+
if (element.tag !== "a") return false;
|
|
235
|
+
if (element.children.some((child) => typeof child !== "string" && !INLINE_TAGS.has(child.tag))) {
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
const reporting = this.reporting;
|
|
239
|
+
this.reporting = false;
|
|
240
|
+
const { style } = this.stylesOf(element);
|
|
241
|
+
this.reporting = reporting;
|
|
242
|
+
return withoutText(style) !== void 0;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Block content: each element a view, and each run of inline content a text block. In a flex
|
|
246
|
+
* container every child is its own item, as CSS blockifies them: a `<span>` pill there is a box.
|
|
247
|
+
*/
|
|
248
|
+
blocks(content, inherited, flex = false) {
|
|
249
|
+
if (flex) {
|
|
250
|
+
const items = [];
|
|
251
|
+
for (const child of content) {
|
|
252
|
+
const item = typeof child === "string" ? this.text({ tag: "#text", attributes: {}, children: [] }, [child], inherited) : this.element(child, inherited, true);
|
|
253
|
+
if (item) items.push(item);
|
|
254
|
+
}
|
|
255
|
+
return items;
|
|
256
|
+
}
|
|
257
|
+
const nodes = [];
|
|
258
|
+
let pending = [];
|
|
259
|
+
const flush = () => {
|
|
260
|
+
const block = this.text({ tag: "#text", attributes: {}, children: [] }, pending, inherited);
|
|
261
|
+
if (block) nodes.push(block);
|
|
262
|
+
pending = [];
|
|
263
|
+
};
|
|
264
|
+
for (const child of content) {
|
|
265
|
+
if (typeof child === "string" || INLINE_TAGS.has(child.tag) && !this.isBlockLink(child)) {
|
|
266
|
+
pending.push(child);
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
flush();
|
|
270
|
+
const node = this.element(child, inherited);
|
|
271
|
+
if (node) nodes.push(node);
|
|
272
|
+
}
|
|
273
|
+
flush();
|
|
274
|
+
return nodes;
|
|
275
|
+
}
|
|
276
|
+
element(element, inherited, flexItem = false) {
|
|
277
|
+
if (SKIPPED_TAGS.has(element.tag)) return void 0;
|
|
278
|
+
const own = this.stylesOf(element);
|
|
279
|
+
if (own.style.display === "none") return void 0;
|
|
280
|
+
const passed = {
|
|
281
|
+
style: { ...inherited.style, ...textOnly(own.style) },
|
|
282
|
+
// An element's own text style holds in both themes unless it sets a dark one: it overrides
|
|
283
|
+
// what the dark theme passes down, as CSS does.
|
|
284
|
+
dark: { ...inherited.dark, ...textOnly(own.style), ...textOnly(own.dark) }
|
|
285
|
+
};
|
|
286
|
+
const current = (style, color) => style && Object.fromEntries(
|
|
287
|
+
Object.entries(style).map(([key, value]) => [
|
|
288
|
+
key,
|
|
289
|
+
value === "currentColor" && typeof color === "string" ? color : value
|
|
290
|
+
])
|
|
291
|
+
);
|
|
292
|
+
const box = current(withoutText(own.style), passed.style.color);
|
|
293
|
+
const boxDark = current(withoutText(own.dark), _nullishCoalesce(passed.dark.color, () => ( passed.style.color)));
|
|
294
|
+
const flex = own.style.display === "flex";
|
|
295
|
+
const textBox = flexItem && INLINE_TAGS.has(element.tag) && element.tag !== "a" && element.tag !== "br";
|
|
296
|
+
if (BLOCK_TEXT_TAGS.has(element.tag) || textBox) {
|
|
297
|
+
if (element.children.some((child) => typeof child !== "string" && !INLINE_TAGS.has(child.tag))) {
|
|
298
|
+
this.problem(`<${element.tag}> holds block elements`);
|
|
299
|
+
}
|
|
300
|
+
const node = this.text(element, element.children, inherited, own);
|
|
301
|
+
return _nullishCoalesce(node, () => ( this.node("View", element, box, boxDark)));
|
|
302
|
+
}
|
|
303
|
+
if (element.tag === "img") {
|
|
304
|
+
const node = this.node("Image", element, box, boxDark);
|
|
305
|
+
node.src = this.url(element.attributes.src);
|
|
306
|
+
if (element.attributes.alt) node.alt = element.attributes.alt;
|
|
307
|
+
if (!node.src) this.problem("<img> without src");
|
|
308
|
+
return node;
|
|
309
|
+
}
|
|
310
|
+
if (element.tag === "input" || element.tag === "textarea") {
|
|
311
|
+
const node = this.node(
|
|
312
|
+
"TextInput",
|
|
313
|
+
element,
|
|
314
|
+
settleLineHeight({ ...passed.style, ...box }),
|
|
315
|
+
boxDark
|
|
316
|
+
);
|
|
317
|
+
if (element.attributes.placeholder) node.placeholder = element.attributes.placeholder;
|
|
318
|
+
const value = element.tag === "textarea" ? textContent(element) : element.attributes.value;
|
|
319
|
+
if (value) node.value = value;
|
|
320
|
+
return node;
|
|
321
|
+
}
|
|
322
|
+
if (element.tag === "a" || element.tag === "button") {
|
|
323
|
+
const node = this.node("Pressable", element, box, boxDark);
|
|
324
|
+
if (element.tag === "a") node.href = this.url(element.attributes.href);
|
|
325
|
+
node.children = this.blocks(element.children, passed, flex);
|
|
326
|
+
return node;
|
|
327
|
+
}
|
|
328
|
+
if (element.tag === "hr") {
|
|
329
|
+
return this.node(
|
|
330
|
+
"View",
|
|
331
|
+
element,
|
|
332
|
+
{
|
|
333
|
+
borderTopWidth: 1,
|
|
334
|
+
borderTopColor: String(_nullishCoalesce(passed.style.color, () => ( "currentColor"))),
|
|
335
|
+
...box
|
|
336
|
+
},
|
|
337
|
+
boxDark
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
if (VIEW_TAGS.has(element.tag)) {
|
|
341
|
+
const node = this.node("View", element, box, boxDark);
|
|
342
|
+
const children = this.blocks(element.children, passed, flex);
|
|
343
|
+
if (children.length > 0) node.children = children;
|
|
344
|
+
return node;
|
|
345
|
+
}
|
|
346
|
+
if (INLINE_TAGS.has(element.tag)) {
|
|
347
|
+
return this.text(element, [element], inherited);
|
|
348
|
+
}
|
|
349
|
+
this.problem(`<${element.tag}>`);
|
|
350
|
+
return void 0;
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
function textContent(element) {
|
|
354
|
+
return element.children.map((child) => typeof child === "string" ? child : textContent(child)).join("");
|
|
355
|
+
}
|
|
356
|
+
function collapse(runs) {
|
|
357
|
+
let previousSpace = true;
|
|
358
|
+
const walk = (items) => {
|
|
359
|
+
const out2 = [];
|
|
360
|
+
for (const item of items) {
|
|
361
|
+
if (typeof item === "string") {
|
|
362
|
+
if (item === "\n") {
|
|
363
|
+
out2.push(item);
|
|
364
|
+
previousSpace = true;
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
let text = item.replace(/[ \t\r\n\f]+/g, " ");
|
|
368
|
+
if (previousSpace) text = text.replace(/^ /, "");
|
|
369
|
+
if (text) {
|
|
370
|
+
previousSpace = text.endsWith(" ");
|
|
371
|
+
out2.push(text);
|
|
372
|
+
}
|
|
373
|
+
continue;
|
|
374
|
+
}
|
|
375
|
+
const children = item.children ? walk(item.children) : [];
|
|
376
|
+
if (children.length > 0 || item.href) out2.push({ ...item, children });
|
|
377
|
+
}
|
|
378
|
+
return out2;
|
|
379
|
+
};
|
|
380
|
+
const out = walk(runs);
|
|
381
|
+
for (let index = out.length - 1; index >= 0; index -= 1) {
|
|
382
|
+
const item = out[index];
|
|
383
|
+
if (typeof item !== "string") break;
|
|
384
|
+
const trimmed = item.replace(/ $/, "");
|
|
385
|
+
if (trimmed) {
|
|
386
|
+
out[index] = trimmed;
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
out.splice(index, 1);
|
|
390
|
+
}
|
|
391
|
+
return out;
|
|
392
|
+
}
|
|
393
|
+
function firstHeading(node) {
|
|
394
|
+
if (node.tag === "h1") {
|
|
395
|
+
const text = (_nullishCoalesce(node.children, () => ( []))).map(function flatten(child) {
|
|
396
|
+
return typeof child === "string" ? child : (_nullishCoalesce(child.children, () => ( []))).map(flatten).join("");
|
|
397
|
+
}).join("").trim();
|
|
398
|
+
return text || void 0;
|
|
399
|
+
}
|
|
400
|
+
for (const child of _nullishCoalesce(node.children, () => ( []))) {
|
|
401
|
+
if (typeof child === "string") continue;
|
|
402
|
+
const found = firstHeading(child);
|
|
403
|
+
if (found) return found;
|
|
404
|
+
}
|
|
405
|
+
return void 0;
|
|
406
|
+
}
|
|
407
|
+
var parsedSheets = /* @__PURE__ */ new Map();
|
|
408
|
+
function parsedStylesheet(css) {
|
|
409
|
+
let sheet = parsedSheets.get(css);
|
|
410
|
+
if (!sheet) {
|
|
411
|
+
sheet = _chunkD2X5MUF5cjs.parseFarmNativeStylesheet.call(void 0, css);
|
|
412
|
+
if (parsedSheets.size >= 16) parsedSheets.delete(parsedSheets.keys().next().value);
|
|
413
|
+
parsedSheets.set(css, sheet);
|
|
414
|
+
}
|
|
415
|
+
return sheet;
|
|
416
|
+
}
|
|
417
|
+
function createFarmNativeTree(html, pageUrl, stylesheets) {
|
|
418
|
+
const title = _optionalChain([/<title\b[^>]*>([\s\S]*?)<\/title>/i, 'access', _7 => _7.exec, 'call', _8 => _8(html), 'optionalAccess', _9 => _9[1]]);
|
|
419
|
+
const document = parseHtml(_chunkLT4VAF5Zcjs._readFarmRenderedHtml.call(void 0, html));
|
|
420
|
+
const page = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(find(document, (element) => element.attributes.id === "__farm_page__"), () => ( find(document, (element) => element.attributes.id === "root"))), () => ( find(document, (element) => element.tag === "body"))), () => ( document));
|
|
421
|
+
const converter = new Converter(pageUrl, _optionalChain([stylesheets, 'optionalAccess', _10 => _10.map, 'call', _11 => _11(parsedStylesheet)]));
|
|
422
|
+
const ancestors = [];
|
|
423
|
+
for (let element = page.parent; element; element = element.parent) ancestors.unshift(element);
|
|
424
|
+
const inherited = { style: {}, dark: {} };
|
|
425
|
+
let background = {};
|
|
426
|
+
converter.reporting = false;
|
|
427
|
+
for (const element of [...ancestors, page]) {
|
|
428
|
+
if (element.tag === "#root") continue;
|
|
429
|
+
const own = converter.stylesOf(element);
|
|
430
|
+
Object.assign(inherited.style, textOnly(own.style));
|
|
431
|
+
Object.assign(inherited.dark, textOnly(own.dark));
|
|
432
|
+
if (own.style.backgroundColor) background = { backgroundColor: own.style.backgroundColor };
|
|
433
|
+
if (own.dark.backgroundColor)
|
|
434
|
+
background = { ...background, darkBackground: own.dark.backgroundColor };
|
|
435
|
+
}
|
|
436
|
+
converter.reporting = true;
|
|
437
|
+
const { darkBackground, ...light } = background;
|
|
438
|
+
const root = {
|
|
439
|
+
type: "View",
|
|
440
|
+
tag: page.tag,
|
|
441
|
+
...Object.keys(light).length > 0 ? { style: light } : {},
|
|
442
|
+
...darkBackground ? { dark: { backgroundColor: darkBackground } } : {}
|
|
443
|
+
};
|
|
444
|
+
const children = converter.blocks(page.children, inherited);
|
|
445
|
+
if (children.length > 0) root.children = children;
|
|
446
|
+
return {
|
|
447
|
+
version: 1,
|
|
448
|
+
..._optionalChain([title, 'optionalAccess', _12 => _12.trim, 'call', _13 => _13()]) ? { title: decode(title.trim()) } : firstHeading(root) ? { title: firstHeading(root) } : {},
|
|
449
|
+
root,
|
|
450
|
+
unsupported: converter.unsupported
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
function readFarmPageStylesheets(html, pageUrl) {
|
|
454
|
+
const out = [];
|
|
455
|
+
const head = _nullishCoalesce(_optionalChain([/<head\b[^>]*>([\s\S]*?)<\/head>/i, 'access', _14 => _14.exec, 'call', _15 => _15(html), 'optionalAccess', _16 => _16[1]]), () => ( html));
|
|
456
|
+
for (const match of head.matchAll(/<link\b([^>]*)>|<style\b[^>]*>([\s\S]*?)<\/style>/gi)) {
|
|
457
|
+
if (match[2] !== void 0) {
|
|
458
|
+
out.push({ inline: match[2] });
|
|
459
|
+
continue;
|
|
460
|
+
}
|
|
461
|
+
const attributes = match[1];
|
|
462
|
+
if (!/\brel\s*=\s*["']?stylesheet\b/i.test(attributes)) continue;
|
|
463
|
+
const href = _optionalChain([/\bhref\s*=\s*["']([^"']+)["']/i, 'access', _17 => _17.exec, 'call', _18 => _18(attributes), 'optionalAccess', _19 => _19[1]]);
|
|
464
|
+
if (!href) continue;
|
|
465
|
+
const resolved = new URL(decode(href), pageUrl);
|
|
466
|
+
if (resolved.origin === pageUrl.origin) out.push({ href: resolved.pathname + resolved.search });
|
|
467
|
+
}
|
|
468
|
+
return out;
|
|
469
|
+
}
|
|
470
|
+
function farmRequestWantsNativeTree(request) {
|
|
471
|
+
return (_nullishCoalesce(request.headers.get("accept"), () => ( ""))).includes(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE);
|
|
472
|
+
}
|
|
473
|
+
async function createFarmNativeTreeResponse(options) {
|
|
474
|
+
const headers = new Headers(options.request.headers);
|
|
475
|
+
headers.set("accept", "text/html");
|
|
476
|
+
headers.delete("accept-encoding");
|
|
477
|
+
const page = await options.renderPage(
|
|
478
|
+
new Request(options.request.url, {
|
|
479
|
+
method: "GET",
|
|
480
|
+
headers,
|
|
481
|
+
signal: options.request.signal
|
|
482
|
+
})
|
|
483
|
+
);
|
|
484
|
+
const type = _nullishCoalesce(page.headers.get("content-type"), () => ( ""));
|
|
485
|
+
if (page.status !== 200 || !type.includes("text/html")) return page;
|
|
486
|
+
const html = await page.text();
|
|
487
|
+
const pageUrl = new URL(options.request.url);
|
|
488
|
+
const load = _nullishCoalesce(options.loadStylesheet, () => ( (async (href) => {
|
|
489
|
+
const response = await options.renderPage(
|
|
490
|
+
new Request(new URL(href, pageUrl), {
|
|
491
|
+
headers: { accept: "text/css,*/*;q=0.1", cookie: _nullishCoalesce(headers.get("cookie"), () => ( "")) },
|
|
492
|
+
signal: options.request.signal
|
|
493
|
+
})
|
|
494
|
+
);
|
|
495
|
+
return response.status === 200 && _optionalChain([response, 'access', _20 => _20.headers, 'access', _21 => _21.get, 'call', _22 => _22("content-type"), 'optionalAccess', _23 => _23.includes, 'call', _24 => _24("text/css")]) ? response.text() : void 0;
|
|
496
|
+
})));
|
|
497
|
+
const stylesheets = [];
|
|
498
|
+
for (const source of readFarmPageStylesheets(html, pageUrl)) {
|
|
499
|
+
const css = await _asyncNullishCoalesce(source.inline, async () => ( await load(source.href)));
|
|
500
|
+
if (css === void 0) {
|
|
501
|
+
const tree2 = {
|
|
502
|
+
version: 1,
|
|
503
|
+
root: { type: "View", tag: "#root" },
|
|
504
|
+
unsupported: [`stylesheet "${source.href}" could not be read`]
|
|
505
|
+
};
|
|
506
|
+
return new Response(JSON.stringify(tree2), {
|
|
507
|
+
headers: {
|
|
508
|
+
"Content-Type": `${_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE}; charset=utf-8`,
|
|
509
|
+
Vary: "Accept"
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
stylesheets.push(css);
|
|
514
|
+
}
|
|
515
|
+
const tree = createFarmNativeTree(html, pageUrl, stylesheets);
|
|
516
|
+
const out = new Headers({
|
|
517
|
+
"Content-Type": `${_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE}; charset=utf-8`,
|
|
518
|
+
Vary: "Accept",
|
|
519
|
+
"Cache-Control": _nullishCoalesce(page.headers.get("cache-control"), () => ( "no-store"))
|
|
520
|
+
});
|
|
521
|
+
for (const cookie of _nullishCoalesce(_optionalChain([page, 'access', _25 => _25.headers, 'access', _26 => _26.getSetCookie, 'optionalCall', _27 => _27()]), () => ( []))) out.append("Set-Cookie", cookie);
|
|
522
|
+
return new Response(options.request.method === "HEAD" ? null : JSON.stringify(tree), {
|
|
523
|
+
status: 200,
|
|
524
|
+
headers: out
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
exports.createFarmNativeTree = createFarmNativeTree; exports.readFarmPageStylesheets = readFarmPageStylesheets; exports.farmRequestWantsNativeTree = farmRequestWantsNativeTree; exports.createFarmNativeTreeResponse = createFarmNativeTreeResponse;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
|
|
4
4
|
|
|
5
5
|
// src/server/dev-loopback.ts
|
|
6
6
|
var _net = require('net'); var _net2 = _interopRequireDefault(_net);
|
|
@@ -30,7 +30,7 @@ async function listenOnOtherLoopback(server) {
|
|
|
30
30
|
const listening = await new Promise((resolve) => {
|
|
31
31
|
const onError = (error) => {
|
|
32
32
|
if (error.code === "EADDRINUSE") {
|
|
33
|
-
|
|
33
|
+
_chunkQMNWKQL4cjs.logger.warn(
|
|
34
34
|
`Another process is listening on ${formatHost(other)}:${address.port}; the dev server answers on ${formatHost(address.address)}:${address.port} only.`
|
|
35
35
|
);
|
|
36
36
|
}
|
|
@@ -43,7 +43,7 @@ async function listenOnOtherLoopback(server) {
|
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
if (!listening) return;
|
|
46
|
-
loopback.on("error", (error) =>
|
|
46
|
+
loopback.on("error", (error) => _chunkQMNWKQL4cjs.logger.warn(`Dev loopback listener failed: ${String(error)}`));
|
|
47
47
|
httpServer.once("close", () => loopback.close());
|
|
48
48
|
}
|
|
49
49
|
function formatHost(address) {
|
|
@@ -7,7 +7,7 @@ var _chunk2KMIJDY6cjs = require('./chunk-2KMIJDY6.cjs');
|
|
|
7
7
|
var _chunkSHIWRBFIcjs = require('./chunk-SHIWRBFI.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
|
|
11
11
|
|
|
12
12
|
// src/cron.ts
|
|
13
13
|
var DEFAULT_FARM_CRON_SECRET_ENV = "CRON_SECRET";
|
|
@@ -67,7 +67,7 @@ async function prepareFarmCronForNitro(config) {
|
|
|
67
67
|
const wrapperNames = resolveCronWrapperFileNames(cron.jobs.map((job) => job.name));
|
|
68
68
|
for (const job of cron.jobs) {
|
|
69
69
|
const taskName = getFarmCronTaskName(job.name);
|
|
70
|
-
const wrapperPath =
|
|
70
|
+
const wrapperPath = _chunkQMNWKQL4cjs.toPosixPath.call(void 0, path.join(generatedDir, `${wrapperNames.get(job.name)}.mjs`));
|
|
71
71
|
await fs.writeFile(wrapperPath, createNitroCronTaskWrapper(job, cron.secretEnv), "utf8");
|
|
72
72
|
tasks[taskName] = {
|
|
73
73
|
handler: wrapperPath,
|
|
@@ -164,14 +164,45 @@ function isCronRequestAuthorized(request, options = {}) {
|
|
|
164
164
|
return _chunkSHIWRBFIcjs.farmSecretsMatch.call(void 0, bearer, secret) || _chunkSHIWRBFIcjs.farmSecretsMatch.call(void 0, headerSecret, secret);
|
|
165
165
|
}
|
|
166
166
|
function cronRoute(handler, options = {}) {
|
|
167
|
+
if (isFarmEndpoint(handler)) return guardCronEndpoint(handler, options);
|
|
168
|
+
const route = handler;
|
|
167
169
|
return (request, ...args) => {
|
|
168
170
|
if (!isCronRequestAuthorized(request, options)) {
|
|
169
|
-
return Promise.resolve(
|
|
170
|
-
Response.json({ error: "Unauthorized cron request." }, { status: 401 })
|
|
171
|
-
);
|
|
171
|
+
return Promise.resolve(unauthorizedCronResponse());
|
|
172
172
|
}
|
|
173
|
-
return
|
|
173
|
+
return route(request, ...args);
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function unauthorizedCronResponse() {
|
|
177
|
+
return Response.json({ error: "Unauthorized cron request." }, { status: 401 });
|
|
178
|
+
}
|
|
179
|
+
function isFarmEndpoint(value) {
|
|
180
|
+
return typeof value === "function" && typeof value.__handler === "function";
|
|
181
|
+
}
|
|
182
|
+
var FUNCTION_OWN_KEYS = /* @__PURE__ */ new Set(["length", "name", "prototype", "arguments", "caller"]);
|
|
183
|
+
function guardCronEndpoint(endpoint, options) {
|
|
184
|
+
const allowed = (context) => {
|
|
185
|
+
const request = _optionalChain([context, 'optionalAccess', _4 => _4.request]);
|
|
186
|
+
return typeof _optionalChain([request, 'optionalAccess', _5 => _5.headers, 'optionalAccess', _6 => _6.get]) === "function" && isCronRequestAuthorized(request, options);
|
|
174
187
|
};
|
|
188
|
+
const guarded = function(context) {
|
|
189
|
+
return allowed(context) ? endpoint.call(this, context) : Promise.resolve(unauthorizedCronResponse());
|
|
190
|
+
};
|
|
191
|
+
for (const key of Reflect.ownKeys(endpoint)) {
|
|
192
|
+
if (typeof key === "string" && FUNCTION_OWN_KEYS.has(key)) continue;
|
|
193
|
+
Object.defineProperty(guarded, key, Object.getOwnPropertyDescriptor(endpoint, key));
|
|
194
|
+
}
|
|
195
|
+
guarded.__handler = (context) => allowed(context) ? endpoint.__handler(context) : unauthorizedCronResponse();
|
|
196
|
+
const invoke = endpoint.__farmInvoke;
|
|
197
|
+
if (invoke) {
|
|
198
|
+
guarded.__farmInvoke = (context) => allowed(context) ? invoke(context) : {
|
|
199
|
+
result: unauthorizedCronResponse(),
|
|
200
|
+
context: context.context,
|
|
201
|
+
handlerExecuted: false,
|
|
202
|
+
invalidations: []
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
return guarded;
|
|
175
206
|
}
|
|
176
207
|
function normalizeCronJob(name, job) {
|
|
177
208
|
if (!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(name)) {
|
|
@@ -192,7 +223,7 @@ function normalizeCronJob(name, job) {
|
|
|
192
223
|
name,
|
|
193
224
|
schedule,
|
|
194
225
|
path,
|
|
195
|
-
description: _optionalChain([job, 'access',
|
|
226
|
+
description: _optionalChain([job, 'access', _7 => _7.description, 'optionalAccess', _8 => _8.trim, 'call', _9 => _9()]) || void 0
|
|
196
227
|
};
|
|
197
228
|
}
|
|
198
229
|
function normalizeCronPath(name, value) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
_findFarmMCPEndpointTool
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-C7GJDVN4.mjs";
|
|
4
4
|
import {
|
|
5
5
|
emitFarmEvent
|
|
6
6
|
} from "./chunk-2DA7CLY7.mjs";
|
|
@@ -890,14 +890,15 @@ function extractHtmlTitle(html) {
|
|
|
890
890
|
return match ? decodeHtml(stripTags(match[1])).trim() : void 0;
|
|
891
891
|
}
|
|
892
892
|
function readHtmlContentRegion(html) {
|
|
893
|
+
return extractHtmlBody(_readFarmRenderedHtml(html));
|
|
894
|
+
}
|
|
895
|
+
function _readFarmRenderedHtml(html) {
|
|
893
896
|
const streamed = readStreamedBoundaryInstructions(html);
|
|
894
|
-
return
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
).replace(/<!--[\s\S]*?-->/g, "")
|
|
900
|
-
)
|
|
897
|
+
return removeHiddenElements(
|
|
898
|
+
resolveStreamedBoundaries(
|
|
899
|
+
html.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, "").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi, "").replace(/<noscript\b[^>]*>[\s\S]*?<\/noscript>/gi, ""),
|
|
900
|
+
streamed
|
|
901
|
+
).replace(/<!--[\s\S]*?-->/g, "")
|
|
901
902
|
);
|
|
902
903
|
}
|
|
903
904
|
function extractHtmlBody(html) {
|
|
@@ -1353,5 +1354,6 @@ export {
|
|
|
1353
1354
|
getFarmMarkdownAlternatePath,
|
|
1354
1355
|
isFarmMarkdownMirrorExposed,
|
|
1355
1356
|
matchesFarmMarkdownRoutePattern,
|
|
1357
|
+
_readFarmRenderedHtml,
|
|
1356
1358
|
extractFarmPageActions
|
|
1357
1359
|
};
|