@akashnetwork/chain-sdk 1.0.0-alpha.41 → 1.0.0-alpha.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/generated/createNodeSDK.cjs +328 -5
- package/dist/cjs/generated/createNodeSDK.cjs.map +2 -2
- package/dist/cjs/generated/createProviderSDK.cjs +36 -19
- package/dist/cjs/generated/createProviderSDK.cjs.map +2 -2
- package/dist/cjs/generated/patches/nodeCustomTypePatches.cjs +6 -0
- package/dist/cjs/generated/patches/nodeCustomTypePatches.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/base/attributes/v1/attribute.cjs +18 -2
- package/dist/cjs/generated/protos/akash/base/attributes/v1/attribute.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/inventory/v1/snapshot.cjs +943 -0
- package/dist/cjs/generated/protos/akash/inventory/v1/snapshot.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/inventory/v1/snapshot_akash.cjs +50 -0
- package/dist/cjs/generated/protos/akash/inventory/v1/snapshot_akash.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/manifest/v2beta3/httpoptions.cjs +159 -2
- package/dist/cjs/generated/protos/akash/manifest/v2beta3/httpoptions.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/market/v1/stats.cjs +248 -0
- package/dist/cjs/generated/protos/akash/market/v1/stats.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/market/v1/types.cjs +6 -0
- package/dist/cjs/generated/protos/akash/market/v1/types.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/market/v1beta5/query.cjs +139 -1
- package/dist/cjs/generated/protos/akash/market/v1beta5/query.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/market/v1beta5/query_akash.cjs +9 -0
- package/dist/cjs/generated/protos/akash/market/v1beta5/query_akash.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/event.cjs +266 -0
- package/dist/cjs/generated/protos/akash/provider/v1beta4/event.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/genesis.cjs +71 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/genesis.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/maintenance.cjs +417 -0
- package/dist/cjs/generated/protos/akash/provider/v1beta4/maintenance.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/provider/v1beta4/msg.cjs +321 -0
- package/dist/cjs/generated/protos/akash/provider/v1beta4/msg.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/params.cjs +96 -0
- package/dist/cjs/generated/protos/akash/provider/v1beta4/params.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/provider/v1beta4/paramsmsg.cjs +132 -0
- package/dist/cjs/generated/protos/akash/provider/v1beta4/paramsmsg.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/provider/v1beta4/provider.cjs +88 -1
- package/dist/cjs/generated/protos/akash/provider/v1beta4/provider.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/query.cjs +462 -1
- package/dist/cjs/generated/protos/akash/provider/v1beta4/query.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/query_akash.cjs +36 -0
- package/dist/cjs/generated/protos/akash/provider/v1beta4/query_akash.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/service_akash.cjs +25 -0
- package/dist/cjs/generated/protos/akash/provider/v1beta4/service_akash.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/verification/v1/event.cjs +2525 -0
- package/dist/cjs/generated/protos/akash/verification/v1/event.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/verification/v1/genesis.cjs +253 -0
- package/dist/cjs/generated/protos/akash/verification/v1/genesis.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/verification/v1/msg.cjs +2774 -0
- package/dist/cjs/generated/protos/akash/verification/v1/msg.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/verification/v1/params.cjs +1044 -0
- package/dist/cjs/generated/protos/akash/verification/v1/params.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/verification/v1/query.cjs +1559 -0
- package/dist/cjs/generated/protos/akash/verification/v1/query.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/verification/v1/query_akash.cjs +147 -0
- package/dist/cjs/generated/protos/akash/verification/v1/query_akash.cjs.map +7 -0
- package/dist/cjs/{sdl/types.cjs → generated/protos/akash/verification/v1/service.cjs} +3 -3
- package/dist/cjs/generated/protos/akash/verification/v1/service.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/verification/v1/service_akash.cjs +190 -0
- package/dist/cjs/generated/protos/akash/verification/v1/service_akash.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/verification/v1/state.cjs +2018 -0
- package/dist/cjs/generated/protos/akash/verification/v1/state.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/verification/v1/types.cjs +1071 -0
- package/dist/cjs/generated/protos/akash/verification/v1/types.cjs.map +7 -0
- package/dist/cjs/generated/protos/akash/verification/v1/verificationrequirement.cjs +148 -0
- package/dist/cjs/generated/protos/akash/verification/v1/verificationrequirement.cjs.map +7 -0
- package/dist/cjs/generated/protos/index.akash.v1.cjs +166 -25
- package/dist/cjs/generated/protos/index.akash.v1.cjs.map +3 -3
- package/dist/cjs/generated/protos/index.akash.v1beta4.cjs +25 -0
- package/dist/cjs/generated/protos/index.akash.v1beta4.cjs.map +3 -3
- package/dist/cjs/generated/protos/index.akash.v1beta5.cjs +2 -0
- package/dist/cjs/generated/protos/index.akash.v1beta5.cjs.map +2 -2
- package/dist/cjs/generated/protos/index.provider.akash.v1.cjs +9 -0
- package/dist/cjs/generated/protos/index.provider.akash.v1.cjs.map +2 -2
- package/dist/cjs/generated/protos/index.provider.akash.v2beta3.cjs +1 -0
- package/dist/cjs/generated/protos/index.provider.akash.v2beta3.cjs.map +2 -2
- package/dist/cjs/sdl/duration.cjs +44 -0
- package/dist/cjs/sdl/duration.cjs.map +7 -0
- package/dist/cjs/sdl/httpTimeout.cjs +59 -0
- package/dist/cjs/sdl/httpTimeout.cjs.map +7 -0
- package/dist/cjs/sdl/index.cjs +0 -2
- package/dist/cjs/sdl/index.cjs.map +2 -2
- package/dist/cjs/sdl/manifest/generateManifestVersion.cjs +11 -0
- package/dist/cjs/sdl/manifest/generateManifestVersion.cjs.map +2 -2
- package/dist/cjs/sdl/manifest/manifestUtils.cjs +10 -2
- package/dist/cjs/sdl/manifest/manifestUtils.cjs.map +2 -2
- package/dist/cjs/sdl/manifest/reclamationDuration.cjs +4 -5
- package/dist/cjs/sdl/manifest/reclamationDuration.cjs.map +3 -3
- package/dist/cjs/sdl/validateSDL/validateSDL.cjs +28 -1
- package/dist/cjs/sdl/validateSDL/validateSDL.cjs.map +2 -2
- package/dist/cjs/sdl/validateSDL/validateSDLInput.cjs +853 -454
- package/dist/cjs/sdl/validateSDL/validateSDLInput.cjs.map +2 -2
- package/dist/esm/chunk-2NPYA3YV.js +1563 -0
- package/dist/esm/chunk-2NPYA3YV.js.map +7 -0
- package/dist/esm/{chunk-4SZHF6SE.js → chunk-3U5XKNEU.js} +3 -3
- package/dist/esm/chunk-474YCD2T.js +356 -0
- package/dist/esm/chunk-474YCD2T.js.map +7 -0
- package/dist/esm/chunk-4CTTYO4O.js +890 -0
- package/dist/esm/chunk-4CTTYO4O.js.map +7 -0
- package/dist/esm/{chunk-IKTMMFJ5.js → chunk-54RECHZZ.js} +2 -2
- package/dist/esm/{chunk-WCUR732W.js → chunk-57534UAR.js} +2 -2
- package/dist/esm/{chunk-B4YVLEG7.js → chunk-7F3NJG67.js} +3 -3
- package/dist/esm/chunk-AIWCRXMP.js +672 -0
- package/dist/esm/chunk-AIWCRXMP.js.map +7 -0
- package/dist/esm/{chunk-XAOERZEY.js → chunk-AKNHD3CM.js} +2 -2
- package/dist/esm/chunk-BI4YL5KH.js +2742 -0
- package/dist/esm/chunk-BI4YL5KH.js.map +7 -0
- package/dist/esm/{chunk-ZGK4PJCD.js → chunk-BQNJHJXY.js} +3 -3
- package/dist/esm/{chunk-YBRE4XNB.js → chunk-CFEWW2ER.js} +2 -2
- package/dist/esm/{chunk-EJQUNX4L.js → chunk-DCLXPAMC.js} +3 -3
- package/dist/esm/{chunk-AR26HCRY.js → chunk-F4IQOYFH.js} +2 -2
- package/dist/esm/{chunk-ENZ3OBCL.js → chunk-F7KT5EX5.js} +2 -2
- package/dist/esm/{chunk-3QS3CMF4.js → chunk-GRGSTKN3.js} +2 -2
- package/dist/esm/{chunk-TTQ36NQ5.js → chunk-HRN6NSO2.js} +2 -2
- package/dist/esm/{chunk-E7KECYS7.js → chunk-IEWLP7PR.js} +7 -1
- package/dist/esm/chunk-IEWLP7PR.js.map +7 -0
- package/dist/esm/chunk-IFKY7FXY.js +484 -0
- package/dist/esm/chunk-IFKY7FXY.js.map +7 -0
- package/dist/esm/chunk-J4CJEGEM.js +3016 -0
- package/dist/esm/chunk-J4CJEGEM.js.map +7 -0
- package/dist/esm/{chunk-N42ATJOO.js → chunk-M5P5LAJJ.js} +2 -2
- package/dist/esm/{chunk-3K7Q5MUF.js → chunk-MIJCN6AD.js} +2 -2
- package/dist/esm/{chunk-OYI3IQIV.js → chunk-NNB5QBR2.js} +2 -2
- package/dist/esm/{chunk-WMSUADX2.js → chunk-OJ54L3XZ.js} +4 -4
- package/dist/esm/{chunk-5ODS4QTF.js → chunk-P64VHYRM.js} +2 -2
- package/dist/esm/{chunk-MFZVOFPX.js → chunk-PAOVIX5L.js} +3 -3
- package/dist/esm/chunk-PEHPXXTS.js +1053 -0
- package/dist/esm/chunk-PEHPXXTS.js.map +7 -0
- package/dist/esm/chunk-PTMMQODC.js +760 -0
- package/dist/esm/chunk-PTMMQODC.js.map +7 -0
- package/dist/esm/{chunk-ZXN75Q55.js → chunk-PWXFQ5FI.js} +3 -3
- package/dist/esm/{chunk-CZGHFBAO.js → chunk-PYD5MY63.js} +131 -9
- package/dist/esm/chunk-PYD5MY63.js.map +7 -0
- package/dist/esm/{chunk-NP4QQMME.js → chunk-RJZ46VHV.js} +2 -2
- package/dist/esm/chunk-SK7LOVVI.js +660 -0
- package/dist/esm/chunk-SK7LOVVI.js.map +7 -0
- package/dist/esm/{chunk-ZRZ6LUI2.js → chunk-TN4W5NLC.js} +7 -1
- package/dist/esm/chunk-TN4W5NLC.js.map +7 -0
- package/dist/esm/chunk-VYCICKFV.js +698 -0
- package/dist/esm/chunk-VYCICKFV.js.map +7 -0
- package/dist/esm/{chunk-4TSICBUM.js → chunk-W3TLZPTC.js} +3 -3
- package/dist/esm/{chunk-M2RS2IFR.js → chunk-WNFIFYG2.js} +2 -2
- package/dist/esm/{chunk-CVX7ZJQR.js → chunk-XP2XNYEA.js} +161 -4
- package/dist/esm/chunk-XP2XNYEA.js.map +7 -0
- package/dist/esm/{chunk-SGDEIQ7L.js → chunk-Y7BVCD32.js} +3 -3
- package/dist/esm/{chunk-UHI2V2WP.js → chunk-YFIDWQNM.js} +1308 -487
- package/dist/esm/chunk-YFIDWQNM.js.map +7 -0
- package/dist/esm/generated/protos/index.akash.v1.js +2988 -77
- package/dist/esm/generated/protos/index.akash.v1.js.map +4 -4
- package/dist/esm/generated/protos/index.akash.v1beta4.js +58 -13
- package/dist/esm/generated/protos/index.akash.v1beta5.js +17 -12
- package/dist/esm/generated/protos/index.akash.v1beta5.js.map +1 -1
- package/dist/esm/generated/protos/index.akash.v2.js +4 -4
- package/dist/esm/generated/protos/index.provider.akash.v1.js +29 -10
- package/dist/esm/generated/protos/index.provider.akash.v2beta3.js +7 -4
- package/dist/esm/index.js +54 -36
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/index.web.js +14 -13
- package/dist/esm/index.web.js.map +1 -1
- package/dist/esm/{query_akash-I3RPHLVA.js → query_akash-BTYAA6UN.js} +5 -5
- package/dist/esm/{query_akash-QF2LHJQN.js → query_akash-EG43V2QH.js} +4 -4
- package/dist/esm/{query_akash-44SHG3FL.js → query_akash-HCIMNA7T.js} +4 -3
- package/dist/esm/{query_akash-44SHG3FL.js.map → query_akash-HCIMNA7T.js.map} +1 -1
- package/dist/esm/{query_akash-72TFPQBZ.js → query_akash-HN4NCENR.js} +4 -4
- package/dist/esm/query_akash-KU4YCMUU.js +85 -0
- package/dist/esm/query_akash-KU4YCMUU.js.map +7 -0
- package/dist/esm/{query_akash-TZ6F7OO4.js → query_akash-LSGWB5MI.js} +24 -12
- package/dist/esm/query_akash-LSGWB5MI.js.map +7 -0
- package/dist/esm/{query_akash-54EYS6GQ.js → query_akash-SOJJMCBH.js} +8 -7
- package/dist/esm/{query_akash-54EYS6GQ.js.map → query_akash-SOJJMCBH.js.map} +1 -1
- package/dist/esm/{query_akash-EGFDDA4L.js → query_akash-SVNQ4S67.js} +4 -4
- package/dist/esm/query_akash-XYSUQTZC.js +164 -0
- package/dist/esm/query_akash-XYSUQTZC.js.map +7 -0
- package/dist/esm/{service_akash-KRCYHNCN.js → service_akash-3R3TC3PH.js} +4 -3
- package/dist/esm/{service_akash-KRCYHNCN.js.map → service_akash-3R3TC3PH.js.map} +1 -1
- package/dist/esm/{service_akash-CEAZGGZS.js → service_akash-43EJ5RKY.js} +8 -7
- package/dist/esm/{service_akash-CEAZGGZS.js.map → service_akash-43EJ5RKY.js.map} +1 -1
- package/dist/esm/{service_akash-YXSRY4G3.js → service_akash-AXWB3IDG.js} +7 -6
- package/dist/esm/{service_akash-YXSRY4G3.js.map → service_akash-AXWB3IDG.js.map} +1 -1
- package/dist/esm/{service_akash-Z4CR3DWY.js → service_akash-BZTUHKJO.js} +8 -7
- package/dist/esm/{service_akash-Z4CR3DWY.js.map → service_akash-BZTUHKJO.js.map} +1 -1
- package/dist/esm/{service_akash-JQKI2SJP.js → service_akash-HFGWADC2.js} +4 -4
- package/dist/esm/{service_akash-SXXXZL6K.js → service_akash-KAJJV7LX.js} +4 -4
- package/dist/esm/service_akash-KYLB3OP3.js +78 -0
- package/dist/esm/service_akash-KYLB3OP3.js.map +7 -0
- package/dist/esm/service_akash-LJBOWZZG.js +221 -0
- package/dist/esm/service_akash-LJBOWZZG.js.map +7 -0
- package/dist/esm/{service_akash-PFTEVUGK.js → service_akash-QTGRTXLG.js} +4 -4
- package/dist/esm/{service_akash-44MLEMTW.js → service_akash-T36Y5DCD.js} +4 -3
- package/dist/esm/{service_akash-44MLEMTW.js.map → service_akash-T36Y5DCD.js.map} +1 -1
- package/dist/esm/{service_akash-ZITNWRBM.js → service_akash-X4HCN3EG.js} +9 -8
- package/dist/esm/{service_akash-ZITNWRBM.js.map → service_akash-X4HCN3EG.js.map} +1 -1
- package/dist/esm/snapshot_akash-KH5X5W3B.js +41 -0
- package/dist/esm/snapshot_akash-KH5X5W3B.js.map +7 -0
- package/dist/sdl-schema.yaml +84 -8
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/generated/createNodeSDK.d.ts +473 -0
- package/dist/types/generated/createProviderSDK.d.ts +31 -0
- package/dist/types/generated/patches/nodeCustomTypePatches.d.ts +8 -0
- package/dist/types/generated/protos/akash/base/attributes/v1/attribute.d.ts +3 -0
- package/dist/types/generated/protos/akash/inventory/v1/snapshot.d.ts +112 -0
- package/dist/types/generated/protos/akash/inventory/v1/snapshot_akash.d.ts +22 -0
- package/dist/types/generated/protos/akash/manifest/v2beta3/httpoptions.d.ts +35 -0
- package/dist/types/generated/protos/akash/market/v1/stats.d.ts +35 -0
- package/dist/types/generated/protos/akash/market/v1/types.d.ts +5 -3
- package/dist/types/generated/protos/akash/market/v1beta5/query.d.ts +29 -0
- package/dist/types/generated/protos/akash/market/v1beta5/query_akash.d.ts +8 -1
- package/dist/types/generated/protos/akash/provider/v1beta4/event.d.ts +40 -0
- package/dist/types/generated/protos/akash/provider/v1beta4/genesis.d.ts +11 -1
- package/dist/types/generated/protos/akash/provider/v1beta4/maintenance.d.ts +87 -0
- package/dist/types/generated/protos/akash/provider/v1beta4/msg.d.ts +57 -0
- package/dist/types/generated/protos/akash/provider/v1beta4/params.d.ts +17 -0
- package/dist/types/generated/protos/akash/provider/v1beta4/paramsmsg.d.ts +22 -0
- package/dist/types/generated/protos/akash/provider/v1beta4/provider.d.ts +13 -0
- package/dist/types/generated/protos/akash/provider/v1beta4/query.d.ts +93 -1
- package/dist/types/generated/protos/akash/provider/v1beta4/query_akash.d.ts +29 -1
- package/dist/types/generated/protos/akash/provider/v1beta4/service_akash.d.ts +20 -1
- package/dist/types/generated/protos/akash/verification/v1/event.d.ts +339 -0
- package/dist/types/generated/protos/akash/verification/v1/genesis.d.ts +45 -0
- package/dist/types/generated/protos/akash/verification/v1/msg.d.ts +614 -0
- package/dist/types/generated/protos/akash/verification/v1/params.d.ts +147 -0
- package/dist/types/generated/protos/akash/verification/v1/query.d.ts +290 -0
- package/dist/types/generated/protos/akash/verification/v1/query_akash.d.ts +97 -0
- package/dist/types/generated/protos/akash/verification/v1/service.d.ts +1 -0
- package/dist/types/generated/protos/akash/verification/v1/service_akash.d.ts +126 -0
- package/dist/types/generated/protos/akash/verification/v1/state.d.ts +320 -0
- package/dist/types/generated/protos/akash/verification/v1/types.d.ts +348 -0
- package/dist/types/generated/protos/akash/verification/v1/verificationrequirement.d.ts +36 -0
- package/dist/types/generated/protos/index.akash.v1.d.ts +9 -0
- package/dist/types/generated/protos/index.akash.v1beta4.d.ts +7 -4
- package/dist/types/generated/protos/index.akash.v1beta5.d.ts +1 -1
- package/dist/types/generated/protos/index.provider.akash.v1.d.ts +1 -0
- package/dist/types/generated/protos/index.provider.akash.v2beta3.d.ts +1 -1
- package/dist/types/sdk/chain/createChainNodeSDK.d.ts +45 -0
- package/dist/types/sdk/chain/createChainNodeWebSDK.d.ts +45 -0
- package/dist/types/sdl/duration.d.ts +13 -0
- package/dist/types/sdl/httpTimeout.d.ts +10 -0
- package/dist/types/sdl/index.d.ts +0 -1
- package/dist/types/sdl/manifest/reclamationDuration.d.ts +3 -7
- package/dist/types/sdl/validateSDL/validateSDLInput.d.ts +131 -16
- package/package.json +1 -1
- package/dist/cjs/sdl/types.cjs.map +0 -7
- package/dist/esm/chunk-C3WV6GJ6.js +0 -234
- package/dist/esm/chunk-C3WV6GJ6.js.map +0 -7
- package/dist/esm/chunk-CVX7ZJQR.js.map +0 -7
- package/dist/esm/chunk-CZGHFBAO.js.map +0 -7
- package/dist/esm/chunk-E7KECYS7.js.map +0 -7
- package/dist/esm/chunk-IVLF3VVZ.js +0 -364
- package/dist/esm/chunk-IVLF3VVZ.js.map +0 -7
- package/dist/esm/chunk-MV27RM25.js +0 -368
- package/dist/esm/chunk-MV27RM25.js.map +0 -7
- package/dist/esm/chunk-S2CZQ6AM.js +0 -211
- package/dist/esm/chunk-S2CZQ6AM.js.map +0 -7
- package/dist/esm/chunk-SXGU4O34.js +0 -258
- package/dist/esm/chunk-SXGU4O34.js.map +0 -7
- package/dist/esm/chunk-UHI2V2WP.js.map +0 -7
- package/dist/esm/chunk-V42TLXWK.js +0 -177
- package/dist/esm/chunk-V42TLXWK.js.map +0 -7
- package/dist/esm/chunk-ZRZ6LUI2.js.map +0 -7
- package/dist/esm/query_akash-N3FPIXVQ.js +0 -39
- package/dist/esm/query_akash-N3FPIXVQ.js.map +0 -7
- package/dist/esm/query_akash-TZ6F7OO4.js.map +0 -7
- package/dist/esm/service_akash-5AUMDLU5.js +0 -46
- package/dist/esm/service_akash-5AUMDLU5.js.map +0 -7
- package/dist/types/sdl/types.d.ts +0 -305
- /package/dist/esm/{chunk-4SZHF6SE.js.map → chunk-3U5XKNEU.js.map} +0 -0
- /package/dist/esm/{chunk-IKTMMFJ5.js.map → chunk-54RECHZZ.js.map} +0 -0
- /package/dist/esm/{chunk-WCUR732W.js.map → chunk-57534UAR.js.map} +0 -0
- /package/dist/esm/{chunk-B4YVLEG7.js.map → chunk-7F3NJG67.js.map} +0 -0
- /package/dist/esm/{chunk-XAOERZEY.js.map → chunk-AKNHD3CM.js.map} +0 -0
- /package/dist/esm/{chunk-ZGK4PJCD.js.map → chunk-BQNJHJXY.js.map} +0 -0
- /package/dist/esm/{chunk-YBRE4XNB.js.map → chunk-CFEWW2ER.js.map} +0 -0
- /package/dist/esm/{chunk-EJQUNX4L.js.map → chunk-DCLXPAMC.js.map} +0 -0
- /package/dist/esm/{chunk-AR26HCRY.js.map → chunk-F4IQOYFH.js.map} +0 -0
- /package/dist/esm/{chunk-ENZ3OBCL.js.map → chunk-F7KT5EX5.js.map} +0 -0
- /package/dist/esm/{chunk-3QS3CMF4.js.map → chunk-GRGSTKN3.js.map} +0 -0
- /package/dist/esm/{chunk-TTQ36NQ5.js.map → chunk-HRN6NSO2.js.map} +0 -0
- /package/dist/esm/{chunk-N42ATJOO.js.map → chunk-M5P5LAJJ.js.map} +0 -0
- /package/dist/esm/{chunk-3K7Q5MUF.js.map → chunk-MIJCN6AD.js.map} +0 -0
- /package/dist/esm/{chunk-OYI3IQIV.js.map → chunk-NNB5QBR2.js.map} +0 -0
- /package/dist/esm/{chunk-WMSUADX2.js.map → chunk-OJ54L3XZ.js.map} +0 -0
- /package/dist/esm/{chunk-5ODS4QTF.js.map → chunk-P64VHYRM.js.map} +0 -0
- /package/dist/esm/{chunk-MFZVOFPX.js.map → chunk-PAOVIX5L.js.map} +0 -0
- /package/dist/esm/{chunk-ZXN75Q55.js.map → chunk-PWXFQ5FI.js.map} +0 -0
- /package/dist/esm/{chunk-NP4QQMME.js.map → chunk-RJZ46VHV.js.map} +0 -0
- /package/dist/esm/{chunk-4TSICBUM.js.map → chunk-W3TLZPTC.js.map} +0 -0
- /package/dist/esm/{chunk-M2RS2IFR.js.map → chunk-WNFIFYG2.js.map} +0 -0
- /package/dist/esm/{chunk-SGDEIQ7L.js.map → chunk-Y7BVCD32.js.map} +0 -0
- /package/dist/esm/{query_akash-I3RPHLVA.js.map → query_akash-BTYAA6UN.js.map} +0 -0
- /package/dist/esm/{query_akash-QF2LHJQN.js.map → query_akash-EG43V2QH.js.map} +0 -0
- /package/dist/esm/{query_akash-72TFPQBZ.js.map → query_akash-HN4NCENR.js.map} +0 -0
- /package/dist/esm/{query_akash-EGFDDA4L.js.map → query_akash-SVNQ4S67.js.map} +0 -0
- /package/dist/esm/{service_akash-JQKI2SJP.js.map → service_akash-HFGWADC2.js.map} +0 -0
- /package/dist/esm/{service_akash-SXXXZL6K.js.map → service_akash-KAJJV7LX.js.map} +0 -0
- /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
|
+
}
|
package/dist/cjs/sdl/index.cjs
CHANGED
|
@@ -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
|
|
5
|
-
"mappings": "
|
|
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
|
}
|
|
@@ -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;
|
|
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"],
|
|
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;AAOpE,MAAM,yBAAyB,oBAAI,I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BAAkB;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
|
|
102
|
-
sendTimeout: httpOptions?.send_timeout
|
|
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
|
|
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,mBAAgE;AAezD,SAAS,+BAA+B,UAAwD;AACrG,QAAM,gBAA0B,CAAC;AAEjC,aAAW,WAAW,OAAO,OAAO,QAAQ,GAAG;AAC7C,QAAI,CAAC,QAAQ,OAAQ;AACrB,eAAW,UA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;AACvC,YAAI,MAAM,UAAW,QAAO,cAAc,MAAM,SAAS;AACzD,eAAO,KAAK,EAAE,KAAK,OAAO,OAAO,CAAC;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACL;AAOA,QAAM,QAAQ,yBAAyB,WAAW,YAAY;AAC9D,MAAI,UAAU,IAAI;AAChB,WAAO,KAAK,EAAE,KAAK,sBAAsB,OAAO,MAAM,CAAC;AAAA,EACzD;AAKA,SAAO,KAAK,CAAC,GAAG,MAAM,EAAE,IAAI,cAAc,EAAE,GAAG,CAAC;AAEhD,SAAO;AACT;AAEO,SAAS,iBAAiB,aAAwD;AACvF,SAAO,6DAAyB,YAAY;AAAA,IAC1C,aAAa,aAAa,iBAAiB;AAAA,IAC3C,aAAa,aAAa,
|
|
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;A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CAAsB,OAAO,IAAI;AAC1C;AAEO,SAAS,kBAAkB,MAAsB;AACtD,aAAO,oCAAsB,IAAI;AACnC;AAEO,SAAS,cAAc,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;",
|
|
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
|
-
|
|
25
|
+
var import_duration2 = require("../duration.cjs");
|
|
26
26
|
function minWindowToDuration(value) {
|
|
27
|
-
const
|
|
28
|
-
|
|
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:
|
|
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\";\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;
|
|
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) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/sdl/validateSDL/validateSDL.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ErrorMessages, ValidationError, ValidationFunction } from \"../../utils/jsonSchemaValidation.ts\";\nimport { dirname, getErrorLocation, humanizeErrors } from \"../../utils/jsonSchemaValidation.ts\";\nimport { INTERCONNECT_GROUP_AUTO, resolveInterconnectGroup } from \"../manifest/manifestUtils.ts\";\nimport { castArray, stringToBoolean } from \"../utils.ts\";\nimport { schema as validationSDLSchema, type SDLInput, validate as validateSDLInput } from \"./validateSDLInput.ts\";\n\nexport { validationSDLSchema };\nexport type { SDLInput };\n\nconst ERROR_MESSAGES: ErrorMessages = {\n \"#/definitions/storageRamClassMustNotBePersistent\"(error) {\n return `\"ram\" storage${getErrorLocation(dirname(error.instancePath))} cannot be persistent`;\n },\n \"#/definitions/exposeToWithIpEnforcesGlobal\"() {\n return `If an IP is declared, the directive must be declared as global.`;\n },\n // Mirrors the shared schema's `min_window` pattern (`^[1-9][0-9]*(s|m|h)$`).\n // Go stays the lenient layer (`go/sdl/reclamation.go` accepts any `> 0`\n // `time.ParseDuration`), so this is a sanctioned schema-only-stricter rule.\n \"#/properties/reclamation/properties/min_window/pattern\"() {\n return `Reclamation min_window must be a whole number followed by s, m, or h (e.g. \"24h\", \"30m\").`;\n },\n};\n\nexport function validateSDL(sdl: SDLInput): undefined | ValidationError[] {\n validateSDLInput(sdl);\n const schemaErrors = humanizeErrors((validateSDLInput as ValidationFunction).errors, validationSDLSchema, ERROR_MESSAGES);\n if (schemaErrors.length) return schemaErrors;\n\n const validator = new SDLValidator(sdl);\n const errors = validator.validate();\n\n const allErrors = schemaErrors.concat(errors);\n return allErrors.length ? allErrors : undefined;\n}\n\nclass SDLValidator {\n readonly #endpointsUsed = new Set<string>();\n readonly #portsUsed = new Map<string, string>();\n readonly #teeTypeByPlacement = new Map<string, string>();\n readonly #sdl: SDLInput;\n readonly #errors: ValidationError[] = [];\n\n constructor(sdl: SDLInput) {\n this.#sdl = sdl;\n }\n\n validate() {\n if (this.#sdl.services) {\n Object.keys(this.#sdl.services).forEach((serviceName) => {\n this.#validateDeploymentWithRelations(serviceName);\n this.#validateLeaseIP(serviceName);\n });\n }\n\n this.#validateInterconnect();\n this.#validateEndpoints();\n return this.#errors;\n }\n\n #validateDeploymentWithRelations(serviceName: string) {\n const deployment = this.#sdl.deployment[serviceName];\n if (!deployment) {\n this.#errors.push({\n message: `Service \"${serviceName}\" is not defined at \"/deployment\" section.`,\n instancePath: `/deployment`,\n schemaPath: \"#/properties/deployment\",\n keyword: \"required\",\n params: {\n missingProperty: serviceName,\n },\n });\n return;\n }\n\n Object.keys(this.#sdl.deployment[serviceName]).forEach((deploymentName) => {\n this.#validateDeploymentRelations(serviceName, deploymentName);\n this.#validateServiceStorages(serviceName, deploymentName);\n this.#validateStorages(serviceName, deploymentName);\n this.#validateGPU(serviceName, deploymentName);\n this.#validateTEE(serviceName, deploymentName);\n });\n }\n\n #validateDeploymentRelations(serviceName: string, deploymentName: string) {\n const serviceDeployment = this.#sdl.deployment?.[serviceName]?.[deploymentName];\n const compute = this.#sdl.profiles?.compute?.[serviceDeployment?.profile];\n const infra = this.#sdl.profiles?.placement?.[deploymentName];\n\n if (!infra) {\n this.#errors.push({\n message: `The placement \"${deploymentName}\" is not defined in the \"placement\" section.`,\n instancePath: `/profiles/placement`,\n schemaPath: \"#/properties/profiles/properties/placement\",\n keyword: \"required\",\n params: {\n missingProperty: deploymentName,\n },\n });\n }\n\n if (infra && !infra.pricing?.[serviceDeployment?.profile]) {\n this.#errors.push({\n message: `The pricing for the \"${serviceDeployment?.profile}\" profile is not defined in the \"${deploymentName}\" placement.`,\n instancePath: `/profiles/placement/${deploymentName}/pricing`,\n schemaPath: \"#/properties/profiles/properties/placement/additionalProperties/properties/pricing\",\n keyword: \"required\",\n params: {\n missingProperty: serviceDeployment?.profile,\n },\n });\n }\n\n if (!compute) {\n this.#errors.push({\n message: `The compute requirements for the \"${serviceDeployment?.profile}\" profile are not defined in the \"compute\" section.`,\n instancePath: `/profiles/compute`,\n schemaPath: \"#/properties/profiles/properties/compute\",\n keyword: \"required\",\n params: {\n missingProperty: serviceDeployment?.profile,\n },\n });\n }\n }\n\n #validateServiceStorages(serviceName: string, deploymentName: string) {\n const service = this.#sdl.services?.[serviceName];\n const mounts: Record<string, string> = {};\n const serviceDeployment = this.#sdl.deployment[serviceName][deploymentName];\n const compute = this.#sdl.profiles?.compute?.[serviceDeployment.profile];\n const storages = castArray(compute?.resources.storage);\n\n if (!service?.params?.storage) {\n return;\n }\n\n Object.entries(service.params.storage).forEach(([storageName, storage]) => {\n if (!storage) {\n this.#errors.push({\n message: `Storage \"${storageName}\" is not configured.`,\n instancePath: `/services/${serviceName}/params/storage/${storageName}`,\n schemaPath: \"#/properties/services/additionalProperties/properties/params/properties/storage/additionalProperties\",\n keyword: \"required\",\n params: {\n missingProperty: storageName,\n },\n });\n return;\n }\n const storageNameExists = storages.some(({ name }) => name === storageName);\n if (!storageNameExists) {\n this.#errors.push({\n message: `Service \"${serviceName}\" references non-existing compute volume \"${storageName}\".`,\n instancePath: `/profiles/compute/${serviceDeployment.profile}/resources/storage`,\n schemaPath: \"#/properties/profiles/properties/compute/additionalProperties/properties/resources/properties/storage\",\n keyword: \"required\",\n params: {\n missingProperty: storageName,\n },\n });\n return;\n }\n\n const mount = String(storage.mount);\n const volumeName = mounts[mount];\n\n if (volumeName && !storage.mount) {\n this.#errors.push({\n message: \"Multiple root ephemeral storages are not allowed.\",\n instancePath: `/services/${serviceName}/params/storage/${storageName}`,\n schemaPath: \"#/properties/services/additionalProperties/properties/params/properties/storage\",\n keyword: \"uniqueItems\",\n params: {\n duplicate: volumeName,\n },\n });\n }\n if (volumeName && storage.mount) {\n this.#errors.push({\n message: `Mount \"${mount}\" already in use by volume \"${volumeName}\".`,\n instancePath: `/services/${serviceName}/params/storage/${storageName}/mount`,\n schemaPath: \"#/properties/services/additionalProperties/properties/params/properties/storage/additionalProperties/properties/mount\",\n keyword: \"uniqueItems\",\n params: {\n duplicate: mount,\n },\n });\n }\n\n mounts[mount] = storageName;\n });\n }\n\n #validateStorages(serviceName: string, deploymentName: string) {\n const service = this.#sdl.services?.[serviceName];\n const serviceDeployment = this.#sdl.deployment[serviceName][deploymentName];\n const compute = this.#sdl.profiles?.compute?.[serviceDeployment.profile];\n const storages = castArray(compute?.resources.storage);\n\n storages.forEach((storage) => {\n const persistent = stringToBoolean(storage.attributes?.persistent as string | boolean || false);\n\n if (persistent && !service?.params?.storage?.[storage.name || \"\"]?.mount) {\n this.#errors.push({\n message: `Persistent storage \"${storage.name || \"default\"}\" requires a mount path in /services/${serviceName}/params/storage/${storage.name || \"default\"}/mount.`,\n instancePath: `/services/${serviceName}/params/storage/${storage.name || \"default\"}`,\n schemaPath: \"#/properties/services/additionalProperties/properties/params/properties/storage/additionalProperties/properties/mount\",\n keyword: \"required\",\n params: {\n missingProperty: \"mount\",\n },\n });\n }\n });\n }\n\n #validateGPU(serviceName: string, deploymentName: string) {\n const deployment = this.#sdl.deployment[serviceName];\n const compute = this.#sdl.profiles?.compute?.[deployment[deploymentName]?.profile];\n const gpu = compute?.resources.gpu;\n if (!gpu) return;\n\n const hasUnits = gpu.units !== undefined && gpu.units !== 0;\n const hasAttributes = typeof gpu.attributes !== \"undefined\";\n const hasVendor = hasAttributes && typeof gpu.attributes?.vendor !== \"undefined\";\n\n const profile = deployment[deploymentName]?.profile;\n const gpuPath = `/profiles/compute/${profile}/resources/gpu`;\n\n if (!hasUnits && hasAttributes) {\n this.#errors.push({\n message: \"GPU must not have attributes if units is 0.\",\n instancePath: `${gpuPath}/attributes`,\n schemaPath: \"#/properties/profiles/properties/compute/additionalProperties/properties/resources/properties/gpu/properties/attributes\",\n keyword: \"additionalProperties\",\n params: {\n additionalProperty: \"attributes\",\n },\n });\n }\n if (hasUnits && !hasAttributes) {\n this.#errors.push({\n message: \"GPU must have attributes if units is not 0.\",\n instancePath: gpuPath,\n schemaPath: \"#/properties/profiles/properties/compute/additionalProperties/properties/resources/properties/gpu\",\n keyword: \"required\",\n params: {\n missingProperty: \"attributes\",\n },\n });\n }\n if (hasUnits && !hasVendor) {\n this.#errors.push({\n message: \"GPU must specify a vendor if units is not 0.\",\n instancePath: `${gpuPath}/attributes`,\n schemaPath: \"#/properties/profiles/properties/compute/additionalProperties/properties/resources/properties/gpu/properties/attributes/properties/vendor\",\n keyword: \"required\",\n params: {\n missingProperty: \"vendor\",\n },\n });\n }\n\n // Note: the units==0 + interconnect/interconnect_group case is already rejected by\n // the schema-level rule `gpuAttributesRequireUnitsGt0` \u2014 it requires\n // units > 0 whenever any attribute (including interconnect / interconnect_group) is\n // present. So we don't need a duplicate semantic check here. The\n // Go parser (go/sdl/gpu.go) carries its own parse-time check because\n // YAML decoding has no schema layer above it.\n }\n\n // Mirror the Go-side validateInterconnect in go/sdl/v2.go. The TS\n // SDK enforces the same cross-field rules so tenants using\n // @akashnetwork/chain-sdk get the same fail-fast feedback as Go CLI\n // users (the chain doesn't validate SDL semantics). See\n // docs/sdl-interconnect-spec.md for the spec.\n //\n // 1. Any opt-in (implicit `[]` or explicit `{ group: <name> }`)\n // requires the placement to require\n // capabilities/gpu-interconnect=\"true\".\n // 2. The reserved name `auto` may not be written explicitly under\n // `interconnect: { group: ... }`. (Rule 2 is enforced at the\n // schema level via the JSON-schema oneOf, but checked here too\n // for a friendlier error message.)\n // 3. Within one placement, no mixing of implicit and explicit\n // opt-in forms \u2014 either every service uses `[]` or every service\n // uses a `{ group: ... }`.\n // 4. (Schema-level) `gpu.units == 0` with any interconnect opt-in\n // is rejected.\n #validateInterconnect() {\n const profiles = this.#sdl.profiles?.compute;\n const placements = this.#sdl.profiles?.placement;\n if (!profiles) return;\n\n // Rule 2: tenants cannot write `group: auto` under the explicit\n // mapping form. The JSON schema's `oneOf` already rules this out at\n // the structural level when the value is bare, but we surface a\n // friendly error here.\n for (const [profileName, compute] of Object.entries(profiles)) {\n const gpu = compute?.resources?.gpu;\n if (!gpu || gpu.units === 0 || gpu.units === undefined) continue;\n const ic = gpu.attributes?.interconnect;\n if (ic && typeof ic === \"object\" && !Array.isArray(ic) && (ic as { group?: unknown }).group === INTERCONNECT_GROUP_AUTO) {\n this.#errors.push({\n message: `Compute profile \"${profileName}\" uses gpu.attributes.interconnect.group=\"${INTERCONNECT_GROUP_AUTO}\", which is reserved (the parser auto-assigns it to \"interconnect: []\" resources). Pick a different group name.`,\n instancePath: `/profiles/compute/${profileName}/resources/gpu/attributes/interconnect/group`,\n schemaPath: \"#/properties/profiles/properties/compute/additionalProperties/properties/resources/properties/gpu/properties/attributes/properties/interconnect\",\n keyword: \"const\",\n params: { allowedValue: `non-${INTERCONNECT_GROUP_AUTO}` },\n });\n }\n }\n\n // Rules 1 + 3 are per-placement. Walk every (service, placement) and\n // capture which profile each service uses and whether it opted into\n // interconnect (implicit, explicit, or not at all).\n interface profileUsage {\n profileName: string;\n serviceName: string;\n group: string; // \"\" if non-interconnect, INTERCONNECT_GROUP_AUTO for implicit, else explicit name\n }\n const usagesByPlacement = new Map<string, profileUsage[]>();\n\n for (const [serviceName, perPlacement] of Object.entries(this.#sdl.deployment ?? {})) {\n for (const [placementName, svcdepl] of Object.entries(perPlacement ?? {})) {\n const compute = profiles[svcdepl.profile];\n if (!compute) continue;\n const gpu = compute.resources?.gpu;\n const usage: profileUsage = {\n profileName: svcdepl.profile,\n serviceName,\n group: \"\",\n };\n if (gpu && gpu.units !== 0 && gpu.units !== undefined) {\n usage.group = resolveInterconnectGroup(gpu.attributes?.interconnect);\n }\n\n const bucket = usagesByPlacement.get(placementName) ?? [];\n bucket.push(usage);\n usagesByPlacement.set(placementName, bucket);\n\n // Rule 1: any interconnect opt-in must be deployed under a\n // placement whose attributes require capabilities/gpu-interconnect=true.\n if (usage.group !== \"\") {\n const placement = placements?.[placementName];\n const attrs = (placement?.attributes ?? {}) as Record<string, unknown>;\n const capability = attrs[\"capabilities/gpu-interconnect\"];\n const requiresInterconnect = capability === \"true\" || capability === true;\n if (!requiresInterconnect) {\n this.#errors.push({\n message: `Service \"${serviceName}\" uses interconnect profile \"${svcdepl.profile}\" under placement \"${placementName}\" but placement does not require capabilities/gpu-interconnect=true.`,\n instancePath: `/profiles/placement/${placementName}/attributes`,\n schemaPath: \"#/properties/profiles/properties/placement/additionalProperties/properties/attributes\",\n keyword: \"required\",\n params: { missingProperty: \"capabilities/gpu-interconnect\" },\n });\n }\n }\n }\n }\n\n // Rule 3: within one placement, no mixing of implicit (`auto`) and\n // explicit (named) opt-ins. Either form alone is fine; combining\n // them is the failure mode this rule catches.\n for (const [placementName, usages] of usagesByPlacement.entries()) {\n let firstImplicit: string | undefined;\n let firstExplicit: string | undefined;\n for (const u of usages) {\n if (u.group === \"\") continue;\n if (u.group === INTERCONNECT_GROUP_AUTO) {\n firstImplicit ??= u.profileName;\n } else {\n firstExplicit ??= u.profileName;\n }\n }\n if (firstImplicit !== undefined && firstExplicit !== undefined) {\n this.#errors.push({\n message: `Placement \"${placementName}\" mixes implicit \"interconnect: []\" (profile \"${firstImplicit}\") and explicit \"interconnect: { group: ... }\" (profile \"${firstExplicit}\"); use one form across the placement.`,\n instancePath: `/profiles/compute/${firstImplicit}/resources/gpu/attributes/interconnect`,\n schemaPath: \"#/properties/profiles/properties/compute/additionalProperties/properties/resources/properties/gpu/properties/attributes/properties/interconnect\",\n keyword: \"oneOf\",\n params: { passingSchemas: [] },\n });\n }\n }\n }\n\n // Mirrors Go's TEE rules from `buildGroups` (go/sdl/groupBuilder_v2.go:58-83,\n // groupBuilder_v2_1.go:59-84). Two checks, both on `deploymentName` (the\n // placement-group name):\n // 1. `validateTEEWithGPU` \u2014 the `cpu-gpu` type requires GPU resources on the\n // resolved compute profile (`cpu`/absent need none).\n // 2. `errTEETypeMismatch` \u2014 a placementg diff group may carry only one tee type,\n // since `generateManifest` projects it as a single `tee/type` requirement\n // attribute. Detecting the conflict here (the validation layer) means\n // standalone `validateSDL` callers catch it, and `generateManifest` can\n // project unconditionally.\n // Unsupported tee values are rejected structurally by the input schema (`tee`\n // enum in validateSDLInput.ts) before this runs.\n #validateTEE(serviceName: string, deploymentName: string) {\n const tee = this.#sdl.services?.[serviceName]?.params?.tee;\n if (!tee) return;\n\n if (tee === \"cpu-gpu\") {\n const profile = this.#sdl.deployment[serviceName]?.[deploymentName]?.profile;\n const gpu = this.#sdl.profiles?.compute?.[profile]?.resources.gpu;\n const hasGpu = gpu?.units !== undefined && gpu.units !== 0;\n\n if (!hasGpu) {\n this.#errors.push({\n message: `Service \"${serviceName}\" tee type requires gpu resources.`,\n instancePath: `/services/${serviceName}/params/tee`,\n schemaPath: \"#/properties/services/additionalProperties/properties/params/properties/tee\",\n keyword: \"required\",\n params: {\n missingProperty: \"gpu\",\n },\n });\n }\n }\n\n const existing = this.#teeTypeByPlacement.get(deploymentName);\n if (existing === undefined) {\n this.#teeTypeByPlacement.set(deploymentName, tee);\n } else if (existing !== tee) {\n this.#errors.push({\n message: `conflicting tee types in placement group \"${deploymentName}\": \"${existing}\" and \"${tee}\"`,\n instancePath: `/services/${serviceName}/params/tee`,\n schemaPath: \"#/properties/services/additionalProperties/properties/params/properties/tee\",\n keyword: \"tee\",\n params: {},\n });\n }\n }\n\n #validateLeaseIP(serviceName: string) {\n this.#sdl.services?.[serviceName]?.expose?.forEach((expose, exposeIndex) => {\n const proto = expose.proto?.toUpperCase() || \"TCP\";\n\n expose.to?.forEach((to, toIndex) => {\n if (to.ip?.length) {\n const toPath = `/services/${serviceName}/expose/${exposeIndex}/to/${toIndex}`;\n\n if (!to.global) {\n this.#errors.push({\n message: `If an IP is declared, the directive must be declared as global.`,\n instancePath: `${toPath}/global`,\n schemaPath: \"#/definitions/exposeToWithIpEnforcesGlobal/then/properties/global/const\",\n keyword: \"const\",\n params: {\n allowedValue: true,\n },\n });\n }\n if (!this.#sdl.endpoints?.[to.ip]) {\n this.#errors.push({\n message: `Unknown endpoint \"${to.ip}\" for service \"${serviceName}\". Add it to the \"endpoints\" section.`,\n instancePath: `/endpoints/${to.ip}`,\n schemaPath: \"#/properties/endpoints\",\n keyword: \"required\",\n params: {\n missingProperty: to.ip,\n },\n });\n }\n\n this.#endpointsUsed.add(to.ip);\n\n const externalPort = expose.as ?? expose.port;\n const portKey = `${to.ip}-${externalPort}-${proto}`;\n const otherServiceName = this.#portsUsed.get(portKey);\n\n if (this.#portsUsed.has(portKey)) {\n this.#errors.push({\n message: `IP endpoint \"${to.ip}\" port ${externalPort} protocol ${proto} already in use by service \"${otherServiceName}\".`,\n instancePath: `${toPath}/ip`,\n schemaPath: \"#/properties/services/additionalProperties/properties/expose/items/properties/to/items\",\n keyword: \"uniqueItems\",\n params: {\n duplicate: portKey,\n },\n });\n }\n this.#portsUsed.set(portKey, serviceName);\n }\n });\n });\n }\n\n #validateEndpoints() {\n if (!this.#sdl.endpoints) return;\n\n Object.keys(this.#sdl.endpoints).forEach((endpoint) => {\n if (!this.#endpointsUsed.has(endpoint)) {\n this.#errors.push({\n message: `Endpoint \"${endpoint}\" declared but never used.`,\n instancePath: `/endpoints/${endpoint}`,\n schemaPath: \"#/properties/endpoints\",\n keyword: \"additionalProperties\",\n params: {\n additionalProperty: endpoint,\n },\n });\n }\n });\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,qDAAAA;AAAA;AAAA;AACA,kCAA0D;AAC1D,2BAAkE;AAClE,mBAA2C;AAC3C,8BAA2F;AAJ3F;AASA,MAAM,iBAAgC;AAAA,EACpC,mDAAmD,OAAO;AACxD,WAAO,oBAAgB,kDAAiB,qCAAQ,MAAM,YAAY,CAAC,CAAC;AAAA,EACtE;AAAA,EACA,+CAA+C;AAC7C,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAIA,2DAA2D;AACzD,WAAO;AAAA,EACT;AACF;AAEO,SAAS,YAAY,KAA8C;AACxE,8BAAAC,UAAiB,GAAG;AACpB,QAAM,mBAAe,4CAAgB,wBAAAA,SAAwC,QAAQ,wBAAAC,QAAqB,cAAc;AACxH,MAAI,aAAa,OAAQ,QAAO;AAEhC,QAAM,YAAY,IAAI,aAAa,GAAG;AACtC,QAAM,SAAS,UAAU,SAAS;AAElC,QAAM,YAAY,aAAa,OAAO,MAAM;AAC5C,SAAO,UAAU,SAAS,YAAY;AACxC;AAEA,MAAM,aAAa;AAAA,EAOjB,YAAY,KAAe;AAP7B;AACE,uBAAS,gBAAiB,oBAAI,IAAY;AAC1C,uBAAS,YAAa,oBAAI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S,WAAW;AAAA,MAC1C;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;AAEA,uBAAkB,WAAG;AACnB,MAAI,CAAC,mBAAK,MAAK,UAAW;AAE1B,SAAO,KAAK,mBAAK,MAAK,SAAS,EAAE,QAAQ,CAAC,aAAa;AACrD,QAAI,CAAC,mBAAK,gBAAe,IAAI,QAAQ,GAAG;AACtC,yBAAK,SAAQ,KAAK;AAAA,QAChB,SAAS,aAAa,QAAQ;AAAA,QAC9B,cAAc,cAAc,QAAQ;AAAA,QACpC,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,QAAQ;AAAA,UACN,oBAAoB;AAAA,QACtB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH;",
|
|
4
|
+
"sourcesContent": ["import type { ErrorMessages, ValidationError, ValidationFunction } from \"../../utils/jsonSchemaValidation.ts\";\nimport { dirname, getErrorLocation, humanizeErrors } from \"../../utils/jsonSchemaValidation.ts\";\nimport { MAX_HTTP_TIMEOUT_MILLISECONDS, parseHTTPTimeout } from \"../httpTimeout.ts\";\nimport { INTERCONNECT_GROUP_AUTO, resolveInterconnectGroup } from \"../manifest/manifestUtils.ts\";\nimport { castArray, stringToBoolean } from \"../utils.ts\";\nimport { schema as validationSDLSchema, type SDLInput, validate as validateSDLInput } from \"./validateSDLInput.ts\";\n\nexport { validationSDLSchema };\nexport type { SDLInput };\n\nconst ERROR_MESSAGES: ErrorMessages = {\n \"#/definitions/storageRamClassMustNotBePersistent\"(error) {\n return `\"ram\" storage${getErrorLocation(dirname(error.instancePath))} cannot be persistent`;\n },\n \"#/definitions/exposeToWithIpEnforcesGlobal\"() {\n return `If an IP is declared, the directive must be declared as global.`;\n },\n // Mirrors the shared schema's `min_window` pattern (`^[1-9][0-9]*(s|m|h)$`).\n // Go stays the lenient layer (`go/sdl/reclamation.go` accepts any `> 0`\n // `time.ParseDuration`), so this is a sanctioned schema-only-stricter rule.\n \"#/properties/reclamation/properties/min_window/pattern\"() {\n return `Reclamation min_window must be a whole number followed by s, m, or h (e.g. \"24h\", \"30m\").`;\n },\n};\n\nexport function validateSDL(sdl: SDLInput): undefined | ValidationError[] {\n validateSDLInput(sdl);\n const schemaErrors = humanizeErrors((validateSDLInput as ValidationFunction).errors, validationSDLSchema, ERROR_MESSAGES);\n if (schemaErrors.length) return schemaErrors;\n\n const validator = new SDLValidator(sdl);\n const errors = validator.validate();\n\n const allErrors = schemaErrors.concat(errors);\n return allErrors.length ? allErrors : undefined;\n}\n\nclass SDLValidator {\n readonly #endpointsUsed = new Set<string>();\n readonly #portsUsed = new Map<string, string>();\n readonly #teeTypeByPlacement = new Map<string, string>();\n readonly #sdl: SDLInput;\n readonly #errors: ValidationError[] = [];\n\n constructor(sdl: SDLInput) {\n this.#sdl = sdl;\n }\n\n validate() {\n if (this.#sdl.services) {\n Object.keys(this.#sdl.services).forEach((serviceName) => {\n this.#validateDeploymentWithRelations(serviceName);\n this.#validateLeaseIP(serviceName);\n this.#validateHTTPTimeoutRanges(serviceName);\n });\n }\n\n this.#validateInterconnect();\n this.#validateEndpoints();\n return this.#errors;\n }\n\n // JSON Schema caps numeric values, but its string pattern cannot enforce the\n // maximum after unit conversion. For example, \"1194h\" matches the pattern.\n #validateHTTPTimeoutRanges(serviceName: string) {\n const exposes = this.#sdl.services[serviceName]?.expose ?? [];\n for (const [exposeIndex, expose] of exposes.entries()) {\n const options = expose.http_options;\n if (!options) continue;\n\n for (const field of [\"read_timeout\", \"send_timeout\"] as const) {\n const value = options[field];\n if (value === undefined) continue;\n\n const result = parseHTTPTimeout(value);\n if (result.ok) continue;\n\n this.#errors.push({\n message: `HTTP ${field.replace(\"_\", \" \")} ${result.message}.`,\n instancePath: `/services/${serviceName}/expose/${exposeIndex}/http_options/${field}`,\n schemaPath: \"#/definitions/httpTimeout/maximum\",\n keyword: \"maximum\",\n params: {\n comparison: \"<=\",\n limit: MAX_HTTP_TIMEOUT_MILLISECONDS,\n },\n });\n }\n }\n }\n\n #validateDeploymentWithRelations(serviceName: string) {\n const deployment = this.#sdl.deployment[serviceName];\n if (!deployment) {\n this.#errors.push({\n message: `Service \"${serviceName}\" is not defined at \"/deployment\" section.`,\n instancePath: `/deployment`,\n schemaPath: \"#/properties/deployment\",\n keyword: \"required\",\n params: {\n missingProperty: serviceName,\n },\n });\n return;\n }\n\n Object.keys(this.#sdl.deployment[serviceName]).forEach((deploymentName) => {\n this.#validateDeploymentRelations(serviceName, deploymentName);\n this.#validateServiceStorages(serviceName, deploymentName);\n this.#validateStorages(serviceName, deploymentName);\n this.#validateGPU(serviceName, deploymentName);\n this.#validateTEE(serviceName, deploymentName);\n });\n }\n\n #validateDeploymentRelations(serviceName: string, deploymentName: string) {\n const serviceDeployment = this.#sdl.deployment?.[serviceName]?.[deploymentName];\n const compute = this.#sdl.profiles?.compute?.[serviceDeployment?.profile];\n const infra = this.#sdl.profiles?.placement?.[deploymentName];\n\n if (!infra) {\n this.#errors.push({\n message: `The placement \"${deploymentName}\" is not defined in the \"placement\" section.`,\n instancePath: `/profiles/placement`,\n schemaPath: \"#/properties/profiles/properties/placement\",\n keyword: \"required\",\n params: {\n missingProperty: deploymentName,\n },\n });\n }\n\n if (infra && !infra.pricing?.[serviceDeployment?.profile]) {\n this.#errors.push({\n message: `The pricing for the \"${serviceDeployment?.profile}\" profile is not defined in the \"${deploymentName}\" placement.`,\n instancePath: `/profiles/placement/${deploymentName}/pricing`,\n schemaPath: \"#/properties/profiles/properties/placement/additionalProperties/properties/pricing\",\n keyword: \"required\",\n params: {\n missingProperty: serviceDeployment?.profile,\n },\n });\n }\n\n if (!compute) {\n this.#errors.push({\n message: `The compute requirements for the \"${serviceDeployment?.profile}\" profile are not defined in the \"compute\" section.`,\n instancePath: `/profiles/compute`,\n schemaPath: \"#/properties/profiles/properties/compute\",\n keyword: \"required\",\n params: {\n missingProperty: serviceDeployment?.profile,\n },\n });\n }\n }\n\n #validateServiceStorages(serviceName: string, deploymentName: string) {\n const service = this.#sdl.services?.[serviceName];\n const mounts: Record<string, string> = {};\n const serviceDeployment = this.#sdl.deployment[serviceName][deploymentName];\n const compute = this.#sdl.profiles?.compute?.[serviceDeployment.profile];\n const storages = castArray(compute?.resources.storage);\n\n if (!service?.params?.storage) {\n return;\n }\n\n Object.entries(service.params.storage).forEach(([storageName, storage]) => {\n if (!storage) {\n this.#errors.push({\n message: `Storage \"${storageName}\" is not configured.`,\n instancePath: `/services/${serviceName}/params/storage/${storageName}`,\n schemaPath: \"#/properties/services/additionalProperties/properties/params/properties/storage/additionalProperties\",\n keyword: \"required\",\n params: {\n missingProperty: storageName,\n },\n });\n return;\n }\n const storageNameExists = storages.some(({ name }) => name === storageName);\n if (!storageNameExists) {\n this.#errors.push({\n message: `Service \"${serviceName}\" references non-existing compute volume \"${storageName}\".`,\n instancePath: `/profiles/compute/${serviceDeployment.profile}/resources/storage`,\n schemaPath: \"#/properties/profiles/properties/compute/additionalProperties/properties/resources/properties/storage\",\n keyword: \"required\",\n params: {\n missingProperty: storageName,\n },\n });\n return;\n }\n\n const mount = String(storage.mount);\n const volumeName = mounts[mount];\n\n if (volumeName && !storage.mount) {\n this.#errors.push({\n message: \"Multiple root ephemeral storages are not allowed.\",\n instancePath: `/services/${serviceName}/params/storage/${storageName}`,\n schemaPath: \"#/properties/services/additionalProperties/properties/params/properties/storage\",\n keyword: \"uniqueItems\",\n params: {\n duplicate: volumeName,\n },\n });\n }\n if (volumeName && storage.mount) {\n this.#errors.push({\n message: `Mount \"${mount}\" already in use by volume \"${volumeName}\".`,\n instancePath: `/services/${serviceName}/params/storage/${storageName}/mount`,\n schemaPath: \"#/properties/services/additionalProperties/properties/params/properties/storage/additionalProperties/properties/mount\",\n keyword: \"uniqueItems\",\n params: {\n duplicate: mount,\n },\n });\n }\n\n mounts[mount] = storageName;\n });\n }\n\n #validateStorages(serviceName: string, deploymentName: string) {\n const service = this.#sdl.services?.[serviceName];\n const serviceDeployment = this.#sdl.deployment[serviceName][deploymentName];\n const compute = this.#sdl.profiles?.compute?.[serviceDeployment.profile];\n const storages = castArray(compute?.resources.storage);\n\n storages.forEach((storage) => {\n const persistent = stringToBoolean(storage.attributes?.persistent as string | boolean || false);\n\n if (persistent && !service?.params?.storage?.[storage.name || \"\"]?.mount) {\n this.#errors.push({\n message: `Persistent storage \"${storage.name || \"default\"}\" requires a mount path in /services/${serviceName}/params/storage/${storage.name || \"default\"}/mount.`,\n instancePath: `/services/${serviceName}/params/storage/${storage.name || \"default\"}`,\n schemaPath: \"#/properties/services/additionalProperties/properties/params/properties/storage/additionalProperties/properties/mount\",\n keyword: \"required\",\n params: {\n missingProperty: \"mount\",\n },\n });\n }\n });\n }\n\n #validateGPU(serviceName: string, deploymentName: string) {\n const deployment = this.#sdl.deployment[serviceName];\n const compute = this.#sdl.profiles?.compute?.[deployment[deploymentName]?.profile];\n const gpu = compute?.resources.gpu;\n if (!gpu) return;\n\n const hasUnits = gpu.units !== undefined && gpu.units !== 0;\n const hasAttributes = typeof gpu.attributes !== \"undefined\";\n const hasVendor = hasAttributes && typeof gpu.attributes?.vendor !== \"undefined\";\n\n const profile = deployment[deploymentName]?.profile;\n const gpuPath = `/profiles/compute/${profile}/resources/gpu`;\n\n if (!hasUnits && hasAttributes) {\n this.#errors.push({\n message: \"GPU must not have attributes if units is 0.\",\n instancePath: `${gpuPath}/attributes`,\n schemaPath: \"#/properties/profiles/properties/compute/additionalProperties/properties/resources/properties/gpu/properties/attributes\",\n keyword: \"additionalProperties\",\n params: {\n additionalProperty: \"attributes\",\n },\n });\n }\n if (hasUnits && !hasAttributes) {\n this.#errors.push({\n message: \"GPU must have attributes if units is not 0.\",\n instancePath: gpuPath,\n schemaPath: \"#/properties/profiles/properties/compute/additionalProperties/properties/resources/properties/gpu\",\n keyword: \"required\",\n params: {\n missingProperty: \"attributes\",\n },\n });\n }\n if (hasUnits && !hasVendor) {\n this.#errors.push({\n message: \"GPU must specify a vendor if units is not 0.\",\n instancePath: `${gpuPath}/attributes`,\n schemaPath: \"#/properties/profiles/properties/compute/additionalProperties/properties/resources/properties/gpu/properties/attributes/properties/vendor\",\n keyword: \"required\",\n params: {\n missingProperty: \"vendor\",\n },\n });\n }\n\n // Note: the units==0 + interconnect/interconnect_group case is already rejected by\n // the schema-level rule `gpuAttributesRequireUnitsGt0` \u2014 it requires\n // units > 0 whenever any attribute (including interconnect / interconnect_group) is\n // present. So we don't need a duplicate semantic check here. The\n // Go parser (go/sdl/gpu.go) carries its own parse-time check because\n // YAML decoding has no schema layer above it.\n }\n\n // Mirror the Go-side validateInterconnect in go/sdl/v2.go. The TS\n // SDK enforces the same cross-field rules so tenants using\n // @akashnetwork/chain-sdk get the same fail-fast feedback as Go CLI\n // users (the chain doesn't validate SDL semantics). See\n // docs/sdl-interconnect-spec.md for the spec.\n //\n // 1. Any opt-in (implicit `[]` or explicit `{ group: <name> }`)\n // requires the placement to require\n // capabilities/gpu-interconnect=\"true\".\n // 2. The reserved name `auto` may not be written explicitly under\n // `interconnect: { group: ... }`. (Rule 2 is enforced at the\n // schema level via the JSON-schema oneOf, but checked here too\n // for a friendlier error message.)\n // 3. Within one placement, no mixing of implicit and explicit\n // opt-in forms \u2014 either every service uses `[]` or every service\n // uses a `{ group: ... }`.\n // 4. (Schema-level) `gpu.units == 0` with any interconnect opt-in\n // is rejected.\n #validateInterconnect() {\n const profiles = this.#sdl.profiles?.compute;\n const placements = this.#sdl.profiles?.placement;\n if (!profiles) return;\n\n // Rule 2: tenants cannot write `group: auto` under the explicit\n // mapping form. The JSON schema's `oneOf` already rules this out at\n // the structural level when the value is bare, but we surface a\n // friendly error here.\n for (const [profileName, compute] of Object.entries(profiles)) {\n const gpu = compute?.resources?.gpu;\n if (!gpu || gpu.units === 0 || gpu.units === undefined) continue;\n const ic = gpu.attributes?.interconnect;\n if (ic && typeof ic === \"object\" && !Array.isArray(ic) && (ic as { group?: unknown }).group === INTERCONNECT_GROUP_AUTO) {\n this.#errors.push({\n message: `Compute profile \"${profileName}\" uses gpu.attributes.interconnect.group=\"${INTERCONNECT_GROUP_AUTO}\", which is reserved (the parser auto-assigns it to \"interconnect: []\" resources). Pick a different group name.`,\n instancePath: `/profiles/compute/${profileName}/resources/gpu/attributes/interconnect/group`,\n schemaPath: \"#/properties/profiles/properties/compute/additionalProperties/properties/resources/properties/gpu/properties/attributes/properties/interconnect\",\n keyword: \"const\",\n params: { allowedValue: `non-${INTERCONNECT_GROUP_AUTO}` },\n });\n }\n }\n\n // Rules 1 + 3 are per-placement. Walk every (service, placement) and\n // capture which profile each service uses and whether it opted into\n // interconnect (implicit, explicit, or not at all).\n interface profileUsage {\n profileName: string;\n serviceName: string;\n group: string; // \"\" if non-interconnect, INTERCONNECT_GROUP_AUTO for implicit, else explicit name\n }\n const usagesByPlacement = new Map<string, profileUsage[]>();\n\n for (const [serviceName, perPlacement] of Object.entries(this.#sdl.deployment ?? {})) {\n for (const [placementName, svcdepl] of Object.entries(perPlacement ?? {})) {\n const compute = profiles[svcdepl.profile];\n if (!compute) continue;\n const gpu = compute.resources?.gpu;\n const usage: profileUsage = {\n profileName: svcdepl.profile,\n serviceName,\n group: \"\",\n };\n if (gpu && gpu.units !== 0 && gpu.units !== undefined) {\n usage.group = resolveInterconnectGroup(gpu.attributes?.interconnect);\n }\n\n const bucket = usagesByPlacement.get(placementName) ?? [];\n bucket.push(usage);\n usagesByPlacement.set(placementName, bucket);\n\n // Rule 1: any interconnect opt-in must be deployed under a\n // placement whose attributes require capabilities/gpu-interconnect=true.\n if (usage.group !== \"\") {\n const placement = placements?.[placementName];\n const attrs = (placement?.attributes ?? {}) as Record<string, unknown>;\n const capability = attrs[\"capabilities/gpu-interconnect\"];\n const requiresInterconnect = capability === \"true\" || capability === true;\n if (!requiresInterconnect) {\n this.#errors.push({\n message: `Service \"${serviceName}\" uses interconnect profile \"${svcdepl.profile}\" under placement \"${placementName}\" but placement does not require capabilities/gpu-interconnect=true.`,\n instancePath: `/profiles/placement/${placementName}/attributes`,\n schemaPath: \"#/properties/profiles/properties/placement/additionalProperties/properties/attributes\",\n keyword: \"required\",\n params: { missingProperty: \"capabilities/gpu-interconnect\" },\n });\n }\n }\n }\n }\n\n // Rule 3: within one placement, no mixing of implicit (`auto`) and\n // explicit (named) opt-ins. Either form alone is fine; combining\n // them is the failure mode this rule catches.\n for (const [placementName, usages] of usagesByPlacement.entries()) {\n let firstImplicit: string | undefined;\n let firstExplicit: string | undefined;\n for (const u of usages) {\n if (u.group === \"\") continue;\n if (u.group === INTERCONNECT_GROUP_AUTO) {\n firstImplicit ??= u.profileName;\n } else {\n firstExplicit ??= u.profileName;\n }\n }\n if (firstImplicit !== undefined && firstExplicit !== undefined) {\n this.#errors.push({\n message: `Placement \"${placementName}\" mixes implicit \"interconnect: []\" (profile \"${firstImplicit}\") and explicit \"interconnect: { group: ... }\" (profile \"${firstExplicit}\"); use one form across the placement.`,\n instancePath: `/profiles/compute/${firstImplicit}/resources/gpu/attributes/interconnect`,\n schemaPath: \"#/properties/profiles/properties/compute/additionalProperties/properties/resources/properties/gpu/properties/attributes/properties/interconnect\",\n keyword: \"oneOf\",\n params: { passingSchemas: [] },\n });\n }\n }\n }\n\n // Mirrors Go's TEE rules from `buildGroups` (go/sdl/groupBuilder_v2.go:58-83,\n // groupBuilder_v2_1.go:59-84). Two checks, both on `deploymentName` (the\n // placement-group name):\n // 1. `validateTEEWithGPU` \u2014 the `cpu-gpu` type requires GPU resources on the\n // resolved compute profile (`cpu`/absent need none).\n // 2. `errTEETypeMismatch` \u2014 a placementg diff group may carry only one tee type,\n // since `generateManifest` projects it as a single `tee/type` requirement\n // attribute. Detecting the conflict here (the validation layer) means\n // standalone `validateSDL` callers catch it, and `generateManifest` can\n // project unconditionally.\n // Unsupported tee values are rejected structurally by the input schema (`tee`\n // enum in validateSDLInput.ts) before this runs.\n #validateTEE(serviceName: string, deploymentName: string) {\n const tee = this.#sdl.services?.[serviceName]?.params?.tee;\n if (!tee) return;\n\n if (tee === \"cpu-gpu\") {\n const profile = this.#sdl.deployment[serviceName]?.[deploymentName]?.profile;\n const gpu = this.#sdl.profiles?.compute?.[profile]?.resources.gpu;\n const hasGpu = gpu?.units !== undefined && gpu.units !== 0;\n\n if (!hasGpu) {\n this.#errors.push({\n message: `Service \"${serviceName}\" tee type requires gpu resources.`,\n instancePath: `/services/${serviceName}/params/tee`,\n schemaPath: \"#/properties/services/additionalProperties/properties/params/properties/tee\",\n keyword: \"required\",\n params: {\n missingProperty: \"gpu\",\n },\n });\n }\n }\n\n const existing = this.#teeTypeByPlacement.get(deploymentName);\n if (existing === undefined) {\n this.#teeTypeByPlacement.set(deploymentName, tee);\n } else if (existing !== tee) {\n this.#errors.push({\n message: `conflicting tee types in placement group \"${deploymentName}\": \"${existing}\" and \"${tee}\"`,\n instancePath: `/services/${serviceName}/params/tee`,\n schemaPath: \"#/properties/services/additionalProperties/properties/params/properties/tee\",\n keyword: \"tee\",\n params: {},\n });\n }\n }\n\n #validateLeaseIP(serviceName: string) {\n this.#sdl.services?.[serviceName]?.expose?.forEach((expose, exposeIndex) => {\n const proto = expose.proto?.toUpperCase() || \"TCP\";\n\n expose.to?.forEach((to, toIndex) => {\n if (to.ip?.length) {\n const toPath = `/services/${serviceName}/expose/${exposeIndex}/to/${toIndex}`;\n\n if (!to.global) {\n this.#errors.push({\n message: `If an IP is declared, the directive must be declared as global.`,\n instancePath: `${toPath}/global`,\n schemaPath: \"#/definitions/exposeToWithIpEnforcesGlobal/then/properties/global/const\",\n keyword: \"const\",\n params: {\n allowedValue: true,\n },\n });\n }\n if (!this.#sdl.endpoints?.[to.ip]) {\n this.#errors.push({\n message: `Unknown endpoint \"${to.ip}\" for service \"${serviceName}\". Add it to the \"endpoints\" section.`,\n instancePath: `/endpoints/${to.ip}`,\n schemaPath: \"#/properties/endpoints\",\n keyword: \"required\",\n params: {\n missingProperty: to.ip,\n },\n });\n }\n\n this.#endpointsUsed.add(to.ip);\n\n const externalPort = expose.as ?? expose.port;\n const portKey = `${to.ip}-${externalPort}-${proto}`;\n const otherServiceName = this.#portsUsed.get(portKey);\n\n if (this.#portsUsed.has(portKey)) {\n this.#errors.push({\n message: `IP endpoint \"${to.ip}\" port ${externalPort} protocol ${proto} already in use by service \"${otherServiceName}\".`,\n instancePath: `${toPath}/ip`,\n schemaPath: \"#/properties/services/additionalProperties/properties/expose/items/properties/to/items\",\n keyword: \"uniqueItems\",\n params: {\n duplicate: portKey,\n },\n });\n }\n this.#portsUsed.set(portKey, serviceName);\n }\n });\n });\n }\n\n #validateEndpoints() {\n if (!this.#sdl.endpoints) return;\n\n Object.keys(this.#sdl.endpoints).forEach((endpoint) => {\n if (!this.#endpointsUsed.has(endpoint)) {\n this.#errors.push({\n message: `Endpoint \"${endpoint}\" declared but never used.`,\n instancePath: `/endpoints/${endpoint}`,\n schemaPath: \"#/properties/endpoints\",\n keyword: \"additionalProperties\",\n params: {\n additionalProperty: endpoint,\n },\n });\n }\n });\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,qDAAAA;AAAA;AAAA;AACA,kCAA0D;AAC1D,yBAAgE;AAChE,2BAAkE;AAClE,mBAA2C;AAC3C,8BAA2F;AAL3F;AAUA,MAAM,iBAAgC;AAAA,EACpC,mDAAmD,OAAO;AACxD,WAAO,oBAAgB,kDAAiB,qCAAQ,MAAM,YAAY,CAAC,CAAC;AAAA,EACtE;AAAA,EACA,+CAA+C;AAC7C,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAIA,2DAA2D;AACzD,WAAO;AAAA,EACT;AACF;AAEO,SAAS,YAAY,KAA8C;AACxE,8BAAAC,UAAiB,GAAG;AACpB,QAAM,mBAAe,4CAAgB,wBAAAA,SAAwC,QAAQ,wBAAAC,QAAqB,cAAc;AACxH,MAAI,aAAa,OAAQ,QAAO;AAEhC,QAAM,YAAY,IAAI,aAAa,GAAG;AACtC,QAAM,SAAS,UAAU,SAAS;AAElC,QAAM,YAAY,aAAa,OAAO,MAAM;AAC5C,SAAO,UAAU,SA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