@alchemy.run/modal 0.0.0 → 2.0.0-beta.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (499) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +96 -4
  3. package/lib/App.d.ts +143 -0
  4. package/lib/App.d.ts.map +1 -0
  5. package/lib/App.js +198 -0
  6. package/lib/App.js.map +1 -0
  7. package/lib/AuthProvider.d.ts +53 -0
  8. package/lib/AuthProvider.d.ts.map +1 -0
  9. package/lib/AuthProvider.js +209 -0
  10. package/lib/AuthProvider.js.map +1 -0
  11. package/lib/BindingHttp.d.ts +56 -0
  12. package/lib/BindingHttp.d.ts.map +1 -0
  13. package/lib/BindingHttp.js +50 -0
  14. package/lib/BindingHttp.js.map +1 -0
  15. package/lib/Blob.d.ts +34 -0
  16. package/lib/Blob.d.ts.map +1 -0
  17. package/lib/Blob.js +59 -0
  18. package/lib/Blob.js.map +1 -0
  19. package/lib/Bootstrap.d.ts +8 -0
  20. package/lib/Bootstrap.d.ts.map +1 -0
  21. package/lib/Bootstrap.js +26 -0
  22. package/lib/Bootstrap.js.map +1 -0
  23. package/lib/Cbor.d.ts +10 -0
  24. package/lib/Cbor.d.ts.map +1 -0
  25. package/lib/Cbor.js +177 -0
  26. package/lib/Cbor.js.map +1 -0
  27. package/lib/ConnectSandbox.d.ts +64 -0
  28. package/lib/ConnectSandbox.d.ts.map +1 -0
  29. package/lib/ConnectSandbox.js +33 -0
  30. package/lib/ConnectSandbox.js.map +1 -0
  31. package/lib/Container.d.ts +124 -0
  32. package/lib/Container.d.ts.map +1 -0
  33. package/lib/Container.js +1 -0
  34. package/lib/Container.js.map +1 -0
  35. package/lib/Contributions.d.ts +7 -0
  36. package/lib/Contributions.d.ts.map +1 -0
  37. package/lib/Contributions.js +6 -0
  38. package/lib/Contributions.js.map +1 -0
  39. package/lib/CreateDict.d.ts +83 -0
  40. package/lib/CreateDict.d.ts.map +1 -0
  41. package/lib/CreateDict.js +3 -0
  42. package/lib/CreateDict.js.map +1 -0
  43. package/lib/CreateDictHttp.d.ts +33 -0
  44. package/lib/CreateDictHttp.d.ts.map +1 -0
  45. package/lib/CreateDictHttp.js +67 -0
  46. package/lib/CreateDictHttp.js.map +1 -0
  47. package/lib/CreateImage.d.ts +98 -0
  48. package/lib/CreateImage.d.ts.map +1 -0
  49. package/lib/CreateImage.js +3 -0
  50. package/lib/CreateImage.js.map +1 -0
  51. package/lib/CreateImageHttp.d.ts +51 -0
  52. package/lib/CreateImageHttp.d.ts.map +1 -0
  53. package/lib/CreateImageHttp.js +87 -0
  54. package/lib/CreateImageHttp.js.map +1 -0
  55. package/lib/CreateQueue.d.ts +83 -0
  56. package/lib/CreateQueue.d.ts.map +1 -0
  57. package/lib/CreateQueue.js +3 -0
  58. package/lib/CreateQueue.js.map +1 -0
  59. package/lib/CreateQueueHttp.d.ts +31 -0
  60. package/lib/CreateQueueHttp.d.ts.map +1 -0
  61. package/lib/CreateQueueHttp.js +67 -0
  62. package/lib/CreateQueueHttp.js.map +1 -0
  63. package/lib/CreateSandbox.d.ts +186 -0
  64. package/lib/CreateSandbox.d.ts.map +1 -0
  65. package/lib/CreateSandbox.js +3 -0
  66. package/lib/CreateSandbox.js.map +1 -0
  67. package/lib/CreateSandboxHttp.d.ts +17 -0
  68. package/lib/CreateSandboxHttp.d.ts.map +1 -0
  69. package/lib/CreateSandboxHttp.js +117 -0
  70. package/lib/CreateSandboxHttp.js.map +1 -0
  71. package/lib/CreateSecret.d.ts +95 -0
  72. package/lib/CreateSecret.d.ts.map +1 -0
  73. package/lib/CreateSecret.js +3 -0
  74. package/lib/CreateSecret.js.map +1 -0
  75. package/lib/CreateSecretHttp.d.ts +24 -0
  76. package/lib/CreateSecretHttp.d.ts.map +1 -0
  77. package/lib/CreateSecretHttp.js +60 -0
  78. package/lib/CreateSecretHttp.js.map +1 -0
  79. package/lib/CreateVolume.d.ts +84 -0
  80. package/lib/CreateVolume.d.ts.map +1 -0
  81. package/lib/CreateVolume.js +3 -0
  82. package/lib/CreateVolume.js.map +1 -0
  83. package/lib/CreateVolumeHttp.d.ts +32 -0
  84. package/lib/CreateVolumeHttp.d.ts.map +1 -0
  85. package/lib/CreateVolumeHttp.js +69 -0
  86. package/lib/CreateVolumeHttp.js.map +1 -0
  87. package/lib/Credentials.d.ts +32 -0
  88. package/lib/Credentials.d.ts.map +1 -0
  89. package/lib/Credentials.js +44 -0
  90. package/lib/Credentials.js.map +1 -0
  91. package/lib/Dict.d.ts +147 -0
  92. package/lib/Dict.d.ts.map +1 -0
  93. package/lib/Dict.js +175 -0
  94. package/lib/Dict.js.map +1 -0
  95. package/lib/DictClient.d.ts +55 -0
  96. package/lib/DictClient.d.ts.map +1 -0
  97. package/lib/DictClient.js +89 -0
  98. package/lib/DictClient.js.map +1 -0
  99. package/lib/Domain.d.ts +86 -0
  100. package/lib/Domain.d.ts.map +1 -0
  101. package/lib/Domain.js +113 -0
  102. package/lib/Domain.js.map +1 -0
  103. package/lib/Endpoint.d.ts +181 -0
  104. package/lib/Endpoint.d.ts.map +1 -0
  105. package/lib/Endpoint.js +283 -0
  106. package/lib/Endpoint.js.map +1 -0
  107. package/lib/Environment.d.ts +174 -0
  108. package/lib/Environment.d.ts.map +1 -0
  109. package/lib/Environment.js +244 -0
  110. package/lib/Environment.js.map +1 -0
  111. package/lib/FetchServer.d.ts +105 -0
  112. package/lib/FetchServer.d.ts.map +1 -0
  113. package/lib/FetchServer.js +3 -0
  114. package/lib/FetchServer.js.map +1 -0
  115. package/lib/FetchServerHttp.d.ts +21 -0
  116. package/lib/FetchServerHttp.d.ts.map +1 -0
  117. package/lib/FetchServerHttp.js +84 -0
  118. package/lib/FetchServerHttp.js.map +1 -0
  119. package/lib/Function.d.ts +236 -0
  120. package/lib/Function.d.ts.map +1 -0
  121. package/lib/Function.js +273 -0
  122. package/lib/Function.js.map +1 -0
  123. package/lib/FunctionAutoscaler.d.ts +99 -0
  124. package/lib/FunctionAutoscaler.d.ts.map +1 -0
  125. package/lib/FunctionAutoscaler.js +136 -0
  126. package/lib/FunctionAutoscaler.js.map +1 -0
  127. package/lib/FunctionTarget.d.ts +61 -0
  128. package/lib/FunctionTarget.d.ts.map +1 -0
  129. package/lib/FunctionTarget.js +136 -0
  130. package/lib/FunctionTarget.js.map +1 -0
  131. package/lib/Image.d.ts +159 -0
  132. package/lib/Image.d.ts.map +1 -0
  133. package/lib/Image.js +203 -0
  134. package/lib/Image.js.map +1 -0
  135. package/lib/ImageBuild.d.ts +108 -0
  136. package/lib/ImageBuild.d.ts.map +1 -0
  137. package/lib/ImageBuild.js +157 -0
  138. package/lib/ImageBuild.js.map +1 -0
  139. package/lib/ImagePlan.d.ts +31 -0
  140. package/lib/ImagePlan.d.ts.map +1 -0
  141. package/lib/ImagePlan.js +70 -0
  142. package/lib/ImagePlan.js.map +1 -0
  143. package/lib/InferEnv.d.ts +26 -0
  144. package/lib/InferEnv.d.ts.map +1 -0
  145. package/lib/InferEnv.js +1 -0
  146. package/lib/InferEnv.js.map +1 -0
  147. package/lib/InvokeFunction.d.ts +186 -0
  148. package/lib/InvokeFunction.d.ts.map +1 -0
  149. package/lib/InvokeFunction.js +10 -0
  150. package/lib/InvokeFunction.js.map +1 -0
  151. package/lib/InvokeFunctionHttp.d.ts +39 -0
  152. package/lib/InvokeFunctionHttp.d.ts.map +1 -0
  153. package/lib/InvokeFunctionHttp.js +210 -0
  154. package/lib/InvokeFunctionHttp.js.map +1 -0
  155. package/lib/ModalBindings.d.ts +138 -0
  156. package/lib/ModalBindings.d.ts.map +1 -0
  157. package/lib/ModalBindings.js +223 -0
  158. package/lib/ModalBindings.js.map +1 -0
  159. package/lib/MountBucket.d.ts +80 -0
  160. package/lib/MountBucket.d.ts.map +1 -0
  161. package/lib/MountBucket.js +44 -0
  162. package/lib/MountBucket.js.map +1 -0
  163. package/lib/MountVolume.d.ts +77 -0
  164. package/lib/MountVolume.d.ts.map +1 -0
  165. package/lib/MountVolume.js +41 -0
  166. package/lib/MountVolume.js.map +1 -0
  167. package/lib/Mounts.d.ts +134 -0
  168. package/lib/Mounts.d.ts.map +1 -0
  169. package/lib/Mounts.js +87 -0
  170. package/lib/Mounts.js.map +1 -0
  171. package/lib/PersistentSandbox.d.ts +75 -0
  172. package/lib/PersistentSandbox.d.ts.map +1 -0
  173. package/lib/PersistentSandbox.js +93 -0
  174. package/lib/PersistentSandbox.js.map +1 -0
  175. package/lib/Providers.d.ts +23 -0
  176. package/lib/Providers.d.ts.map +1 -0
  177. package/lib/Providers.js +64 -0
  178. package/lib/Providers.js.map +1 -0
  179. package/lib/Proxy.d.ts +94 -0
  180. package/lib/Proxy.d.ts.map +1 -0
  181. package/lib/Proxy.js +132 -0
  182. package/lib/Proxy.js.map +1 -0
  183. package/lib/Queue.d.ts +147 -0
  184. package/lib/Queue.d.ts.map +1 -0
  185. package/lib/Queue.js +177 -0
  186. package/lib/Queue.js.map +1 -0
  187. package/lib/QueueClient.d.ts +64 -0
  188. package/lib/QueueClient.d.ts.map +1 -0
  189. package/lib/QueueClient.js +73 -0
  190. package/lib/QueueClient.js.map +1 -0
  191. package/lib/ReadApp.d.ts +85 -0
  192. package/lib/ReadApp.d.ts.map +1 -0
  193. package/lib/ReadApp.js +3 -0
  194. package/lib/ReadApp.js.map +1 -0
  195. package/lib/ReadAppHttp.d.ts +26 -0
  196. package/lib/ReadAppHttp.d.ts.map +1 -0
  197. package/lib/ReadAppHttp.js +106 -0
  198. package/lib/ReadAppHttp.js.map +1 -0
  199. package/lib/ReadDict.d.ts +39 -0
  200. package/lib/ReadDict.d.ts.map +1 -0
  201. package/lib/ReadDict.js +3 -0
  202. package/lib/ReadDict.js.map +1 -0
  203. package/lib/ReadDictHttp.d.ts +12 -0
  204. package/lib/ReadDictHttp.d.ts.map +1 -0
  205. package/lib/ReadDictHttp.js +23 -0
  206. package/lib/ReadDictHttp.js.map +1 -0
  207. package/lib/ReadFunction.d.ts +73 -0
  208. package/lib/ReadFunction.d.ts.map +1 -0
  209. package/lib/ReadFunction.js +3 -0
  210. package/lib/ReadFunction.js.map +1 -0
  211. package/lib/ReadFunctionHttp.d.ts +25 -0
  212. package/lib/ReadFunctionHttp.d.ts.map +1 -0
  213. package/lib/ReadFunctionHttp.js +63 -0
  214. package/lib/ReadFunctionHttp.js.map +1 -0
  215. package/lib/ReadQueue.d.ts +39 -0
  216. package/lib/ReadQueue.d.ts.map +1 -0
  217. package/lib/ReadQueue.js +3 -0
  218. package/lib/ReadQueue.js.map +1 -0
  219. package/lib/ReadQueueHttp.d.ts +12 -0
  220. package/lib/ReadQueueHttp.d.ts.map +1 -0
  221. package/lib/ReadQueueHttp.js +23 -0
  222. package/lib/ReadQueueHttp.js.map +1 -0
  223. package/lib/ReadServer.d.ts +72 -0
  224. package/lib/ReadServer.d.ts.map +1 -0
  225. package/lib/ReadServer.js +3 -0
  226. package/lib/ReadServer.js.map +1 -0
  227. package/lib/ReadServerHttp.d.ts +25 -0
  228. package/lib/ReadServerHttp.d.ts.map +1 -0
  229. package/lib/ReadServerHttp.js +70 -0
  230. package/lib/ReadServerHttp.js.map +1 -0
  231. package/lib/ReadVolume.d.ts +40 -0
  232. package/lib/ReadVolume.d.ts.map +1 -0
  233. package/lib/ReadVolume.js +3 -0
  234. package/lib/ReadVolume.js.map +1 -0
  235. package/lib/ReadVolumeHttp.d.ts +12 -0
  236. package/lib/ReadVolumeHttp.d.ts.map +1 -0
  237. package/lib/ReadVolumeHttp.js +24 -0
  238. package/lib/ReadVolumeHttp.js.map +1 -0
  239. package/lib/ReadWriteDict.d.ts +39 -0
  240. package/lib/ReadWriteDict.d.ts.map +1 -0
  241. package/lib/ReadWriteDict.js +3 -0
  242. package/lib/ReadWriteDict.js.map +1 -0
  243. package/lib/ReadWriteDictHttp.d.ts +12 -0
  244. package/lib/ReadWriteDictHttp.d.ts.map +1 -0
  245. package/lib/ReadWriteDictHttp.js +23 -0
  246. package/lib/ReadWriteDictHttp.js.map +1 -0
  247. package/lib/ReadWriteQueue.d.ts +40 -0
  248. package/lib/ReadWriteQueue.d.ts.map +1 -0
  249. package/lib/ReadWriteQueue.js +3 -0
  250. package/lib/ReadWriteQueue.js.map +1 -0
  251. package/lib/ReadWriteQueueHttp.d.ts +12 -0
  252. package/lib/ReadWriteQueueHttp.d.ts.map +1 -0
  253. package/lib/ReadWriteQueueHttp.js +23 -0
  254. package/lib/ReadWriteQueueHttp.js.map +1 -0
  255. package/lib/ReadWriteVolume.d.ts +40 -0
  256. package/lib/ReadWriteVolume.d.ts.map +1 -0
  257. package/lib/ReadWriteVolume.js +3 -0
  258. package/lib/ReadWriteVolume.js.map +1 -0
  259. package/lib/ReadWriteVolumeHttp.d.ts +12 -0
  260. package/lib/ReadWriteVolumeHttp.d.ts.map +1 -0
  261. package/lib/ReadWriteVolumeHttp.js +24 -0
  262. package/lib/ReadWriteVolumeHttp.js.map +1 -0
  263. package/lib/RuntimeOwner.d.ts +39 -0
  264. package/lib/RuntimeOwner.d.ts.map +1 -0
  265. package/lib/RuntimeOwner.js +85 -0
  266. package/lib/RuntimeOwner.js.map +1 -0
  267. package/lib/Sandbox.d.ts +215 -0
  268. package/lib/Sandbox.d.ts.map +1 -0
  269. package/lib/Sandbox.js +278 -0
  270. package/lib/Sandbox.js.map +1 -0
  271. package/lib/SandboxClient.d.ts +748 -0
  272. package/lib/SandboxClient.d.ts.map +1 -0
  273. package/lib/SandboxClient.js +710 -0
  274. package/lib/SandboxClient.js.map +1 -0
  275. package/lib/ScaleFunction.d.ts +54 -0
  276. package/lib/ScaleFunction.d.ts.map +1 -0
  277. package/lib/ScaleFunction.js +3 -0
  278. package/lib/ScaleFunction.js.map +1 -0
  279. package/lib/ScaleFunctionHttp.d.ts +21 -0
  280. package/lib/ScaleFunctionHttp.d.ts.map +1 -0
  281. package/lib/ScaleFunctionHttp.js +39 -0
  282. package/lib/ScaleFunctionHttp.js.map +1 -0
  283. package/lib/Secret.d.ts +170 -0
  284. package/lib/Secret.d.ts.map +1 -0
  285. package/lib/Secret.js +196 -0
  286. package/lib/Secret.js.map +1 -0
  287. package/lib/Server.d.ts +155 -0
  288. package/lib/Server.d.ts.map +1 -0
  289. package/lib/Server.js +184 -0
  290. package/lib/Server.js.map +1 -0
  291. package/lib/ServiceUser.d.ts +139 -0
  292. package/lib/ServiceUser.d.ts.map +1 -0
  293. package/lib/ServiceUser.js +210 -0
  294. package/lib/ServiceUser.js.map +1 -0
  295. package/lib/Volume.d.ts +170 -0
  296. package/lib/Volume.d.ts.map +1 -0
  297. package/lib/Volume.js +220 -0
  298. package/lib/Volume.js.map +1 -0
  299. package/lib/VolumeClient.d.ts +53 -0
  300. package/lib/VolumeClient.d.ts.map +1 -0
  301. package/lib/VolumeClient.js +22 -0
  302. package/lib/VolumeClient.js.map +1 -0
  303. package/lib/VolumeFiles.d.ts +94 -0
  304. package/lib/VolumeFiles.d.ts.map +1 -0
  305. package/lib/VolumeFiles.js +139 -0
  306. package/lib/VolumeFiles.js.map +1 -0
  307. package/lib/WebhookToken.d.ts +102 -0
  308. package/lib/WebhookToken.d.ts.map +1 -0
  309. package/lib/WebhookToken.js +176 -0
  310. package/lib/WebhookToken.js.map +1 -0
  311. package/lib/WorkspaceSettings.d.ts +70 -0
  312. package/lib/WorkspaceSettings.d.ts.map +1 -0
  313. package/lib/WorkspaceSettings.js +105 -0
  314. package/lib/WorkspaceSettings.js.map +1 -0
  315. package/lib/WriteApp.d.ts +38 -0
  316. package/lib/WriteApp.d.ts.map +1 -0
  317. package/lib/WriteApp.js +3 -0
  318. package/lib/WriteApp.js.map +1 -0
  319. package/lib/WriteAppHttp.d.ts +23 -0
  320. package/lib/WriteAppHttp.d.ts.map +1 -0
  321. package/lib/WriteAppHttp.js +36 -0
  322. package/lib/WriteAppHttp.js.map +1 -0
  323. package/lib/WriteDict.d.ts +39 -0
  324. package/lib/WriteDict.d.ts.map +1 -0
  325. package/lib/WriteDict.js +3 -0
  326. package/lib/WriteDict.js.map +1 -0
  327. package/lib/WriteDictHttp.d.ts +12 -0
  328. package/lib/WriteDictHttp.d.ts.map +1 -0
  329. package/lib/WriteDictHttp.js +23 -0
  330. package/lib/WriteDictHttp.js.map +1 -0
  331. package/lib/WriteQueue.d.ts +39 -0
  332. package/lib/WriteQueue.d.ts.map +1 -0
  333. package/lib/WriteQueue.js +3 -0
  334. package/lib/WriteQueue.js.map +1 -0
  335. package/lib/WriteQueueHttp.d.ts +12 -0
  336. package/lib/WriteQueueHttp.d.ts.map +1 -0
  337. package/lib/WriteQueueHttp.js +23 -0
  338. package/lib/WriteQueueHttp.js.map +1 -0
  339. package/lib/WriteSecret.d.ts +53 -0
  340. package/lib/WriteSecret.d.ts.map +1 -0
  341. package/lib/WriteSecret.js +3 -0
  342. package/lib/WriteSecret.js.map +1 -0
  343. package/lib/WriteSecretHttp.d.ts +23 -0
  344. package/lib/WriteSecretHttp.d.ts.map +1 -0
  345. package/lib/WriteSecretHttp.js +44 -0
  346. package/lib/WriteSecretHttp.js.map +1 -0
  347. package/lib/WriteVolume.d.ts +39 -0
  348. package/lib/WriteVolume.d.ts.map +1 -0
  349. package/lib/WriteVolume.js +3 -0
  350. package/lib/WriteVolume.js.map +1 -0
  351. package/lib/WriteVolumeHttp.d.ts +12 -0
  352. package/lib/WriteVolumeHttp.d.ts.map +1 -0
  353. package/lib/WriteVolumeHttp.js +24 -0
  354. package/lib/WriteVolumeHttp.js.map +1 -0
  355. package/lib/index.d.ts +80 -0
  356. package/lib/index.d.ts.map +1 -0
  357. package/lib/index.js +78 -0
  358. package/lib/index.js.map +1 -0
  359. package/lib/internal/Declared.d.ts +29 -0
  360. package/lib/internal/Declared.d.ts.map +1 -0
  361. package/lib/internal/Declared.js +31 -0
  362. package/lib/internal/Declared.js.map +1 -0
  363. package/lib/internal/Deploy.d.ts +110 -0
  364. package/lib/internal/Deploy.d.ts.map +1 -0
  365. package/lib/internal/Deploy.js +230 -0
  366. package/lib/internal/Deploy.js.map +1 -0
  367. package/lib/internal/Entrypoint.d.ts +52 -0
  368. package/lib/internal/Entrypoint.d.ts.map +1 -0
  369. package/lib/internal/Entrypoint.js +193 -0
  370. package/lib/internal/Entrypoint.js.map +1 -0
  371. package/lib/internal/Rpc.d.ts +17 -0
  372. package/lib/internal/Rpc.d.ts.map +1 -0
  373. package/lib/internal/Rpc.js +49 -0
  374. package/lib/internal/Rpc.js.map +1 -0
  375. package/lib/internal/RpcAuth.d.ts +41 -0
  376. package/lib/internal/RpcAuth.d.ts.map +1 -0
  377. package/lib/internal/RpcAuth.js +100 -0
  378. package/lib/internal/RpcAuth.js.map +1 -0
  379. package/lib/internal/Runtime.d.ts +127 -0
  380. package/lib/internal/Runtime.d.ts.map +1 -0
  381. package/lib/internal/Runtime.js +246 -0
  382. package/lib/internal/Runtime.js.map +1 -0
  383. package/lib/internal/Tags.d.ts +19 -0
  384. package/lib/internal/Tags.d.ts.map +1 -0
  385. package/lib/internal/Tags.js +33 -0
  386. package/lib/internal/Tags.js.map +1 -0
  387. package/lib/internal/TcpConnect.d.ts +12 -0
  388. package/lib/internal/TcpConnect.d.ts.map +1 -0
  389. package/lib/internal/TcpConnect.js +46 -0
  390. package/lib/internal/TcpConnect.js.map +1 -0
  391. package/lib/internal/Transport.d.ts +13 -0
  392. package/lib/internal/Transport.d.ts.map +1 -0
  393. package/lib/internal/Transport.js +16 -0
  394. package/lib/internal/Transport.js.map +1 -0
  395. package/lib/internal.d.ts +71 -0
  396. package/lib/internal.d.ts.map +1 -0
  397. package/lib/internal.js +102 -0
  398. package/lib/internal.js.map +1 -0
  399. package/package.json +59 -3
  400. package/src/App.ts +262 -0
  401. package/src/AuthProvider.ts +295 -0
  402. package/src/BindingHttp.ts +112 -0
  403. package/src/Blob.ts +71 -0
  404. package/src/Bootstrap.ts +52 -0
  405. package/src/Cbor.ts +158 -0
  406. package/src/ConnectSandbox.ts +99 -0
  407. package/src/Container.ts +121 -0
  408. package/src/Contributions.ts +9 -0
  409. package/src/CreateDict.ts +95 -0
  410. package/src/CreateDictHttp.ts +91 -0
  411. package/src/CreateImage.ts +105 -0
  412. package/src/CreateImageHttp.ts +117 -0
  413. package/src/CreateQueue.ts +95 -0
  414. package/src/CreateQueueHttp.ts +91 -0
  415. package/src/CreateSandbox.ts +228 -0
  416. package/src/CreateSandboxHttp.ts +160 -0
  417. package/src/CreateSecret.ts +109 -0
  418. package/src/CreateSecretHttp.ts +83 -0
  419. package/src/CreateVolume.ts +96 -0
  420. package/src/CreateVolumeHttp.ts +93 -0
  421. package/src/Credentials.ts +74 -0
  422. package/src/Dict.ts +245 -0
  423. package/src/DictClient.ts +166 -0
  424. package/src/Domain.ts +147 -0
  425. package/src/Endpoint.ts +406 -0
  426. package/src/Environment.ts +373 -0
  427. package/src/FetchServer.ts +126 -0
  428. package/src/FetchServerHttp.ts +110 -0
  429. package/src/Function.ts +397 -0
  430. package/src/FunctionAutoscaler.ts +210 -0
  431. package/src/FunctionTarget.ts +181 -0
  432. package/src/Image.ts +281 -0
  433. package/src/ImageBuild.ts +228 -0
  434. package/src/ImagePlan.ts +78 -0
  435. package/src/InferEnv.ts +27 -0
  436. package/src/InvokeFunction.ts +211 -0
  437. package/src/InvokeFunctionHttp.ts +316 -0
  438. package/src/ModalBindings.ts +310 -0
  439. package/src/MountBucket.ts +137 -0
  440. package/src/MountVolume.ts +113 -0
  441. package/src/Mounts.ts +230 -0
  442. package/src/PersistentSandbox.ts +142 -0
  443. package/src/Providers.ts +100 -0
  444. package/src/Proxy.ts +191 -0
  445. package/src/Queue.ts +258 -0
  446. package/src/QueueClient.ts +149 -0
  447. package/src/ReadApp.ts +101 -0
  448. package/src/ReadAppHttp.ts +142 -0
  449. package/src/ReadDict.ts +44 -0
  450. package/src/ReadDictHttp.ts +27 -0
  451. package/src/ReadFunction.ts +107 -0
  452. package/src/ReadFunctionHttp.ts +91 -0
  453. package/src/ReadQueue.ts +44 -0
  454. package/src/ReadQueueHttp.ts +27 -0
  455. package/src/ReadServer.ts +98 -0
  456. package/src/ReadServerHttp.ts +101 -0
  457. package/src/ReadVolume.ts +45 -0
  458. package/src/ReadVolumeHttp.ts +28 -0
  459. package/src/ReadWriteDict.ts +44 -0
  460. package/src/ReadWriteDictHttp.ts +27 -0
  461. package/src/ReadWriteQueue.ts +45 -0
  462. package/src/ReadWriteQueueHttp.ts +27 -0
  463. package/src/ReadWriteVolume.ts +45 -0
  464. package/src/ReadWriteVolumeHttp.ts +28 -0
  465. package/src/RuntimeOwner.ts +111 -0
  466. package/src/Sandbox.ts +402 -0
  467. package/src/SandboxClient.ts +1404 -0
  468. package/src/ScaleFunction.ts +70 -0
  469. package/src/ScaleFunctionHttp.ts +54 -0
  470. package/src/Secret.ts +296 -0
  471. package/src/Server.ts +285 -0
  472. package/src/ServiceUser.ts +295 -0
  473. package/src/Volume.ts +320 -0
  474. package/src/VolumeClient.ts +108 -0
  475. package/src/VolumeFiles.ts +194 -0
  476. package/src/WebhookToken.ts +230 -0
  477. package/src/WorkspaceSettings.ts +160 -0
  478. package/src/WriteApp.ts +43 -0
  479. package/src/WriteAppHttp.ts +51 -0
  480. package/src/WriteDict.ts +44 -0
  481. package/src/WriteDictHttp.ts +27 -0
  482. package/src/WriteQueue.ts +44 -0
  483. package/src/WriteQueueHttp.ts +27 -0
  484. package/src/WriteSecret.ts +60 -0
  485. package/src/WriteSecretHttp.ts +56 -0
  486. package/src/WriteVolume.ts +44 -0
  487. package/src/WriteVolumeHttp.ts +28 -0
  488. package/src/globals.d.ts +2 -0
  489. package/src/index.ts +85 -0
  490. package/src/internal/Declared.ts +80 -0
  491. package/src/internal/Deploy.ts +309 -0
  492. package/src/internal/Entrypoint.ts +198 -0
  493. package/src/internal/Rpc.ts +59 -0
  494. package/src/internal/RpcAuth.ts +132 -0
  495. package/src/internal/Runtime.ts +386 -0
  496. package/src/internal/Tags.ts +44 -0
  497. package/src/internal/TcpConnect.ts +78 -0
  498. package/src/internal/Transport.ts +25 -0
  499. package/src/internal.ts +147 -0
@@ -0,0 +1,186 @@
1
+ import * as Binding from "alchemy/Binding";
2
+ import type { Input } from "alchemy/Input";
3
+ import type { Rpc } from "alchemy/Rpc";
4
+ import type { RuntimeContext } from "alchemy/RuntimeContext";
5
+ import type * as Effect from "effect/Effect";
6
+ import type { downloadBlob, uploadBlob } from "./Blob.ts";
7
+ import type { Function } from "./Function.ts";
8
+ import type { FunctionLookupError } from "./FunctionTarget.ts";
9
+ import type { ErrorOf, OpError } from "./internal.ts";
10
+ import type { InvokeOps } from "./InvokeFunctionHttp.ts";
11
+ /** A function deployed outside the Stack (`modal deploy`), by name. */
12
+ export interface FunctionRef {
13
+ /** Name of the deployed App (`modal deploy` / `modal.App("…")`). */
14
+ readonly app: string;
15
+ /** Function name in the App (`"embed"`), or `"Class.method"` for a class method. */
16
+ readonly function: string;
17
+ /** Environment the App is deployed in. @default the workspace default */
18
+ readonly environment?: string;
19
+ /**
20
+ * Parameters of a parameterized class (`modal.parameter()` fields), for a
21
+ * `"Class.method"` target. Modal runs one set of containers per value set.
22
+ */
23
+ readonly parameters?: Record<string, string | number | boolean | Uint8Array>;
24
+ }
25
+ /** What a function binding targets: a `Modal.Function` of the Stack, or a deployed function by name. */
26
+ export type FunctionTarget = Function | FunctionRef;
27
+ declare const FunctionCallFailed_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
28
+ readonly _tag: "Modal.FunctionCallFailed";
29
+ } & Readonly<A>;
30
+ /** The function raised, or Modal failed the call. */
31
+ export declare class FunctionCallFailed extends FunctionCallFailed_base<{
32
+ readonly status: string;
33
+ readonly message: string;
34
+ readonly traceback?: string;
35
+ }> {
36
+ }
37
+ /** Calling a function: looking it up, sending inputs, reading outputs, and the call's own failure. */
38
+ export type InvokeError = FunctionLookupError | OpError<InvokeOps, "map" | "putInputs" | "getOutputs"> | ErrorOf<typeof uploadBlob | typeof downloadBlob> | FunctionCallFailed | FunctionCallTimeout;
39
+ declare const FunctionCallTimeout_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
40
+ readonly _tag: "Modal.FunctionCallTimeout";
41
+ } & Readonly<A>;
42
+ /** The call didn't finish within its timeout. */
43
+ export declare class FunctionCallTimeout extends FunctionCallTimeout_base<{
44
+ readonly functionCallId: string;
45
+ readonly message: string;
46
+ }> {
47
+ }
48
+ /** Options for one call. */
49
+ export interface CallOptions {
50
+ /** How long to wait for the result (seconds, or `"10 minutes"`). @default 300 seconds */
51
+ readonly timeout?: number | string;
52
+ }
53
+ /** Call one function. Arguments and results travel as CBOR. */
54
+ export interface FunctionClient {
55
+ /** Call the function and wait for its result. */
56
+ call<A = unknown>(args?: ReadonlyArray<unknown>, kwargs?: Record<string, unknown>, options?: CallOptions): Effect.Effect<A, InvokeError, RuntimeContext>;
57
+ /**
58
+ * Call the function once per input, in parallel across containers, and
59
+ * return the results in input order. Each input is a list of positional
60
+ * arguments. Fails with the first failed input.
61
+ */
62
+ map<A = unknown>(inputs: ReadonlyArray<ReadonlyArray<unknown>>, options?: CallOptions): Effect.Effect<A[], InvokeError, RuntimeContext>;
63
+ /** Start a call without waiting; read it later with {@link result}. */
64
+ spawn(args?: ReadonlyArray<unknown>, kwargs?: Record<string, unknown>): Effect.Effect<{
65
+ readonly functionCallId: string;
66
+ }, InvokeError, RuntimeContext>;
67
+ /** The result of a spawned call, waiting up to `timeout`. */
68
+ result<A = unknown>(call: {
69
+ readonly functionCallId: string;
70
+ }, options?: CallOptions): Effect.Effect<A, InvokeError, RuntimeContext>;
71
+ /** Cancel a spawned call. */
72
+ cancel(call: {
73
+ readonly functionCallId: string;
74
+ }): Effect.Effect<void, FunctionLookupError | OpError<InvokeOps, "cancel">, RuntimeContext>;
75
+ }
76
+ /**
77
+ * The RPC methods of a `Modal.Function` program: every function it returns
78
+ * besides `fetch` and `run`, called through Modal with the same arguments
79
+ * and results.
80
+ */
81
+ export type FunctionStub<Shape> = Omit<Shape, "fetch" | "run">;
82
+ /**
83
+ * Call a Modal Function from any runtime: a Worker, a Lambda, a Durable
84
+ * Object, another Modal Function. Bind a `Modal.Function` of the Stack, or
85
+ * a function deployed with `modal deploy` by name.
86
+ *
87
+ * A `Modal.Function` program's RPC methods come back as a typed client:
88
+ * each call goes through Modal (queued, retried and autoscaled like any
89
+ * Modal call) to the method of that name. Arguments and results are JSON
90
+ * values, and a typed failure reaches the caller by its `_tag`. A method
91
+ * that returns a `Stream` arrives whole, once the call finishes. The
92
+ * binding gives the host its own key for the function, which every call
93
+ * carries: the program answers only callers bound to it.
94
+ *
95
+ * A Python function, or an async program, gets a {@link FunctionClient}
96
+ * instead: `call`, `map` and `spawn` with CBOR arguments (Modal's
97
+ * cross-language format). Payloads over 2 MiB go through Modal's blob store.
98
+ *
99
+ * ### Call a function
100
+ * **Example:** RPC methods of a `Modal.Function`
101
+ * ```typescript
102
+ * // src/Embed.ts
103
+ * import * as Modal from "@alchemy.run/modal";
104
+ * import * as Effect from "effect/Effect";
105
+ * import { Inference } from "./Inference.ts";
106
+ *
107
+ * export default class Embed extends Modal.Function<Embed>()(
108
+ * "Embed",
109
+ * { main: import.meta.url, app: Inference },
110
+ * Effect.gen(function* () {
111
+ * return {
112
+ * embed: Effect.fn(function* (text: string) {
113
+ * return { tokens: text.split(/\s+/).length };
114
+ * }),
115
+ * };
116
+ * }),
117
+ * ) {}
118
+ * ```
119
+ *
120
+ * **Example:** Call it from a Cloudflare Worker
121
+ * ```typescript
122
+ * import * as Cloudflare from "@alchemy.run/cloudflare";
123
+ * import * as Modal from "@alchemy.run/modal";
124
+ * import * as Effect from "effect/Effect";
125
+ * import * as HttpServerResponse from "effect/http/HttpServerResponse";
126
+ * import Embed from "./Embed.ts";
127
+ *
128
+ * export default class Api extends Cloudflare.Worker<Api>()(
129
+ * "Api",
130
+ * { main: import.meta.url, compatibility: { flags: ["nodejs_compat"] } },
131
+ * Effect.gen(function* () {
132
+ * const embed = yield* Modal.InvokeFunction(Embed);
133
+ * return {
134
+ * fetch: Effect.gen(function* () {
135
+ * const { tokens } = yield* embed.embed("hello world");
136
+ * return yield* HttpServerResponse.json({ tokens });
137
+ * }).pipe(Effect.orDie),
138
+ * };
139
+ * }).pipe(Effect.provide(Modal.InvokeFunctionHttp)),
140
+ * ) {}
141
+ * ```
142
+ *
143
+ * **Example:** A Python function deployed with `modal deploy`
144
+ * ```typescript
145
+ * const embed = yield* Modal.InvokeFunction({ app: "inference", function: "embed" });
146
+ * const vector = yield* embed.call<number[]>(["hello world"]);
147
+ * ```
148
+ *
149
+ * **Example:** A method of a parameterized Python class
150
+ * ```typescript
151
+ * const model = yield* Modal.InvokeFunction({
152
+ * app: "inference",
153
+ * function: "Model.generate",
154
+ * parameters: { size: "7b" },
155
+ * });
156
+ * const text = yield* model.call<string>(["hello"]);
157
+ * ```
158
+ *
159
+ * ### Fan out
160
+ * **Example:** One call per input, in parallel
161
+ * ```typescript
162
+ * const results = yield* embed.map<{ tokens: number }>([["a"], ["b"], ["c"]]);
163
+ * ```
164
+ *
165
+ * ### Fire and forget
166
+ * **Example:** Spawn, then read the result later
167
+ * ```typescript
168
+ * const job = yield* train.spawn([], { epochs: 3 });
169
+ * const metrics = yield* train.result(job, { timeout: "30 minutes" });
170
+ * ```
171
+ *
172
+ * @binding
173
+ * @product Function
174
+ */
175
+ export interface InvokeFunction extends Binding.Service<InvokeFunction, "Modal.InvokeFunction", (target: FunctionTarget) => Effect.Effect<FunctionClient>> {
176
+ }
177
+ /** InvokeFunction's call signatures, typed from the target's program. */
178
+ export interface InvokeFunctionCall {
179
+ /** A `Modal.Function` of the Stack whose program has RPC methods: its typed client. */
180
+ <Shape, Req = never>(target: (Function & Rpc<Shape>) | Effect.Effect<Function & Rpc<Shape>, never, Req>): Effect.Effect<FunctionStub<Shape>, never, InvokeFunction | Req>;
181
+ /** A deployed function by name, or an async program: `call`, `map` and `spawn`. */
182
+ <Req = never>(target: Input<FunctionTarget> | Effect.Effect<FunctionTarget, never, Req>): Effect.Effect<FunctionClient, never, InvokeFunction | Req>;
183
+ }
184
+ export declare const InvokeFunction: InvokeFunctionCall & InvokeFunction;
185
+ export {};
186
+ //# sourceMappingURL=InvokeFunction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvokeFunction.d.ts","sources":["../src/InvokeFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC1B,oEAAoE;IACpE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;CAC9E;AAED,wGAAwG;AACxG,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,WAAW,CAAC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AAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,GACjF,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,cAAc,GAAG,GAAG,CAAC,CAAC;IACnE,mFAAmF;IACnF,CAAC,GAAG,GAAG,KAAK,EACV,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,KAAK,EAAE,GAAG,CAAC,GACxE,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,KAAK,EAAE,cAAc,GAAG,GAAG,CAAC,CAAC;CAC/D;AAED,eAAO,MAAM,cAAc,EAEX,kBAAkB,GAAG,cAAc,CAAC"}
@@ -0,0 +1,10 @@
1
+ import * as Binding from "alchemy/Binding";
2
+ import * as Data from "effect/Data";
3
+ /** The function raised, or Modal failed the call. */
4
+ export class FunctionCallFailed extends Data.TaggedError("Modal.FunctionCallFailed") {
5
+ }
6
+ /** The call didn't finish within its timeout. */
7
+ export class FunctionCallTimeout extends Data.TaggedError("Modal.FunctionCallTimeout") {
8
+ }
9
+ export const InvokeFunction = Binding.Service("Modal.InvokeFunction");
10
+ //# sourceMappingURL=InvokeFunction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvokeFunction.js","sources":["../src/InvokeFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAI3C,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AA0BpC,qDAAqD;AACrD,MAAM,OAAO,kBAAmB,SAAQ,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAIjF;CAAG;AAUL,iDAAiD;AACjD,MAAM,OAAO,mBAAoB,SAAQ,IAAI,CAAC,WAAW,CAAC,2BAA2B,CAGnF;CAAG;AA+JL,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CAC3C,sBAAsB,CAC2B,CAAC"}
@@ -0,0 +1,39 @@
1
+ import * as functions from "@distilled.cloud/modal/functions";
2
+ import * as Effect from "effect/Effect";
3
+ import * as Layer from "effect/Layer";
4
+ import { type ResolvedFunction } from "./FunctionTarget.ts";
5
+ import { InvokeFunction, type FunctionClient } from "./InvokeFunction.ts";
6
+ /** The operations the client calls, resolved by `ModalBindings.withCredentials`. */
7
+ declare const InvokeOps: Effect.Effect<{
8
+ readonly map: (input: functions.FunctionMapRequest) => Effect.Effect<functions.FunctionMapResponse, functions.FunctionMapError, never>;
9
+ readonly putInputs: (input: functions.FunctionPutInputsRequest) => Effect.Effect<functions.FunctionPutInputsResponse, functions.ModalOpError, never>;
10
+ readonly getOutputs: (input: functions.GetFunctionOutputsRequest) => Effect.Effect<functions.GetFunctionOutputsResponse, functions.GetFunctionOutputsError, never>;
11
+ readonly cancel: (input: functions.CancelFunctionCallRequest) => Effect.Effect<functions.CancelFunctionCallResponse, functions.CancelFunctionCallError, never>;
12
+ readonly blobs: {
13
+ readonly create: (input: import("@distilled.cloud/modal/blob").CreateBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").CreateBlobResponse, functions.ModalOpError, never>;
14
+ readonly get: (input: import("@distilled.cloud/modal/blob").GetBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").GetBlobResponse, functions.ModalOpError, never>;
15
+ readonly http: import("effect/http/HttpClient").HttpClient;
16
+ };
17
+ }, never, import("./internal.ts").OperationServices>;
18
+ export type InvokeOps = Effect.Success<typeof InvokeOps>;
19
+ /** A client for a resolved function. */
20
+ export declare const makeFunctionClient: (resolved: ResolvedFunction, ops: InvokeOps) => FunctionClient;
21
+ /**
22
+ * The typed client of a `Modal.Function` program's RPC methods. Each method
23
+ * is a call to the function's method of that name; its result is the
24
+ * program's JSON answer, a failure envelope the call fails with, or a
25
+ * stream's values. A Function without methods (an async program) keeps
26
+ * the {@link FunctionClient} operations.
27
+ */
28
+ export declare const makeRpcClient: (resolved: ResolvedFunction, ops: InvokeOps, methods: Effect.Effect<ReadonlyArray<string> | undefined>, key: Effect.Effect<string | undefined>) => Record<string, unknown>;
29
+ /**
30
+ * {@link InvokeFunction} over Modal's API. Grants the host's identity (a scoped
31
+ * `Modal.ServiceUser`) the `contributor` role on the function's environment.
32
+ *
33
+ * @layer
34
+ * @product Function
35
+ * @provides Modal.InvokeFunction
36
+ */
37
+ export declare const InvokeFunctionHttp: Layer.Layer<InvokeFunction, never, never>;
38
+ export {};
39
+ //# sourceMappingURL=InvokeFunctionHttp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvokeFunctionHttp.d.ts","sources":["../src/InvokeFunctionHttp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,kCAAkC,CAAC;AAO9D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,EAAsC,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIhG,OAAO,EAGL,cAAc,EAEd,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAE7B,oFAAoF;AACpF,QAAA,MAAM,SAAS;;;;;;;;;;oDAMb,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,SAAS,CAAC,CAAC;AA6DzD,wCAAwC;AACxC,eAAO,MAAM,kBAAkB,aAAc,gBAAgB,OAAO,SAAS,KAAG,cAgH/E,CAAC;AAQF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,aACd,gBAAgB,OACrB,SAAS,WACL,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,OACpD,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,KACrC,MAAM,CAAC,MAAM,EAAE,OAAO,CAsDxB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,2CAuB9B,CAAC"}
@@ -0,0 +1,210 @@
1
+ import * as functions from "@distilled.cloud/modal/functions";
2
+ import { asEffectOrStream, decodeRpcResponseStream, decodeRpcResult, RpcCallError, } from "alchemy/Rpc";
3
+ import * as Effect from "effect/Effect";
4
+ import * as Layer from "effect/Layer";
5
+ import * as Stream from "effect/Stream";
6
+ import { BlobOps, downloadBlob, MAX_INLINE_BYTES, uploadBlob } from "./Blob.js";
7
+ import { decodeCbor, encodeCbor } from "./Cbor.js";
8
+ import { isFunctionRef, makeFunctionBinding } from "./FunctionTarget.js";
9
+ import { operations, seconds } from "./internal.js";
10
+ import { RPC_STREAM_KEY } from "./internal/Entrypoint.js";
11
+ import { RPC_KEY_KWARG, RpcCaller } from "./internal/RpcAuth.js";
12
+ import { FunctionCallFailed, FunctionCallTimeout, InvokeFunction, } from "./InvokeFunction.js";
13
+ /** The operations the client calls, resolved by `ModalBindings.withCredentials`. */
14
+ const InvokeOps = operations({
15
+ map: functions.functionMap,
16
+ putInputs: functions.functionPutInputs,
17
+ getOutputs: functions.getFunctionOutputs,
18
+ cancel: functions.cancelFunctionCall,
19
+ blobs: BlobOps,
20
+ });
21
+ /** One input: CBOR `[args, kwargs]`, inline or (over 2 MiB) as a blob. */
22
+ const encodeInput = Effect.fn(function* (blobs, args, kwargs, method) {
23
+ const bytes = yield* Effect.try({
24
+ try: () => encodeCbor([args, kwargs]),
25
+ catch: (cause) => new FunctionCallFailed({
26
+ status: "INVALID_ARGUMENTS",
27
+ message: `Arguments aren't CBOR-encodable: ${String(cause)}`,
28
+ }),
29
+ });
30
+ const payload = bytes.length > MAX_INLINE_BYTES
31
+ ? { argsBlobId: yield* uploadBlob(blobs, bytes) }
32
+ : { args: yield* Effect.sync(() => Buffer.from(bytes).toString("base64")) };
33
+ return {
34
+ ...payload,
35
+ dataFormat: "DATA_FORMAT_CBOR",
36
+ methodName: method,
37
+ };
38
+ });
39
+ /** The value of a finished output, or its failure. */
40
+ const decodeOutput = Effect.fn(function* (blobs, functionCallId, output) {
41
+ const result = output.result;
42
+ if (result?.status !== "GENERIC_STATUS_SUCCESS") {
43
+ return yield* new FunctionCallFailed({
44
+ status: result?.status ?? "GENERIC_STATUS_UNSPECIFIED",
45
+ message: result?.exception || `Function call ${functionCallId} failed`,
46
+ traceback: result?.traceback,
47
+ });
48
+ }
49
+ const bytes = result.dataBlobId
50
+ ? yield* downloadBlob(blobs, result.dataBlobId)
51
+ : result.data
52
+ ? yield* Effect.sync(() => new Uint8Array(Buffer.from(result.data, "base64")))
53
+ : undefined;
54
+ if (bytes === undefined)
55
+ return null;
56
+ return yield* Effect.try({
57
+ try: () => decodeCbor(bytes),
58
+ catch: (cause) => new FunctionCallFailed({
59
+ status: "INVALID_RESULT",
60
+ message: `The result isn't CBOR (return plain values, or set the function's serialization): ${String(cause)}`,
61
+ }),
62
+ });
63
+ });
64
+ /** Inputs per `FunctionPutInputs` request. */
65
+ const BATCH = 49;
66
+ /** A client for a resolved function. */
67
+ export const makeFunctionClient = (resolved, ops) => {
68
+ const { functionId, method } = resolved;
69
+ /** Collect `count` outputs of a call, by input index. */
70
+ const collect = Effect.fn(function* (functionCallId, count, timeout) {
71
+ const budget = seconds(timeout) ?? 300;
72
+ const rounds = Math.max(1, Math.ceil(budget / 55));
73
+ const values = new Map();
74
+ let lastEntryId = "0-0";
75
+ for (let round = 0; round < rounds && values.size < count; round++) {
76
+ const response = yield* ops.getOutputs({
77
+ functionCallId,
78
+ maxValues: Math.min(1000, count - values.size),
79
+ timeout: Math.min(55, budget),
80
+ lastEntryId,
81
+ // A map's outputs stay until all are read; a single output is popped.
82
+ clearOnSuccess: count === 1,
83
+ });
84
+ if (response.lastEntryId)
85
+ lastEntryId = response.lastEntryId;
86
+ for (const output of response.outputs ?? []) {
87
+ if (!output.result)
88
+ continue;
89
+ values.set(output.idx ?? 0, yield* decodeOutput(ops.blobs, functionCallId, output));
90
+ }
91
+ }
92
+ if (values.size < count) {
93
+ return yield* new FunctionCallTimeout({
94
+ functionCallId,
95
+ message: `Function call ${functionCallId} didn't finish within ${budget} seconds`,
96
+ });
97
+ }
98
+ return Array.from({ length: count }, (_, idx) => values.get(idx));
99
+ });
100
+ /**
101
+ * Start a function call the way Modal's clients do: a unary call sends its
102
+ * input with `FunctionMap` (or with `FunctionPutInputs` when Modal doesn't
103
+ * take it there); a map creates the call, then sends every input with
104
+ * `FunctionPutInputs`.
105
+ */
106
+ const start = Effect.fn(function* (inputs, type, invocation) {
107
+ const id = yield* functionId;
108
+ const items = yield* Effect.forEach(inputs, ([args, kwargs], idx) => Effect.map(encodeInput(ops.blobs, args, kwargs, method), (input) => ({ idx, input })));
109
+ const unary = type === "FUNCTION_CALL_TYPE_UNARY";
110
+ const response = yield* ops.map({
111
+ functionId: id,
112
+ functionCallType: type,
113
+ functionCallInvocationType: invocation,
114
+ returnExceptions: false,
115
+ pipelinedInputs: unary ? items : undefined,
116
+ });
117
+ const functionCallId = response.functionCallId ?? "";
118
+ const sent = unary && (response.pipelinedInputs ?? []).length > 0 ? items.length : 0;
119
+ for (let offset = sent; offset < items.length; offset += BATCH) {
120
+ yield* ops.putInputs({
121
+ functionId: id,
122
+ functionCallId,
123
+ inputs: items.slice(offset, offset + BATCH),
124
+ });
125
+ }
126
+ return functionCallId;
127
+ });
128
+ return {
129
+ call: (args = [], kwargs = {}, options = {}) => start([[args, kwargs]], "FUNCTION_CALL_TYPE_UNARY", "FUNCTION_CALL_INVOCATION_TYPE_SYNC").pipe(Effect.flatMap((id) => collect(id, 1, options.timeout)),
130
+ // CBOR results are untyped; the caller names the shape it expects.
131
+ Effect.map(([value]) => value)),
132
+ map: (inputs, options = {}) => inputs.length === 0
133
+ ? Effect.succeed([])
134
+ : start(inputs.map((args) => [args, {}]), "FUNCTION_CALL_TYPE_MAP", "FUNCTION_CALL_INVOCATION_TYPE_SYNC").pipe(Effect.flatMap((id) => collect(id, inputs.length, options.timeout)), Effect.map((values) => values)),
135
+ spawn: (args = [], kwargs = {}) => start([[args, kwargs]], "FUNCTION_CALL_TYPE_UNARY", "FUNCTION_CALL_INVOCATION_TYPE_ASYNC").pipe(Effect.map((functionCallId) => ({ functionCallId }))),
136
+ result: (call, options = {}) => collect(call.functionCallId, 1, options.timeout).pipe(Effect.map(([value]) => value)),
137
+ cancel: (call) => ops.cancel({ functionCallId: call.functionCallId }).pipe(Effect.catchTag("FunctionCallNotFound", () => Effect.void), Effect.asVoid),
138
+ };
139
+ };
140
+ /** Whether a call's result is a streamed RPC result (see `RPC_STREAM_KEY`). */
141
+ const isStreamResult = (value) => typeof value === "object" &&
142
+ value !== null &&
143
+ Array.isArray(value[RPC_STREAM_KEY]);
144
+ /**
145
+ * The typed client of a `Modal.Function` program's RPC methods. Each method
146
+ * is a call to the function's method of that name; its result is the
147
+ * program's JSON answer, a failure envelope the call fails with, or a
148
+ * stream's values. A Function without methods (an async program) keeps
149
+ * the {@link FunctionClient} operations.
150
+ */
151
+ export const makeRpcClient = (resolved, ops, methods, key) => {
152
+ const client = makeFunctionClient(resolved, ops);
153
+ const callMethod = (name, args) => key.pipe(Effect.flatMap((value) => makeFunctionClient({ ...resolved, method: name }, ops).call(args,
154
+ // The binding's key: the program serves only callers it issued keys to.
155
+ value === undefined ? {} : { [RPC_KEY_KWARG]: value })), Effect.flatMap((value) => isStreamResult(value)
156
+ ? // The stream's values, re-encoded as the NDJSON the RPC codec
157
+ // decodes (byte chunks and a trailing failure marker included).
158
+ Effect.succeed(Stream.fromIterable(value[RPC_STREAM_KEY]).pipe(Stream.map((item) => `${JSON.stringify(item)}\n`), Stream.encodeText, decodeRpcResponseStream))
159
+ : decodeRpcResult(value)));
160
+ return new Proxy({}, {
161
+ get: (_, prop) => {
162
+ // Never thenable, and no symbol members.
163
+ if (typeof prop !== "string" || prop === "then")
164
+ return undefined;
165
+ const call = (args) => Effect.gen(function* () {
166
+ const names = (yield* methods) ?? [];
167
+ if (names.includes(prop))
168
+ return yield* callMethod(prop, args);
169
+ const operation = client[prop];
170
+ if (typeof operation === "function") {
171
+ return yield* operation(...args);
172
+ }
173
+ return yield* new RpcCallError({
174
+ method: prop,
175
+ cause: `The function has no RPC method ${prop}`,
176
+ });
177
+ });
178
+ return (...args) => asEffectOrStream(
179
+ // oxlint-disable-next-line effecttsgo/unsafe-effect-type-assertion -- the stub's declared method types carry `RuntimeContext`, which the caller's runtime provides
180
+ call(args));
181
+ },
182
+ });
183
+ };
184
+ /**
185
+ * {@link InvokeFunction} over Modal's API. Grants the host's identity (a scoped
186
+ * `Modal.ServiceUser`) the `contributor` role on the function's environment.
187
+ *
188
+ * @layer
189
+ * @product Function
190
+ * @provides Modal.InvokeFunction
191
+ */
192
+ export const InvokeFunctionHttp = Layer.effect(InvokeFunction, Effect.gen(function* () {
193
+ const caller = yield* RpcCaller;
194
+ return yield* makeFunctionBinding({
195
+ tag: "Modal.InvokeFunction",
196
+ operations: InvokeOps,
197
+ role: "contributor",
198
+ make: Effect.fn(function* (resolved, ops, target) {
199
+ if (isFunctionRef(target))
200
+ return makeFunctionClient(resolved, ops);
201
+ // This host's key for the Function's RPC methods (minted at deploy).
202
+ const key = yield* caller(target);
203
+ // The program's methods, recorded at deploy (an attribute of the Function).
204
+ const methods = yield* target.methods;
205
+ // Typed by `InvokeFunction`'s call signatures from the target's program.
206
+ return makeRpcClient(resolved, ops, methods, key);
207
+ }),
208
+ });
209
+ }));
210
+ //# sourceMappingURL=InvokeFunctionHttp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvokeFunctionHttp.js","sources":["../src/InvokeFunctionHttp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAA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AC;YACL,OAAO,CAAC,GAAG,IAAe,EAAE,EAAE,CAC5B,gBAAgB;YACd,mKAAmK;YACnK,IAAI,CAAC,IAAI,CAAoC,CAC9C,CAAC;QACN,CAAC;KACF,CACF,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,MAAM,CAC5C,cAAc,EACd,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,SAAS,CAAC;IAChC,OAAO,KAAK,CAAC,CAAC,mBAAmB,CAAC;QAChC,GAAG,EAAE,sBAAsB;QAC3B,UAAU,EAAE,SAAS;QACrB,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAsB;YAC9D,IAAI,aAAa,CAAC,MAAM,CAAC;gBAAE,OAAO,kBAAkB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;YACpE,qEAAqE;YACrE,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,MAAmD,CAAC,CAAC;YAC/E,4EAA4E;YAC5E,MAAM,OAAO,GAAG,KAAK,CAAC,CACpB,MAGD,CAAC,OAAO,CAAC;YACV,yEAAyE;YACzE,OAAO,aAAa,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,CAA8B,CAAC;QACjF,CAAC,CAAC;KACH,CAAC,CAAC;AACL,CAAC,CAAC,CACH,CAAC"}
@@ -0,0 +1,138 @@
1
+ import type { Input } from "alchemy/Input";
2
+ import * as Context from "effect/Context";
3
+ import * as Effect from "effect/Effect";
4
+ import * as Layer from "effect/Layer";
5
+ import type * as Stream from "effect/Stream";
6
+ import type { OperationServices } from "./internal.ts";
7
+ /**
8
+ * How a Modal binding reaches Modal from its host.
9
+ *
10
+ * Modal grants access per environment, as a `viewer` or a `contributor`. So:
11
+ *
12
+ * - a Modal Function or Server: nothing is bound. It calls Modal as its own
13
+ * container, over the API socket Modal gives every container
14
+ * (`fromContainer`), the way Modal's Python client does there. No
15
+ * credential is stored. A host with `restrictModalAccess` has no such
16
+ * access, so it gets a service user like any other host;
17
+ * - any other host (a Cloudflare Worker, a Lambda, a Modal Sandbox):
18
+ * {@link Bind} creates a scoped `Modal.ServiceUser` for the
19
+ * host (`<host>ModalIdentity`), grants it the role each binding asks for
20
+ * on the bound resource's environment, and binds its token pair into the
21
+ * host's env (`MODAL_TOKEN_ID`, and `MODAL_TOKEN_SECRET` kept `Redacted`);
22
+ * - no host (a script or a deploy-time Action): nothing is bound, and calls
23
+ * use the deployer's credentials.
24
+ *
25
+ * Modal's Starter plan has no service users. There, provide
26
+ * {@link DeployerHostIdentity} to bind the deployer's own token pair into
27
+ * each host instead: hosts then act with the deployer's workspace-wide
28
+ * access, not the roles their bindings ask for.
29
+ *
30
+ * Import it as a namespace. A binding resolves its operations with
31
+ * {@link withCredentials} and gets its `bind` from {@link Bind} when its layer
32
+ * is built, then binds behind its own `__ALCHEMY_RUNTIME__` guard:
33
+ *
34
+ * ```ts
35
+ * Effect.gen(function* () {
36
+ * const put = yield* ModalBindings.withCredentials(modalQueue.putQueue);
37
+ * const bind = yield* ModalBindings.Bind;
38
+ * return Effect.fn(function* (queue: Queue) {
39
+ * if (!globalThis.__ALCHEMY_RUNTIME__) {
40
+ * yield* bind`Modal.WriteQueue(${queue})`({
41
+ * roles: [{ environment: queue.environment, role: "contributor" }],
42
+ * });
43
+ * }
44
+ * const queueId = yield* queue.queueId;
45
+ * return (value) => put({ queueId: yield* queueId, values: [...] });
46
+ * });
47
+ * })
48
+ * ```
49
+ */
50
+ export declare const TOKEN_ENV: {
51
+ readonly id: "MODAL_TOKEN_ID";
52
+ readonly secret: "MODAL_TOKEN_SECRET";
53
+ readonly serverUrl: "ALCHEMY_MODAL_SERVER_URL";
54
+ };
55
+ /**
56
+ * The identity {@link Bind} gives a binding's host:
57
+ *
58
+ * - `"service-user"`: a scoped `Modal.ServiceUser` per host with only the
59
+ * roles its bindings ask for (needs Modal's Team or Enterprise plan);
60
+ * - `"deployer"`: the deployer's own token pair, with its workspace-wide
61
+ * access (for the Starter plan, which has no service users).
62
+ *
63
+ * Set it with {@link DeployerHostIdentity}.
64
+ */
65
+ export declare const HostIdentity: Context.Reference<"deployer" | "service-user">;
66
+ /**
67
+ * Bind the deployer's own Modal token into binding hosts instead of a
68
+ * scoped service user per host. Use it on Modal's Starter plan, which has
69
+ * no service users; hosts then have the deployer's workspace-wide access.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * export default Alchemy.Stack(
74
+ * "App",
75
+ * { providers: Layer.mergeAll(Cloudflare.providers(), Modal.providers(), Modal.DeployerHostIdentity) },
76
+ * Effect.gen(function* () { ... }),
77
+ * );
78
+ * ```
79
+ */
80
+ export declare const DeployerHostIdentity: Layer.Layer<never>;
81
+ /** A role a binding needs in one environment. */
82
+ export interface EnvironmentGrant {
83
+ /** The environment's name; `undefined` is the workspace default. */
84
+ readonly environment: Input<string | undefined>;
85
+ readonly role: "viewer" | "contributor";
86
+ }
87
+ /** What a Modal binding attaches to its host. */
88
+ export interface HostBinding {
89
+ /** Environment roles the host's identity needs. */
90
+ readonly roles?: ReadonlyArray<EnvironmentGrant>;
91
+ /** Env vars the binding reads at runtime. */
92
+ readonly env?: Record<string, unknown>;
93
+ }
94
+ /** The signature {@link Bind} yields. */
95
+ export type BindHost = (label: TemplateStringsArray, ...args: unknown[]) => (data?: HostBinding) => Effect.Effect<void>;
96
+ /**
97
+ * The `bind` for a binding's layer: yield it while the layer is built, then
98
+ * call it from the returned function behind a literal
99
+ * `if (!globalThis.__ALCHEMY_RUNTIME__)` so the bundler drops it. On a host it
100
+ * grants `data.roles` to the host's service user and binds that user's token
101
+ * pair (and `data.env`) into the host's env; with no host it does nothing.
102
+ */
103
+ export declare const Bind: Effect.Effect<BindHost>;
104
+ /**
105
+ * Resolve a distilled operation (or several, with `Effect.all`) once when
106
+ * the binding's layer is built: with the token pair {@link Bind} bound into
107
+ * the host, or the deployer's credentials when there is none.
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * const ops = yield* ModalBindings.withCredentials(
112
+ * operations({ getFile: volume.volumeGetFile2, putFiles: volume.volumePutFiles2 }),
113
+ * );
114
+ * ```
115
+ */
116
+ export declare const withCredentials: <Op>(operation: Effect.Effect<Op, never, OperationServices>) => Effect.Effect<Op>;
117
+ /**
118
+ * Resolve a task command router operation for one sandbox: the router runs
119
+ * per task, at a URL with its own JWT (from `sandboxGetCommandRouterAccess`).
120
+ * The router credentials are applied on every call, because a resolved
121
+ * operation runs with its caller's `Credentials` (the control plane's) over
122
+ * the ones it captured. `withTaskCommandRouter` also supplies the HTTP/2
123
+ * client the router requires.
124
+ */
125
+ export declare const withRouter: <I, O, E>(operation: (input: I) => Effect.Effect<O, E, OperationServices>) => (access: RouterAccess) => Effect.Effect<(input: I) => Effect.Effect<O, E>>;
126
+ /**
127
+ * {@link withRouter} for a server-streaming router operation: its `.stream`,
128
+ * which emits each message as the router sends it.
129
+ */
130
+ export declare const streamRouter: <I, A, E>(operation: {
131
+ readonly stream: (input: I) => Stream.Stream<A, E, OperationServices>;
132
+ }) => (access: RouterAccess) => Effect.Effect<(input: I) => Stream.Stream<A, E>>;
133
+ /** A task's command router: its URL and JWT, from `sandboxGetCommandRouterAccess`. */
134
+ export interface RouterAccess {
135
+ readonly url: string;
136
+ readonly jwt: string;
137
+ }
138
+ //# sourceMappingURL=ModalBindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModalBindings.d.ts","sources":["../src/ModalBindings.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC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