@xano/sdk 1.0.19 → 1.0.20

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.
Files changed (234) hide show
  1. package/README.md +5 -2
  2. package/dist/.build-fingerprint +1 -1
  3. package/dist/{agent-file-refresh-5IP25UYO.js → agent-file-refresh-MOEDX5OL.js} +13 -11
  4. package/dist/{agent-skill-command-BPM4S6C7.js → agent-skill-command-A4QEVNTP.js} +49 -47
  5. package/dist/ai-models-command-SN2UKVC5.js +270 -0
  6. package/dist/{answer-shape-ZRQS7ZC4.js → answer-shape-BCGPH73R.js} +5 -5
  7. package/dist/{backend-dir-RLILKCMR.js → backend-dir-66VVLCUF.js} +16 -14
  8. package/dist/{backend-slot-7BATLL3X.js → backend-slot-WSWAHL2W.js} +3 -3
  9. package/dist/bin.js +53 -51
  10. package/dist/{branch-SJKKUCMZ.js → branch-6DBHVVUT.js} +11 -11
  11. package/dist/{branch-commands-5HKCBRLN.js → branch-commands-KUEGS6XL.js} +29 -28
  12. package/dist/bundle.js +3 -3
  13. package/dist/{chunk-2HBJU76D.js → chunk-2SWJ3267.js} +40 -22
  14. package/dist/{chunk-UJ5HLRYH.js → chunk-2VHEZDZZ.js} +35 -35
  15. package/dist/{chunk-BT6CJNEO.js → chunk-34OZQNKR.js} +4 -4
  16. package/dist/chunk-37BT62SX.js +17 -0
  17. package/dist/{chunk-QK2WIASY.js → chunk-3H765RXT.js} +7 -7
  18. package/dist/{chunk-2IC3K22K.js → chunk-3HK7VELD.js} +2 -2
  19. package/dist/{chunk-5AHHO2QA.js → chunk-3OR2RCXJ.js} +118 -94
  20. package/dist/{chunk-ZYZ7GRX3.js → chunk-4DVP42ZC.js} +2 -2
  21. package/dist/{chunk-Q45RTKWW.js → chunk-4GI22VPJ.js} +6 -6
  22. package/dist/{chunk-2NUOFHPX.js → chunk-4PHCBKJI.js} +7 -7
  23. package/dist/{chunk-ROWYW3JF.js → chunk-4QRDNBPY.js} +2 -2
  24. package/dist/{chunk-SINL5WMI.js → chunk-4Y3SWNPE.js} +2 -2
  25. package/dist/{chunk-6SEPZQYB.js → chunk-4ZV4MDKP.js} +2 -2
  26. package/dist/{chunk-XKHQLKUL.js → chunk-52VELHIH.js} +3 -3
  27. package/dist/{chunk-IFHFJR5O.js → chunk-5ABAIJVV.js} +6 -6
  28. package/dist/{chunk-L4L6YITX.js → chunk-5BLBX2Q5.js} +13 -10
  29. package/dist/chunk-5KSVMHFS.js +81 -0
  30. package/dist/{chunk-MOVRSULZ.js → chunk-5Z4WQQHC.js} +2 -2
  31. package/dist/{chunk-ZHFSIQ6E.js → chunk-6534P3VH.js} +25 -2
  32. package/dist/{chunk-Q6AKSLD2.js → chunk-6L32HAIP.js} +2 -2
  33. package/dist/chunk-6SXKKDGF.js +9 -0
  34. package/dist/{chunk-OTQF4B37.js → chunk-6TAYTKFM.js} +4 -4
  35. package/dist/{chunk-7UQZ7C4W.js → chunk-745NOWB7.js} +6 -6
  36. package/dist/{chunk-XAE4NIZ2.js → chunk-7J7YRAZB.js} +4 -4
  37. package/dist/{chunk-E34VGSCI.js → chunk-7LLVSTXY.js} +9 -1
  38. package/dist/{chunk-YT5UN2F4.js → chunk-7Z43XRBL.js} +14 -14
  39. package/dist/{chunk-E7VF2JVJ.js → chunk-AD7YILOU.js} +10 -10
  40. package/dist/{chunk-AICWDCLJ.js → chunk-BBFHZMQA.js} +2 -2
  41. package/dist/{chunk-YP4QTC4F.js → chunk-BFM2P47R.js} +6 -6
  42. package/dist/{chunk-KG3RDXN5.js → chunk-C6ERQFEB.js} +4 -4
  43. package/dist/{chunk-54CJ74BH.js → chunk-C7KO5KKB.js} +4 -4
  44. package/dist/chunk-CBACTYIC.js +278 -0
  45. package/dist/{chunk-V2MIBJZU.js → chunk-CGLYG2VF.js} +2 -2
  46. package/dist/{chunk-Z73I7Q2H.js → chunk-CJ5WRCVE.js} +80 -2
  47. package/dist/{chunk-GTB7JL3M.js → chunk-CJIXD67B.js} +6 -6
  48. package/dist/{chunk-JUCL5MUZ.js → chunk-CP7OSHLK.js} +8 -8
  49. package/dist/{chunk-D4N72H35.js → chunk-CPR2F3WN.js} +9 -9
  50. package/dist/{chunk-WGKKDGSA.js → chunk-DAXFWXSV.js} +8 -8
  51. package/dist/{chunk-MSYMEP7Y.js → chunk-DJ7JH4UE.js} +7 -7
  52. package/dist/{chunk-XDGLYIB2.js → chunk-DORGB2Y2.js} +2 -2
  53. package/dist/{chunk-5JUWB6XL.js → chunk-E7YXNU57.js} +7 -7
  54. package/dist/{chunk-GA6HTO3O.js → chunk-EBSJUSID.js} +2 -2
  55. package/dist/{chunk-PLOBHRGV.js → chunk-EJXJE2H3.js} +49 -49
  56. package/dist/{chunk-O2BLNQEC.js → chunk-EME5G4YP.js} +2 -2
  57. package/dist/{chunk-RVWWNNZQ.js → chunk-EOWNLLLV.js} +4 -4
  58. package/dist/{chunk-QIT2GGNB.js → chunk-EPD5J3WA.js} +2 -2
  59. package/dist/{chunk-554FJWNH.js → chunk-EQ2KB5YF.js} +4 -4
  60. package/dist/{chunk-GT7PZCTK.js → chunk-FVBJKM6N.js} +3 -3
  61. package/dist/{chunk-F3IA3YWI.js → chunk-FVZ5C3PF.js} +22 -2
  62. package/dist/{chunk-KVF7YQ2W.js → chunk-G3ZUGFIS.js} +9 -9
  63. package/dist/{chunk-RKTVXFBV.js → chunk-GUHJV7C5.js} +31 -3
  64. package/dist/{chunk-ASUDP4OS.js → chunk-HGUQIBYY.js} +8 -8
  65. package/dist/{chunk-DO5VZIY4.js → chunk-HUXMRYUX.js} +3 -3
  66. package/dist/{chunk-G2XSDIYS.js → chunk-I52AKG2O.js} +4 -4
  67. package/dist/{chunk-VCFRALU7.js → chunk-I5YD7QPI.js} +28 -11
  68. package/dist/{chunk-YYBBJPCL.js → chunk-IUBGFCJJ.js} +14 -18
  69. package/dist/{chunk-UH5VQGNR.js → chunk-JXX2QXPP.js} +2 -2
  70. package/dist/{chunk-2DUYJR5N.js → chunk-KHX6VQ4M.js} +2 -2
  71. package/dist/{chunk-NYIFU3BR.js → chunk-KMXXOJL2.js} +21 -19
  72. package/dist/{chunk-4HMF5TRB.js → chunk-KNLPGIRY.js} +8 -8
  73. package/dist/{chunk-KYQRIL4V.js → chunk-LLG33KGY.js} +26 -26
  74. package/dist/{chunk-WGGATSIP.js → chunk-LMX4VE4H.js} +2 -2
  75. package/dist/{chunk-DXUICABI.js → chunk-LZDH5COS.js} +21 -2
  76. package/dist/{chunk-E5M5P23K.js → chunk-M5GXZEX7.js} +21 -215
  77. package/dist/{chunk-B6ZHSM2D.js → chunk-MAAQ4ZSN.js} +73 -73
  78. package/dist/{chunk-Q4LJCCH5.js → chunk-MGC5S6OE.js} +75 -9
  79. package/dist/{chunk-5Y5HWQ2P.js → chunk-MKRREVNB.js} +4 -4
  80. package/dist/{chunk-OTYK2V44.js → chunk-OAWBNCME.js} +24 -24
  81. package/dist/{chunk-64UVVLDT.js → chunk-OG6WYZNA.js} +7 -7
  82. package/dist/{chunk-AJBOGO5U.js → chunk-OQMXCNN7.js} +59 -31
  83. package/dist/{chunk-EPB6FAR5.js → chunk-OSMPI45P.js} +3 -3
  84. package/dist/{chunk-3X4B5GWY.js → chunk-P3WIMLG2.js} +3 -3
  85. package/dist/{chunk-GJZMKMWO.js → chunk-PC7XEO7F.js} +2 -2
  86. package/dist/{chunk-MF4W6FHU.js → chunk-Q4R2ABFL.js} +1 -1
  87. package/dist/{chunk-LRN6QX44.js → chunk-QBSSSKIC.js} +3 -3
  88. package/dist/{chunk-NH5Z2NOD.js → chunk-QZ2PC6B7.js} +3 -3
  89. package/dist/{chunk-LCOCRJ4K.js → chunk-RQGSZ7AR.js} +16 -2
  90. package/dist/{chunk-3FNEHRJF.js → chunk-RSWPVU6X.js} +8 -8
  91. package/dist/chunk-RVBDZMCC.js +264 -0
  92. package/dist/{chunk-WLZSKD7E.js → chunk-SQVETROU.js} +3 -3
  93. package/dist/{chunk-AJPICYPW.js → chunk-SWQA6SZI.js} +113 -94
  94. package/dist/{chunk-QETVFGD7.js → chunk-T6GI2AFJ.js} +16 -16
  95. package/dist/{chunk-FRJB3NTE.js → chunk-T6KQYCAU.js} +3 -3
  96. package/dist/{chunk-YYDM4DNP.js → chunk-TDSRZDQP.js} +2 -2
  97. package/dist/{chunk-K23RUXSH.js → chunk-TEZKQQDT.js} +44 -16
  98. package/dist/{chunk-BCN6OZLF.js → chunk-TN7ZBZRW.js} +3 -3
  99. package/dist/{chunk-WDWIXCGB.js → chunk-UN73LNM5.js} +4 -4
  100. package/dist/{chunk-RKNCISPM.js → chunk-VEA6EXJL.js} +3 -3
  101. package/dist/{chunk-6FCAFWD5.js → chunk-VO62TKK5.js} +3 -77
  102. package/dist/{chunk-HM5X73PY.js → chunk-WK5QDV25.js} +2 -2
  103. package/dist/{chunk-JORPZKBE.js → chunk-X3LYWTZ5.js} +3 -3
  104. package/dist/{chunk-CO7US54H.js → chunk-X7IBJLAD.js} +2 -2
  105. package/dist/{chunk-PKBC7G5H.js → chunk-XDIPEWLU.js} +25 -1
  106. package/dist/{chunk-OJ6YGRPV.js → chunk-YAZEB255.js} +3 -3
  107. package/dist/{chunk-RGPHFHJU.js → chunk-YFVD3LNL.js} +2 -2
  108. package/dist/{chunk-HUGNB6UN.js → chunk-YRLSJBSY.js} +71 -49
  109. package/dist/{chunk-35SI4GBM.js → chunk-YSSAJQH4.js} +3 -3
  110. package/dist/{chunk-UQNDODRU.js → chunk-Z7IINILG.js} +5 -5
  111. package/dist/{chunk-PRSNMSVG.js → chunk-ZCXWOGFL.js} +3 -3
  112. package/dist/cli.d.ts +10 -1
  113. package/dist/cli.js +48 -46
  114. package/dist/{codegen-command-OF3TPC66.js → codegen-command-GGGU6YAP.js} +68 -66
  115. package/dist/{commands-Z2QZOORB.js → commands-EN4RLPOP.js} +2 -2
  116. package/dist/{completion-LFXXNQGR.js → completion-KH45QD3E.js} +2 -2
  117. package/dist/{config-7GGINOFY.js → config-AKHBFTKA.js} +8 -8
  118. package/dist/{deploy-command-MGYR2TKC.js → deploy-command-WOHYD22D.js} +55 -53
  119. package/dist/{deploy-source-UHCHCI5Z.js → deploy-source-QK7Y4Y3V.js} +34 -33
  120. package/dist/{dev-env-sync-XWZVXEI2.js → dev-env-sync-AMFPULCP.js} +51 -49
  121. package/dist/{display-name-hint-5GLJGPQ6.js → display-name-hint-QMT562BI.js} +13 -13
  122. package/dist/{emit-DlOKIJER.d.ts → emit-BfHifhJy.d.ts} +120 -7
  123. package/dist/{env-example-refresh-FACP4FQE.js → env-example-refresh-F5RTDVJ5.js} +69 -67
  124. package/dist/{env-pull-command-SHK4TI6U.js → env-pull-command-J2ARE33T.js} +52 -50
  125. package/dist/{env-target-ZQSPPN4A.js → env-target-WA4BR6GW.js} +13 -13
  126. package/dist/{env-var-command-Q2ZHKWAQ.js → env-var-command-WEC22FI5.js} +55 -54
  127. package/dist/{ephemeral-2DXWP3VK.js → ephemeral-MNHEWSZ6.js} +11 -11
  128. package/dist/{ephemeral-command-FKOSN56R.js → ephemeral-command-EJLS42VJ.js} +64 -62
  129. package/dist/{ephemeral-state-56XEDUJW.js → ephemeral-state-QTT5JHD5.js} +11 -11
  130. package/dist/{generate-command-2JCMZ6CG.js → generate-command-2WHFL4CB.js} +77 -75
  131. package/dist/{gitignore-Z5N6DEEV.js → gitignore-OKB3X335.js} +19 -17
  132. package/dist/{guards-LQ7PSXOL.js → guards-N4PUFKN5.js} +3 -2
  133. package/dist/{impersonate-command-R24VBFQA.js → impersonate-command-EIWI3FBD.js} +44 -42
  134. package/dist/{import-VJQGIS33.js → import-7HFTOT7M.js} +5 -5
  135. package/dist/index.d.ts +142 -7
  136. package/dist/index.js +7 -6
  137. package/dist/{init-command-UOCNESZK.js → init-command-POIWZKZ4.js} +52 -50
  138. package/dist/{init-modules-5DYK7V4J.js → init-modules-S7BR4NIJ.js} +11 -9
  139. package/dist/{init-web-25QJ4JWB.js → init-web-YCPD6BYN.js} +2 -2
  140. package/dist/internal.d.ts +4 -4
  141. package/dist/internal.js +169 -24
  142. package/dist/{keep-data-merge-HLIXZC77.js → keep-data-merge-NXP77QML.js} +32 -31
  143. package/dist/{landing-record-FYKDJIUF.js → landing-record-MK44WCRY.js} +23 -21
  144. package/dist/{live-diff-YOFOJCFX.js → live-diff-GZ6JUNP6.js} +5 -4
  145. package/dist/local-engine-ai-3XLJLOBP.js +47 -0
  146. package/dist/{local-engine-choice-4ZA2HZXH.js → local-engine-choice-7QBML5XF.js} +43 -36
  147. package/dist/local-engine-command-N7VDPABW.js +93 -0
  148. package/dist/{local-engine-config-6CB6FOEJ.js → local-engine-config-MVNWKHZ4.js} +15 -3
  149. package/dist/{local-engine-deploy-XAEDT55W.js → local-engine-deploy-RYZZYEDQ.js} +21 -18
  150. package/dist/{local-engine-lookup-WBYTY2JE.js → local-engine-lookup-2VSUWEQY.js} +6 -6
  151. package/dist/{local-engine-mcp-bridge-3H5OXBWQ.js → local-engine-mcp-bridge-ECGTK7LF.js} +6 -6
  152. package/dist/{local-engine-mcp-command-SUAVS5UA.js → local-engine-mcp-command-A257D3WK.js} +52 -44
  153. package/dist/{local-engine-process-35B2KQED.js → local-engine-process-P5T2766M.js} +19 -11
  154. package/dist/local-engine-release-OK6GKULS.js +40 -0
  155. package/dist/{local-engine-state-JZHTKHDG.js → local-engine-state-BOKHLNRQ.js} +4 -4
  156. package/dist/{local-engine-update-check-VXJZSIJU.js → local-engine-update-check-C72LSVUQ.js} +7 -7
  157. package/dist/{lock-commands-ZT6YTQYA.js → lock-commands-KMWLIGT2.js} +55 -53
  158. package/dist/{login-command-ONGJASKA.js → login-command-E2KMN6DV.js} +39 -32
  159. package/dist/{logout-command-PLYGFHBQ.js → logout-command-AIB446AQ.js} +16 -16
  160. package/dist/{loop-CLLBQSJF.js → loop-EMTBWN4X.js} +5 -4
  161. package/dist/{marketplace-command-LNNAA7ZK.js → marketplace-command-YLBFUBHL.js} +42 -40
  162. package/dist/{marketplace-resolve-63QWMQZU.js → marketplace-resolve-LT76KHJD.js} +9 -7
  163. package/dist/{meta-client-JND42QEJ.js → meta-client-AOPF5IQN.js} +15 -15
  164. package/dist/{module-manifest-NWJWAQLQ.js → module-manifest-B432UFBK.js} +3 -3
  165. package/dist/node.d.ts +5 -5
  166. package/dist/node.js +61 -59
  167. package/dist/{operation-outcome-U6IWKLBK.js → operation-outcome-GBSISFAP.js} +26 -26
  168. package/dist/{output-target-QJSHZBVY.js → output-target-NHJLT4YI.js} +20 -18
  169. package/dist/{plan-disclosure-XTAEE4BE.js → plan-disclosure-5HM7CMRW.js} +19 -18
  170. package/dist/{plugin-contributions-DD6R6RL6.js → plugin-contributions-MEXUR7TY.js} +4 -4
  171. package/dist/{plugin-prompt-UX2TT5NS.js → plugin-prompt-XM4ATAWA.js} +4 -4
  172. package/dist/{plugin-questions-WE2F4ZC4.js → plugin-questions-VGU3B4LE.js} +3 -3
  173. package/dist/{preflight-command-ZKUQSIL2.js → preflight-command-O52GLYGA.js} +60 -58
  174. package/dist/{profile-command-PJUA5ZMX.js → profile-command-NOKUVV3M.js} +38 -36
  175. package/dist/{profile-pointer-RCPHVTJV.js → profile-pointer-DHOU26Q2.js} +5 -5
  176. package/dist/{profile-select-45G5VPJK.js → profile-select-ZANK43KE.js} +2 -2
  177. package/dist/project-config-SGRYMHBT.js +37 -0
  178. package/dist/{project-dependency-TPVV3YIX.js → project-dependency-WTH776QE.js} +10 -8
  179. package/dist/{project-sdk-DKZBK5H5.js → project-sdk-FYNY7RTO.js} +3 -3
  180. package/dist/promote-command-2NMTINVS.js +150 -0
  181. package/dist/{prompt-OYQHQWKI.js → prompt-JVYQH4OR.js} +3 -3
  182. package/dist/{publish-command-JSYK6HOW.js → publish-command-LB2XULJA.js} +65 -63
  183. package/dist/{pull-command-K5X367MA.js → pull-command-UVNPFY2E.js} +71 -69
  184. package/dist/{pull-superseded-3SSM3JFT.js → pull-superseded-7EZ7M54I.js} +3 -3
  185. package/dist/{release-command-OC7MT4FV.js → release-command-BGSDY3BE.js} +66 -64
  186. package/dist/{release-ns-command-EHNEAEDU.js → release-ns-command-IVXK7HEG.js} +93 -91
  187. package/dist/{retry-command-WP4ZI6CJ.js → retry-command-HG4IFE65.js} +10 -10
  188. package/dist/{routes-manifest-file-A2PW7IQ7.js → routes-manifest-file-3MDX3JB3.js} +4 -4
  189. package/dist/{secrets-file-2RHMJFXQ.js → secrets-file-NFNUKRGZ.js} +19 -17
  190. package/dist/{secrets-fill-command-HYMF6EZM.js → secrets-fill-command-U5L7IKUO.js} +52 -50
  191. package/dist/{seed-W5FNE6IB.js → seed-M33F4OJW.js} +3 -3
  192. package/dist/{source-resolve-PMA7SHZE.js → source-resolve-MAMVIHDF.js} +24 -24
  193. package/dist/{static-host-3HPZKVKK.js → static-host-HCKD26Q3.js} +5 -5
  194. package/dist/{status-command-CROHQRPI.js → status-command-VXIN37ET.js} +52 -51
  195. package/dist/{store-Dg9FLJkx.d.ts → store-Dt-5vOSe.d.ts} +149 -1
  196. package/dist/{store-B63BQV6R.js → store-ZWQFSXH5.js} +8 -8
  197. package/dist/{sync-baseline-LSGKNCKM.js → sync-baseline-XLRJQZCS.js} +7 -6
  198. package/dist/{sync-contributions-QDEWZ3IU.js → sync-contributions-PGMYJKLG.js} +17 -13
  199. package/dist/{sync-record-AWFCSS4D.js → sync-record-UFEJDNLR.js} +13 -13
  200. package/dist/{table-WJ7YDJ6Q.js → table-JHPGUJ2Z.js} +6 -6
  201. package/dist/{tables-command-BKVDHAGJ.js → tables-command-FNBHVJG3.js} +41 -40
  202. package/dist/{tenant-IXIW3FOI.js → tenant-SSWC7B3V.js} +12 -12
  203. package/dist/{tenant-command-Y7VCGDMY.js → tenant-command-PHNX3PXS.js} +96 -94
  204. package/dist/{test-command-2RAUNIU5.js → test-command-DMMF3RMK.js} +44 -43
  205. package/dist/{tests-N4MMBABH.js → tests-ZFQWDWS2.js} +6 -6
  206. package/dist/{token-4I26OGWH.js → token-IHOPB74T.js} +14 -12
  207. package/dist/{toolchain-hooks-IJWV3ZQS.js → toolchain-hooks-IRPM6LYL.js} +3 -3
  208. package/dist/{toolchain-modules-XM4JXHQC.js → toolchain-modules-V56JXU2E.js} +9 -5
  209. package/dist/{toolchain-peers-EMOYN4U7.js → toolchain-peers-NOIM44ED.js} +11 -9
  210. package/dist/{tracked-backend-EZE6H3EZ.js → tracked-backend-VKWZKKBG.js} +39 -36
  211. package/dist/{update-check-QLB5DV3B.js → update-check-DZ4YVDNS.js} +51 -49
  212. package/dist/{upgrade-command-4DCDBDB5.js → upgrade-command-EP5WQWFA.js} +55 -53
  213. package/dist/{whoami-command-WI4VT3IN.js → whoami-command-UV6EEDBY.js} +15 -15
  214. package/dist/{workspace-DIM3SBPV.js → workspace-6LVJ3LZE.js} +5 -5
  215. package/dist/{workspace-binding-43PBQEE4.js → workspace-binding-AUZIERMF.js} +14 -14
  216. package/dist/{workspace-command-FWTHIFVI.js → workspace-command-VXOY6KPE.js} +96 -94
  217. package/dist/{workspace-env-5PJVWQ2O.js → workspace-env-ZNGE3DFN.js} +17 -15
  218. package/dist/{workspace-export-3KMWNZDD.js → workspace-export-A4L6272C.js} +5 -5
  219. package/dist/{writable-X7BCN7XE.js → writable-762DMPHW.js} +3 -3
  220. package/dist/{xano-RLSNDM7O.js → xano-XZN5SRDH.js} +4 -3
  221. package/dist/{xanosdk-import-VOJEAK5Q.js → xanosdk-import-FENZ7XMW.js} +6 -6
  222. package/dist/{xanosdk-project-PV3ORVP5.js → xanosdk-project-K4RKLLNO.js} +16 -14
  223. package/guides/cli.md +3 -0
  224. package/guides/coverage.md +4 -4
  225. package/llms/kinds-agent-mcp.md +3 -1
  226. package/llms/statements-ai.md +21 -0
  227. package/llms/statements-catalog.md +1 -8
  228. package/llms-full.txt +33 -15
  229. package/llms.txt +7 -6
  230. package/manifest.json +651 -3
  231. package/package.json +2 -1
  232. package/skills/xano-backend/SKILL.md +2 -2
  233. package/dist/local-engine-command-WQS4SD6N.js +0 -85
  234. package/dist/promote-command-NDYP66LD.js +0 -148
@@ -0,0 +1,264 @@
1
+ import {
2
+ acquireEngine
3
+ } from "./chunk-M5GXZEX7.js";
4
+ import {
5
+ engineRunsUntilStopped,
6
+ engineVersion,
7
+ engineVersionToken,
8
+ listEngines,
9
+ resolveRecordedEngine,
10
+ startEngine,
11
+ stopEngineNamed,
12
+ stopOrphanedEngineProcesses
13
+ } from "./chunk-I5YD7QPI.js";
14
+ import {
15
+ RELEASE_VERSION,
16
+ readEngineEntry
17
+ } from "./chunk-VO62TKK5.js";
18
+ import {
19
+ compareSemver,
20
+ parseSemver
21
+ } from "./chunk-2TFRR6JV.js";
22
+ import {
23
+ recordDeployed
24
+ } from "./chunk-5Z4WQQHC.js";
25
+ import {
26
+ ImportHttpError
27
+ } from "./chunk-EBSJUSID.js";
28
+ import {
29
+ engineNameForProject,
30
+ getEngineRecord,
31
+ setEngineRecord
32
+ } from "./chunk-MKRREVNB.js";
33
+ import {
34
+ ENGINE_AI_MAX_TTL_S,
35
+ clampEngineAiTtl,
36
+ engineAiTokenPath
37
+ } from "./chunk-FVZ5C3PF.js";
38
+ import {
39
+ assertLoopbackUrl
40
+ } from "./chunk-RQGSZ7AR.js";
41
+
42
+ // src/deploy/local-engine-deploy.ts
43
+ import { rmSync } from "fs";
44
+ async function ensureProjectEngine(opts) {
45
+ try {
46
+ return await ensureProjectEngineUnnoted(opts);
47
+ } catch (err) {
48
+ throw withDeployFallbackNote(err);
49
+ }
50
+ }
51
+ var DEPLOY_FALLBACK_NOTE = "Meanwhile `xanosdk deploy --ephemeral` still deploys to an ephemeral.";
52
+ function withDeployFallbackNote(err) {
53
+ if (!(err instanceof Error) || err.message.includes(DEPLOY_FALLBACK_NOTE)) return err;
54
+ err.message = `${err.message.trimEnd()}
55
+ ${DEPLOY_FALLBACK_NOTE}`;
56
+ return err;
57
+ }
58
+ async function ensureProjectEngineUnnoted(opts) {
59
+ const env = opts.env ?? process.env;
60
+ const acquired = await acquireEngine({
61
+ spec: opts.source,
62
+ env,
63
+ ...opts.rerun === void 0 ? {} : { rerun: opts.rerun },
64
+ ...opts.rerunNote === void 0 || opts.rerunNote === "" ? {} : { rerunNote: opts.rerunNote },
65
+ ...opts.fetch === void 0 ? {} : { fetch: opts.fetch },
66
+ ...opts.onDownloaded === void 0 ? {} : { onDownloaded: opts.onDownloaded }
67
+ });
68
+ const { entry, version } = acquired;
69
+ opts.onAcquired?.(acquired);
70
+ const shownVersion = version ?? overrideVersion(entry, env, opts.run);
71
+ const { record, name, live, replaced } = reconcileLive(opts.dir, entry, shownVersion, env, opts.run);
72
+ const sweep = opts.sweepOrphans ?? (opts.spawn === void 0 ? () => stopOrphanedEngineProcesses({ env }).stopped : void 0);
73
+ const sweptOrphans = live === void 0 && sweep !== void 0 ? sweep() : [];
74
+ const ai = await engineAi(opts.ai, name, live === void 0 ? void 0 : { record }, aiTtlFor(live, shownVersion), env);
75
+ const engine = live ?? await startEngine({
76
+ entry,
77
+ name,
78
+ env,
79
+ ...shownVersion === void 0 ? {} : { version: shownVersion },
80
+ ...opts.spawn === void 0 ? {} : { spawn: opts.spawn },
81
+ ai: wiringFor(name, ai, env)
82
+ });
83
+ const reused = live !== void 0;
84
+ const hadRecord = record !== void 0;
85
+ const priorFilled = record?.filled;
86
+ const carry = opts.carryFilled?.({ reused, hadRecord, priorFilled, url: engine.url }) === true;
87
+ const aiGatewayUrl = reused ? record?.aiGatewayUrl : ai?.gatewayUrl;
88
+ writeRecord(opts.dir, engine, entry, shownVersion, reused && carry ? priorFilled : void 0, env, aiGatewayUrl);
89
+ if (!reused) recordDeployed(opts.dir, "local");
90
+ return {
91
+ engine,
92
+ reused,
93
+ previousUrl: record?.url,
94
+ entry,
95
+ version,
96
+ engineVersion: shownVersion,
97
+ ...replaced === void 0 ? {} : { replaced },
98
+ ...sweptOrphans.length === 0 ? {} : { sweptOrphans },
99
+ hadRecord,
100
+ priorFilled,
101
+ ...ai === void 0 ? {} : { ai }
102
+ };
103
+ }
104
+ async function engineAi(opts, name, reuse, ttl, env) {
105
+ if (opts === void 0) return void 0;
106
+ const booted = reuse?.record?.aiGatewayUrl;
107
+ if (reuse !== void 0 && booted === void 0) {
108
+ return restartToEnable(name, opts.billing, "was started before it could take a Xano AI credential", env);
109
+ }
110
+ const request = opts.request ?? (await import("./local-engine-ai-3XLJLOBP.js")).requestEngineAiCredential;
111
+ const outcome = await request({ billing: opts.billing, engineName: name, ttl, env });
112
+ if (reuse !== void 0 && outcome.status === "on" && outcome.gatewayUrl !== void 0 && outcome.gatewayUrl !== booted) {
113
+ return restartToEnable(name, opts.billing, "was started with another Xano AI gateway than this sign-in uses", env);
114
+ }
115
+ return outcome;
116
+ }
117
+ var ENGINE_DEFAULT_TTL_S = 3600;
118
+ function aiTtlFor(live, version) {
119
+ if (live !== void 0) {
120
+ return live.expiresAt === void 0 ? ENGINE_AI_MAX_TTL_S : clampEngineAiTtl((live.expiresAt - Date.now()) / 1e3);
121
+ }
122
+ return engineRunsUntilStopped(version) ? ENGINE_AI_MAX_TTL_S : ENGINE_DEFAULT_TTL_S;
123
+ }
124
+ function restartToEnable(name, billing, why, env) {
125
+ rmSync(engineAiTokenPath(name, env), { force: true });
126
+ return {
127
+ status: "off",
128
+ billing,
129
+ reason: "restart-to-enable",
130
+ message: `Xano AI is off for this engine: ${name} ${why}. Restart it to turn it on: \`xanosdk local stop ${name}\`, then deploy again.`
131
+ };
132
+ }
133
+ function wiringFor(name, ai, env) {
134
+ return {
135
+ tokenFile: engineAiTokenPath(name, env),
136
+ ...ai?.gatewayUrl === void 0 ? {} : { gatewayUrl: ai.gatewayUrl }
137
+ };
138
+ }
139
+ async function restartMismatchedEngine(opts) {
140
+ const env = opts.env ?? process.env;
141
+ const { entry, version } = opts.acquired;
142
+ const shownVersion = version ?? overrideVersion(entry, env, opts.run);
143
+ const { record, name, replaced } = reconcileLive(opts.dir, entry, shownVersion, env, opts.run);
144
+ if (replaced === void 0) return void 0;
145
+ const ai = await engineAi(opts.ai, name, void 0, aiTtlFor(void 0, shownVersion), env);
146
+ const engine = await startEngine({
147
+ entry,
148
+ name,
149
+ env,
150
+ ...shownVersion === void 0 ? {} : { version: shownVersion },
151
+ ...opts.spawn === void 0 ? {} : { spawn: opts.spawn },
152
+ ai: wiringFor(name, ai, env)
153
+ });
154
+ writeRecord(opts.dir, engine, entry, shownVersion, void 0, env, ai?.gatewayUrl);
155
+ return { ...replaced, url: engine.url, previousUrl: record?.url, ...ai === void 0 ? {} : { ai } };
156
+ }
157
+ function reconcileLive(dir, entry, shownVersion, env, run) {
158
+ const record = getEngineRecord(dir, env);
159
+ const name = record?.name ?? engineNameForProject(dir);
160
+ const running = listEngines({ entry, env, ...run === void 0 ? {} : { run } });
161
+ const found = reuseCandidate(name, record, running);
162
+ if (found === void 0 || record?.engineDigest === entry.digest) return { record, name, live: found };
163
+ stopMismatched(found.name, record, entry, env, run);
164
+ return { record, name, live: void 0, replaced: { name: found.name, from: record?.engineVersion, to: shownVersion } };
165
+ }
166
+ function writeRecord(dir, engine, entry, shownVersion, filled, env, aiGatewayUrl) {
167
+ setEngineRecord(
168
+ dir,
169
+ {
170
+ name: engine.name,
171
+ url: engine.url,
172
+ workspaceId: engine.workspaceId,
173
+ project: dir,
174
+ engineUrl: entry.url,
175
+ engineDigest: entry.digest,
176
+ ...shownVersion === void 0 ? {} : { engineVersion: shownVersion },
177
+ startedAt: Date.now(),
178
+ ...filled === void 0 ? {} : { filled },
179
+ ...aiGatewayUrl === void 0 ? {} : { aiGatewayUrl }
180
+ },
181
+ env
182
+ );
183
+ }
184
+ function overrideVersion(entry, env, run) {
185
+ let out;
186
+ try {
187
+ out = engineVersion({ entry, env, ...run === void 0 ? {} : { run } });
188
+ } catch {
189
+ return void 0;
190
+ }
191
+ return engineVersionToken(out);
192
+ }
193
+ function stopMismatched(name, record, entry, env, run) {
194
+ const seam = run === void 0 ? {} : { run };
195
+ const attempt = (binary) => {
196
+ try {
197
+ return stopEngineNamed(name, { entry: binary, env, ...seam }).stopped;
198
+ } catch {
199
+ return false;
200
+ }
201
+ };
202
+ if (attempt(entry)) return;
203
+ const previous = recordedBinary(record, env);
204
+ if (previous !== void 0 && previous.digest !== entry.digest && attempt(previous)) return;
205
+ throw new Error(
206
+ `The Xano Engine "${name}" already serving this project is not the engine this deploy resolved to, and it could not be stopped` + (previous === void 0 ? `` : ` by either engine version`) + `.
207
+ Stop it with \`xanosdk local stop ${name}\` (or end the process), then deploy again.`
208
+ );
209
+ }
210
+ function recordedBinary(record, env) {
211
+ const version = record?.engineVersion;
212
+ if (version === void 0 || !RELEASE_VERSION.test(version)) return void 0;
213
+ try {
214
+ return readEngineEntry({ version }, env);
215
+ } catch {
216
+ return void 0;
217
+ }
218
+ }
219
+ function reuseCandidate(name, record, running) {
220
+ if (record !== void 0) {
221
+ const resolved = resolveRecordedEngine(record, running);
222
+ if (resolved.state === "unusable") throw new Error(resolved.reason);
223
+ return resolved.state === "live" ? resolved.engine : void 0;
224
+ }
225
+ const engine = running.find((e) => e.name === name);
226
+ if (engine === void 0) return void 0;
227
+ assertLoopbackUrl(engine.url, "The engine already serving this project");
228
+ return engine;
229
+ }
230
+ function explainUnsupportedEngineImport(err, engineVersion2, ctx = {}) {
231
+ if (!(err instanceof ImportHttpError) || err.status !== 501) return void 0;
232
+ const which = engineVersion2 === void 0 ? "The Xano Engine" : `Xano Engine ${engineVersion2}`;
233
+ const newer = newerRelease(engineVersion2, ctx.latest);
234
+ if (newer !== void 0) {
235
+ return new Error(
236
+ `${which} does not support this import (HTTP 501): it is older than this SDK needs. Nothing was written. Deploy with ${newer} \u2014 \`xanosdk local update\` moves this project's pin to it, or pass \`--local=${newer}\` for one deploy.`,
237
+ { cause: err }
238
+ );
239
+ }
240
+ if (ctx.resetRerun !== void 0) {
241
+ return new Error(
242
+ `${which} cannot apply this merge (HTTP 501): keeping the rows through this schema change is not available on the Xano Engine yet. Nothing was written. Deploy with \`${ctx.resetRerun}\` instead \u2014 it replaces the workspace and writes every table's seed rows, so rows entered since the last deploy are lost.`,
243
+ { cause: err }
244
+ );
245
+ }
246
+ return new Error(
247
+ `${which} does not support this import (HTTP 501). Nothing was written. \`xanosdk deploy --ephemeral\` deploys to an ephemeral meanwhile.`,
248
+ { cause: err }
249
+ );
250
+ }
251
+ function newerRelease(current, latest) {
252
+ if (current === void 0 || latest === void 0) return void 0;
253
+ const a = parseSemver(current);
254
+ const b = parseSemver(latest);
255
+ return a !== null && b !== null && compareSemver(b, a) > 0 ? latest : void 0;
256
+ }
257
+
258
+ export {
259
+ ensureProjectEngine,
260
+ DEPLOY_FALLBACK_NOTE,
261
+ restartMismatchedEngine,
262
+ explainUnsupportedEngineImport
263
+ };
264
+ //# sourceMappingURL=chunk-RVBDZMCC.js.map
@@ -3,14 +3,14 @@ import {
3
3
  listAnswer,
4
4
  notTheAnswer,
5
5
  writeTransportFailure
6
- } from "./chunk-SINL5WMI.js";
6
+ } from "./chunk-4Y3SWNPE.js";
7
7
  import {
8
8
  SENT_AFTERMATH,
9
9
  fetchOrExplain,
10
10
  readBodyText,
11
11
  safeHttpFailure,
12
12
  withWriteStatusAftermath
13
- } from "./chunk-NH5Z2NOD.js";
13
+ } from "./chunk-QZ2PC6B7.js";
14
14
  import {
15
15
  isNonPublicColumn
16
16
  } from "./chunk-FSHW3GQU.js";
@@ -184,4 +184,4 @@ export {
184
184
  truncateTable,
185
185
  insertTableRows
186
186
  };
187
- //# sourceMappingURL=chunk-WLZSKD7E.js.map
187
+ //# sourceMappingURL=chunk-SQVETROU.js.map