@farm.js/core 0.1.51-beta.3 → 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-7JSKGSOW.mjs → agent-mcp-handler-7QMX2LUY.mjs} +7 -7
- package/dist/agent-mcp-handler-OV4WRFBL.cjs +18 -0
- package/dist/{agent-mcp.d-BJKChOrO.d.mts → agent-mcp.d-C-2S9bnP.d.mts} +1 -1
- package/dist/{agent-mcp.d-BAR9njbJ.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-OTPEWH5W.mjs → analyzer-22BEYV7S.mjs} +116 -13
- package/dist/{analyzer-TSQXZCZN.cjs → analyzer-LCSI3NSH.cjs} +123 -20
- 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-DEQNnNhV.d.mts → app-manifest.d-DrSAHskY.d.mts} +1 -1
- package/dist/{app-manifest.d-BLFbaqx8.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-CNPaUYaa.d.ts → app.d-CmWlYpZJ.d.ts} +9 -4
- package/dist/{app.d-CT7xDkj2.d.mts → app.d-D6QQM_kk.d.mts} +9 -4
- package/dist/{chunk-SN5VSO3Q.mjs → chunk-25T5VXOE.mjs} +7 -9
- package/dist/{chunk-OAMUSC7H.cjs → chunk-2FRLSDBT.cjs} +1 -1
- package/dist/{chunk-LM2YOGDK.mjs → chunk-2I6PUKWJ.mjs} +1 -1
- package/dist/{chunk-ZD2VKAUI.mjs → chunk-2KTYMMWT.mjs} +1 -1
- package/dist/{chunk-B5BBTPJQ.cjs → chunk-2OF5RPVU.cjs} +14 -14
- package/dist/{chunk-UQF3OJVE.mjs → chunk-37PYUEK5.mjs} +173 -29
- 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-7MD37P5V.cjs → chunk-4P23B7DU.cjs} +5 -5
- package/dist/{chunk-3BLEXUGE.mjs → chunk-55U5QIXQ.mjs} +1 -1
- package/dist/{chunk-TWHXBMLJ.cjs → chunk-5JNUYGNF.cjs} +4 -4
- package/dist/{chunk-53SACYBY.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-UJL4JOXV.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-4SEHMBL4.cjs → chunk-DPJ66FSI.cjs} +22 -22
- package/dist/{chunk-FFE2EMF7.cjs → chunk-DZPR2W6U.cjs} +5 -5
- package/dist/{chunk-3Z63X45F.mjs → chunk-E72UD6ME.mjs} +1 -1
- 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-5FXPJIOT.mjs → chunk-F6Y7ZAPQ.mjs} +2 -2
- package/dist/{chunk-LMFJCXDD.mjs → chunk-FN5UEC7I.mjs} +1 -1
- package/dist/{chunk-3SMXQNFD.mjs → chunk-FORSVMEJ.mjs} +2 -2
- package/dist/{chunk-R4PHCZ3G.mjs → chunk-HPWB57PZ.mjs} +1 -1
- package/dist/{chunk-Y2G5SJFB.mjs → chunk-IFHPDLIS.mjs} +1 -1
- package/dist/{chunk-3XQ57EFI.cjs → chunk-IFXSBJPN.cjs} +16 -16
- package/dist/{chunk-3WSIYBMG.mjs → chunk-ILMTRGBG.mjs} +279 -48
- package/dist/{chunk-HLWOWZFX.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-YAJTD3ZG.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-X2AMN2WV.cjs → chunk-LQNW3ABP.cjs} +10 -10
- package/dist/{chunk-6ONBZGVH.cjs → chunk-LRB5OVRT.cjs} +3 -3
- package/dist/{chunk-D7UQC4O6.cjs → chunk-LT4VAF5Z.cjs} +2 -2
- package/dist/{chunk-F6TLUMH7.mjs → chunk-M53MIIXY.mjs} +1 -1
- package/dist/{chunk-H33PJEXN.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-WGUHDWT5.cjs → chunk-MTWXOEI4.cjs} +527 -366
- package/dist/chunk-NHD7BAKD.mjs +1457 -0
- package/dist/{chunk-KLNFJDFM.cjs → chunk-NQJDO7K7.cjs} +31 -31
- package/dist/{chunk-TSFMFPRU.cjs → chunk-O27PLNQZ.cjs} +10 -10
- package/dist/{chunk-PIHKO25G.mjs → chunk-OM7WILES.mjs} +1 -1
- package/dist/{chunk-YUEYBL35.mjs → chunk-PCXIJKPM.mjs} +8 -8
- package/dist/{chunk-IWFV5ZED.cjs → chunk-PMJSG4JS.cjs} +1 -1
- package/dist/{chunk-B3GM5I6N.cjs → chunk-PRFNLQSP.cjs} +4 -4
- package/dist/{chunk-46KXZBOG.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-4353ZRE5.mjs → chunk-SX7EECTS.mjs} +8 -5
- package/dist/{chunk-LDNSSHEG.mjs → chunk-T4TBK5NY.mjs} +2 -2
- package/dist/{chunk-NOTSHVRN.mjs → chunk-T7I62A4C.mjs} +293 -132
- package/dist/{chunk-E36C43IX.cjs → chunk-U4BJKNIR.cjs} +6 -6
- package/dist/{chunk-4CGOMZP3.cjs → chunk-UDJY2ZGY.cjs} +487 -256
- package/dist/{chunk-SHS6KXOZ.mjs → chunk-UR25Z5Z6.mjs} +1 -1
- package/dist/{chunk-TQMI6BYO.cjs → chunk-UYSTTPYJ.cjs} +1262 -936
- package/dist/{chunk-E5DXF5GE.mjs → chunk-UZZ6IEQP.mjs} +3 -3
- package/dist/{chunk-EKJYE4Y7.cjs → chunk-VGG74PSU.cjs} +25 -25
- package/dist/{chunk-GAO7MS5O.mjs → chunk-VPTWKOCY.mjs} +19 -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-JXEPLIXD.cjs → chunk-XTG73QZA.cjs} +183 -39
- package/dist/{chunk-XPMC4E2G.cjs → chunk-XVSBALOY.cjs} +3 -3
- package/dist/{chunk-XYL4HSVC.cjs → chunk-YI6FKTTN.cjs} +38 -7
- package/dist/{chunk-LPDKG6RA.mjs → chunk-YSXTNSXS.mjs} +1 -1
- package/dist/{chunk-EHB77D5U.cjs → chunk-ZDAEHG2O.cjs} +3 -3
- package/dist/{chunk-3TLKUBXG.mjs → chunk-ZFUKPWFC.mjs} +912 -586
- package/dist/{chunk-4TKAIO2F.mjs → chunk-ZMHAFH4R.mjs} +8 -8
- package/dist/{chunk-ZOWNWHK6.cjs → chunk-ZNH6NR3H.cjs} +2 -2
- package/dist/{chunk-PFV2KPDZ.cjs → chunk-ZOYKJBP5.cjs} +3 -3
- package/dist/{chunk-CECUDGXQ.cjs → chunk-ZP32GNJQ.cjs} +13 -13
- package/dist/{chunk-MRNDAJEV.mjs → chunk-ZZ2QKCKW.mjs} +1 -1
- package/dist/{client-plugins.d-DllmH8eM.d.mts → client-plugins.d-CgQQ-EAv.d.mts} +10 -2
- package/dist/{client-plugins.d-n3iWY1EJ.d.ts → client-plugins.d-vXrbcfJ1.d.ts} +10 -2
- 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-DqKaCr1r.d.ts → config.d-DqZkLwef.d.mts} +139 -1
- package/dist/{config.d-DqKaCr1r.d.mts → config.d-DqZkLwef.d.ts} +139 -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-UESYARTF.mjs → devtools-KQZ6SRCJ.mjs} +16 -16
- package/dist/{devtools-TO6TAO32.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 +96 -96
- package/dist/{index.d-BXsAXm1U.d.ts → index.d-DlCELfhf.d.ts} +1 -1
- package/dist/{index.d-BL7KKiwa.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 -139
- 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 +50 -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 +49 -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 +94 -6
- package/dist/internal/config-runtime.d.ts +94 -6
- 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 +37 -101
- package/dist/internal/production-runtime.d.mts +17 -11
- package/dist/internal/production-runtime.d.ts +17 -11
- package/dist/internal/production-runtime.mjs +47 -111
- package/dist/markdown.cjs +5 -5
- package/dist/markdown.d.mts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.mjs +4 -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 +27 -5
- package/dist/mobile.d.ts +27 -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-EBPDFTRW.mjs → native-tree-VWNW2MQ2.mjs} +10 -8
- 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-C76gXTmO.d.mts → navigation-delegate.d-CnOTWOyi.d.mts} +1 -1
- package/dist/{navigation-delegate.d-DIyDslxt.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 +42 -42
- package/dist/plugin.d.mts +4 -4
- package/dist/plugin.d.ts +4 -4
- package/dist/plugin.mjs +41 -41
- package/dist/port-C6GBH4C6.cjs +419 -0
- package/dist/port-WOOQ3V56.mjs +419 -0
- package/dist/{production-runtime.d-CDHztggO.d.mts → production-runtime.d-CP5s6RuY.d.mts} +1 -1
- package/dist/{production-runtime.d-tyaGdbk6.d.ts → production-runtime.d-N-cE3pmy.d.ts} +1 -1
- package/dist/{programmatic-routes-client.d-XfmIrCK1.d.ts → programmatic-routes-client.d-CLG2N1yH.d.ts} +2 -2
- package/dist/{programmatic-routes-client.d-aAWiDd64.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-Dr5WRjoV.d.ts → render-plan.d-B9lAP3uX.d.ts} +1 -1
- package/dist/{render-plan.d-Diwybxo8.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-D01fRn--.d.ts → request.d-BiicaNxb.d.ts} +1 -1
- package/dist/{request.d-Dd3AFR79.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-BQ53lJ_D.d.mts → route-rendering.d-BrIKA51A.d.mts} +1 -1
- package/dist/{route-rendering.d-Bhx4QoJt.d.ts → route-rendering.d-Iss0C7GR.d.ts} +1 -1
- package/dist/{router.d-DQ3k7EYn.d.ts → router.d-DjGn_al7.d.ts} +1 -1
- package/dist/{router.d-Bi23a6Xc.d.mts → router.d-mNTbOGV_.d.mts} +1 -1
- package/dist/{routes.d-C7jMJFvP.d.ts → routes.d-BKSjHuH9.d.ts} +25 -2
- package/dist/{routes.d-BgTd7vI4.d.mts → routes.d-qd8Qf4LG.d.mts} +25 -2
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/{rsc-pipeline-OCZIT5OF.cjs → rsc-pipeline-SVLBTY7H.cjs} +21 -21
- package/dist/{rsc-pipeline-K3ER3Q4N.mjs → rsc-pipeline-WBLBDQXA.mjs} +20 -20
- package/dist/{runtime-DKNSIH7V.cjs → runtime-DGUOWSMF.cjs} +293 -41
- package/dist/{runtime-MKYDEUZT.mjs → runtime-HFZTVNFF.mjs} +283 -31
- package/dist/{runtime.d-B2Js6qZ2.d.mts → runtime.d-BNVbojF1.d.mts} +1 -1
- package/dist/{runtime.d-BL-CGwoi.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 +81 -81
- package/dist/server.d.mts +11 -11
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +64 -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-DqZ6Lfs0.d.ts → spa-router.d-DAtnNoBe.d.ts} +11 -2
- package/dist/{spa-router.d-B2rIFGs0.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-Bv2MPeLR.d.ts → utils.d-DwZ-KLSB.d.ts} +7 -1
- package/dist/{utils.d-fqXe8lNc.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 +42 -42
- package/dist/vite.d.mts +10 -5
- package/dist/vite.d.ts +10 -5
- package/dist/vite.mjs +41 -41
- package/dist/workflows.cjs +3 -3
- package/dist/workflows.mjs +2 -2
- package/package.json +17 -3
- package/dist/agent-mcp-handler-YE4AGWHN.cjs +0 -18
- package/dist/chunk-MIGFX2FN.mjs +0 -758
- package/dist/chunk-P6MHI5O2.cjs +0 -758
- package/dist/native-tree-MMZS7S6W.cjs +0 -25
- 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,251 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return 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; }// src/mobile/native-specs.ts
|
|
2
|
+
var _fs = require('fs');
|
|
3
|
+
var _module = require('module');
|
|
4
|
+
var _path = require('path'); var path = _interopRequireWildcard(_path);
|
|
5
|
+
var UnsupportedType = class extends Error {
|
|
6
|
+
};
|
|
7
|
+
var parsers = /* @__PURE__ */ new Map();
|
|
8
|
+
function loadCodegen(root) {
|
|
9
|
+
const cached = parsers.get(root);
|
|
10
|
+
if (cached) return cached;
|
|
11
|
+
let codegenDir;
|
|
12
|
+
let load;
|
|
13
|
+
try {
|
|
14
|
+
let reactNative;
|
|
15
|
+
for (let dir = root; ; dir = path.dirname(dir)) {
|
|
16
|
+
const candidate = path.join(dir, "node_modules", "react-native", "package.json");
|
|
17
|
+
if (_fs.existsSync.call(void 0, candidate)) {
|
|
18
|
+
reactNative = _fs.realpathSync.call(void 0, candidate);
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
if (path.dirname(dir) === dir) throw new Error(`react-native is not installed in ${root}.`);
|
|
22
|
+
}
|
|
23
|
+
load = _module.createRequire.call(void 0, reactNative);
|
|
24
|
+
codegenDir = path.dirname(load.resolve("@react-native/codegen/package.json"));
|
|
25
|
+
} catch (error) {
|
|
26
|
+
throw Object.assign(
|
|
27
|
+
new Error(
|
|
28
|
+
"Reading a native module spec needs React Native's Codegen (@react-native/codegen, installed with react-native). Add react-native to the app's dependencies and install them."
|
|
29
|
+
),
|
|
30
|
+
{ cause: error }
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
const typescript = load(path.join(codegenDir, "lib/parsers/typescript/parser.js"));
|
|
34
|
+
const flow = load(path.join(codegenDir, "lib/parsers/flow/parser.js"));
|
|
35
|
+
const loaded = { typescript: new typescript.TypeScriptParser(), flow: new flow.FlowParser() };
|
|
36
|
+
parsers.set(root, loaded);
|
|
37
|
+
return loaded;
|
|
38
|
+
}
|
|
39
|
+
function hasFarmNativeCodegen(root) {
|
|
40
|
+
try {
|
|
41
|
+
loadCodegen(root);
|
|
42
|
+
return true;
|
|
43
|
+
} catch (e) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function describe(annotation) {
|
|
48
|
+
switch (annotation.type) {
|
|
49
|
+
case "FunctionTypeAnnotation":
|
|
50
|
+
return "a callback";
|
|
51
|
+
case "MixedTypeAnnotation":
|
|
52
|
+
return "a mixed value";
|
|
53
|
+
case "ReservedTypeAnnotation":
|
|
54
|
+
return String(_nullishCoalesce(annotation.name, () => ( "a reserved type")));
|
|
55
|
+
case "EventEmitterTypeAnnotation":
|
|
56
|
+
return "an event emitter";
|
|
57
|
+
default:
|
|
58
|
+
return annotation.type.replace(/TypeAnnotation$/, "");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function toType(annotation, module, options = {}) {
|
|
62
|
+
switch (annotation.type) {
|
|
63
|
+
case "NullableTypeAnnotation":
|
|
64
|
+
return {
|
|
65
|
+
...toType(annotation.typeAnnotation, module, options),
|
|
66
|
+
nullable: true
|
|
67
|
+
};
|
|
68
|
+
case "StringTypeAnnotation":
|
|
69
|
+
return { type: "string" };
|
|
70
|
+
case "NumberTypeAnnotation":
|
|
71
|
+
case "DoubleTypeAnnotation":
|
|
72
|
+
case "FloatTypeAnnotation":
|
|
73
|
+
return { type: "number" };
|
|
74
|
+
case "Int32TypeAnnotation":
|
|
75
|
+
return { type: "number", integer: true };
|
|
76
|
+
case "BooleanTypeAnnotation":
|
|
77
|
+
return { type: "boolean" };
|
|
78
|
+
case "StringLiteralTypeAnnotation":
|
|
79
|
+
case "NumberLiteralTypeAnnotation":
|
|
80
|
+
return { type: "literal", values: [annotation.value] };
|
|
81
|
+
case "UnionTypeAnnotation":
|
|
82
|
+
case "StringLiteralUnionTypeAnnotation": {
|
|
83
|
+
const types = _nullishCoalesce(annotation.types, () => ( []));
|
|
84
|
+
const values = types.map((member) => member.value);
|
|
85
|
+
if (types.length > 0 && types.every(
|
|
86
|
+
(member) => member.type === "StringLiteralTypeAnnotation" || member.type === "NumberLiteralTypeAnnotation"
|
|
87
|
+
) && (values.every((value) => typeof value === "string") || values.every((value) => typeof value === "number"))) {
|
|
88
|
+
return { type: "literal", values };
|
|
89
|
+
}
|
|
90
|
+
throw new UnsupportedType("a union that is not all string or all number literals");
|
|
91
|
+
}
|
|
92
|
+
case "EnumDeclaration": {
|
|
93
|
+
const members = _nullishCoalesce(_optionalChain([module, 'access', _ => _.enumMap, 'optionalAccess', _2 => _2[String(annotation.name)], 'optionalAccess', _3 => _3.members]), () => ( []));
|
|
94
|
+
const values = members.map((member) => _optionalChain([member, 'access', _4 => _4.value, 'optionalAccess', _5 => _5.value]));
|
|
95
|
+
if (values.length > 0 && (values.every((value) => typeof value === "string") || values.every((value) => typeof value === "number"))) {
|
|
96
|
+
return { type: "literal", values };
|
|
97
|
+
}
|
|
98
|
+
throw new UnsupportedType(`the enum ${String(annotation.name)}`);
|
|
99
|
+
}
|
|
100
|
+
case "ObjectTypeAnnotation": {
|
|
101
|
+
const properties = _nullishCoalesce(annotation.properties, () => ( []));
|
|
102
|
+
return {
|
|
103
|
+
type: "object",
|
|
104
|
+
properties: properties.map((property) => ({
|
|
105
|
+
name: property.name,
|
|
106
|
+
optional: property.optional === true,
|
|
107
|
+
type: toType(property.typeAnnotation, module, options)
|
|
108
|
+
}))
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
case "TypeAliasTypeAnnotation": {
|
|
112
|
+
const alias = _optionalChain([module, 'access', _6 => _6.aliasMap, 'optionalAccess', _7 => _7[String(annotation.name)]]);
|
|
113
|
+
if (!alias) throw new UnsupportedType(`the unknown type ${String(annotation.name)}`);
|
|
114
|
+
return toType(alias, module, options);
|
|
115
|
+
}
|
|
116
|
+
case "GenericObjectTypeAnnotation":
|
|
117
|
+
return { type: "map" };
|
|
118
|
+
case "ArrayTypeAnnotation": {
|
|
119
|
+
const element = annotation.elementType;
|
|
120
|
+
if (!element || element.type === "AnyTypeAnnotation") return { type: "array" };
|
|
121
|
+
return { type: "array", element: toType(element, module, options) };
|
|
122
|
+
}
|
|
123
|
+
case "VoidTypeAnnotation":
|
|
124
|
+
if (options.returns) return { type: "void" };
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
if (options.returns) return { type: "unknown" };
|
|
128
|
+
throw new UnsupportedType(describe(annotation));
|
|
129
|
+
}
|
|
130
|
+
function readFarmNativeWebSpec(options) {
|
|
131
|
+
const codegen = loadCodegen(options.root);
|
|
132
|
+
const parser = /\.tsx?$/.test(options.file) ? codegen.typescript : codegen.flow;
|
|
133
|
+
let schema;
|
|
134
|
+
try {
|
|
135
|
+
schema = parser.parseFile(options.file);
|
|
136
|
+
} catch (error) {
|
|
137
|
+
const shown = path.relative(options.root, options.file).split(path.sep).join("/");
|
|
138
|
+
throw Object.assign(
|
|
139
|
+
new Error(`React Native's Codegen rejected ${shown}: ${error.message}`),
|
|
140
|
+
{ cause: error }
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
const module = Object.values(schema.modules).find((entry) => entry.type === "NativeModule");
|
|
144
|
+
const result = { methods: [], unsupported: [] };
|
|
145
|
+
for (const method of _nullishCoalesce(_optionalChain([module, 'optionalAccess', _8 => _8.spec, 'optionalAccess', _9 => _9.methods]), () => ( []))) {
|
|
146
|
+
let fn = method.typeAnnotation;
|
|
147
|
+
if (fn.type === "NullableTypeAnnotation") fn = fn.typeAnnotation;
|
|
148
|
+
if (fn.type !== "FunctionTypeAnnotation") continue;
|
|
149
|
+
const returned = fn.returnTypeAnnotation;
|
|
150
|
+
if (_optionalChain([returned, 'optionalAccess', _10 => _10.type]) !== "PromiseTypeAnnotation") continue;
|
|
151
|
+
const params = _nullishCoalesce(fn.params, () => ( []));
|
|
152
|
+
try {
|
|
153
|
+
result.methods.push({
|
|
154
|
+
name: method.name,
|
|
155
|
+
params: params.map((param) => {
|
|
156
|
+
try {
|
|
157
|
+
return {
|
|
158
|
+
name: param.name,
|
|
159
|
+
optional: param.optional === true,
|
|
160
|
+
type: toType(param.typeAnnotation, module)
|
|
161
|
+
};
|
|
162
|
+
} catch (error) {
|
|
163
|
+
if (!(error instanceof UnsupportedType)) throw error;
|
|
164
|
+
throw new UnsupportedType(
|
|
165
|
+
`its parameter ${param.name} is ${error.message}, which a web screen cannot send`
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
}),
|
|
169
|
+
returns: toType(
|
|
170
|
+
_nullishCoalesce(returned.elementType, () => ( { type: "VoidTypeAnnotation" })),
|
|
171
|
+
module,
|
|
172
|
+
{ returns: true }
|
|
173
|
+
)
|
|
174
|
+
});
|
|
175
|
+
} catch (error) {
|
|
176
|
+
if (!(error instanceof UnsupportedType)) throw error;
|
|
177
|
+
result.unsupported.push({ method: method.name, reason: error.message });
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return result;
|
|
181
|
+
}
|
|
182
|
+
var IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
|
|
183
|
+
function renderFarmNativeType(type) {
|
|
184
|
+
let rendered;
|
|
185
|
+
switch (type.type) {
|
|
186
|
+
case "string":
|
|
187
|
+
case "number":
|
|
188
|
+
case "boolean":
|
|
189
|
+
case "void":
|
|
190
|
+
case "unknown":
|
|
191
|
+
rendered = type.type;
|
|
192
|
+
break;
|
|
193
|
+
case "literal":
|
|
194
|
+
rendered = type.values.map((value) => JSON.stringify(value)).join(" | ");
|
|
195
|
+
break;
|
|
196
|
+
case "map":
|
|
197
|
+
rendered = "Record<string, unknown>";
|
|
198
|
+
break;
|
|
199
|
+
case "array": {
|
|
200
|
+
const element = type.element ? renderFarmNativeType(type.element) : "unknown";
|
|
201
|
+
rendered = `Array<${element}>`;
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
case "object":
|
|
205
|
+
rendered = type.properties.length ? `{ ${type.properties.map(
|
|
206
|
+
(property) => `${IDENTIFIER.test(property.name) ? property.name : JSON.stringify(property.name)}${property.optional ? "?" : ""}: ${renderFarmNativeType(property.type)}`
|
|
207
|
+
).join("; ")} }` : "{}";
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
return type.nullable ? `${rendered} | null` : rendered;
|
|
211
|
+
}
|
|
212
|
+
function renderFarmNativeMethod(method) {
|
|
213
|
+
const lastRequired = method.params.reduce(
|
|
214
|
+
(last, param, index) => param.optional ? last : index,
|
|
215
|
+
-1
|
|
216
|
+
);
|
|
217
|
+
const params = method.params.map((param, index) => {
|
|
218
|
+
const type = renderFarmNativeType(param.type);
|
|
219
|
+
if (!param.optional) return `${param.name}: ${type}`;
|
|
220
|
+
return index > lastRequired ? `${param.name}?: ${type}` : `${param.name}: ${type} | undefined`;
|
|
221
|
+
}).join(", ");
|
|
222
|
+
return `${method.name}(${params}): Promise<${renderFarmNativeType(method.returns)}>;`;
|
|
223
|
+
}
|
|
224
|
+
function createFarmNativeModuleTypeDeclarations(specs, options) {
|
|
225
|
+
if (specs.length === 0 || !hasFarmNativeCodegen(options.root)) return void 0;
|
|
226
|
+
const modules = specs.map((spec) => {
|
|
227
|
+
const { methods } = readFarmNativeWebSpec({ root: options.root, file: spec.file });
|
|
228
|
+
const body = methods.filter((method) => method.name !== "available").map((method) => ` ${renderFarmNativeMethod(method)}`).join("\n");
|
|
229
|
+
return ` ${spec.name}: {${body ? `
|
|
230
|
+
${body}
|
|
231
|
+
` : ""}};`;
|
|
232
|
+
});
|
|
233
|
+
return `/**
|
|
234
|
+
* Auto-generated from the Codegen specs in src/native: native.<module> from @farm.js/core/native.
|
|
235
|
+
* Web screens reach a module's Promise methods only when mobile.modules.<name>.web is true, and
|
|
236
|
+
* only inside the Android shell; check native.<module>.available() first.
|
|
237
|
+
*/
|
|
238
|
+
declare module "@farm.js/core/native" {
|
|
239
|
+
interface FarmNativeModules {
|
|
240
|
+
${modules.join("\n")}
|
|
241
|
+
}
|
|
242
|
+
}`;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
exports.hasFarmNativeCodegen = hasFarmNativeCodegen; exports.readFarmNativeWebSpec = readFarmNativeWebSpec; exports.renderFarmNativeType = renderFarmNativeType; exports.renderFarmNativeMethod = renderFarmNativeMethod; exports.createFarmNativeModuleTypeDeclarations = createFarmNativeModuleTypeDeclarations;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return 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
|
+
var _chunkRAWWCDCTcjs = require('./chunk-RAWWCDCT.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkA25FXJ7Dcjs = require('./chunk-A25FXJ7D.cjs');
|
|
8
|
+
|
|
9
|
+
// src/mobile/shell-response.ts
|
|
10
|
+
var FARM_SHELL_HEADER = "X-Farm-Shell";
|
|
11
|
+
function isFarmMobileShellRequest(request) {
|
|
12
|
+
const value = request.headers.get(FARM_SHELL_HEADER);
|
|
13
|
+
return value !== null && /^[a-z][a-z0-9-]{0,31}$/.test(value);
|
|
14
|
+
}
|
|
15
|
+
function isHtml(response) {
|
|
16
|
+
return _optionalChain([response, 'access', _ => _.headers, 'access', _2 => _2.get, 'call', _3 => _3("content-type"), 'optionalAccess', _4 => _4.toLowerCase, 'call', _5 => _5(), 'access', _6 => _6.includes, 'call', _7 => _7("text/html")]) === true;
|
|
17
|
+
}
|
|
18
|
+
function appendVary(headers, name) {
|
|
19
|
+
const current = headers.get("Vary");
|
|
20
|
+
if (!current) {
|
|
21
|
+
headers.set("Vary", name);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const names = current.split(",").map((value) => value.trim().toLowerCase());
|
|
25
|
+
if (names.includes("*") || names.includes(name.toLowerCase())) return;
|
|
26
|
+
headers.set("Vary", `${current}, ${name}`);
|
|
27
|
+
}
|
|
28
|
+
function escapeRegExp(value) {
|
|
29
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
30
|
+
}
|
|
31
|
+
var MAX_HELD_TAG = 4096;
|
|
32
|
+
function createFarmMobileShellRewriter(client) {
|
|
33
|
+
const entry = new RegExp(`(["'])${escapeRegExp(client.webEntry)}\\1`, "g");
|
|
34
|
+
const webOnly = new Set(client.webOnly);
|
|
35
|
+
const preload = /<link rel="modulepreload" href="\/([^"]+)"[^>]*>/g;
|
|
36
|
+
let held = "";
|
|
37
|
+
return (text, final = false) => {
|
|
38
|
+
let input = held + text;
|
|
39
|
+
held = "";
|
|
40
|
+
if (!final) {
|
|
41
|
+
const open = input.lastIndexOf("<");
|
|
42
|
+
if (open !== -1 && input.indexOf(">", open) === -1 && input.length - open <= MAX_HELD_TAG) {
|
|
43
|
+
held = input.slice(open);
|
|
44
|
+
input = input.slice(0, open);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return input.replace(entry, (_match, quote) => `${quote}${client.entry}${quote}`).replace(preload, (tag, file) => webOnly.has(file) ? "" : tag);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function _applyFarmMobileShellClient(request, response, client, onPrivate) {
|
|
51
|
+
if (!client || !isHtml(response)) return response;
|
|
52
|
+
if (!isFarmMobileShellRequest(request) || !response.body) {
|
|
53
|
+
return _chunkA25FXJ7Dcjs._withFarmResponseHeaders.call(void 0, response, (headers2) => appendVary(headers2, FARM_SHELL_HEADER));
|
|
54
|
+
}
|
|
55
|
+
_optionalChain([onPrivate, 'optionalCall', _8 => _8()]);
|
|
56
|
+
const headers = new Headers(_chunkRAWWCDCTcjs._withFarmGuardedResponseCache.call(void 0, response).headers);
|
|
57
|
+
appendVary(headers, FARM_SHELL_HEADER);
|
|
58
|
+
headers.delete("content-length");
|
|
59
|
+
headers.delete("etag");
|
|
60
|
+
const rewrite = createFarmMobileShellRewriter(client);
|
|
61
|
+
const decoder = new TextDecoder();
|
|
62
|
+
const encoder = new TextEncoder();
|
|
63
|
+
const body = response.body.pipeThrough(
|
|
64
|
+
new TransformStream({
|
|
65
|
+
transform(chunk, controller) {
|
|
66
|
+
const output = rewrite(decoder.decode(chunk, { stream: true }));
|
|
67
|
+
if (output) controller.enqueue(encoder.encode(output));
|
|
68
|
+
},
|
|
69
|
+
flush(controller) {
|
|
70
|
+
const output = rewrite(decoder.decode(), true);
|
|
71
|
+
if (output) controller.enqueue(encoder.encode(output));
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
return _chunkA25FXJ7Dcjs._markFarmOwnedResponse.call(void 0,
|
|
76
|
+
new Response(body, { status: response.status, statusText: response.statusText, headers })
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// src/mobile/shell-render.ts
|
|
81
|
+
var FARM_SHELL_RENDER_HEADER = "X-Farm-Shell-Render";
|
|
82
|
+
var FARM_SHELL_ROUTE_HEADER = "X-Farm-Shell-Route";
|
|
83
|
+
var FARM_SHELL_PARAM_SEGMENT = "__farm_shell__";
|
|
84
|
+
function constantTimeEqual(left, right) {
|
|
85
|
+
if (left.length !== right.length) return false;
|
|
86
|
+
let difference = 0;
|
|
87
|
+
for (let index = 0; index < left.length; index += 1) {
|
|
88
|
+
difference |= left.charCodeAt(index) ^ right.charCodeAt(index);
|
|
89
|
+
}
|
|
90
|
+
return difference === 0;
|
|
91
|
+
}
|
|
92
|
+
function _isFarmMobileShellRenderRequest(request, token) {
|
|
93
|
+
const value = request.headers.get(FARM_SHELL_RENDER_HEADER);
|
|
94
|
+
return token.length > 0 && value !== null && constantTimeEqual(value, token);
|
|
95
|
+
}
|
|
96
|
+
function stripRouteGroups(pattern) {
|
|
97
|
+
const segments = pattern.split("/").filter((segment) => segment && !(segment.startsWith("(") && segment.endsWith(")")));
|
|
98
|
+
return segments.length === 0 ? "/" : `/${segments.join("/")}`;
|
|
99
|
+
}
|
|
100
|
+
function isDynamicPattern(pattern) {
|
|
101
|
+
return pattern.split("/").some((segment) => segment.startsWith("["));
|
|
102
|
+
}
|
|
103
|
+
function _checkFarmMobileShellRoute(check) {
|
|
104
|
+
const route = stripRouteGroups(check.route);
|
|
105
|
+
if (check.requested === null || stripRouteGroups(check.requested) !== route) {
|
|
106
|
+
return `the request matched ${route}, not ${_nullishCoalesce(check.requested, () => ( "a requested route"))}`;
|
|
107
|
+
}
|
|
108
|
+
if (check.loading === null) return "it has no loading file";
|
|
109
|
+
if (isDynamicPattern(check.loading)) {
|
|
110
|
+
return `its loading file is in a dynamic folder (${stripRouteGroups(check.loading)})`;
|
|
111
|
+
}
|
|
112
|
+
const layout = check.layouts.find(isDynamicPattern);
|
|
113
|
+
if (layout !== void 0) {
|
|
114
|
+
return `a layout is in a dynamic folder (${stripRouteGroups(layout)})`;
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
function createFarmMobileShellRenderPath(route) {
|
|
119
|
+
const segments = [];
|
|
120
|
+
for (const segment of route.split("/")) {
|
|
121
|
+
if (!segment || segment.startsWith("(") && segment.endsWith(")")) continue;
|
|
122
|
+
if (segment.startsWith("[[...") && segment.endsWith("]]")) continue;
|
|
123
|
+
segments.push(segment.startsWith("[") ? FARM_SHELL_PARAM_SEGMENT : segment);
|
|
124
|
+
}
|
|
125
|
+
return `/${segments.join("/")}`;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
exports.FARM_SHELL_HEADER = FARM_SHELL_HEADER; exports._applyFarmMobileShellClient = _applyFarmMobileShellClient; exports.FARM_SHELL_RENDER_HEADER = FARM_SHELL_RENDER_HEADER; exports.FARM_SHELL_ROUTE_HEADER = FARM_SHELL_ROUTE_HEADER; exports.FARM_SHELL_PARAM_SEGMENT = FARM_SHELL_PARAM_SEGMENT; exports._isFarmMobileShellRenderRequest = _isFarmMobileShellRenderRequest; exports._checkFarmMobileShellRoute = _checkFarmMobileShellRoute; exports.createFarmMobileShellRenderPath = createFarmMobileShellRenderPath;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return 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
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkDPJ66FSIcjs = require('./chunk-DPJ66FSI.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkLT4VAF5Zcjs = require('./chunk-LT4VAF5Z.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
|
|
@@ -75,7 +75,7 @@ function resolveFarmInfraAnalytics(env = processEnv()) {
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
function classifyFarmInfraAgent(userAgent) {
|
|
78
|
-
return
|
|
78
|
+
return _chunkLT4VAF5Zcjs.classifyFarmAgent.call(void 0, userAgent);
|
|
79
79
|
}
|
|
80
80
|
function routeTemplate(pattern) {
|
|
81
81
|
return typeof pattern === "string" && pattern.length <= 256 && /^\/(?!\/)[a-zA-Z0-9_./:[\]()*-]*$/.test(pattern) ? pattern : "/[unmatched]";
|
|
@@ -273,7 +273,7 @@ function requestEvent(metadata, method, status, durationMs) {
|
|
|
273
273
|
id: uuid(),
|
|
274
274
|
requestId: metadata.id,
|
|
275
275
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
276
|
-
route: routeTemplate(
|
|
276
|
+
route: routeTemplate(_chunkDPJ66FSIcjs.getFarmRouteLabel.call(void 0, metadata.route)),
|
|
277
277
|
agent: metadata.agent,
|
|
278
278
|
kind: "request",
|
|
279
279
|
method,
|
|
@@ -286,7 +286,7 @@ function toolEvent(metadata, event) {
|
|
|
286
286
|
id: uuid(),
|
|
287
287
|
requestId: metadata.id,
|
|
288
288
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
289
|
-
route: routeTemplate(
|
|
289
|
+
route: routeTemplate(_chunkDPJ66FSIcjs.getFarmRouteLabel.call(void 0, metadata.route)),
|
|
290
290
|
agent: metadata.agent,
|
|
291
291
|
kind: "mcp.tool",
|
|
292
292
|
tool: event.tool,
|
|
@@ -18,7 +18,7 @@ var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
|
|
|
18
18
|
var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkLT4VAF5Zcjs = require('./chunk-LT4VAF5Z.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
var _chunkLIFUPCXWcjs = require('./chunk-LIFUPCXW.cjs');
|
|
@@ -1179,11 +1179,11 @@ function shouldReturnMarkdown(request) {
|
|
|
1179
1179
|
if (url.pathname.endsWith(".md")) return true;
|
|
1180
1180
|
const accept = request.headers.get("accept");
|
|
1181
1181
|
const markdown = Math.max(
|
|
1182
|
-
|
|
1183
|
-
|
|
1182
|
+
_chunkLT4VAF5Zcjs.farmAcceptQuality.call(void 0, accept, "text/markdown"),
|
|
1183
|
+
_chunkLT4VAF5Zcjs.farmAcceptQuality.call(void 0, accept, "text/plain")
|
|
1184
1184
|
);
|
|
1185
1185
|
if (markdown <= 0) return false;
|
|
1186
|
-
return markdown >=
|
|
1186
|
+
return markdown >= _chunkLT4VAF5Zcjs.farmAcceptQuality.call(void 0, accept, "text/html", { wildcards: true });
|
|
1187
1187
|
}
|
|
1188
1188
|
function escapeAttribute(value) {
|
|
1189
1189
|
return escapeHtml(value).replace(/'/g, "'");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkQAS7KE7Jcjs = require('./chunk-QAS7KE7J.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
@@ -36,10 +36,10 @@ async function handleFarmDefaultMCPRequest(request, context) {
|
|
|
36
36
|
return transportError(403, "Cross-origin requests are not allowed.");
|
|
37
37
|
}
|
|
38
38
|
const protocolHeader = request.headers.get("mcp-protocol-version");
|
|
39
|
-
if (protocolHeader && !
|
|
39
|
+
if (protocolHeader && !_chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.includes(protocolHeader.trim())) {
|
|
40
40
|
return transportError(
|
|
41
41
|
400,
|
|
42
|
-
`Unsupported MCP-Protocol-Version: ${protocolHeader.slice(0, 32)}. Supported: ${
|
|
42
|
+
`Unsupported MCP-Protocol-Version: ${protocolHeader.slice(0, 32)}. Supported: ${_chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.join(", ")}.`
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
const contentType = _nullishCoalesce(request.headers.get("content-type"), () => ( ""));
|
|
@@ -95,7 +95,7 @@ async function dispatch(method, params, request, context) {
|
|
|
95
95
|
switch (method) {
|
|
96
96
|
case "initialize": {
|
|
97
97
|
const requested = isRecord(params) ? params.protocolVersion : void 0;
|
|
98
|
-
const protocolVersion = typeof requested === "string" &&
|
|
98
|
+
const protocolVersion = typeof requested === "string" && _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.includes(requested) ? requested : _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS[0];
|
|
99
99
|
return {
|
|
100
100
|
protocolVersion,
|
|
101
101
|
capabilities: { tools: { listChanged: false } },
|
|
@@ -103,7 +103,7 @@ async function dispatch(method, params, request, context) {
|
|
|
103
103
|
name: context.server.name,
|
|
104
104
|
version: context.server.version,
|
|
105
105
|
...context.server.title ? { title: context.server.title } : {},
|
|
106
|
-
description:
|
|
106
|
+
description: _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_DESCRIPTION
|
|
107
107
|
},
|
|
108
108
|
instructions: INSTRUCTIONS
|
|
109
109
|
};
|
|
@@ -111,7 +111,7 @@ async function dispatch(method, params, request, context) {
|
|
|
111
111
|
case "ping":
|
|
112
112
|
return {};
|
|
113
113
|
case "tools/list":
|
|
114
|
-
return { tools:
|
|
114
|
+
return { tools: _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_TOOLS };
|
|
115
115
|
case "tools/call":
|
|
116
116
|
return callTool(params, request, context);
|
|
117
117
|
default:
|
|
@@ -122,7 +122,7 @@ async function callTool(params, request, context) {
|
|
|
122
122
|
if (!isRecord(params) || typeof params.name !== "string") {
|
|
123
123
|
throw new FarmMCPRequestError(INVALID_PARAMS, "tools/call needs a tool name.");
|
|
124
124
|
}
|
|
125
|
-
const tool =
|
|
125
|
+
const tool = _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_TOOLS.find(({ name }) => name === params.name);
|
|
126
126
|
if (!tool) {
|
|
127
127
|
throw new FarmMCPRequestError(INVALID_PARAMS, `Unknown tool: ${params.name.slice(0, 64)}`);
|
|
128
128
|
}
|