@akashnetwork/chain-sdk 1.0.0-alpha.41 → 1.0.0-alpha.43

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 (295) hide show
  1. package/dist/cjs/generated/createNodeSDK.cjs +328 -5
  2. package/dist/cjs/generated/createNodeSDK.cjs.map +2 -2
  3. package/dist/cjs/generated/createProviderSDK.cjs +36 -19
  4. package/dist/cjs/generated/createProviderSDK.cjs.map +2 -2
  5. package/dist/cjs/generated/patches/nodeCustomTypePatches.cjs +6 -0
  6. package/dist/cjs/generated/patches/nodeCustomTypePatches.cjs.map +2 -2
  7. package/dist/cjs/generated/protos/akash/base/attributes/v1/attribute.cjs +18 -2
  8. package/dist/cjs/generated/protos/akash/base/attributes/v1/attribute.cjs.map +2 -2
  9. package/dist/cjs/generated/protos/akash/inventory/v1/snapshot.cjs +943 -0
  10. package/dist/cjs/generated/protos/akash/inventory/v1/snapshot.cjs.map +7 -0
  11. package/dist/cjs/generated/protos/akash/inventory/v1/snapshot_akash.cjs +50 -0
  12. package/dist/cjs/generated/protos/akash/inventory/v1/snapshot_akash.cjs.map +7 -0
  13. package/dist/cjs/generated/protos/akash/manifest/v2beta3/httpoptions.cjs +159 -2
  14. package/dist/cjs/generated/protos/akash/manifest/v2beta3/httpoptions.cjs.map +2 -2
  15. package/dist/cjs/generated/protos/akash/market/v1/stats.cjs +248 -0
  16. package/dist/cjs/generated/protos/akash/market/v1/stats.cjs.map +7 -0
  17. package/dist/cjs/generated/protos/akash/market/v1/types.cjs +6 -0
  18. package/dist/cjs/generated/protos/akash/market/v1/types.cjs.map +2 -2
  19. package/dist/cjs/generated/protos/akash/market/v1beta5/query.cjs +139 -1
  20. package/dist/cjs/generated/protos/akash/market/v1beta5/query.cjs.map +2 -2
  21. package/dist/cjs/generated/protos/akash/market/v1beta5/query_akash.cjs +9 -0
  22. package/dist/cjs/generated/protos/akash/market/v1beta5/query_akash.cjs.map +2 -2
  23. package/dist/cjs/generated/protos/akash/provider/v1beta4/event.cjs +266 -0
  24. package/dist/cjs/generated/protos/akash/provider/v1beta4/event.cjs.map +2 -2
  25. package/dist/cjs/generated/protos/akash/provider/v1beta4/genesis.cjs +71 -2
  26. package/dist/cjs/generated/protos/akash/provider/v1beta4/genesis.cjs.map +2 -2
  27. package/dist/cjs/generated/protos/akash/provider/v1beta4/maintenance.cjs +417 -0
  28. package/dist/cjs/generated/protos/akash/provider/v1beta4/maintenance.cjs.map +7 -0
  29. package/dist/cjs/generated/protos/akash/provider/v1beta4/msg.cjs +321 -0
  30. package/dist/cjs/generated/protos/akash/provider/v1beta4/msg.cjs.map +2 -2
  31. package/dist/cjs/generated/protos/akash/provider/v1beta4/params.cjs +96 -0
  32. package/dist/cjs/generated/protos/akash/provider/v1beta4/params.cjs.map +7 -0
  33. package/dist/cjs/generated/protos/akash/provider/v1beta4/paramsmsg.cjs +132 -0
  34. package/dist/cjs/generated/protos/akash/provider/v1beta4/paramsmsg.cjs.map +7 -0
  35. package/dist/cjs/generated/protos/akash/provider/v1beta4/provider.cjs +88 -1
  36. package/dist/cjs/generated/protos/akash/provider/v1beta4/provider.cjs.map +2 -2
  37. package/dist/cjs/generated/protos/akash/provider/v1beta4/query.cjs +462 -1
  38. package/dist/cjs/generated/protos/akash/provider/v1beta4/query.cjs.map +2 -2
  39. package/dist/cjs/generated/protos/akash/provider/v1beta4/query_akash.cjs +36 -0
  40. package/dist/cjs/generated/protos/akash/provider/v1beta4/query_akash.cjs.map +2 -2
  41. package/dist/cjs/generated/protos/akash/provider/v1beta4/service_akash.cjs +25 -0
  42. package/dist/cjs/generated/protos/akash/provider/v1beta4/service_akash.cjs.map +2 -2
  43. package/dist/cjs/generated/protos/akash/verification/v1/event.cjs +2525 -0
  44. package/dist/cjs/generated/protos/akash/verification/v1/event.cjs.map +7 -0
  45. package/dist/cjs/generated/protos/akash/verification/v1/genesis.cjs +253 -0
  46. package/dist/cjs/generated/protos/akash/verification/v1/genesis.cjs.map +7 -0
  47. package/dist/cjs/generated/protos/akash/verification/v1/msg.cjs +2774 -0
  48. package/dist/cjs/generated/protos/akash/verification/v1/msg.cjs.map +7 -0
  49. package/dist/cjs/generated/protos/akash/verification/v1/params.cjs +1044 -0
  50. package/dist/cjs/generated/protos/akash/verification/v1/params.cjs.map +7 -0
  51. package/dist/cjs/generated/protos/akash/verification/v1/query.cjs +1559 -0
  52. package/dist/cjs/generated/protos/akash/verification/v1/query.cjs.map +7 -0
  53. package/dist/cjs/generated/protos/akash/verification/v1/query_akash.cjs +147 -0
  54. package/dist/cjs/generated/protos/akash/verification/v1/query_akash.cjs.map +7 -0
  55. package/dist/cjs/{sdl/types.cjs → generated/protos/akash/verification/v1/service.cjs} +3 -3
  56. package/dist/cjs/generated/protos/akash/verification/v1/service.cjs.map +7 -0
  57. package/dist/cjs/generated/protos/akash/verification/v1/service_akash.cjs +190 -0
  58. package/dist/cjs/generated/protos/akash/verification/v1/service_akash.cjs.map +7 -0
  59. package/dist/cjs/generated/protos/akash/verification/v1/state.cjs +2018 -0
  60. package/dist/cjs/generated/protos/akash/verification/v1/state.cjs.map +7 -0
  61. package/dist/cjs/generated/protos/akash/verification/v1/types.cjs +1071 -0
  62. package/dist/cjs/generated/protos/akash/verification/v1/types.cjs.map +7 -0
  63. package/dist/cjs/generated/protos/akash/verification/v1/verificationrequirement.cjs +148 -0
  64. package/dist/cjs/generated/protos/akash/verification/v1/verificationrequirement.cjs.map +7 -0
  65. package/dist/cjs/generated/protos/index.akash.v1.cjs +166 -25
  66. package/dist/cjs/generated/protos/index.akash.v1.cjs.map +3 -3
  67. package/dist/cjs/generated/protos/index.akash.v1beta4.cjs +25 -0
  68. package/dist/cjs/generated/protos/index.akash.v1beta4.cjs.map +3 -3
  69. package/dist/cjs/generated/protos/index.akash.v1beta5.cjs +2 -0
  70. package/dist/cjs/generated/protos/index.akash.v1beta5.cjs.map +2 -2
  71. package/dist/cjs/generated/protos/index.provider.akash.v1.cjs +9 -0
  72. package/dist/cjs/generated/protos/index.provider.akash.v1.cjs.map +2 -2
  73. package/dist/cjs/generated/protos/index.provider.akash.v2beta3.cjs +1 -0
  74. package/dist/cjs/generated/protos/index.provider.akash.v2beta3.cjs.map +2 -2
  75. package/dist/cjs/sdl/duration.cjs +44 -0
  76. package/dist/cjs/sdl/duration.cjs.map +7 -0
  77. package/dist/cjs/sdl/httpTimeout.cjs +59 -0
  78. package/dist/cjs/sdl/httpTimeout.cjs.map +7 -0
  79. package/dist/cjs/sdl/index.cjs +0 -2
  80. package/dist/cjs/sdl/index.cjs.map +2 -2
  81. package/dist/cjs/sdl/manifest/generateManifest.cjs +20 -1
  82. package/dist/cjs/sdl/manifest/generateManifest.cjs.map +2 -2
  83. package/dist/cjs/sdl/manifest/generateManifestVersion.cjs +11 -0
  84. package/dist/cjs/sdl/manifest/generateManifestVersion.cjs.map +2 -2
  85. package/dist/cjs/sdl/manifest/manifestUtils.cjs +10 -2
  86. package/dist/cjs/sdl/manifest/manifestUtils.cjs.map +2 -2
  87. package/dist/cjs/sdl/manifest/reclamationDuration.cjs +4 -5
  88. package/dist/cjs/sdl/manifest/reclamationDuration.cjs.map +3 -3
  89. package/dist/cjs/sdl/validateSDL/validateSDL.cjs +28 -1
  90. package/dist/cjs/sdl/validateSDL/validateSDL.cjs.map +2 -2
  91. package/dist/cjs/sdl/validateSDL/validateSDLInput.cjs +853 -454
  92. package/dist/cjs/sdl/validateSDL/validateSDLInput.cjs.map +2 -2
  93. package/dist/esm/chunk-2NPYA3YV.js +1563 -0
  94. package/dist/esm/chunk-2NPYA3YV.js.map +7 -0
  95. package/dist/esm/{chunk-4SZHF6SE.js → chunk-3U5XKNEU.js} +3 -3
  96. package/dist/esm/chunk-474YCD2T.js +356 -0
  97. package/dist/esm/chunk-474YCD2T.js.map +7 -0
  98. package/dist/esm/chunk-4CTTYO4O.js +890 -0
  99. package/dist/esm/chunk-4CTTYO4O.js.map +7 -0
  100. package/dist/esm/{chunk-IKTMMFJ5.js → chunk-54RECHZZ.js} +2 -2
  101. package/dist/esm/{chunk-WCUR732W.js → chunk-57534UAR.js} +2 -2
  102. package/dist/esm/{chunk-UHI2V2WP.js → chunk-5VWXQLXG.js} +1331 -489
  103. package/dist/esm/chunk-5VWXQLXG.js.map +7 -0
  104. package/dist/esm/{chunk-B4YVLEG7.js → chunk-7F3NJG67.js} +3 -3
  105. package/dist/esm/chunk-AIWCRXMP.js +672 -0
  106. package/dist/esm/chunk-AIWCRXMP.js.map +7 -0
  107. package/dist/esm/{chunk-XAOERZEY.js → chunk-AKNHD3CM.js} +2 -2
  108. package/dist/esm/chunk-BI4YL5KH.js +2742 -0
  109. package/dist/esm/chunk-BI4YL5KH.js.map +7 -0
  110. package/dist/esm/{chunk-ZGK4PJCD.js → chunk-BQNJHJXY.js} +3 -3
  111. package/dist/esm/{chunk-YBRE4XNB.js → chunk-CFEWW2ER.js} +2 -2
  112. package/dist/esm/{chunk-EJQUNX4L.js → chunk-DCLXPAMC.js} +3 -3
  113. package/dist/esm/{chunk-AR26HCRY.js → chunk-F4IQOYFH.js} +2 -2
  114. package/dist/esm/{chunk-ENZ3OBCL.js → chunk-F7KT5EX5.js} +2 -2
  115. package/dist/esm/{chunk-3QS3CMF4.js → chunk-GRGSTKN3.js} +2 -2
  116. package/dist/esm/{chunk-TTQ36NQ5.js → chunk-HRN6NSO2.js} +2 -2
  117. package/dist/esm/{chunk-E7KECYS7.js → chunk-IEWLP7PR.js} +7 -1
  118. package/dist/esm/chunk-IEWLP7PR.js.map +7 -0
  119. package/dist/esm/chunk-IFKY7FXY.js +484 -0
  120. package/dist/esm/chunk-IFKY7FXY.js.map +7 -0
  121. package/dist/esm/chunk-J4CJEGEM.js +3016 -0
  122. package/dist/esm/chunk-J4CJEGEM.js.map +7 -0
  123. package/dist/esm/{chunk-N42ATJOO.js → chunk-M5P5LAJJ.js} +2 -2
  124. package/dist/esm/{chunk-3K7Q5MUF.js → chunk-MIJCN6AD.js} +2 -2
  125. package/dist/esm/{chunk-OYI3IQIV.js → chunk-NNB5QBR2.js} +2 -2
  126. package/dist/esm/{chunk-WMSUADX2.js → chunk-OJ54L3XZ.js} +4 -4
  127. package/dist/esm/{chunk-5ODS4QTF.js → chunk-P64VHYRM.js} +2 -2
  128. package/dist/esm/{chunk-MFZVOFPX.js → chunk-PAOVIX5L.js} +3 -3
  129. package/dist/esm/chunk-PEHPXXTS.js +1053 -0
  130. package/dist/esm/chunk-PEHPXXTS.js.map +7 -0
  131. package/dist/esm/chunk-PTMMQODC.js +760 -0
  132. package/dist/esm/chunk-PTMMQODC.js.map +7 -0
  133. package/dist/esm/{chunk-ZXN75Q55.js → chunk-PWXFQ5FI.js} +3 -3
  134. package/dist/esm/{chunk-CZGHFBAO.js → chunk-PYD5MY63.js} +131 -9
  135. package/dist/esm/chunk-PYD5MY63.js.map +7 -0
  136. package/dist/esm/{chunk-NP4QQMME.js → chunk-RJZ46VHV.js} +2 -2
  137. package/dist/esm/chunk-SK7LOVVI.js +660 -0
  138. package/dist/esm/chunk-SK7LOVVI.js.map +7 -0
  139. package/dist/esm/{chunk-ZRZ6LUI2.js → chunk-TN4W5NLC.js} +7 -1
  140. package/dist/esm/chunk-TN4W5NLC.js.map +7 -0
  141. package/dist/esm/chunk-VYCICKFV.js +698 -0
  142. package/dist/esm/chunk-VYCICKFV.js.map +7 -0
  143. package/dist/esm/{chunk-4TSICBUM.js → chunk-W3TLZPTC.js} +3 -3
  144. package/dist/esm/{chunk-M2RS2IFR.js → chunk-WNFIFYG2.js} +2 -2
  145. package/dist/esm/{chunk-CVX7ZJQR.js → chunk-XP2XNYEA.js} +161 -4
  146. package/dist/esm/chunk-XP2XNYEA.js.map +7 -0
  147. package/dist/esm/{chunk-SGDEIQ7L.js → chunk-Y7BVCD32.js} +3 -3
  148. package/dist/esm/generated/protos/index.akash.v1.js +2988 -77
  149. package/dist/esm/generated/protos/index.akash.v1.js.map +4 -4
  150. package/dist/esm/generated/protos/index.akash.v1beta4.js +58 -13
  151. package/dist/esm/generated/protos/index.akash.v1beta5.js +17 -12
  152. package/dist/esm/generated/protos/index.akash.v1beta5.js.map +1 -1
  153. package/dist/esm/generated/protos/index.akash.v2.js +4 -4
  154. package/dist/esm/generated/protos/index.provider.akash.v1.js +29 -10
  155. package/dist/esm/generated/protos/index.provider.akash.v2beta3.js +7 -4
  156. package/dist/esm/index.js +54 -36
  157. package/dist/esm/index.js.map +2 -2
  158. package/dist/esm/index.web.js +14 -13
  159. package/dist/esm/index.web.js.map +1 -1
  160. package/dist/esm/{query_akash-I3RPHLVA.js → query_akash-BTYAA6UN.js} +5 -5
  161. package/dist/esm/{query_akash-QF2LHJQN.js → query_akash-EG43V2QH.js} +4 -4
  162. package/dist/esm/{query_akash-44SHG3FL.js → query_akash-HCIMNA7T.js} +4 -3
  163. package/dist/esm/{query_akash-44SHG3FL.js.map → query_akash-HCIMNA7T.js.map} +1 -1
  164. package/dist/esm/{query_akash-72TFPQBZ.js → query_akash-HN4NCENR.js} +4 -4
  165. package/dist/esm/query_akash-KU4YCMUU.js +85 -0
  166. package/dist/esm/query_akash-KU4YCMUU.js.map +7 -0
  167. package/dist/esm/{query_akash-TZ6F7OO4.js → query_akash-LSGWB5MI.js} +24 -12
  168. package/dist/esm/query_akash-LSGWB5MI.js.map +7 -0
  169. package/dist/esm/{query_akash-54EYS6GQ.js → query_akash-SOJJMCBH.js} +8 -7
  170. package/dist/esm/{query_akash-54EYS6GQ.js.map → query_akash-SOJJMCBH.js.map} +1 -1
  171. package/dist/esm/{query_akash-EGFDDA4L.js → query_akash-SVNQ4S67.js} +4 -4
  172. package/dist/esm/query_akash-XYSUQTZC.js +164 -0
  173. package/dist/esm/query_akash-XYSUQTZC.js.map +7 -0
  174. package/dist/esm/{service_akash-KRCYHNCN.js → service_akash-3R3TC3PH.js} +4 -3
  175. package/dist/esm/{service_akash-KRCYHNCN.js.map → service_akash-3R3TC3PH.js.map} +1 -1
  176. package/dist/esm/{service_akash-CEAZGGZS.js → service_akash-43EJ5RKY.js} +8 -7
  177. package/dist/esm/{service_akash-CEAZGGZS.js.map → service_akash-43EJ5RKY.js.map} +1 -1
  178. package/dist/esm/{service_akash-YXSRY4G3.js → service_akash-AXWB3IDG.js} +7 -6
  179. package/dist/esm/{service_akash-YXSRY4G3.js.map → service_akash-AXWB3IDG.js.map} +1 -1
  180. package/dist/esm/{service_akash-Z4CR3DWY.js → service_akash-BZTUHKJO.js} +8 -7
  181. package/dist/esm/{service_akash-Z4CR3DWY.js.map → service_akash-BZTUHKJO.js.map} +1 -1
  182. package/dist/esm/{service_akash-JQKI2SJP.js → service_akash-HFGWADC2.js} +4 -4
  183. package/dist/esm/{service_akash-SXXXZL6K.js → service_akash-KAJJV7LX.js} +4 -4
  184. package/dist/esm/service_akash-KYLB3OP3.js +78 -0
  185. package/dist/esm/service_akash-KYLB3OP3.js.map +7 -0
  186. package/dist/esm/service_akash-LJBOWZZG.js +221 -0
  187. package/dist/esm/service_akash-LJBOWZZG.js.map +7 -0
  188. package/dist/esm/{service_akash-PFTEVUGK.js → service_akash-QTGRTXLG.js} +4 -4
  189. package/dist/esm/{service_akash-44MLEMTW.js → service_akash-T36Y5DCD.js} +4 -3
  190. package/dist/esm/{service_akash-44MLEMTW.js.map → service_akash-T36Y5DCD.js.map} +1 -1
  191. package/dist/esm/{service_akash-ZITNWRBM.js → service_akash-X4HCN3EG.js} +9 -8
  192. package/dist/esm/{service_akash-ZITNWRBM.js.map → service_akash-X4HCN3EG.js.map} +1 -1
  193. package/dist/esm/snapshot_akash-KH5X5W3B.js +41 -0
  194. package/dist/esm/snapshot_akash-KH5X5W3B.js.map +7 -0
  195. package/dist/sdl-schema.yaml +84 -8
  196. package/dist/tsconfig.build.tsbuildinfo +1 -1
  197. package/dist/types/generated/createNodeSDK.d.ts +473 -0
  198. package/dist/types/generated/createProviderSDK.d.ts +31 -0
  199. package/dist/types/generated/patches/nodeCustomTypePatches.d.ts +8 -0
  200. package/dist/types/generated/protos/akash/base/attributes/v1/attribute.d.ts +3 -0
  201. package/dist/types/generated/protos/akash/inventory/v1/snapshot.d.ts +112 -0
  202. package/dist/types/generated/protos/akash/inventory/v1/snapshot_akash.d.ts +22 -0
  203. package/dist/types/generated/protos/akash/manifest/v2beta3/httpoptions.d.ts +35 -0
  204. package/dist/types/generated/protos/akash/market/v1/stats.d.ts +35 -0
  205. package/dist/types/generated/protos/akash/market/v1/types.d.ts +5 -3
  206. package/dist/types/generated/protos/akash/market/v1beta5/query.d.ts +29 -0
  207. package/dist/types/generated/protos/akash/market/v1beta5/query_akash.d.ts +8 -1
  208. package/dist/types/generated/protos/akash/provider/v1beta4/event.d.ts +40 -0
  209. package/dist/types/generated/protos/akash/provider/v1beta4/genesis.d.ts +11 -1
  210. package/dist/types/generated/protos/akash/provider/v1beta4/maintenance.d.ts +87 -0
  211. package/dist/types/generated/protos/akash/provider/v1beta4/msg.d.ts +57 -0
  212. package/dist/types/generated/protos/akash/provider/v1beta4/params.d.ts +17 -0
  213. package/dist/types/generated/protos/akash/provider/v1beta4/paramsmsg.d.ts +22 -0
  214. package/dist/types/generated/protos/akash/provider/v1beta4/provider.d.ts +13 -0
  215. package/dist/types/generated/protos/akash/provider/v1beta4/query.d.ts +93 -1
  216. package/dist/types/generated/protos/akash/provider/v1beta4/query_akash.d.ts +29 -1
  217. package/dist/types/generated/protos/akash/provider/v1beta4/service_akash.d.ts +20 -1
  218. package/dist/types/generated/protos/akash/verification/v1/event.d.ts +339 -0
  219. package/dist/types/generated/protos/akash/verification/v1/genesis.d.ts +45 -0
  220. package/dist/types/generated/protos/akash/verification/v1/msg.d.ts +614 -0
  221. package/dist/types/generated/protos/akash/verification/v1/params.d.ts +147 -0
  222. package/dist/types/generated/protos/akash/verification/v1/query.d.ts +290 -0
  223. package/dist/types/generated/protos/akash/verification/v1/query_akash.d.ts +97 -0
  224. package/dist/types/generated/protos/akash/verification/v1/service.d.ts +1 -0
  225. package/dist/types/generated/protos/akash/verification/v1/service_akash.d.ts +126 -0
  226. package/dist/types/generated/protos/akash/verification/v1/state.d.ts +320 -0
  227. package/dist/types/generated/protos/akash/verification/v1/types.d.ts +348 -0
  228. package/dist/types/generated/protos/akash/verification/v1/verificationrequirement.d.ts +36 -0
  229. package/dist/types/generated/protos/index.akash.v1.d.ts +9 -0
  230. package/dist/types/generated/protos/index.akash.v1beta4.d.ts +7 -4
  231. package/dist/types/generated/protos/index.akash.v1beta5.d.ts +1 -1
  232. package/dist/types/generated/protos/index.provider.akash.v1.d.ts +1 -0
  233. package/dist/types/generated/protos/index.provider.akash.v2beta3.d.ts +1 -1
  234. package/dist/types/sdk/chain/createChainNodeSDK.d.ts +45 -0
  235. package/dist/types/sdk/chain/createChainNodeWebSDK.d.ts +45 -0
  236. package/dist/types/sdl/duration.d.ts +13 -0
  237. package/dist/types/sdl/httpTimeout.d.ts +10 -0
  238. package/dist/types/sdl/index.d.ts +0 -1
  239. package/dist/types/sdl/manifest/reclamationDuration.d.ts +3 -7
  240. package/dist/types/sdl/validateSDL/validateSDLInput.d.ts +131 -16
  241. package/package.json +1 -1
  242. package/dist/cjs/sdl/types.cjs.map +0 -7
  243. package/dist/esm/chunk-C3WV6GJ6.js +0 -234
  244. package/dist/esm/chunk-C3WV6GJ6.js.map +0 -7
  245. package/dist/esm/chunk-CVX7ZJQR.js.map +0 -7
  246. package/dist/esm/chunk-CZGHFBAO.js.map +0 -7
  247. package/dist/esm/chunk-E7KECYS7.js.map +0 -7
  248. package/dist/esm/chunk-IVLF3VVZ.js +0 -364
  249. package/dist/esm/chunk-IVLF3VVZ.js.map +0 -7
  250. package/dist/esm/chunk-MV27RM25.js +0 -368
  251. package/dist/esm/chunk-MV27RM25.js.map +0 -7
  252. package/dist/esm/chunk-S2CZQ6AM.js +0 -211
  253. package/dist/esm/chunk-S2CZQ6AM.js.map +0 -7
  254. package/dist/esm/chunk-SXGU4O34.js +0 -258
  255. package/dist/esm/chunk-SXGU4O34.js.map +0 -7
  256. package/dist/esm/chunk-UHI2V2WP.js.map +0 -7
  257. package/dist/esm/chunk-V42TLXWK.js +0 -177
  258. package/dist/esm/chunk-V42TLXWK.js.map +0 -7
  259. package/dist/esm/chunk-ZRZ6LUI2.js.map +0 -7
  260. package/dist/esm/query_akash-N3FPIXVQ.js +0 -39
  261. package/dist/esm/query_akash-N3FPIXVQ.js.map +0 -7
  262. package/dist/esm/query_akash-TZ6F7OO4.js.map +0 -7
  263. package/dist/esm/service_akash-5AUMDLU5.js +0 -46
  264. package/dist/esm/service_akash-5AUMDLU5.js.map +0 -7
  265. package/dist/types/sdl/types.d.ts +0 -305
  266. /package/dist/esm/{chunk-4SZHF6SE.js.map → chunk-3U5XKNEU.js.map} +0 -0
  267. /package/dist/esm/{chunk-IKTMMFJ5.js.map → chunk-54RECHZZ.js.map} +0 -0
  268. /package/dist/esm/{chunk-WCUR732W.js.map → chunk-57534UAR.js.map} +0 -0
  269. /package/dist/esm/{chunk-B4YVLEG7.js.map → chunk-7F3NJG67.js.map} +0 -0
  270. /package/dist/esm/{chunk-XAOERZEY.js.map → chunk-AKNHD3CM.js.map} +0 -0
  271. /package/dist/esm/{chunk-ZGK4PJCD.js.map → chunk-BQNJHJXY.js.map} +0 -0
  272. /package/dist/esm/{chunk-YBRE4XNB.js.map → chunk-CFEWW2ER.js.map} +0 -0
  273. /package/dist/esm/{chunk-EJQUNX4L.js.map → chunk-DCLXPAMC.js.map} +0 -0
  274. /package/dist/esm/{chunk-AR26HCRY.js.map → chunk-F4IQOYFH.js.map} +0 -0
  275. /package/dist/esm/{chunk-ENZ3OBCL.js.map → chunk-F7KT5EX5.js.map} +0 -0
  276. /package/dist/esm/{chunk-3QS3CMF4.js.map → chunk-GRGSTKN3.js.map} +0 -0
  277. /package/dist/esm/{chunk-TTQ36NQ5.js.map → chunk-HRN6NSO2.js.map} +0 -0
  278. /package/dist/esm/{chunk-N42ATJOO.js.map → chunk-M5P5LAJJ.js.map} +0 -0
  279. /package/dist/esm/{chunk-3K7Q5MUF.js.map → chunk-MIJCN6AD.js.map} +0 -0
  280. /package/dist/esm/{chunk-OYI3IQIV.js.map → chunk-NNB5QBR2.js.map} +0 -0
  281. /package/dist/esm/{chunk-WMSUADX2.js.map → chunk-OJ54L3XZ.js.map} +0 -0
  282. /package/dist/esm/{chunk-5ODS4QTF.js.map → chunk-P64VHYRM.js.map} +0 -0
  283. /package/dist/esm/{chunk-MFZVOFPX.js.map → chunk-PAOVIX5L.js.map} +0 -0
  284. /package/dist/esm/{chunk-ZXN75Q55.js.map → chunk-PWXFQ5FI.js.map} +0 -0
  285. /package/dist/esm/{chunk-NP4QQMME.js.map → chunk-RJZ46VHV.js.map} +0 -0
  286. /package/dist/esm/{chunk-4TSICBUM.js.map → chunk-W3TLZPTC.js.map} +0 -0
  287. /package/dist/esm/{chunk-M2RS2IFR.js.map → chunk-WNFIFYG2.js.map} +0 -0
  288. /package/dist/esm/{chunk-SGDEIQ7L.js.map → chunk-Y7BVCD32.js.map} +0 -0
  289. /package/dist/esm/{query_akash-I3RPHLVA.js.map → query_akash-BTYAA6UN.js.map} +0 -0
  290. /package/dist/esm/{query_akash-QF2LHJQN.js.map → query_akash-EG43V2QH.js.map} +0 -0
  291. /package/dist/esm/{query_akash-72TFPQBZ.js.map → query_akash-HN4NCENR.js.map} +0 -0
  292. /package/dist/esm/{query_akash-EGFDDA4L.js.map → query_akash-SVNQ4S67.js.map} +0 -0
  293. /package/dist/esm/{service_akash-JQKI2SJP.js.map → service_akash-HFGWADC2.js.map} +0 -0
  294. /package/dist/esm/{service_akash-SXXXZL6K.js.map → service_akash-KAJJV7LX.js.map} +0 -0
  295. /package/dist/esm/{service_akash-PFTEVUGK.js.map → service_akash-QTGRTXLG.js.map} +0 -0
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var duration_exports = {};
20
+ __export(duration_exports, {
21
+ parseDuration: () => parseDuration
22
+ });
23
+ module.exports = __toCommonJS(duration_exports);
24
+ const DURATION_PATTERN = /^([0-9]+)(ms|s|m|h)?$/;
25
+ const UNIT_MILLISECONDS = {
26
+ ms: 1n,
27
+ s: 1000n,
28
+ m: 60000n,
29
+ h: 3600000n
30
+ };
31
+ function parseDuration(value) {
32
+ const match = DURATION_PATTERN.exec(value);
33
+ if (!match) return void 0;
34
+ const unit = match[2];
35
+ if (unit !== void 0 && !isDurationUnit(unit)) return void 0;
36
+ return {
37
+ milliseconds: BigInt(match[1]) * (unit === void 0 ? 1n : UNIT_MILLISECONDS[unit]),
38
+ unit
39
+ };
40
+ }
41
+ function isDurationUnit(value) {
42
+ return Object.hasOwn(UNIT_MILLISECONDS, value);
43
+ }
44
+ //# sourceMappingURL=duration.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/sdl/duration.ts"],
4
+ "sourcesContent": ["const DURATION_PATTERN = /^([0-9]+)(ms|s|m|h)?$/;\n\nconst UNIT_MILLISECONDS = {\n ms: 1n,\n s: 1_000n,\n m: 60_000n,\n h: 3_600_000n,\n};\n\ntype DurationUnit = keyof typeof UNIT_MILLISECONDS;\n\ntype ParsedDuration = {\n milliseconds: bigint;\n unit: DurationUnit | undefined;\n};\n\nexport function parseDuration(value: string): ParsedDuration | undefined {\n const match = DURATION_PATTERN.exec(value);\n if (!match) return undefined;\n\n const unit = match[2];\n if (unit !== undefined && !isDurationUnit(unit)) return undefined;\n\n return {\n milliseconds: BigInt(match[1]) * (unit === undefined ? 1n : UNIT_MILLISECONDS[unit]),\n unit,\n };\n}\n\nfunction isDurationUnit(value: string): value is DurationUnit {\n return Object.hasOwn(UNIT_MILLISECONDS, value);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,mBAAmB;AAEzB,MAAM,oBAAoB;AAAA,EACxB,IAAI;AAAA,EACJ,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AASO,SAAS,cAAc,OAA2C;AACvE,QAAM,QAAQ,iBAAiB,KAAK,KAAK;AACzC,MAAI,CAAC,MAAO,QAAO;AAEnB,QAAM,OAAO,MAAM,CAAC;AACpB,MAAI,SAAS,UAAa,CAAC,eAAe,IAAI,EAAG,QAAO;AAExD,SAAO;AAAA,IACL,cAAc,OAAO,MAAM,CAAC,CAAC,KAAK,SAAS,SAAY,KAAK,kBAAkB,IAAI;AAAA,IAClF;AAAA,EACF;AACF;AAEA,SAAS,eAAe,OAAsC;AAC5D,SAAO,OAAO,OAAO,mBAAmB,KAAK;AAC/C;",
6
+ "names": []
7
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var httpTimeout_exports = {};
20
+ __export(httpTimeout_exports, {
21
+ MAX_HTTP_TIMEOUT_MILLISECONDS: () => MAX_HTTP_TIMEOUT_MILLISECONDS,
22
+ parseHTTPTimeout: () => parseHTTPTimeout
23
+ });
24
+ module.exports = __toCommonJS(httpTimeout_exports);
25
+ var import_duration = require("./duration.cjs");
26
+ const MAX_HTTP_TIMEOUT_MILLISECONDS = 4294967295;
27
+ const MAX_HTTP_TIMEOUT_MILLISECONDS_BIGINT = BigInt(MAX_HTTP_TIMEOUT_MILLISECONDS);
28
+ function parseHTTPTimeout(value) {
29
+ if (typeof value === "number") {
30
+ return validateMilliseconds(value);
31
+ }
32
+ const duration = (0, import_duration.parseDuration)(value);
33
+ if (!duration) {
34
+ return {
35
+ message: "must be milliseconds or a whole-number duration using ms, s, m, or h",
36
+ ok: false
37
+ };
38
+ }
39
+ if (duration.milliseconds > MAX_HTTP_TIMEOUT_MILLISECONDS_BIGINT) {
40
+ return {
41
+ message: `cannot be greater than ${MAX_HTTP_TIMEOUT_MILLISECONDS} ms`,
42
+ ok: false
43
+ };
44
+ }
45
+ return { milliseconds: Number(duration.milliseconds), ok: true };
46
+ }
47
+ function validateMilliseconds(milliseconds) {
48
+ if (!Number.isSafeInteger(milliseconds) || milliseconds < 0) {
49
+ return { message: "must resolve to a non-negative whole number of milliseconds", ok: false };
50
+ }
51
+ if (milliseconds > MAX_HTTP_TIMEOUT_MILLISECONDS) {
52
+ return {
53
+ message: `cannot be greater than ${MAX_HTTP_TIMEOUT_MILLISECONDS} ms`,
54
+ ok: false
55
+ };
56
+ }
57
+ return { milliseconds, ok: true };
58
+ }
59
+ //# sourceMappingURL=httpTimeout.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/sdl/httpTimeout.ts"],
4
+ "sourcesContent": ["import { parseDuration } from \"./duration.ts\";\n\nexport const MAX_HTTP_TIMEOUT_MILLISECONDS = 4_294_967_295;\n\nconst MAX_HTTP_TIMEOUT_MILLISECONDS_BIGINT = BigInt(MAX_HTTP_TIMEOUT_MILLISECONDS);\n\ntype HTTPTimeoutParseResult =\n | { milliseconds: number; ok: true }\n | { message: string; ok: false };\n\nexport function parseHTTPTimeout(value: number | string): HTTPTimeoutParseResult {\n if (typeof value === \"number\") {\n return validateMilliseconds(value);\n }\n\n const duration = parseDuration(value);\n if (!duration) {\n return {\n message: \"must be milliseconds or a whole-number duration using ms, s, m, or h\",\n ok: false,\n };\n }\n\n if (duration.milliseconds > MAX_HTTP_TIMEOUT_MILLISECONDS_BIGINT) {\n return {\n message: `cannot be greater than ${MAX_HTTP_TIMEOUT_MILLISECONDS} ms`,\n ok: false,\n };\n }\n\n return { milliseconds: Number(duration.milliseconds), ok: true };\n}\n\nfunction validateMilliseconds(milliseconds: number): HTTPTimeoutParseResult {\n if (!Number.isSafeInteger(milliseconds) || milliseconds < 0) {\n return { message: \"must resolve to a non-negative whole number of milliseconds\", ok: false };\n }\n\n if (milliseconds > MAX_HTTP_TIMEOUT_MILLISECONDS) {\n return {\n message: `cannot be greater than ${MAX_HTTP_TIMEOUT_MILLISECONDS} ms`,\n ok: false,\n };\n }\n\n return { milliseconds, ok: true };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA8B;AAEvB,MAAM,gCAAgC;AAE7C,MAAM,uCAAuC,OAAO,6BAA6B;AAM1E,SAAS,iBAAiB,OAAgD;AAC/E,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,qBAAqB,KAAK;AAAA,EACnC;AAEA,QAAM,eAAW,+BAAc,KAAK;AACpC,MAAI,CAAC,UAAU;AACb,WAAO;AAAA,MACL,SAAS;AAAA,MACT,IAAI;AAAA,IACN;AAAA,EACF;AAEA,MAAI,SAAS,eAAe,sCAAsC;AAChE,WAAO;AAAA,MACL,SAAS,0BAA0B,6BAA6B;AAAA,MAChE,IAAI;AAAA,IACN;AAAA,EACF;AAEA,SAAO,EAAE,cAAc,OAAO,SAAS,YAAY,GAAG,IAAI,KAAK;AACjE;AAEA,SAAS,qBAAqB,cAA8C;AAC1E,MAAI,CAAC,OAAO,cAAc,YAAY,KAAK,eAAe,GAAG;AAC3D,WAAO,EAAE,SAAS,+DAA+D,IAAI,MAAM;AAAA,EAC7F;AAEA,MAAI,eAAe,+BAA+B;AAChD,WAAO;AAAA,MACL,SAAS,0BAA0B,6BAA6B;AAAA,MAChE,IAAI;AAAA,IACN;AAAA,EACF;AAEA,SAAO,EAAE,cAAc,IAAI,KAAK;AAClC;",
6
+ "names": []
7
+ }
@@ -15,7 +15,6 @@ var __copyProps = (to, from, except, desc) => {
15
15
  }
16
16
  return to;
17
17
  };
18
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
19
  var sdl_exports = {};
21
20
  __export(sdl_exports, {
@@ -27,7 +26,6 @@ __export(sdl_exports, {
27
26
  });
28
27
  module.exports = __toCommonJS(sdl_exports);
29
28
  var import_validateSDL = require("./validateSDL/validateSDL.cjs");
30
- __reExport(sdl_exports, require("./types.cjs"), module.exports);
31
29
  var import_generateManifest = require("./manifest/generateManifest.cjs");
32
30
  var import_generateManifestVersion = require("./manifest/generateManifestVersion.cjs");
33
31
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/sdl/index.ts"],
4
- "sourcesContent": ["/**\n * SDL (Stack Definition Language) module exports\n * Provides functionality for parsing and validating Akash deployment manifests\n *\n * @example\n * ```ts\n * import { SDL } from './sdl';\n *\n * const yaml = `\n * version: \"2.0\"\n * services:\n * web:\n * image: nginx\n * expose:\n * - port: 80\n * as: 80\n * to:\n * - global: true\n * `;\n *\n * const sdl = SDL.fromString(yaml);\n * const manifest = sdl.manifest();\n * ```\n */\n\nexport { validateSDL, validationSDLSchema } from \"./validateSDL/validateSDL.ts\";\nexport type { SDLInput } from \"./validateSDL/validateSDLInput.ts\";\nexport type { ValidationError } from \"../utils/jsonSchemaValidation.ts\";\n\nexport * from \"./types.ts\";\n\nexport { generateManifest } from \"./manifest/generateManifest.ts\";\nexport type { Manifest, GenerateManifestResult } from \"./manifest/generateManifest.ts\";\nexport { generateManifestVersion, manifestToSortedJSON } from \"./manifest/generateManifestVersion.ts\";\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBA,yBAAiD;AAIjD,wBAAc,uBA7Bd;AA+BA,8BAAiC;AAEjC,qCAA8D;",
4
+ "sourcesContent": ["/**\n * SDL (Stack Definition Language) module exports\n * Provides functionality for parsing and validating Akash deployment manifests\n *\n * @example\n * ```ts\n * import { SDL } from './sdl';\n *\n * const yaml = `\n * version: \"2.0\"\n * services:\n * web:\n * image: nginx\n * expose:\n * - port: 80\n * as: 80\n * to:\n * - global: true\n * `;\n *\n * const sdl = SDL.fromString(yaml);\n * const manifest = sdl.manifest();\n * ```\n */\n\nexport { validateSDL, validationSDLSchema } from \"./validateSDL/validateSDL.ts\";\nexport type { SDLInput } from \"./validateSDL/validateSDLInput.ts\";\nexport type { ValidationError } from \"../utils/jsonSchemaValidation.ts\";\n\nexport { generateManifest } from \"./manifest/generateManifest.ts\";\nexport type { Manifest, GenerateManifestResult } from \"./manifest/generateManifest.ts\";\nexport { generateManifestVersion, manifestToSortedJSON } from \"./manifest/generateManifestVersion.ts\";\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBA,yBAAiD;AAIjD,8BAAiC;AAEjC,qCAA8D;",
6
6
  "names": []
7
7
  }
@@ -33,6 +33,8 @@ var import_resourceunit = require("../../generated/protos/akash/deployment/v1bet
33
33
  var import_group = require("../../generated/protos/akash/manifest/v2beta3/group.cjs");
34
34
  var import_service = require("../../generated/protos/akash/manifest/v2beta3/service.cjs");
35
35
  var import_serviceexpose = require("../../generated/protos/akash/manifest/v2beta3/serviceexpose.cjs");
36
+ var import_types = require("../../generated/protos/akash/verification/v1/types.cjs");
37
+ var import_verificationrequirement = require("../../generated/protos/akash/verification/v1/verificationrequirement.cjs");
36
38
  var import_utils = require("../utils.cjs");
37
39
  var import_validateSDL = require("../validateSDL/validateSDL.cjs");
38
40
  var import_manifestUtils = require("./manifestUtils.cjs");
@@ -78,7 +80,8 @@ function generateManifest(sdl) {
78
80
  signedBy: import_attribute.SignedBy.fromPartial({
79
81
  allOf: infra.signedBy?.allOf,
80
82
  anyOf: infra.signedBy?.anyOf
81
- })
83
+ }),
84
+ verification: buildVerificationRequirement(infra.verification)
82
85
  })
83
86
  }),
84
87
  boundComputes: {},
@@ -171,6 +174,22 @@ function generateManifest(sdl) {
171
174
  };
172
175
  return { ok: true, value: manifest };
173
176
  }
177
+ const CAPABILITY_FLAGS = {
178
+ tee_hardware_attestation: import_types.CapabilityFlag.capability_tee_hardware_attestation,
179
+ confidential_computing: import_types.CapabilityFlag.capability_confidential_computing,
180
+ persistent_storage: import_types.CapabilityFlag.capability_persistent_storage,
181
+ bare_metal: import_types.CapabilityFlag.capability_bare_metal
182
+ };
183
+ function buildVerificationRequirement(requirement) {
184
+ if (!requirement || requirement.min_tier === 0) return void 0;
185
+ return import_verificationrequirement.VerificationRequirement.fromPartial({
186
+ minTier: (0, import_types.verificationTierFromJSON)(requirement.min_tier),
187
+ requiredCapabilities: (requirement.capabilities ?? []).map((capability) => CAPABILITY_FLAGS[capability]),
188
+ requiredAuditors: requirement.auditors,
189
+ auditorMode: requirement.auditor_mode === "all" ? import_types.AuditorSelectionMode.auditor_selection_mode_all : import_types.AuditorSelectionMode.auditor_selection_mode_any,
190
+ minAuditorCount: requirement.min_auditor_count
191
+ });
192
+ }
174
193
  function buildResources(id, compute, service, endpointSequenceNumbers) {
175
194
  const res = compute.resources;
176
195
  const cpuAttributes = (0, import_manifestUtils.buildResourceAttributes)(res.cpu.attributes);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/sdl/manifest/generateManifest.ts"],
4
- "sourcesContent": ["import { PlacementRequirements, SignedBy } from \"../../generated/protos/akash/base/attributes/v1/attribute.ts\";\nimport { CPU } from \"../../generated/protos/akash/base/resources/v1beta4/cpu.ts\";\nimport { GPU } from \"../../generated/protos/akash/base/resources/v1beta4/gpu.ts\";\nimport { Memory } from \"../../generated/protos/akash/base/resources/v1beta4/memory.ts\";\nimport { Resources } from \"../../generated/protos/akash/base/resources/v1beta4/resources.ts\";\nimport { Storage } from \"../../generated/protos/akash/base/resources/v1beta4/storage.ts\";\nimport { DeploymentReclamation } from \"../../generated/protos/akash/deployment/v1/deployment.ts\";\nimport { GroupSpec } from \"../../generated/protos/akash/deployment/v1beta4/groupspec.ts\";\nimport { ResourceUnit } from \"../../generated/protos/akash/deployment/v1beta4/resourceunit.ts\";\nimport { Group } from \"../../generated/protos/akash/manifest/v2beta3/group.ts\";\nimport { ImageCredentials, Service, ServiceParams, StorageParams, TEEParams } from \"../../generated/protos/akash/manifest/v2beta3/service.ts\";\nimport { ServiceExpose } from \"../../generated/protos/akash/manifest/v2beta3/serviceexpose.ts\";\nimport type { ValidationError } from \"../../utils/jsonSchemaValidation.ts\";\nimport { castArray } from \"../utils.ts\";\nimport type { SDLInput } from \"../validateSDL/validateSDL.ts\";\nimport { validateSDL } from \"../validateSDL/validateSDL.ts\";\nimport {\n buildHttpOptions,\n buildResourceAttributes,\n buildServiceEndpoints,\n buildStorageAttributes,\n computeEndpointSequenceNumbers,\n parseCpuUnits,\n parseGpuUnits,\n parseMemoryBytes,\n parseServiceProto,\n parseStorageBytes,\n resolveInterconnectGroup,\n type SDLCompute,\n type SDLService,\n transformGpuAttributes,\n} from \"./manifestUtils.ts\";\nimport { minWindowToDuration } from \"./reclamationDuration.ts\";\n\nexport interface GenerateManifestOkResult {\n groups: Group[];\n groupSpecs: GroupSpec[];\n reclamation?: DeploymentReclamation;\n}\n\nexport type Manifest = GenerateManifestOkResult[\"groups\"];\nexport type GenerateManifestResult =\n | { ok?: false; value: ValidationError[] }\n | { ok: true; value: GenerateManifestOkResult };\nexport function generateManifest(sdl: SDLInput): GenerateManifestResult {\n const errors = validateSDL(sdl);\n if (errors) return { ok: false, value: errors };\n\n const endpointSequenceNumbers = computeEndpointSequenceNumbers(sdl.services);\n const groupsMap = new Map<string, {\n dgroup: GroupSpec;\n boundComputes: Record<string, number>;\n teeType?: string;\n }>();\n const resourceIds = new Map<string, number>();\n\n const deploymentsByPlacement = new Map<string, [string, { profile: string; count: number }][]>();\n for (const [svcName, placements] of Object.entries(sdl.deployment)) {\n for (const [placementName, deployment] of Object.entries(placements)) {\n let list = deploymentsByPlacement.get(placementName);\n if (!list) {\n list = [];\n deploymentsByPlacement.set(placementName, list);\n }\n list.push([svcName, deployment]);\n }\n }\n for (const list of deploymentsByPlacement.values()) {\n list.sort(([a], [b]) => a.localeCompare(b));\n }\n\n const services = Object.entries(sdl.services).sort(([a], [b]) => a.localeCompare(b));\n\n for (const [svcName, service] of services) {\n for (const [placementName, svcdepl] of Object.entries(sdl.deployment[svcName])) {\n const compute = sdl.profiles.compute[svcdepl.profile];\n const infra = sdl.profiles.placement[placementName];\n const pricing = infra.pricing[svcdepl.profile];\n const price = {\n denom: pricing.denom,\n amount: pricing.amount?.toString(),\n };\n\n let group = groupsMap.get(placementName);\n\n if (!group) {\n group = {\n dgroup: GroupSpec.fromPartial({\n name: placementName,\n resources: [],\n requirements: PlacementRequirements.fromPartial({\n attributes: buildResourceAttributes(infra.attributes),\n signedBy: SignedBy.fromPartial({\n allOf: infra.signedBy?.allOf,\n anyOf: infra.signedBy?.anyOf,\n }),\n }),\n }),\n boundComputes: {},\n teeType: undefined,\n };\n\n groupsMap.set(placementName, group);\n }\n\n const teeType = service.params?.tee;\n if (teeType && !group.teeType) {\n group.teeType = teeType;\n group.dgroup.requirements!.attributes.push({ key: \"tee/type\", value: teeType });\n group.dgroup.requirements!.attributes.sort((a, b) => a.key.localeCompare(b.key));\n }\n\n const profileKey = `${placementName}:${svcdepl.profile}`;\n const location = group.boundComputes[svcdepl.profile];\n\n if (location === undefined) {\n const resId = group.dgroup.resources.length > 0\n ? group.dgroup.resources.length + 1\n : 1;\n\n resourceIds.set(profileKey, resId);\n\n const resources = buildResources(resId, compute, service, endpointSequenceNumbers);\n\n group.dgroup.resources.push(\n ResourceUnit.fromPartial({\n resource: resources,\n count: svcdepl.count,\n price,\n }),\n );\n\n group.boundComputes[svcdepl.profile] = group.dgroup.resources.length - 1;\n } else {\n if (!resourceIds.has(profileKey)) {\n resourceIds.set(profileKey, group.dgroup.resources[location].resource!.id);\n }\n\n group.dgroup.resources[location].count += svcdepl.count;\n group.dgroup.resources[location].resource!.endpoints.push(\n ...buildServiceEndpoints(service, endpointSequenceNumbers),\n );\n }\n }\n }\n\n for (const group of groupsMap.values()) {\n for (const resourceUnit of group.dgroup.resources) {\n resourceUnit.resource!.endpoints.sort(\n (a, b) => a.kind - b.kind || a.sequenceNumber - b.sequenceNumber,\n );\n }\n }\n\n const sortedGroupNames = [...groupsMap.keys()].sort();\n let groups: Group[] | undefined;\n let groupSpecs: GroupSpec[] | undefined;\n let reclamation: DeploymentReclamation | undefined;\n\n const manifest = {\n // reclamation is a `MsgCreateDeployment` field, not a manifest group, and is\n // not needed in every call \u2014 so it's lazy like `groups`/`groupSpecs`.\n // `validateSDL` (run above) already guaranteed `min_window` is valid, so\n // `minWindowToDuration` never throws here.\n get reclamation() {\n if (sdl.reclamation && !reclamation) {\n reclamation = DeploymentReclamation.fromPartial({\n minWindow: minWindowToDuration(sdl.reclamation.min_window),\n });\n }\n return reclamation;\n },\n get groups() {\n groups ??= sortedGroupNames.map((placementName) => {\n const deployments = deploymentsByPlacement.get(placementName)!;\n\n return Group.fromPartial({\n name: placementName,\n services: deployments.map(([svcName]) => {\n const service = sdl.services[svcName];\n const deployment = sdl.deployment[svcName][placementName];\n const compute = sdl.profiles.compute[deployment.profile];\n const resourceId = resourceIds.get(`${placementName}:${deployment.profile}`) || 1;\n\n return buildManifestService(\n resourceId,\n svcName,\n service,\n compute,\n deployment.count,\n endpointSequenceNumbers,\n );\n }),\n });\n });\n return groups;\n },\n get groupSpecs() {\n groupSpecs ??= sortedGroupNames.map((name) => groupsMap.get(name)!.dgroup);\n return groupSpecs;\n },\n };\n\n return { ok: true, value: manifest };\n}\n\nfunction buildResources(\n id: number,\n compute: SDLCompute,\n service: SDLService,\n endpointSequenceNumbers: Record<string, number>,\n): Resources {\n const res = compute.resources;\n const cpuAttributes = buildResourceAttributes(res.cpu.attributes);\n const gpuAttributes = res.gpu?.attributes ? transformGpuAttributes(res.gpu.attributes) : [];\n\n return Resources.fromPartial({\n id,\n cpu: CPU.fromPartial({\n units: { val: parseCpuUnits(res.cpu) },\n attributes: cpuAttributes,\n }),\n memory: Memory.fromPartial({\n quantity: { val: parseMemoryBytes(res.memory) },\n }),\n storage: castArray(res.storage).map((s) =>\n Storage.fromPartial({\n name: s.name || \"default\",\n quantity: { val: parseStorageBytes(s.size) },\n attributes: buildStorageAttributes(s.attributes),\n }),\n ),\n gpu: GPU.fromPartial({\n units: { val: parseGpuUnits(res.gpu) },\n attributes: gpuAttributes,\n }),\n endpoints: buildServiceEndpoints(service, endpointSequenceNumbers),\n });\n}\n\nfunction buildManifestService(\n resourceId: number,\n name: string,\n service: SDLService,\n compute: SDLCompute,\n count: number,\n endpointSequenceNumbers: Record<string, number>,\n): Service {\n const credentials = service.credentials\n ? ImageCredentials.fromPartial({\n host: service.credentials.host,\n email: service.credentials.email || \"\",\n username: service.credentials.username,\n password: service.credentials.password,\n })\n : undefined;\n\n const params = buildParams(service);\n\n // The interconnect group lives under gpu.attributes.interconnect (either\n // `[]` for the implicit `auto` group or `{ group: <name> }` for an\n // explicit name) and propagates to the off-chain manifest's\n // Service.interconnectGroup field so the provider's workload builder\n // can label pods for per-group anti-affinity. The same value is also\n // emitted into Resources.GPU.Attributes by transformGpuAttributes \u2014\n // both consumers (bid engine vs. workload builder) see it.\n const interconnectGroup = resolveInterconnectGroup(compute.resources.gpu?.attributes?.interconnect);\n\n return Service.fromPartial({\n name,\n image: service.image,\n command: service.command || [],\n args: service.args || [],\n env: service.env || [],\n resources: buildResources(resourceId, compute, service, endpointSequenceNumbers),\n count,\n expose: buildManifestExpose(service, endpointSequenceNumbers),\n params,\n credentials,\n interconnectGroup,\n });\n}\n\nfunction buildParams(service: SDLService): ServiceParams | undefined {\n if (!service.params) return undefined;\n\n const storage = service.params.storage || {};\n const storageNames = service.params.storage ? Object.keys(storage).sort() : [];\n const result = ServiceParams.fromPartial({\n storage: storageNames.map((name) => {\n const config = storage[name];\n return StorageParams.fromPartial({\n name,\n mount: config.mount || \"\",\n readOnly: config.readOnly || false,\n });\n }),\n });\n\n // Permissions are not in the protobuf type but need to be preserved\n if (service.params.permissions) {\n (result as unknown as Record<string, unknown>).permissions = service.params.permissions;\n }\n\n // Project TEE onto the manifest, mirroring Go's groupBuilder\n // (params.TEE = {Type, Attestation: true}). `attestation` is hard-coded true\n // (not an input knob); the provider injects the attestation sidecar.\n if (service.params.tee) {\n result.tee = TEEParams.fromPartial({ type: service.params.tee, attestation: true });\n }\n\n return result;\n}\n\nfunction buildManifestExpose(\n service: SDLService,\n endpointSequenceNumbers: Record<string, number>,\n): ServiceExpose[] {\n return (service.expose ?? [])\n .flatMap((expose) =>\n (expose.to ?? []).map((to) =>\n ServiceExpose.fromPartial({\n port: expose.port,\n externalPort: expose.as,\n proto: parseServiceProto(expose.proto),\n service: to.service || \"\",\n global: to.global || false,\n hosts: expose.accept || [],\n httpOptions: buildHttpOptions(expose.http_options),\n ip: to.ip || \"\",\n endpointSequenceNumber: endpointSequenceNumbers[to.ip!],\n }),\n ),\n )\n .sort((a, b) => {\n if (a.service !== b.service) return a.service.localeCompare(b.service);\n if (a.port !== b.port) return a.port - b.port;\n if (a.proto !== b.proto) return a.proto.localeCompare(b.proto);\n if (a.global !== b.global) return a.global ? -1 : 1;\n return 0;\n });\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAgD;AAChD,iBAAoB;AACpB,iBAAoB;AACpB,oBAAuB;AACvB,uBAA0B;AAC1B,qBAAwB;AACxB,wBAAsC;AACtC,uBAA0B;AAC1B,0BAA6B;AAC7B,mBAAsB;AACtB,qBAAmF;AACnF,2BAA8B;AAE9B,mBAA0B;AAE1B,yBAA4B;AAC5B,2BAeO;AACP,iCAAoC;AAY7B,SAAS,iBAAiB,KAAuC;AACtE,QAAM,aAAS,gCAAY,GAAG;AAC9B,MAAI,OAAQ,QAAO,EAAE,IAAI,OAAO,OAAO,OAAO;AAE9C,QAAM,8BAA0B,qDAA+B,IAAI,QAAQ;AAC3E,QAAM,YAAY,oBAAI,IAInB;AACH,QAAM,cAAc,oBAAI,IAAoB;AAE5C,QAAM,yBAAyB,oBAAI,IAA4D;AAC/F,aAAW,CAAC,SAAS,UAAU,KAAK,OAAO,QAAQ,IAAI,UAAU,GAAG;AAClE,eAAW,CAAC,eAAe,UAAU,KAAK,OAAO,QAAQ,UAAU,GAAG;AACpE,UAAI,OAAO,uBAAuB,IAAI,aAAa;AACnD,UAAI,CAAC,MAAM;AACT,eAAO,CAAC;AACR,+BAAuB,IAAI,eAAe,IAAI;AAAA,MAChD;AACA,WAAK,KAAK,CAAC,SAAS,UAAU,CAAC;AAAA,IACjC;AAAA,EACF;AACA,aAAW,QAAQ,uBAAuB,OAAO,GAAG;AAClD,SAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAAA,EAC5C;AAEA,QAAM,WAAW,OAAO,QAAQ,IAAI,QAAQ,EAAE,KAAK,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AE,MAAM,cAAc,EAAE,KAAK;AAC7D,QAAI,EAAE,WAAW,EAAE,OAAQ,QAAO,EAAE,SAAS,KAAK;AAClD,WAAO;AAAA,EACT,CAAC;AACL;",
4
+ "sourcesContent": ["import { PlacementRequirements, SignedBy } from \"../../generated/protos/akash/base/attributes/v1/attribute.ts\";\nimport { CPU } from \"../../generated/protos/akash/base/resources/v1beta4/cpu.ts\";\nimport { GPU } from \"../../generated/protos/akash/base/resources/v1beta4/gpu.ts\";\nimport { Memory } from \"../../generated/protos/akash/base/resources/v1beta4/memory.ts\";\nimport { Resources } from \"../../generated/protos/akash/base/resources/v1beta4/resources.ts\";\nimport { Storage } from \"../../generated/protos/akash/base/resources/v1beta4/storage.ts\";\nimport { DeploymentReclamation } from \"../../generated/protos/akash/deployment/v1/deployment.ts\";\nimport { GroupSpec } from \"../../generated/protos/akash/deployment/v1beta4/groupspec.ts\";\nimport { ResourceUnit } from \"../../generated/protos/akash/deployment/v1beta4/resourceunit.ts\";\nimport { Group } from \"../../generated/protos/akash/manifest/v2beta3/group.ts\";\nimport { ImageCredentials, Service, ServiceParams, StorageParams, TEEParams } from \"../../generated/protos/akash/manifest/v2beta3/service.ts\";\nimport { ServiceExpose } from \"../../generated/protos/akash/manifest/v2beta3/serviceexpose.ts\";\nimport { AuditorSelectionMode, CapabilityFlag, verificationTierFromJSON } from \"../../generated/protos/akash/verification/v1/types.ts\";\nimport { VerificationRequirement } from \"../../generated/protos/akash/verification/v1/verificationrequirement.ts\";\nimport type { ValidationError } from \"../../utils/jsonSchemaValidation.ts\";\nimport { castArray } from \"../utils.ts\";\nimport type { SDLInput } from \"../validateSDL/validateSDL.ts\";\nimport { validateSDL } from \"../validateSDL/validateSDL.ts\";\nimport {\n buildHttpOptions,\n buildResourceAttributes,\n buildServiceEndpoints,\n buildStorageAttributes,\n computeEndpointSequenceNumbers,\n parseCpuUnits,\n parseGpuUnits,\n parseMemoryBytes,\n parseServiceProto,\n parseStorageBytes,\n resolveInterconnectGroup,\n type SDLCompute,\n type SDLService,\n transformGpuAttributes,\n} from \"./manifestUtils.ts\";\nimport { minWindowToDuration } from \"./reclamationDuration.ts\";\n\nexport interface GenerateManifestOkResult {\n groups: Group[];\n groupSpecs: GroupSpec[];\n reclamation?: DeploymentReclamation;\n}\n\nexport type Manifest = GenerateManifestOkResult[\"groups\"];\nexport type GenerateManifestResult =\n | { ok?: false; value: ValidationError[] }\n | { ok: true; value: GenerateManifestOkResult };\nexport function generateManifest(sdl: SDLInput): GenerateManifestResult {\n const errors = validateSDL(sdl);\n if (errors) return { ok: false, value: errors };\n\n const endpointSequenceNumbers = computeEndpointSequenceNumbers(sdl.services);\n const groupsMap = new Map<string, {\n dgroup: GroupSpec;\n boundComputes: Record<string, number>;\n teeType?: string;\n }>();\n const resourceIds = new Map<string, number>();\n\n const deploymentsByPlacement = new Map<string, [string, { profile: string; count: number }][]>();\n for (const [svcName, placements] of Object.entries(sdl.deployment)) {\n for (const [placementName, deployment] of Object.entries(placements)) {\n let list = deploymentsByPlacement.get(placementName);\n if (!list) {\n list = [];\n deploymentsByPlacement.set(placementName, list);\n }\n list.push([svcName, deployment]);\n }\n }\n for (const list of deploymentsByPlacement.values()) {\n list.sort(([a], [b]) => a.localeCompare(b));\n }\n\n const services = Object.entries(sdl.services).sort(([a], [b]) => a.localeCompare(b));\n\n for (const [svcName, service] of services) {\n for (const [placementName, svcdepl] of Object.entries(sdl.deployment[svcName])) {\n const compute = sdl.profiles.compute[svcdepl.profile];\n const infra = sdl.profiles.placement[placementName];\n const pricing = infra.pricing[svcdepl.profile];\n const price = {\n denom: pricing.denom,\n amount: pricing.amount?.toString(),\n };\n\n let group = groupsMap.get(placementName);\n\n if (!group) {\n group = {\n dgroup: GroupSpec.fromPartial({\n name: placementName,\n resources: [],\n requirements: PlacementRequirements.fromPartial({\n attributes: buildResourceAttributes(infra.attributes),\n signedBy: SignedBy.fromPartial({\n allOf: infra.signedBy?.allOf,\n anyOf: infra.signedBy?.anyOf,\n }),\n verification: buildVerificationRequirement(infra.verification),\n }),\n }),\n boundComputes: {},\n teeType: undefined,\n };\n\n groupsMap.set(placementName, group);\n }\n\n const teeType = service.params?.tee;\n if (teeType && !group.teeType) {\n group.teeType = teeType;\n group.dgroup.requirements!.attributes.push({ key: \"tee/type\", value: teeType });\n group.dgroup.requirements!.attributes.sort((a, b) => a.key.localeCompare(b.key));\n }\n\n const profileKey = `${placementName}:${svcdepl.profile}`;\n const location = group.boundComputes[svcdepl.profile];\n\n if (location === undefined) {\n const resId = group.dgroup.resources.length > 0\n ? group.dgroup.resources.length + 1\n : 1;\n\n resourceIds.set(profileKey, resId);\n\n const resources = buildResources(resId, compute, service, endpointSequenceNumbers);\n\n group.dgroup.resources.push(\n ResourceUnit.fromPartial({\n resource: resources,\n count: svcdepl.count,\n price,\n }),\n );\n\n group.boundComputes[svcdepl.profile] = group.dgroup.resources.length - 1;\n } else {\n if (!resourceIds.has(profileKey)) {\n resourceIds.set(profileKey, group.dgroup.resources[location].resource!.id);\n }\n\n group.dgroup.resources[location].count += svcdepl.count;\n group.dgroup.resources[location].resource!.endpoints.push(\n ...buildServiceEndpoints(service, endpointSequenceNumbers),\n );\n }\n }\n }\n\n for (const group of groupsMap.values()) {\n for (const resourceUnit of group.dgroup.resources) {\n resourceUnit.resource!.endpoints.sort(\n (a, b) => a.kind - b.kind || a.sequenceNumber - b.sequenceNumber,\n );\n }\n }\n\n const sortedGroupNames = [...groupsMap.keys()].sort();\n let groups: Group[] | undefined;\n let groupSpecs: GroupSpec[] | undefined;\n let reclamation: DeploymentReclamation | undefined;\n\n const manifest = {\n // reclamation is a `MsgCreateDeployment` field, not a manifest group, and is\n // not needed in every call \u2014 so it's lazy like `groups`/`groupSpecs`.\n // `validateSDL` (run above) already guaranteed `min_window` is valid, so\n // `minWindowToDuration` never throws here.\n get reclamation() {\n if (sdl.reclamation && !reclamation) {\n reclamation = DeploymentReclamation.fromPartial({\n minWindow: minWindowToDuration(sdl.reclamation.min_window),\n });\n }\n return reclamation;\n },\n get groups() {\n groups ??= sortedGroupNames.map((placementName) => {\n const deployments = deploymentsByPlacement.get(placementName)!;\n\n return Group.fromPartial({\n name: placementName,\n services: deployments.map(([svcName]) => {\n const service = sdl.services[svcName];\n const deployment = sdl.deployment[svcName][placementName];\n const compute = sdl.profiles.compute[deployment.profile];\n const resourceId = resourceIds.get(`${placementName}:${deployment.profile}`) || 1;\n\n return buildManifestService(\n resourceId,\n svcName,\n service,\n compute,\n deployment.count,\n endpointSequenceNumbers,\n );\n }),\n });\n });\n return groups;\n },\n get groupSpecs() {\n groupSpecs ??= sortedGroupNames.map((name) => groupsMap.get(name)!.dgroup);\n return groupSpecs;\n },\n };\n\n return { ok: true, value: manifest };\n}\n\ntype SDLVerificationRequirement = NonNullable<SDLInput[\"profiles\"][\"placement\"][string][\"verification\"]>;\n\nconst CAPABILITY_FLAGS: Record<NonNullable<SDLVerificationRequirement[\"capabilities\"]>[number], CapabilityFlag> = {\n tee_hardware_attestation: CapabilityFlag.capability_tee_hardware_attestation,\n confidential_computing: CapabilityFlag.capability_confidential_computing,\n persistent_storage: CapabilityFlag.capability_persistent_storage,\n bare_metal: CapabilityFlag.capability_bare_metal,\n};\n\nfunction buildVerificationRequirement(requirement?: SDLVerificationRequirement): VerificationRequirement | undefined {\n if (!requirement || requirement.min_tier === 0) return undefined;\n\n return VerificationRequirement.fromPartial({\n minTier: verificationTierFromJSON(requirement.min_tier),\n requiredCapabilities: (requirement.capabilities ?? []).map((capability) => CAPABILITY_FLAGS[capability]),\n requiredAuditors: requirement.auditors,\n auditorMode: requirement.auditor_mode === \"all\"\n ? AuditorSelectionMode.auditor_selection_mode_all\n : AuditorSelectionMode.auditor_selection_mode_any,\n minAuditorCount: requirement.min_auditor_count,\n });\n}\n\nfunction buildResources(\n id: number,\n compute: SDLCompute,\n service: SDLService,\n endpointSequenceNumbers: Record<string, number>,\n): Resources {\n const res = compute.resources;\n const cpuAttributes = buildResourceAttributes(res.cpu.attributes);\n const gpuAttributes = res.gpu?.attributes ? transformGpuAttributes(res.gpu.attributes) : [];\n\n return Resources.fromPartial({\n id,\n cpu: CPU.fromPartial({\n units: { val: parseCpuUnits(res.cpu) },\n attributes: cpuAttributes,\n }),\n memory: Memory.fromPartial({\n quantity: { val: parseMemoryBytes(res.memory) },\n }),\n storage: castArray(res.storage).map((s) =>\n Storage.fromPartial({\n name: s.name || \"default\",\n quantity: { val: parseStorageBytes(s.size) },\n attributes: buildStorageAttributes(s.attributes),\n }),\n ),\n gpu: GPU.fromPartial({\n units: { val: parseGpuUnits(res.gpu) },\n attributes: gpuAttributes,\n }),\n endpoints: buildServiceEndpoints(service, endpointSequenceNumbers),\n });\n}\n\nfunction buildManifestService(\n resourceId: number,\n name: string,\n service: SDLService,\n compute: SDLCompute,\n count: number,\n endpointSequenceNumbers: Record<string, number>,\n): Service {\n const credentials = service.credentials\n ? ImageCredentials.fromPartial({\n host: service.credentials.host,\n email: service.credentials.email || \"\",\n username: service.credentials.username,\n password: service.credentials.password,\n })\n : undefined;\n\n const params = buildParams(service);\n\n // The interconnect group lives under gpu.attributes.interconnect (either\n // `[]` for the implicit `auto` group or `{ group: <name> }` for an\n // explicit name) and propagates to the off-chain manifest's\n // Service.interconnectGroup field so the provider's workload builder\n // can label pods for per-group anti-affinity. The same value is also\n // emitted into Resources.GPU.Attributes by transformGpuAttributes \u2014\n // both consumers (bid engine vs. workload builder) see it.\n const interconnectGroup = resolveInterconnectGroup(compute.resources.gpu?.attributes?.interconnect);\n\n return Service.fromPartial({\n name,\n image: service.image,\n command: service.command || [],\n args: service.args || [],\n env: service.env || [],\n resources: buildResources(resourceId, compute, service, endpointSequenceNumbers),\n count,\n expose: buildManifestExpose(service, endpointSequenceNumbers),\n params,\n credentials,\n interconnectGroup,\n });\n}\n\nfunction buildParams(service: SDLService): ServiceParams | undefined {\n if (!service.params) return undefined;\n\n const storage = service.params.storage || {};\n const storageNames = service.params.storage ? Object.keys(storage).sort() : [];\n const result = ServiceParams.fromPartial({\n storage: storageNames.map((name) => {\n const config = storage[name];\n return StorageParams.fromPartial({\n name,\n mount: config.mount || \"\",\n readOnly: config.readOnly || false,\n });\n }),\n });\n\n // Permissions are not in the protobuf type but need to be preserved\n if (service.params.permissions) {\n (result as unknown as Record<string, unknown>).permissions = service.params.permissions;\n }\n\n // Project TEE onto the manifest, mirroring Go's groupBuilder\n // (params.TEE = {Type, Attestation: true}). `attestation` is hard-coded true\n // (not an input knob); the provider injects the attestation sidecar.\n if (service.params.tee) {\n result.tee = TEEParams.fromPartial({ type: service.params.tee, attestation: true });\n }\n\n return result;\n}\n\nfunction buildManifestExpose(\n service: SDLService,\n endpointSequenceNumbers: Record<string, number>,\n): ServiceExpose[] {\n return (service.expose ?? [])\n .flatMap((expose) =>\n (expose.to ?? []).map((to) =>\n ServiceExpose.fromPartial({\n port: expose.port,\n externalPort: expose.as,\n proto: parseServiceProto(expose.proto),\n service: to.service || \"\",\n global: to.global || false,\n hosts: expose.accept || [],\n httpOptions: buildHttpOptions(expose.http_options),\n ip: to.ip || \"\",\n endpointSequenceNumber: endpointSequenceNumbers[to.ip!],\n }),\n ),\n )\n .sort((a, b) => {\n if (a.service !== b.service) return a.service.localeCompare(b.service);\n if (a.port !== b.port) return a.port - b.port;\n if (a.proto !== b.proto) return a.proto.localeCompare(b.proto);\n if (a.global !== b.global) return a.global ? -1 : 1;\n return 0;\n });\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAgD;AAChD,iBAAoB;AACpB,iBAAoB;AACpB,oBAAuB;AACvB,uBAA0B;AAC1B,qBAAwB;AACxB,wBAAsC;AACtC,uBAA0B;AAC1B,0BAA6B;AAC7B,mBAAsB;AACtB,qBAAmF;AACnF,2BAA8B;AAC9B,mBAA+E;AAC/E,qCAAwC;AAExC,mBAA0B;AAE1B,yBAA4B;AAC5B,2BAeO;AACP,iCAAoC;AAY7B,SAAS,iBAAiB,KAAuC;AACtE,QAAM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zC,QAAI,EAAE,UAAU,EAAE,MAAO,QAAO,EAAE,MAAM,cAAc,EAAE,KAAK;AAC7D,QAAI,EAAE,WAAW,EAAE,OAAQ,QAAO,EAAE,SAAS,KAAK;AAClD,WAAO;AAAA,EACT,CAAC;AACL;",
6
6
  "names": []
7
7
  }
@@ -38,6 +38,14 @@ const encoder = new TextEncoder();
38
38
  const NULLABLE_MANIFEST_KEYS = /* @__PURE__ */ new Set(["command", "args", "env", "hosts", "storage"]);
39
39
  const OMITTED_MANIFEST_KEYS = /* @__PURE__ */ new Set(["kind", "attributes"]);
40
40
  const OMITTED_WHEN_EMPTY_STRING_KEYS = /* @__PURE__ */ new Set(["interconnectGroup"]);
41
+ const OMITTED_WHEN_ZERO_KEYS = /* @__PURE__ */ new Set([
42
+ "bufferingDisable",
43
+ "bufferSize",
44
+ "buffersNumber",
45
+ "buffersSize",
46
+ "busyBuffersSize",
47
+ "connectTimeout"
48
+ ]);
41
49
  async function generateManifestVersion(manifest) {
42
50
  const jsonStr = manifestToSortedJSON(manifest);
43
51
  const sortedBytes = encoder.encode(jsonStr);
@@ -67,6 +75,9 @@ function manifestReplacer(key, value) {
67
75
  if (OMITTED_MANIFEST_KEYS.has(key) && (Array.isArray(value) && value.length === 0 || value === 0)) {
68
76
  return void 0;
69
77
  }
78
+ if (OMITTED_WHEN_ZERO_KEYS.has(key) && (value === 0 || value === false)) {
79
+ return void 0;
80
+ }
70
81
  if (OMITTED_WHEN_EMPTY_STRING_KEYS.has(key) && value === "") {
71
82
  return void 0;
72
83
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/sdl/manifest/generateManifestVersion.ts"],
4
- "sourcesContent": ["import { default as stableStringify } from \"json-stable-stringify\";\n\nimport type { GenerateManifestOkResult, Manifest } from \"./generateManifest.ts\";\n\nconst decoder = new TextDecoder();\nconst encoder = new TextEncoder();\n// Go marshals nil slices as `null`, so empty manifest arrays must serialize to\n// `null` to stay byte-compatible with the Go SDK's manifest. `storage` covers\n// `params.storage` when a service sets other params (e.g. `tee`) but no storage;\n// resource-level storage is schema-required and never empty, so it is unaffected.\nconst NULLABLE_MANIFEST_KEYS = new Set([\"command\", \"args\", \"env\", \"hosts\", \"storage\"]);\nconst OMITTED_MANIFEST_KEYS = new Set([\"kind\", \"attributes\"]);\n\n// Manifest fields that on the Go side use `omitempty` for string values \u2014\n// the field must NOT appear in the JSON when its value is the empty\n// string, otherwise the manifest version hash (a SHA over this exact\n// serialization) diverges from the Go side and breaks send-manifest\n// validation on existing leases.\nconst OMITTED_WHEN_EMPTY_STRING_KEYS = new Set([\"interconnectGroup\"]);\n\nexport async function generateManifestVersion(manifest: Manifest): Promise<Uint8Array> {\n const jsonStr = manifestToSortedJSON(manifest);\n const sortedBytes = encoder.encode(jsonStr);\n const sum = await crypto.subtle.digest(\"SHA-256\", sortedBytes);\n return new Uint8Array(sum);\n}\n\nexport function manifestToSortedJSON(manifest: Manifest | GenerateManifestOkResult[\"groupSpecs\"]): string {\n const json = stableStringify(manifest, { replacer: manifestReplacer }) || \"\";\n return escapeHtml(renameFields(json));\n}\n\nfunction manifestReplacer(this: unknown, key: string | number, value: unknown): unknown {\n if (value && value instanceof Uint8Array) {\n return decoder.decode(value);\n }\n\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n\n if (typeof key !== \"string\") {\n return value;\n }\n\n // only top-level \"credentials\" field can be null, credentials in params should be omitted\n if (typeof this === \"object\" && this && Object.hasOwn(this, \"command\") && key === \"credentials\" && value == null) {\n return null;\n }\n\n if (NULLABLE_MANIFEST_KEYS.has(key) && ((Array.isArray(value) && value.length === 0) || value == null)) {\n return null;\n }\n\n if (OMITTED_MANIFEST_KEYS.has(key) && ((Array.isArray(value) && value.length === 0) || value === 0)) {\n return undefined;\n }\n\n if (OMITTED_WHEN_EMPTY_STRING_KEYS.has(key) && value === \"\") {\n return undefined;\n }\n\n return value;\n}\n\nconst MANIFEST_VERSION_FIELD_MAPPING: Record<string, string> = { quantity: \"size\", sequenceNumber: \"sequence_number\" };\nconst MANIFEST_VERSION_FIELD_REGEX = new RegExp(`\"(${Object.keys(MANIFEST_VERSION_FIELD_MAPPING).join(\"|\")})\":`, \"g\");\nfunction renameFields(jsonStr: string): string {\n MANIFEST_VERSION_FIELD_REGEX.lastIndex = 0; // reset regex state\n return jsonStr.replace(MANIFEST_VERSION_FIELD_REGEX, (_, field) => `\"${MANIFEST_VERSION_FIELD_MAPPING[field]}\":`);\n}\n\nconst htmlEscapes: Record<string, string> = {\n \"<\": \"\\\\u003c\",\n \">\": \"\\\\u003e\",\n \"&\": \"\\\\u0026\",\n};\n\nconst HTML_SPECIAL_CHARS_REGEX = new RegExp(`[${Object.keys(htmlEscapes).join(\"\")}]`, \"g\");\nfunction escapeHtml(raw: string): string {\n HTML_SPECIAL_CHARS_REGEX.lastIndex = 0; // reset regex state\n return raw.replace(HTML_SPECIAL_CHARS_REGEX, (ch) => htmlEscapes[ch]);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mCAA2C;AAI3C,MAAM,UAAU,IAAI,YAAY;AAChC,MAAM,UAAU,IAAI,YAAY;AAKhC,MAAM,yBAAyB,oBAAI,IAAI,CAAC,WAAW,QAAQ,OAAO,SAAS,SAAS,CAAC;AACrF,MAAM,wBAAwB,oBAAI,IAAI,CAAC,QAAQ,YAAY,CAAC;AAO5D,MAAM,iCAAiC,oBAAI,IAAI,CAAC,mBAAmB,CAAC;AAEpE,eAAsB,wBAAwB,UAAyC;AACrF,QAAM,UAAU,qBAAqB,QAAQ;AAC7C,QAAM,cAAc,QAAQ,OAAO,OAAO;AAC1C,QAAM,MAAM,MAAM,OAAO,OAAO,OAAO,WAAW,WAAW;AAC7D,SAAO,IAAI,WAAW,GAAG;AAC3B;AAEO,SAAS,qBAAqB,UAAqE;AACxG,QAAM,WAAO,6BAAAA,SAAgB,UAAU,EAAE,UAAU,iBA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AyB,YAAY;AACrC,SAAO,IAAI,QAAQ,0BAA0B,CAAC,OAAO,YAAY,EAAE,CAAC;AACtE;",
4
+ "sourcesContent": ["import { default as stableStringify } from \"json-stable-stringify\";\n\nimport type { GenerateManifestOkResult, Manifest } from \"./generateManifest.ts\";\n\nconst decoder = new TextDecoder();\nconst encoder = new TextEncoder();\n// Go marshals nil slices as `null`, so empty manifest arrays must serialize to\n// `null` to stay byte-compatible with the Go SDK's manifest. `storage` covers\n// `params.storage` when a service sets other params (e.g. `tee`) but no storage;\n// resource-level storage is schema-required and never empty, so it is unaffected.\nconst NULLABLE_MANIFEST_KEYS = new Set([\"command\", \"args\", \"env\", \"hosts\", \"storage\"]);\nconst OMITTED_MANIFEST_KEYS = new Set([\"kind\", \"attributes\"]);\n\n// Manifest fields that on the Go side use `omitempty` for string values \u2014\n// the field must NOT appear in the JSON when its value is the empty\n// string, otherwise the manifest version hash (a SHA over this exact\n// serialization) diverges from the Go side and breaks send-manifest\n// validation on existing leases.\nconst OMITTED_WHEN_EMPTY_STRING_KEYS = new Set([\"interconnectGroup\"]);\n\n// Nested `proxy` object fields that on the Go side use `omitempty`, so an unset\n// value (0 for the numeric fields, false for the `bufferingDisable` bool) must NOT\n// appear in the JSON. Like the empty-string case above, keeping it would diverge the\n// manifest version hash from the Go side and break send-manifest validation for\n// deployments that do not set these fields.\nconst OMITTED_WHEN_ZERO_KEYS = new Set([\n \"bufferingDisable\",\n \"bufferSize\",\n \"buffersNumber\",\n \"buffersSize\",\n \"busyBuffersSize\",\n \"connectTimeout\",\n]);\n\nexport async function generateManifestVersion(manifest: Manifest): Promise<Uint8Array> {\n const jsonStr = manifestToSortedJSON(manifest);\n const sortedBytes = encoder.encode(jsonStr);\n const sum = await crypto.subtle.digest(\"SHA-256\", sortedBytes);\n return new Uint8Array(sum);\n}\n\nexport function manifestToSortedJSON(manifest: Manifest | GenerateManifestOkResult[\"groupSpecs\"]): string {\n const json = stableStringify(manifest, { replacer: manifestReplacer }) || \"\";\n return escapeHtml(renameFields(json));\n}\n\nfunction manifestReplacer(this: unknown, key: string | number, value: unknown): unknown {\n if (value && value instanceof Uint8Array) {\n return decoder.decode(value);\n }\n\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n\n if (typeof key !== \"string\") {\n return value;\n }\n\n // only top-level \"credentials\" field can be null, credentials in params should be omitted\n if (typeof this === \"object\" && this && Object.hasOwn(this, \"command\") && key === \"credentials\" && value == null) {\n return null;\n }\n\n if (NULLABLE_MANIFEST_KEYS.has(key) && ((Array.isArray(value) && value.length === 0) || value == null)) {\n return null;\n }\n\n if (OMITTED_MANIFEST_KEYS.has(key) && ((Array.isArray(value) && value.length === 0) || value === 0)) {\n return undefined;\n }\n\n if (OMITTED_WHEN_ZERO_KEYS.has(key) && (value === 0 || value === false)) {\n return undefined;\n }\n\n if (OMITTED_WHEN_EMPTY_STRING_KEYS.has(key) && value === \"\") {\n return undefined;\n }\n\n return value;\n}\n\nconst MANIFEST_VERSION_FIELD_MAPPING: Record<string, string> = { quantity: \"size\", sequenceNumber: \"sequence_number\" };\nconst MANIFEST_VERSION_FIELD_REGEX = new RegExp(`\"(${Object.keys(MANIFEST_VERSION_FIELD_MAPPING).join(\"|\")})\":`, \"g\");\nfunction renameFields(jsonStr: string): string {\n MANIFEST_VERSION_FIELD_REGEX.lastIndex = 0; // reset regex state\n return jsonStr.replace(MANIFEST_VERSION_FIELD_REGEX, (_, field) => `\"${MANIFEST_VERSION_FIELD_MAPPING[field]}\":`);\n}\n\nconst htmlEscapes: Record<string, string> = {\n \"<\": \"\\\\u003c\",\n \">\": \"\\\\u003e\",\n \"&\": \"\\\\u0026\",\n};\n\nconst HTML_SPECIAL_CHARS_REGEX = new RegExp(`[${Object.keys(htmlEscapes).join(\"\")}]`, \"g\");\nfunction escapeHtml(raw: string): string {\n HTML_SPECIAL_CHARS_REGEX.lastIndex = 0; // reset regex state\n return raw.replace(HTML_SPECIAL_CHARS_REGEX, (ch) => htmlEscapes[ch]);\n}\n"],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M,SAAS,OAAO;AACtG,WAAO;AAAA,EACT;AAEA,MAAI,sBAAsB,IAAI,GAAG,MAAO,MAAM,QAAQ,KAAK,KAAK,MAAM,WAAW,KAAM,UAAU,IAAI;AACnG,WAAO;AAAA,EACT;AAEA,MAAI,uBAAuB,IAAI,GAAG,MAAM,UAAU,KAAK,UAAU,QAAQ;AACvE,WAAO;AAAA,EACT;AAEA,MAAI,+BAA+B,IAAI,GAAG,KAAK,UAAU,IAAI;AAC3D,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAEA,MAAM,iCAAyD,EAAE,UAAU,QAAQ,gBAAgB,kBAAkB;AACrH,MAAM,+BAA+B,IAAI,OAAO,KAAK,OAAO,KAAK,8BAA8B,EAAE,KAAK,GAAG,CAAC,OAAO,GAAG;AACpH,SAAS,aAAa,SAAyB;AAC7C,+BAA6B,YAAY;AACzC,SAAO,QAAQ,QAAQ,8BAA8B,CAAC,GAAG,UAAU,IAAI,+BAA+B,KAAK,CAAC,IAAI;AAClH;AAEA,MAAM,cAAsC;AAAA,EAC1C,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAEA,MAAM,2BAA2B,IAAI,OAAO,IAAI,OAAO,KAAK,WAAW,EAAE,KAAK,EAAE,CAAC,KAAK,GAAG;AACzF,SAAS,WAAW,KAAqB;AACvC,2BAAyB,YAAY;AACrC,SAAO,IAAI,QAAQ,0BAA0B,CAAC,OAAO,YAAY,EAAE,CAAC;AACtE;",
6
6
  "names": ["stableStringify"]
7
7
  }
@@ -36,6 +36,7 @@ __export(manifestUtils_exports, {
36
36
  module.exports = __toCommonJS(manifestUtils_exports);
37
37
  var import_index_akash_v1beta4 = require("../../generated/protos/index.akash.v1beta4.cjs");
38
38
  var import_index_provider_akash_v2beta3 = require("../../generated/protos/index.provider.akash.v2beta3.cjs");
39
+ var import_httpTimeout = require("../httpTimeout.cjs");
39
40
  var import_sizes = require("../sizes.cjs");
40
41
  function computeEndpointSequenceNumbers(services) {
41
42
  const endpointNames = [];
@@ -98,13 +99,20 @@ function transformGpuAttributes(attributes) {
98
99
  function buildHttpOptions(httpOptions) {
99
100
  return import_index_provider_akash_v2beta3.ServiceExposeHTTPOptions.fromPartial({
100
101
  maxBodySize: httpOptions?.max_body_size ?? 1048576,
101
- readTimeout: httpOptions?.read_timeout ?? 6e4,
102
- sendTimeout: httpOptions?.send_timeout ?? 6e4,
102
+ readTimeout: normalizedHTTPTimeout(httpOptions?.read_timeout),
103
+ sendTimeout: normalizedHTTPTimeout(httpOptions?.send_timeout),
103
104
  nextTries: httpOptions?.next_tries ?? 3,
104
105
  nextTimeout: httpOptions?.next_timeout ?? 0,
105
106
  nextCases: httpOptions?.next_cases ?? ["error", "timeout"]
106
107
  });
107
108
  }
109
+ function normalizedHTTPTimeout(value) {
110
+ const result = (0, import_httpTimeout.parseHTTPTimeout)(value ?? 6e4);
111
+ if (!result.ok) {
112
+ throw new Error(`Invalid HTTP timeout: ${result.message}`);
113
+ }
114
+ return result.milliseconds;
115
+ }
108
116
  function buildStorageAttributes(attributes) {
109
117
  if (!attributes) return [];
110
118
  const pairs = Object.entries(attributes).map(([key, value]) => ({
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/sdl/manifest/manifestUtils.ts"],
4
- "sourcesContent": ["import type { Attribute } from \"../../generated/protos/index.akash.v1.ts\";\nimport {\n Endpoint,\n Endpoint_Kind,\n} from \"../../generated/protos/index.akash.v1beta4.ts\";\nimport {\n ServiceExposeHTTPOptions,\n} from \"../../generated/protos/index.provider.akash.v2beta3.ts\";\nimport { convertCpuResourceString, convertResourceString } from \"../sizes.ts\";\nimport type { SDLInput } from \"../validateSDL/validateSDL.ts\";\nimport type { StorageAttributesValidation } from \"../validateSDL/validateSDLInput.ts\";\n\ntype SDLService = SDLInput[\"services\"][string];\ntype SDLExpose = NonNullable<SDLService[\"expose\"]>[number];\ntype SDLExposeTo = NonNullable<SDLExpose[\"to\"]>[number];\ntype SDLHttpOptions = SDLExpose[\"http_options\"];\ntype SDLCompute = SDLInput[\"profiles\"][\"compute\"][string];\ntype SDLStorage = SDLCompute[\"resources\"][\"storage\"];\ntype SDLStorageVolume = SDLStorage extends (infer T)[] ? T : SDLStorage;\ntype SDLGpuAttributes = NonNullable<NonNullable<SDLCompute[\"resources\"][\"gpu\"]>[\"attributes\"]>;\n\nexport type { SDLCompute, SDLExpose, SDLExposeTo, SDLGpuAttributes, SDLHttpOptions, SDLService, SDLStorage, SDLStorageVolume };\n\nexport function computeEndpointSequenceNumbers(services: SDLInput[\"services\"]): Record<string, number> {\n const endpointNames: string[] = [];\n\n for (const service of Object.values(services)) {\n if (!service.expose) continue;\n for (const expose of service.expose) {\n if (!expose.to) continue;\n for (const to of expose.to) {\n if (to.global && to.ip && to.ip.length > 0) {\n endpointNames.push(to.ip);\n }\n }\n }\n }\n\n return endpointNames.sort().reduce<Record<string, number>>((result, name, seqNumber) => {\n result[name] = seqNumber + 1;\n return result;\n }, {});\n}\n\nexport function isIngress(proto: string, global: boolean, externalPort: number, port: number): boolean {\n const effectivePort = externalPort === 0 ? port : externalPort;\n return global && proto === \"TCP\" && effectivePort === 80;\n}\n\n// INTERCONNECT_GROUP_AUTO is the reserved name the SDL parser assigns to\n// every `interconnect: []` opt-in within one placement. Tenants cannot\n// write it explicitly under `interconnect: { group: ... }` \u2014 mirrors\n// `InterconnectGroupAuto` in go/sdl/gpu.go.\nexport const INTERCONNECT_GROUP_AUTO = \"auto\";\n\n// resolveInterconnectGroup returns the group string the parser derives\n// from gpu.attributes.interconnect:\n// - empty sequence `[]` \u2192 INTERCONNECT_GROUP_AUTO (\"auto\")\n// - mapping `{ group: <name> }` \u2192 <name>\n// - anything else / absent \u2192 \"\" (non-interconnect)\n// Both the on-chain attribute emitter and the off-chain manifest builder\n// route through this helper so they agree on the resolved value.\nexport function resolveInterconnectGroup(interconnect: SDLGpuAttributes[\"interconnect\"]): string {\n if (Array.isArray(interconnect)) {\n return interconnect.length === 0 ? INTERCONNECT_GROUP_AUTO : \"\";\n }\n if (interconnect && typeof interconnect === \"object\" && \"group\" in interconnect) {\n const g = (interconnect as { group?: unknown }).group;\n return typeof g === \"string\" ? g : \"\";\n }\n return \"\";\n}\n\nexport function transformGpuAttributes(attributes: SDLGpuAttributes): Attribute[] {\n const result: Attribute[] = [];\n\n const vendor = attributes.vendor;\n if (vendor) {\n Object.keys(vendor)\n .sort((a, b) => a.localeCompare(b))\n .forEach((vendorName) => {\n const models = vendor[vendorName as keyof typeof vendor];\n if (!models) {\n result.push({ key: `vendor/${vendorName}/model/*`, value: \"true\" });\n return;\n }\n for (const model of models) {\n let key = `vendor/${vendorName}/model/${model.model}`;\n if (model.ram) key += `/ram/${model.ram}`;\n if (model.interface) key += `/interface/${model.interface}`;\n result.push({ key, value: \"true\" });\n }\n });\n }\n\n // interconnect emits a single on-chain attribute `interconnect/group` \u2014\n // the group is the entire opt-in signal. Keep parity with the Go parser\n // in go/sdl/gpu.go: empty sequence `[]` resolves to the reserved literal\n // `auto`, the explicit mapping form `{ group: <name> }` carries the\n // tenant-chosen name. See docs/sdl-interconnect-spec.md.\n const group = resolveInterconnectGroup(attributes.interconnect);\n if (group !== \"\") {\n result.push({ key: \"interconnect/group\", value: group });\n }\n\n // Go SDL parser canonicalizes the slice via sort.Sort(res) before\n // returning. Mirror that here so the on-chain attribute order matches\n // byte-for-byte across both implementations.\n result.sort((a, b) => a.key.localeCompare(b.key));\n\n return result;\n}\n\nexport function buildHttpOptions(httpOptions?: SDLHttpOptions): ServiceExposeHTTPOptions {\n return ServiceExposeHTTPOptions.fromPartial({\n maxBodySize: httpOptions?.max_body_size ?? 1048576,\n readTimeout: httpOptions?.read_timeout ?? 60000,\n sendTimeout: httpOptions?.send_timeout ?? 60000,\n nextTries: httpOptions?.next_tries ?? 3,\n nextTimeout: httpOptions?.next_timeout ?? 0,\n nextCases: httpOptions?.next_cases ?? [\"error\", \"timeout\"],\n });\n}\n\nexport function buildStorageAttributes(attributes?: StorageAttributesValidation): Attribute[] {\n if (!attributes) return [];\n\n const pairs: Attribute[] = Object.entries(attributes).map(([key, value]) => ({\n key,\n value: String(value),\n }));\n\n if (attributes.class === \"ram\" && !(\"persistent\" in attributes)) {\n pairs.push({ key: \"persistent\", value: \"false\" });\n }\n\n pairs.sort((a, b) => a.key.localeCompare(b.key));\n return pairs;\n}\n\nexport function parseServiceProto(proto?: string): string {\n return proto?.toUpperCase() || \"TCP\";\n}\n\nexport function buildServiceEndpoints(\n service: SDLService,\n endpointSequenceNumbers: Record<string, number>,\n): Endpoint[] {\n return (service.expose ?? []).flatMap((expose) =>\n (expose.to ?? [])\n .filter((to) => to.global)\n .flatMap((to) => {\n const externalPort = expose.as || 0;\n const proto = parseServiceProto(expose.proto);\n const kind = isIngress(proto, !!to.global, externalPort, expose.port)\n ? Endpoint_Kind.SHARED_HTTP\n : Endpoint_Kind.RANDOM_PORT;\n\n const defaultEp = Endpoint.fromPartial({\n kind,\n sequenceNumber: 0,\n });\n\n if (!to.ip?.length) {\n return [defaultEp];\n }\n\n const leasedEp = Endpoint.fromPartial({\n kind: Endpoint_Kind.LEASED_IP,\n sequenceNumber: endpointSequenceNumbers[to.ip] ?? 0,\n });\n\n return [defaultEp, leasedEp];\n }),\n );\n}\n\nexport function parseCpuUnits(cpu: SDLCompute[\"resources\"][\"cpu\"]): bigint {\n return typeof cpu.units === \"string\"\n ? convertCpuResourceString(cpu.units)\n : convertCpuResourceString(String(cpu.units));\n}\n\nexport function parseMemoryBytes(memory: SDLCompute[\"resources\"][\"memory\"]): bigint {\n return convertResourceString(memory.size);\n}\n\nexport function parseStorageBytes(size: string): bigint {\n return convertResourceString(size);\n}\n\nexport function parseGpuUnits(gpu?: SDLCompute[\"resources\"][\"gpu\"]): bigint {\n const value = gpu?.units;\n if (value === undefined || value === null) return 0n;\n return BigInt(value);\n}\n\nexport function buildResourceAttributes(attributes?: Record<string, unknown>): Attribute[] | undefined {\n if (!attributes) return undefined;\n return Object.keys(attributes)\n .sort((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AAc,KAA8C;AAC1E,QAAM,QAAQ,KAAK;AACnB,MAAI,UAAU,UAAa,UAAU,KAAM,QAAO;AAClD,SAAO,OAAO,KAAK;AACrB;AAEO,SAAS,wBAAwB,YAA+D;AACrG,MAAI,CAAC,WAAY,QAAO;AACxB,SAAO,OAAO,KAAK,UAAU,EAC1B,KAAK,CAAC,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC,EACjC,IAAI,CAAC,SAAS,EAAE,KAAK,OAAO,OAAO,WAAW,GAAG,CAAC,EAAE,EAAE;AAC3D;",
4
+ "sourcesContent": ["import type { Attribute } from \"../../generated/protos/index.akash.v1.ts\";\nimport {\n Endpoint,\n Endpoint_Kind,\n} from \"../../generated/protos/index.akash.v1beta4.ts\";\nimport {\n ServiceExposeHTTPOptions,\n} from \"../../generated/protos/index.provider.akash.v2beta3.ts\";\nimport { parseHTTPTimeout } from \"../httpTimeout.ts\";\nimport { convertCpuResourceString, convertResourceString } from \"../sizes.ts\";\nimport type { SDLInput } from \"../validateSDL/validateSDL.ts\";\nimport type { StorageAttributesValidation } from \"../validateSDL/validateSDLInput.ts\";\n\ntype SDLService = SDLInput[\"services\"][string];\ntype SDLExpose = NonNullable<SDLService[\"expose\"]>[number];\ntype SDLExposeTo = NonNullable<SDLExpose[\"to\"]>[number];\ntype SDLHttpOptions = SDLExpose[\"http_options\"];\ntype SDLCompute = SDLInput[\"profiles\"][\"compute\"][string];\ntype SDLStorage = SDLCompute[\"resources\"][\"storage\"];\ntype SDLStorageVolume = SDLStorage extends (infer T)[] ? T : SDLStorage;\ntype SDLGpuAttributes = NonNullable<NonNullable<SDLCompute[\"resources\"][\"gpu\"]>[\"attributes\"]>;\n\nexport type { SDLCompute, SDLExpose, SDLExposeTo, SDLGpuAttributes, SDLHttpOptions, SDLService, SDLStorage, SDLStorageVolume };\n\nexport function computeEndpointSequenceNumbers(services: SDLInput[\"services\"]): Record<string, number> {\n const endpointNames: string[] = [];\n\n for (const service of Object.values(services)) {\n if (!service.expose) continue;\n for (const expose of service.expose) {\n if (!expose.to) continue;\n for (const to of expose.to) {\n if (to.global && to.ip && to.ip.length > 0) {\n endpointNames.push(to.ip);\n }\n }\n }\n }\n\n return endpointNames.sort().reduce<Record<string, number>>((result, name, seqNumber) => {\n result[name] = seqNumber + 1;\n return result;\n }, {});\n}\n\nexport function isIngress(proto: string, global: boolean, externalPort: number, port: number): boolean {\n const effectivePort = externalPort === 0 ? port : externalPort;\n return global && proto === \"TCP\" && effectivePort === 80;\n}\n\n// INTERCONNECT_GROUP_AUTO is the reserved name the SDL parser assigns to\n// every `interconnect: []` opt-in within one placement. Tenants cannot\n// write it explicitly under `interconnect: { group: ... }` \u2014 mirrors\n// `InterconnectGroupAuto` in go/sdl/gpu.go.\nexport const INTERCONNECT_GROUP_AUTO = \"auto\";\n\n// resolveInterconnectGroup returns the group string the parser derives\n// from gpu.attributes.interconnect:\n// - empty sequence `[]` \u2192 INTERCONNECT_GROUP_AUTO (\"auto\")\n// - mapping `{ group: <name> }` \u2192 <name>\n// - anything else / absent \u2192 \"\" (non-interconnect)\n// Both the on-chain attribute emitter and the off-chain manifest builder\n// route through this helper so they agree on the resolved value.\nexport function resolveInterconnectGroup(interconnect: SDLGpuAttributes[\"interconnect\"]): string {\n if (Array.isArray(interconnect)) {\n return interconnect.length === 0 ? INTERCONNECT_GROUP_AUTO : \"\";\n }\n if (interconnect && typeof interconnect === \"object\" && \"group\" in interconnect) {\n const g = (interconnect as { group?: unknown }).group;\n return typeof g === \"string\" ? g : \"\";\n }\n return \"\";\n}\n\nexport function transformGpuAttributes(attributes: SDLGpuAttributes): Attribute[] {\n const result: Attribute[] = [];\n\n const vendor = attributes.vendor;\n if (vendor) {\n Object.keys(vendor)\n .sort((a, b) => a.localeCompare(b))\n .forEach((vendorName) => {\n const models = vendor[vendorName as keyof typeof vendor];\n if (!models) {\n result.push({ key: `vendor/${vendorName}/model/*`, value: \"true\" });\n return;\n }\n for (const model of models) {\n let key = `vendor/${vendorName}/model/${model.model}`;\n if (model.ram) key += `/ram/${model.ram}`;\n if (model.interface) key += `/interface/${model.interface}`;\n result.push({ key, value: \"true\" });\n }\n });\n }\n\n // interconnect emits a single on-chain attribute `interconnect/group` \u2014\n // the group is the entire opt-in signal. Keep parity with the Go parser\n // in go/sdl/gpu.go: empty sequence `[]` resolves to the reserved literal\n // `auto`, the explicit mapping form `{ group: <name> }` carries the\n // tenant-chosen name. See docs/sdl-interconnect-spec.md.\n const group = resolveInterconnectGroup(attributes.interconnect);\n if (group !== \"\") {\n result.push({ key: \"interconnect/group\", value: group });\n }\n\n // Go SDL parser canonicalizes the slice via sort.Sort(res) before\n // returning. Mirror that here so the on-chain attribute order matches\n // byte-for-byte across both implementations.\n result.sort((a, b) => a.key.localeCompare(b.key));\n\n return result;\n}\n\nexport function buildHttpOptions(httpOptions?: SDLHttpOptions): ServiceExposeHTTPOptions {\n return ServiceExposeHTTPOptions.fromPartial({\n maxBodySize: httpOptions?.max_body_size ?? 1048576,\n readTimeout: normalizedHTTPTimeout(httpOptions?.read_timeout),\n sendTimeout: normalizedHTTPTimeout(httpOptions?.send_timeout),\n nextTries: httpOptions?.next_tries ?? 3,\n nextTimeout: httpOptions?.next_timeout ?? 0,\n nextCases: httpOptions?.next_cases ?? [\"error\", \"timeout\"],\n });\n}\n\nfunction normalizedHTTPTimeout(value: number | string | undefined): number {\n const result = parseHTTPTimeout(value ?? 60_000);\n if (!result.ok) {\n throw new Error(`Invalid HTTP timeout: ${result.message}`);\n }\n\n return result.milliseconds;\n}\n\nexport function buildStorageAttributes(attributes?: StorageAttributesValidation): Attribute[] {\n if (!attributes) return [];\n\n const pairs: Attribute[] = Object.entries(attributes).map(([key, value]) => ({\n key,\n value: String(value),\n }));\n\n if (attributes.class === \"ram\" && !(\"persistent\" in attributes)) {\n pairs.push({ key: \"persistent\", value: \"false\" });\n }\n\n pairs.sort((a, b) => a.key.localeCompare(b.key));\n return pairs;\n}\n\nexport function parseServiceProto(proto?: string): string {\n return proto?.toUpperCase() || \"TCP\";\n}\n\nexport function buildServiceEndpoints(\n service: SDLService,\n endpointSequenceNumbers: Record<string, number>,\n): Endpoint[] {\n return (service.expose ?? []).flatMap((expose) =>\n (expose.to ?? [])\n .filter((to) => to.global)\n .flatMap((to) => {\n const externalPort = expose.as || 0;\n const proto = parseServiceProto(expose.proto);\n const kind = isIngress(proto, !!to.global, externalPort, expose.port)\n ? Endpoint_Kind.SHARED_HTTP\n : Endpoint_Kind.RANDOM_PORT;\n\n const defaultEp = Endpoint.fromPartial({\n kind,\n sequenceNumber: 0,\n });\n\n if (!to.ip?.length) {\n return [defaultEp];\n }\n\n const leasedEp = Endpoint.fromPartial({\n kind: Endpoint_Kind.LEASED_IP,\n sequenceNumber: endpointSequenceNumbers[to.ip] ?? 0,\n });\n\n return [defaultEp, leasedEp];\n }),\n );\n}\n\nexport function parseCpuUnits(cpu: SDLCompute[\"resources\"][\"cpu\"]): bigint {\n return typeof cpu.units === \"string\"\n ? convertCpuResourceString(cpu.units)\n : convertCpuResourceString(String(cpu.units));\n}\n\nexport function parseMemoryBytes(memory: SDLCompute[\"resources\"][\"memory\"]): bigint {\n return convertResourceString(memory.size);\n}\n\nexport function parseStorageBytes(size: string): bigint {\n return convertResourceString(size);\n}\n\nexport function parseGpuUnits(gpu?: SDLCompute[\"resources\"][\"gpu\"]): bigint {\n const value = gpu?.units;\n if (value === undefined || value === null) return 0n;\n return BigInt(value);\n}\n\nexport function buildResourceAttributes(attributes?: Record<string, unknown>): Attribute[] | undefined {\n if (!attributes) return undefined;\n return Object.keys(attributes)\n .sort((a, b) => a.localeCompare(b))\n .map((key) => ({ key, value: String(attributes[key]) }));\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iCAGO;AACP,0CAEO;AACP,yBAAiC;AACjC,mBAAgE;AAezD,S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I,UAAU,UAAa,UAAU,KAAM,QAAO;AAClD,SAAO,OAAO,KAAK;AACrB;AAEO,SAAS,wBAAwB,YAA+D;AACrG,MAAI,CAAC,WAAY,QAAO;AACxB,SAAO,OAAO,KAAK,UAAU,EAC1B,KAAK,CAAC,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC,EACjC,IAAI,CAAC,SAAS,EAAE,KAAK,OAAO,OAAO,WAAW,GAAG,CAAC,EAAE,EAAE;AAC3D;",
6
6
  "names": []
7
7
  }
@@ -22,13 +22,12 @@ __export(reclamationDuration_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(reclamationDuration_exports);
24
24
  var import_duration = require("../../generated/protos/google/protobuf/duration.cjs");
25
- const UNIT_SECONDS = { s: 1n, m: 60n, h: 3600n };
25
+ var import_duration2 = require("../duration.cjs");
26
26
  function minWindowToDuration(value) {
27
- const unitSeconds = UNIT_SECONDS[value.at(-1) ?? ""];
28
- const amount = Number(value.slice(0, -1));
29
- if (unitSeconds === void 0 || !Number.isInteger(amount) || amount <= 0) {
27
+ const duration = (0, import_duration2.parseDuration)(value);
28
+ if (!duration || duration.unit === void 0 || duration.unit === "ms" || duration.milliseconds === 0n) {
30
29
  throw new Error(`invalid reclamation min_window "${value}"`);
31
30
  }
32
- return import_duration.Duration.fromPartial({ seconds: (BigInt(amount) * unitSeconds).toString(), nanos: 0 });
31
+ return import_duration.Duration.fromPartial({ seconds: duration.milliseconds / 1000n, nanos: 0 });
33
32
  }
34
33
  //# sourceMappingURL=reclamationDuration.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/sdl/manifest/reclamationDuration.ts"],
4
- "sourcesContent": ["import { Duration } from \"../../generated/protos/google/protobuf/duration.ts\";\n\nconst UNIT_SECONDS: Record<string, bigint> = { s: 1n, m: 60n, h: 3600n };\n\n/**\n * Converts a reclamation `min_window` into a proto `Duration`. The SDL schema\n * pattern (`^[1-9][0-9]*(s|m|h)$`) has already guaranteed the format (and `> 0`)\n * before this runs, so on the request hot path we split off the trailing unit\n * and parse the amount directly instead of re-running a regex. The cheap\n * unit/integer/positivity guards stay only to reject obviously-invalid direct\n * calls. Whole-unit windows are an exact second count, so `nanos` is always 0\n * and the BigInt product never loses precision.\n */\nexport function minWindowToDuration(value: string): Duration {\n const unitSeconds = UNIT_SECONDS[value.at(-1) ?? \"\"];\n const amount = Number(value.slice(0, -1));\n if (unitSeconds === undefined || !Number.isInteger(amount) || amount <= 0) {\n throw new Error(`invalid reclamation min_window \"${value}\"`);\n }\n return Duration.fromPartial({ seconds: (BigInt(amount) * unitSeconds).toString(), nanos: 0 });\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AAEzB,MAAM,eAAuC,EAAE,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM;AAWhE,SAAS,oBAAoB,OAAyB;AAC3D,QAAM,cAAc,aAAa,MAAM,GAAG,EAAE,KAAK,EAAE;AACnD,QAAM,SAAS,OAAO,MAAM,MAAM,GAAG,EAAE,CAAC;AACxC,MAAI,gBAAgB,UAAa,CAAC,OAAO,UAAU,MAAM,KAAK,UAAU,GAAG;AACzE,UAAM,IAAI,MAAM,mCAAmC,KAAK,GAAG;AAAA,EAC7D;AACA,SAAO,yBAAS,YAAY,EAAE,UAAU,OAAO,MAAM,IAAI,aAAa,SAAS,GAAG,OAAO,EAAE,CAAC;AAC9F;",
6
- "names": []
4
+ "sourcesContent": ["import { Duration } from \"../../generated/protos/google/protobuf/duration.ts\";\nimport { parseDuration } from \"../duration.ts\";\n\n/**\n * Converts a reclamation `min_window` into a proto `Duration`. Reclamation\n * windows require a positive whole-number value using seconds, minutes, or\n * hours. The shared duration parser performs the unit conversion exactly.\n */\nexport function minWindowToDuration(value: string): Duration {\n const duration = parseDuration(value);\n if (\n !duration\n || duration.unit === undefined\n || duration.unit === \"ms\"\n || duration.milliseconds === 0n\n ) {\n throw new Error(`invalid reclamation min_window \"${value}\"`);\n }\n\n return Duration.fromPartial({ seconds: duration.milliseconds / 1_000n, nanos: 0 });\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AACzB,IAAAA,mBAA8B;AAOvB,SAAS,oBAAoB,OAAyB;AAC3D,QAAM,eAAW,gCAAc,KAAK;AACpC,MACE,CAAC,YACE,SAAS,SAAS,UAClB,SAAS,SAAS,QAClB,SAAS,iBAAiB,IAC7B;AACA,UAAM,IAAI,MAAM,mCAAmC,KAAK,GAAG;AAAA,EAC7D;AAEA,SAAO,yBAAS,YAAY,EAAE,SAAS,SAAS,eAAe,OAAQ,OAAO,EAAE,CAAC;AACnF;",
6
+ "names": ["import_duration"]
7
7
  }
@@ -31,10 +31,11 @@ __export(validateSDL_exports, {
31
31
  });
32
32
  module.exports = __toCommonJS(validateSDL_exports);
33
33
  var import_jsonSchemaValidation = require("../../utils/jsonSchemaValidation.cjs");
34
+ var import_httpTimeout = require("../httpTimeout.cjs");
34
35
  var import_manifestUtils = require("../manifest/manifestUtils.cjs");
35
36
  var import_utils = require("../utils.cjs");
36
37
  var import_validateSDLInput = require("./validateSDLInput.cjs");
37
- var _endpointsUsed, _portsUsed, _teeTypeByPlacement, _sdl, _errors, _SDLValidator_instances, validateDeploymentWithRelations_fn, validateDeploymentRelations_fn, validateServiceStorages_fn, validateStorages_fn, validateGPU_fn, validateInterconnect_fn, validateTEE_fn, validateLeaseIP_fn, validateEndpoints_fn;
38
+ var _endpointsUsed, _portsUsed, _teeTypeByPlacement, _sdl, _errors, _SDLValidator_instances, validateHTTPTimeoutRanges_fn, validateDeploymentWithRelations_fn, validateDeploymentRelations_fn, validateServiceStorages_fn, validateStorages_fn, validateGPU_fn, validateInterconnect_fn, validateTEE_fn, validateLeaseIP_fn, validateEndpoints_fn;
38
39
  const ERROR_MESSAGES = {
39
40
  "#/definitions/storageRamClassMustNotBePersistent"(error) {
40
41
  return `"ram" storage${(0, import_jsonSchemaValidation.getErrorLocation)((0, import_jsonSchemaValidation.dirname)(error.instancePath))} cannot be persistent`;
@@ -73,6 +74,7 @@ class SDLValidator {
73
74
  Object.keys(__privateGet(this, _sdl).services).forEach((serviceName) => {
74
75
  __privateMethod(this, _SDLValidator_instances, validateDeploymentWithRelations_fn).call(this, serviceName);
75
76
  __privateMethod(this, _SDLValidator_instances, validateLeaseIP_fn).call(this, serviceName);
77
+ __privateMethod(this, _SDLValidator_instances, validateHTTPTimeoutRanges_fn).call(this, serviceName);
76
78
  });
77
79
  }
78
80
  __privateMethod(this, _SDLValidator_instances, validateInterconnect_fn).call(this);
@@ -86,6 +88,31 @@ _teeTypeByPlacement = new WeakMap();
86
88
  _sdl = new WeakMap();
87
89
  _errors = new WeakMap();
88
90
  _SDLValidator_instances = new WeakSet();
91
+ // JSON Schema caps numeric values, but its string pattern cannot enforce the
92
+ // maximum after unit conversion. For example, "1194h" matches the pattern.
93
+ validateHTTPTimeoutRanges_fn = function(serviceName) {
94
+ const exposes = __privateGet(this, _sdl).services[serviceName]?.expose ?? [];
95
+ for (const [exposeIndex, expose] of exposes.entries()) {
96
+ const options = expose.http_options;
97
+ if (!options) continue;
98
+ for (const field of ["read_timeout", "send_timeout"]) {
99
+ const value = options[field];
100
+ if (value === void 0) continue;
101
+ const result = (0, import_httpTimeout.parseHTTPTimeout)(value);
102
+ if (result.ok) continue;
103
+ __privateGet(this, _errors).push({
104
+ message: `HTTP ${field.replace("_", " ")} ${result.message}.`,
105
+ instancePath: `/services/${serviceName}/expose/${exposeIndex}/http_options/${field}`,
106
+ schemaPath: "#/definitions/httpTimeout/maximum",
107
+ keyword: "maximum",
108
+ params: {
109
+ comparison: "<=",
110
+ limit: import_httpTimeout.MAX_HTTP_TIMEOUT_MILLISECONDS
111
+ }
112
+ });
113
+ }
114
+ }
115
+ };
89
116
  validateDeploymentWithRelations_fn = function(serviceName) {
90
117
  const deployment = __privateGet(this, _sdl).deployment[serviceName];
91
118
  if (!deployment) {