@leaflow/sdk 0.209.0 → 0.211.0

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 (282) hide show
  1. package/dist/assistant/v1/generated/functions.d.ts +243 -67
  2. package/dist/assistant/v1/generated/functions.js +248 -44
  3. package/dist/assistant/v1/generated/models.d.ts +302 -230
  4. package/dist/assistant/v1/generated/models.js +9 -19
  5. package/dist/assistant/v1/generated/schemas.zod.d.ts +119 -29
  6. package/dist/assistant/v1/generated/schemas.zod.js +139 -29
  7. package/dist/assistant/v1/generated/validators/answerQuestionRequestBody.zod.d.ts +4 -3
  8. package/dist/assistant/v1/generated/validators/answerQuestionRequestBody.zod.js +4 -3
  9. package/dist/assistant/v1/generated/validators/approvalMode.zod.d.ts +4 -3
  10. package/dist/assistant/v1/generated/validators/approvalMode.zod.js +4 -3
  11. package/dist/assistant/v1/generated/validators/artifactListResponseBody.zod.d.ts +68 -0
  12. package/dist/assistant/v1/generated/validators/artifactListResponseBody.zod.js +35 -0
  13. package/dist/assistant/v1/generated/validators/artifactResource.zod.d.ts +65 -0
  14. package/dist/assistant/v1/generated/validators/{attachmentResource.zod.js → artifactResource.zod.js} +13 -14
  15. package/dist/assistant/v1/generated/validators/artifactVersionListResponseBody.zod.d.ts +61 -0
  16. package/dist/assistant/v1/generated/validators/artifactVersionListResponseBody.zod.js +35 -0
  17. package/dist/assistant/v1/generated/validators/{uploadedResource.zod.d.ts → artifactVersionResource.zod.d.ts} +30 -16
  18. package/dist/assistant/v1/generated/validators/{attachmentFileResource.zod.js → artifactVersionResource.zod.js} +23 -16
  19. package/dist/assistant/v1/generated/validators/bindingCodeResponseBody.zod.d.ts +4 -3
  20. package/dist/assistant/v1/generated/validators/bindingCodeResponseBody.zod.js +4 -3
  21. package/dist/assistant/v1/generated/validators/bindingResource.zod.d.ts +4 -3
  22. package/dist/assistant/v1/generated/validators/bindingResource.zod.js +4 -3
  23. package/dist/assistant/v1/generated/validators/channelResource.zod.d.ts +4 -3
  24. package/dist/assistant/v1/generated/validators/channelResource.zod.js +4 -3
  25. package/dist/assistant/v1/generated/validators/channelWithSecretResponseBody.zod.d.ts +4 -3
  26. package/dist/assistant/v1/generated/validators/channelWithSecretResponseBody.zod.js +4 -3
  27. package/dist/assistant/v1/generated/validators/checkSenderParams.zod.d.ts +4 -3
  28. package/dist/assistant/v1/generated/validators/checkSenderParams.zod.js +4 -3
  29. package/dist/assistant/v1/generated/validators/choiceResource.zod.d.ts +4 -3
  30. package/dist/assistant/v1/generated/validators/choiceResource.zod.js +4 -3
  31. package/dist/assistant/v1/generated/validators/clientActionRequest.zod.d.ts +4 -3
  32. package/dist/assistant/v1/generated/validators/clientActionRequest.zod.js +4 -3
  33. package/dist/assistant/v1/generated/validators/clientContextPart.zod.d.ts +4 -3
  34. package/dist/assistant/v1/generated/validators/clientContextPart.zod.js +4 -3
  35. package/dist/assistant/v1/generated/validators/clientContextRequest.zod.d.ts +4 -3
  36. package/dist/assistant/v1/generated/validators/clientContextRequest.zod.js +4 -3
  37. package/dist/assistant/v1/generated/validators/clientFunctionRequest.zod.d.ts +4 -3
  38. package/dist/assistant/v1/generated/validators/clientFunctionRequest.zod.js +4 -3
  39. package/dist/assistant/v1/generated/validators/completeUploadRequestBody.zod.d.ts +4 -3
  40. package/dist/assistant/v1/generated/validators/completeUploadRequestBody.zod.js +4 -3
  41. package/dist/assistant/v1/generated/validators/contextUsageResource.zod.d.ts +4 -3
  42. package/dist/assistant/v1/generated/validators/contextUsageResource.zod.js +4 -3
  43. package/dist/assistant/v1/generated/validators/createArtifactRequestBody.zod.d.ts +38 -0
  44. package/dist/assistant/v1/generated/validators/createArtifactRequestBody.zod.js +36 -0
  45. package/dist/assistant/v1/generated/validators/createArtifactVersionRequestBody.zod.d.ts +36 -0
  46. package/dist/assistant/v1/generated/validators/createArtifactVersionRequestBody.zod.js +34 -0
  47. package/dist/assistant/v1/generated/validators/createChannelRequestBody.zod.d.ts +4 -3
  48. package/dist/assistant/v1/generated/validators/createChannelRequestBody.zod.js +4 -3
  49. package/dist/assistant/v1/generated/validators/createFolderRequestBody.zod.d.ts +4 -3
  50. package/dist/assistant/v1/generated/validators/createFolderRequestBody.zod.js +4 -3
  51. package/dist/assistant/v1/generated/validators/createTaskRequestBody.zod.d.ts +4 -3
  52. package/dist/assistant/v1/generated/validators/createTaskRequestBody.zod.js +4 -3
  53. package/dist/assistant/v1/generated/validators/createThreadRequestBody.zod.d.ts +5 -4
  54. package/dist/assistant/v1/generated/validators/createThreadRequestBody.zod.js +4 -3
  55. package/dist/assistant/v1/generated/validators/createThreadResponseBody.zod.d.ts +4 -3
  56. package/dist/assistant/v1/generated/validators/createThreadResponseBody.zod.js +4 -3
  57. package/dist/assistant/v1/generated/validators/createUploadRequestBody.zod.d.ts +4 -3
  58. package/dist/assistant/v1/generated/validators/createUploadRequestBody.zod.js +4 -3
  59. package/dist/assistant/v1/generated/validators/credentialFieldResource.zod.d.ts +4 -3
  60. package/dist/assistant/v1/generated/validators/credentialFieldResource.zod.js +4 -3
  61. package/dist/assistant/v1/generated/validators/cursorPagination.zod.d.ts +4 -3
  62. package/dist/assistant/v1/generated/validators/cursorPagination.zod.js +4 -3
  63. package/dist/assistant/v1/generated/validators/decideToolCallsRequestBody.zod.d.ts +4 -3
  64. package/dist/assistant/v1/generated/validators/decideToolCallsRequestBody.zod.js +4 -3
  65. package/dist/assistant/v1/generated/validators/defaultModelResource.zod.d.ts +4 -3
  66. package/dist/assistant/v1/generated/validators/defaultModelResource.zod.js +4 -3
  67. package/dist/assistant/v1/generated/validators/error.zod.d.ts +4 -3
  68. package/dist/assistant/v1/generated/validators/error.zod.js +4 -3
  69. package/dist/assistant/v1/generated/validators/errorStatus.zod.d.ts +4 -3
  70. package/dist/assistant/v1/generated/validators/errorStatus.zod.js +4 -3
  71. package/dist/assistant/v1/generated/validators/fieldViolation.zod.d.ts +4 -3
  72. package/dist/assistant/v1/generated/validators/fieldViolation.zod.js +4 -3
  73. package/dist/assistant/v1/generated/validators/{attachmentCountsResource.zod.d.ts → fileCountsResource.zod.d.ts} +7 -6
  74. package/dist/assistant/v1/generated/validators/{attachmentCountsResource.zod.js → fileCountsResource.zod.js} +5 -4
  75. package/dist/assistant/v1/generated/validators/fileDiffResource.zod.d.ts +4 -3
  76. package/dist/assistant/v1/generated/validators/fileDiffResource.zod.js +4 -3
  77. package/dist/assistant/v1/generated/validators/{attachmentListResponseBody.zod.d.ts → fileListResponseBody.zod.d.ts} +15 -14
  78. package/dist/assistant/v1/generated/validators/{attachmentListResponseBody.zod.js → fileListResponseBody.zod.js} +9 -8
  79. package/dist/assistant/v1/generated/validators/{attachmentFileResource.zod.d.ts → fileResource.zod.d.ts} +14 -13
  80. package/dist/assistant/v1/generated/validators/{uploadedResource.zod.js → fileResource.zod.js} +25 -15
  81. package/dist/assistant/v1/generated/validators/folderCountsResource.zod.d.ts +4 -3
  82. package/dist/assistant/v1/generated/validators/folderCountsResource.zod.js +4 -3
  83. package/dist/assistant/v1/generated/validators/folderListResponseBody.zod.d.ts +4 -3
  84. package/dist/assistant/v1/generated/validators/folderListResponseBody.zod.js +4 -3
  85. package/dist/assistant/v1/generated/validators/folderResource.zod.d.ts +4 -3
  86. package/dist/assistant/v1/generated/validators/folderResource.zod.js +4 -3
  87. package/dist/assistant/v1/generated/validators/itemSourceResource.zod.d.ts +4 -3
  88. package/dist/assistant/v1/generated/validators/itemSourceResource.zod.js +4 -3
  89. package/dist/assistant/v1/generated/validators/lastTurnResource.zod.d.ts +4 -3
  90. package/dist/assistant/v1/generated/validators/lastTurnResource.zod.js +4 -3
  91. package/dist/assistant/v1/generated/validators/lengthAwarePageBindingResource.zod.d.ts +4 -3
  92. package/dist/assistant/v1/generated/validators/lengthAwarePageBindingResource.zod.js +4 -3
  93. package/dist/assistant/v1/generated/validators/lengthAwarePageChannelResource.zod.d.ts +4 -3
  94. package/dist/assistant/v1/generated/validators/lengthAwarePageChannelResource.zod.js +4 -3
  95. package/dist/assistant/v1/generated/validators/listArtifactVersionsParams.zod.d.ts +39 -0
  96. package/dist/assistant/v1/generated/validators/listArtifactVersionsParams.zod.js +41 -0
  97. package/dist/assistant/v1/generated/validators/listArtifactsParams.zod.d.ts +41 -0
  98. package/dist/assistant/v1/generated/validators/listArtifactsParams.zod.js +39 -0
  99. package/dist/assistant/v1/generated/validators/listBindingsParams.zod.d.ts +4 -3
  100. package/dist/assistant/v1/generated/validators/listBindingsParams.zod.js +4 -3
  101. package/dist/assistant/v1/generated/validators/listChannelRejectionsParams.zod.d.ts +4 -3
  102. package/dist/assistant/v1/generated/validators/listChannelRejectionsParams.zod.js +4 -3
  103. package/dist/assistant/v1/generated/validators/listChannelsParams.zod.d.ts +4 -3
  104. package/dist/assistant/v1/generated/validators/listChannelsParams.zod.js +4 -3
  105. package/dist/assistant/v1/generated/validators/listTaskRunsParams.zod.d.ts +4 -3
  106. package/dist/assistant/v1/generated/validators/listTaskRunsParams.zod.js +4 -3
  107. package/dist/assistant/v1/generated/validators/listThreadItemsParams.zod.d.ts +4 -3
  108. package/dist/assistant/v1/generated/validators/listThreadItemsParams.zod.js +4 -3
  109. package/dist/assistant/v1/generated/validators/listThreadMessagesParams.zod.d.ts +4 -3
  110. package/dist/assistant/v1/generated/validators/listThreadMessagesParams.zod.js +4 -3
  111. package/dist/assistant/v1/generated/validators/listThreadTurnsParams.zod.d.ts +4 -3
  112. package/dist/assistant/v1/generated/validators/listThreadTurnsParams.zod.js +4 -3
  113. package/dist/assistant/v1/generated/validators/loginResource.zod.d.ts +4 -3
  114. package/dist/assistant/v1/generated/validators/loginResource.zod.js +4 -3
  115. package/dist/assistant/v1/generated/validators/memoryListResponseBody.zod.d.ts +4 -3
  116. package/dist/assistant/v1/generated/validators/memoryListResponseBody.zod.js +4 -3
  117. package/dist/assistant/v1/generated/validators/memoryResource.zod.d.ts +4 -3
  118. package/dist/assistant/v1/generated/validators/memoryResource.zod.js +4 -3
  119. package/dist/assistant/v1/generated/validators/messagePart.zod.d.ts +5 -4
  120. package/dist/assistant/v1/generated/validators/messagePart.zod.js +7 -6
  121. package/dist/assistant/v1/generated/validators/moveFolderRequestBody.zod.d.ts +4 -3
  122. package/dist/assistant/v1/generated/validators/moveFolderRequestBody.zod.js +4 -3
  123. package/dist/assistant/v1/generated/validators/offsetPagination.zod.d.ts +4 -3
  124. package/dist/assistant/v1/generated/validators/offsetPagination.zod.js +4 -3
  125. package/dist/assistant/v1/generated/validators/partResource.zod.d.ts +20 -4
  126. package/dist/assistant/v1/generated/validators/partResource.zod.js +8 -7
  127. package/dist/assistant/v1/generated/validators/pendingActionResource.zod.d.ts +4 -3
  128. package/dist/assistant/v1/generated/validators/pendingActionResource.zod.js +4 -3
  129. package/dist/assistant/v1/generated/validators/placeThreadRequestBody.zod.d.ts +4 -3
  130. package/dist/assistant/v1/generated/validators/placeThreadRequestBody.zod.js +4 -3
  131. package/dist/assistant/v1/generated/validators/platformListResponseBody.zod.d.ts +4 -3
  132. package/dist/assistant/v1/generated/validators/platformListResponseBody.zod.js +4 -3
  133. package/dist/assistant/v1/generated/validators/platformResource.zod.d.ts +4 -3
  134. package/dist/assistant/v1/generated/validators/platformResource.zod.js +4 -3
  135. package/dist/assistant/v1/generated/validators/presentationResource.zod.d.ts +4 -3
  136. package/dist/assistant/v1/generated/validators/presentationResource.zod.js +4 -3
  137. package/dist/assistant/v1/generated/validators/putUploadPartHeaders.zod.d.ts +4 -3
  138. package/dist/assistant/v1/generated/validators/putUploadPartHeaders.zod.js +4 -3
  139. package/dist/assistant/v1/generated/validators/putUploadPartParams.zod.d.ts +4 -3
  140. package/dist/assistant/v1/generated/validators/putUploadPartParams.zod.js +4 -3
  141. package/dist/assistant/v1/generated/validators/questionResource.zod.d.ts +4 -3
  142. package/dist/assistant/v1/generated/validators/questionResource.zod.js +4 -3
  143. package/dist/assistant/v1/generated/validators/reasoningEffort.zod.d.ts +4 -3
  144. package/dist/assistant/v1/generated/validators/reasoningEffort.zod.js +4 -3
  145. package/dist/assistant/v1/generated/validators/rejectionListResponseBody.zod.d.ts +4 -3
  146. package/dist/assistant/v1/generated/validators/rejectionListResponseBody.zod.js +4 -3
  147. package/dist/assistant/v1/generated/validators/rejectionResource.zod.d.ts +4 -3
  148. package/dist/assistant/v1/generated/validators/rejectionResource.zod.js +4 -3
  149. package/dist/assistant/v1/generated/validators/resumeThreadRequestBody.zod.d.ts +4 -3
  150. package/dist/assistant/v1/generated/validators/resumeThreadRequestBody.zod.js +4 -3
  151. package/dist/assistant/v1/generated/validators/revertRequestBody.zod.d.ts +4 -3
  152. package/dist/assistant/v1/generated/validators/revertRequestBody.zod.js +4 -3
  153. package/dist/assistant/v1/generated/validators/revertedCountResponseBody.zod.d.ts +4 -3
  154. package/dist/assistant/v1/generated/validators/revertedCountResponseBody.zod.js +4 -3
  155. package/dist/assistant/v1/generated/validators/rotateSecretRequestBody.zod.d.ts +4 -3
  156. package/dist/assistant/v1/generated/validators/rotateSecretRequestBody.zod.js +4 -3
  157. package/dist/assistant/v1/generated/validators/{searchAttachmentsRequestBody.zod.d.ts → searchFilesRequestBody.zod.d.ts} +12 -11
  158. package/dist/assistant/v1/generated/validators/{searchAttachmentsRequestBody.zod.js → searchFilesRequestBody.zod.js} +17 -16
  159. package/dist/assistant/v1/generated/validators/searchTasksRequestBody.zod.d.ts +4 -3
  160. package/dist/assistant/v1/generated/validators/searchTasksRequestBody.zod.js +4 -3
  161. package/dist/assistant/v1/generated/validators/searchThreadsRequestBody.zod.d.ts +4 -3
  162. package/dist/assistant/v1/generated/validators/searchThreadsRequestBody.zod.js +4 -3
  163. package/dist/assistant/v1/generated/validators/sendMessageRequestBody.zod.d.ts +5 -4
  164. package/dist/assistant/v1/generated/validators/sendMessageRequestBody.zod.js +4 -3
  165. package/dist/assistant/v1/generated/validators/sendMessageResponseBody.zod.d.ts +4 -3
  166. package/dist/assistant/v1/generated/validators/sendMessageResponseBody.zod.js +4 -3
  167. package/dist/assistant/v1/generated/validators/senderCheckResource.zod.d.ts +4 -3
  168. package/dist/assistant/v1/generated/validators/senderCheckResource.zod.js +4 -3
  169. package/dist/assistant/v1/generated/validators/settingsResource.zod.d.ts +4 -3
  170. package/dist/assistant/v1/generated/validators/settingsResource.zod.js +4 -3
  171. package/dist/assistant/v1/generated/validators/skillEnabledRequestBody.zod.d.ts +4 -3
  172. package/dist/assistant/v1/generated/validators/skillEnabledRequestBody.zod.js +4 -3
  173. package/dist/assistant/v1/generated/validators/skillListResponseBody.zod.d.ts +4 -3
  174. package/dist/assistant/v1/generated/validators/skillListResponseBody.zod.js +4 -3
  175. package/dist/assistant/v1/generated/validators/skillRequestBody.zod.d.ts +4 -3
  176. package/dist/assistant/v1/generated/validators/skillRequestBody.zod.js +4 -3
  177. package/dist/assistant/v1/generated/validators/skillResource.zod.d.ts +4 -3
  178. package/dist/assistant/v1/generated/validators/skillResource.zod.js +4 -3
  179. package/dist/assistant/v1/generated/validators/subagentCountResource.zod.d.ts +4 -3
  180. package/dist/assistant/v1/generated/validators/subagentCountResource.zod.js +4 -3
  181. package/dist/assistant/v1/generated/validators/taskAction.zod.d.ts +4 -3
  182. package/dist/assistant/v1/generated/validators/taskAction.zod.js +4 -3
  183. package/dist/assistant/v1/generated/validators/taskListResponseBody.zod.d.ts +4 -3
  184. package/dist/assistant/v1/generated/validators/taskListResponseBody.zod.js +4 -3
  185. package/dist/assistant/v1/generated/validators/taskResource.zod.d.ts +4 -3
  186. package/dist/assistant/v1/generated/validators/taskResource.zod.js +4 -3
  187. package/dist/assistant/v1/generated/validators/taskRunEvent.zod.d.ts +4 -3
  188. package/dist/assistant/v1/generated/validators/taskRunEvent.zod.js +4 -3
  189. package/dist/assistant/v1/generated/validators/taskRunListResponseBody.zod.d.ts +4 -3
  190. package/dist/assistant/v1/generated/validators/taskRunListResponseBody.zod.js +4 -3
  191. package/dist/assistant/v1/generated/validators/taskRunResource.zod.d.ts +4 -3
  192. package/dist/assistant/v1/generated/validators/taskRunResource.zod.js +4 -3
  193. package/dist/assistant/v1/generated/validators/taskTrigger.zod.d.ts +4 -3
  194. package/dist/assistant/v1/generated/validators/taskTrigger.zod.js +4 -3
  195. package/dist/assistant/v1/generated/validators/threadCountsResource.zod.d.ts +4 -3
  196. package/dist/assistant/v1/generated/validators/threadCountsResource.zod.js +4 -3
  197. package/dist/assistant/v1/generated/validators/threadItemListResponseBody.zod.d.ts +120 -29
  198. package/dist/assistant/v1/generated/validators/threadItemListResponseBody.zod.js +4 -3
  199. package/dist/assistant/v1/generated/validators/threadItemResource.zod.d.ts +62 -16
  200. package/dist/assistant/v1/generated/validators/threadItemResource.zod.js +5 -6
  201. package/dist/assistant/v1/generated/validators/threadListResponseBody.zod.d.ts +4 -3
  202. package/dist/assistant/v1/generated/validators/threadListResponseBody.zod.js +4 -3
  203. package/dist/assistant/v1/generated/validators/threadMessageListResponseBody.zod.d.ts +4 -3
  204. package/dist/assistant/v1/generated/validators/threadMessageListResponseBody.zod.js +4 -3
  205. package/dist/assistant/v1/generated/validators/threadMessageResource.zod.d.ts +4 -3
  206. package/dist/assistant/v1/generated/validators/threadMessageResource.zod.js +4 -3
  207. package/dist/assistant/v1/generated/validators/threadResource.zod.d.ts +4 -3
  208. package/dist/assistant/v1/generated/validators/threadResource.zod.js +4 -3
  209. package/dist/assistant/v1/generated/validators/threadStatus.zod.d.ts +4 -3
  210. package/dist/assistant/v1/generated/validators/threadStatus.zod.js +4 -3
  211. package/dist/assistant/v1/generated/validators/threadTurnListResponseBody.zod.d.ts +4 -3
  212. package/dist/assistant/v1/generated/validators/threadTurnListResponseBody.zod.js +4 -3
  213. package/dist/assistant/v1/generated/validators/threadTurnResource.zod.d.ts +4 -3
  214. package/dist/assistant/v1/generated/validators/threadTurnResource.zod.js +4 -3
  215. package/dist/assistant/v1/generated/validators/todoResource.zod.d.ts +4 -3
  216. package/dist/assistant/v1/generated/validators/todoResource.zod.js +4 -3
  217. package/dist/assistant/v1/generated/validators/toolCallResource.zod.d.ts +46 -3
  218. package/dist/assistant/v1/generated/validators/toolCallResource.zod.js +12 -3
  219. package/dist/assistant/v1/generated/validators/toolResultRequestBody.zod.d.ts +4 -3
  220. package/dist/assistant/v1/generated/validators/toolResultRequestBody.zod.js +4 -3
  221. package/dist/assistant/v1/generated/validators/turnStartedResponseBody.zod.d.ts +4 -3
  222. package/dist/assistant/v1/generated/validators/turnStartedResponseBody.zod.js +4 -3
  223. package/dist/assistant/v1/generated/validators/turnStatus.zod.d.ts +4 -3
  224. package/dist/assistant/v1/generated/validators/turnStatus.zod.js +4 -3
  225. package/dist/assistant/v1/generated/validators/turnType.zod.d.ts +4 -3
  226. package/dist/assistant/v1/generated/validators/turnType.zod.js +4 -3
  227. package/dist/assistant/v1/generated/validators/{attachmentResource.zod.d.ts → updateArtifactRequestBody.zod.d.ts} +9 -16
  228. package/dist/assistant/v1/generated/validators/updateArtifactRequestBody.zod.js +34 -0
  229. package/dist/assistant/v1/generated/validators/updateChannelRequestBody.zod.d.ts +4 -3
  230. package/dist/assistant/v1/generated/validators/updateChannelRequestBody.zod.js +4 -3
  231. package/dist/assistant/v1/generated/validators/{updateAttachmentRequestBody.zod.d.ts → updateFileRequestBody.zod.d.ts} +8 -7
  232. package/dist/assistant/v1/generated/validators/{updateAttachmentRequestBody.zod.js → updateFileRequestBody.zod.js} +7 -6
  233. package/dist/assistant/v1/generated/validators/updateFolderRequestBody.zod.d.ts +4 -3
  234. package/dist/assistant/v1/generated/validators/updateFolderRequestBody.zod.js +4 -3
  235. package/dist/assistant/v1/generated/validators/updateSettingsRequestBody.zod.d.ts +4 -3
  236. package/dist/assistant/v1/generated/validators/updateSettingsRequestBody.zod.js +4 -3
  237. package/dist/assistant/v1/generated/validators/updateTaskRequestBody.zod.d.ts +4 -3
  238. package/dist/assistant/v1/generated/validators/updateTaskRequestBody.zod.js +4 -3
  239. package/dist/assistant/v1/generated/validators/updateThreadRequestBody.zod.d.ts +4 -3
  240. package/dist/assistant/v1/generated/validators/updateThreadRequestBody.zod.js +4 -3
  241. package/dist/assistant/v1/generated/validators/updateUploadRequestBody.zod.d.ts +4 -3
  242. package/dist/assistant/v1/generated/validators/updateUploadRequestBody.zod.js +4 -3
  243. package/dist/assistant/v1/generated/validators/uploadConfigurationResource.zod.d.ts +4 -3
  244. package/dist/assistant/v1/generated/validators/uploadConfigurationResource.zod.js +4 -3
  245. package/dist/assistant/v1/generated/validators/{uploadAttachmentParams.zod.d.ts → uploadFileParams.zod.d.ts} +8 -7
  246. package/dist/assistant/v1/generated/validators/{uploadAttachmentParams.zod.js → uploadFileParams.zod.js} +7 -6
  247. package/dist/assistant/v1/generated/validators/uploadListResponseBody.zod.d.ts +5 -4
  248. package/dist/assistant/v1/generated/validators/uploadListResponseBody.zod.js +4 -3
  249. package/dist/assistant/v1/generated/validators/uploadPartResource.zod.d.ts +4 -3
  250. package/dist/assistant/v1/generated/validators/uploadPartResource.zod.js +4 -3
  251. package/dist/assistant/v1/generated/validators/uploadResource.zod.d.ts +5 -4
  252. package/dist/assistant/v1/generated/validators/uploadResource.zod.js +8 -4
  253. package/dist/assistant/v1/generated/validators/usage.zod.d.ts +4 -3
  254. package/dist/assistant/v1/generated/validators/usage.zod.js +4 -3
  255. package/dist/assistant/v1/generated/validators/verifyCodeRequestBody.zod.d.ts +4 -3
  256. package/dist/assistant/v1/generated/validators/verifyCodeRequestBody.zod.js +4 -3
  257. package/dist/assistant/v1/generated/validators/webhookSecretResponseBody.zod.d.ts +4 -3
  258. package/dist/assistant/v1/generated/validators/webhookSecretResponseBody.zod.js +4 -3
  259. package/dist/canopy/v1/generated/functions.d.ts +73 -1
  260. package/dist/canopy/v1/generated/functions.js +92 -6
  261. package/dist/canopy/v1/generated/models.d.ts +148 -12
  262. package/dist/canopy/v1/generated/models.js +13 -0
  263. package/dist/canopy/v1/generated/schemas.zod.d.ts +49 -0
  264. package/dist/canopy/v1/generated/schemas.zod.js +28 -0
  265. package/dist/canopy/v1/generated/validators/cursorPageRequestResource.zod.d.ts +10 -0
  266. package/dist/canopy/v1/generated/validators/getVideoContentHeaders.zod.d.ts +46 -0
  267. package/dist/canopy/v1/generated/validators/getVideoContentHeaders.zod.js +44 -0
  268. package/dist/canopy/v1/generated/validators/mediaUsageDetails.zod.d.ts +61 -0
  269. package/dist/canopy/v1/generated/validators/mediaUsageDetails.zod.js +67 -0
  270. package/dist/canopy/v1/generated/validators/requestResource.zod.d.ts +10 -0
  271. package/dist/canopy/v1/generated/validators/requestResource.zod.js +2 -0
  272. package/dist/canopy/v1/generated/validators/videoCreateRequest.zod.d.ts +67 -0
  273. package/dist/canopy/v1/generated/validators/videoCreateRequest.zod.js +70 -0
  274. package/dist/canopy/v1/generated/validators/videoReferenceMedia.zod.d.ts +53 -0
  275. package/dist/canopy/v1/generated/validators/videoReferenceMedia.zod.js +53 -0
  276. package/dist/canopy/v1/generated/validators/videoTask.zod.d.ts +71 -0
  277. package/dist/canopy/v1/generated/validators/videoTask.zod.js +64 -0
  278. package/dist/canopy/v1/generated/validators/videoUsage.zod.d.ts +54 -0
  279. package/dist/canopy/v1/generated/validators/videoUsage.zod.js +62 -0
  280. package/dist/routes.d.ts +100 -12
  281. package/dist/routes.js +111 -12
  282. package/package.json +1 -1
@@ -20,14 +20,15 @@
20
20
  * outlines the person's messages for navigating a long conversation.
21
21
  *
22
22
  * Upload large files with /api/v1/uploads: read /api/v1/upload-configuration first, send exact-sized
23
- * parts, then complete the upload and send its attachment id in a message.
23
+ * parts, then complete the upload and send its file id in a message.
24
24
  *
25
- * Files uploaded that way are listed by search-attachments. Renaming or removing one does not change
26
- * the conversations that already use it; downloading keeps working.
25
+ * Files the person attached are listed by search-files. Renaming or removing one does not change
26
+ * the conversations that already use it; downloading keeps working. Files the assistant hands over
27
+ * are artifacts: they appear on the tool call that created them and are listed by list-artifacts.
27
28
  * OpenAPI spec version: 2.0.0
28
29
  */
29
30
  import * as zod from "zod";
30
- export const uploadAttachmentParamsFilenameMax = 255;
31
- export const UploadAttachmentParams = zod.strictObject({
32
- filename: zod.string().max(uploadAttachmentParamsFilenameMax).optional(),
31
+ export const uploadFileParamsFilenameMax = 255;
32
+ export const UploadFileParams = zod.strictObject({
33
+ filename: zod.string().max(uploadFileParamsFilenameMax).optional(),
33
34
  });
@@ -20,10 +20,11 @@
20
20
  * outlines the person's messages for navigating a long conversation.
21
21
  *
22
22
  * Upload large files with /api/v1/uploads: read /api/v1/upload-configuration first, send exact-sized
23
- * parts, then complete the upload and send its attachment id in a message.
23
+ * parts, then complete the upload and send its file id in a message.
24
24
  *
25
- * Files uploaded that way are listed by search-attachments. Renaming or removing one does not change
26
- * the conversations that already use it; downloading keeps working.
25
+ * Files the person attached are listed by search-files. Renaming or removing one does not change
26
+ * the conversations that already use it; downloading keeps working. Files the assistant hands over
27
+ * are artifacts: they appear on the tool call that created them and are listed by list-artifacts.
27
28
  * OpenAPI spec version: 2.0.0
28
29
  */
29
30
  import * as zod from "zod";
@@ -36,7 +37,7 @@ export declare const UploadListResponseBody: zod.ZodObject<{
36
37
  policyId: zod.ZodString;
37
38
  expiresAt: zod.z.ZodISODateTime;
38
39
  status: zod.ZodString;
39
- attachmentId: zod.ZodNullable<zod.ZodString>;
40
+ fileId: zod.ZodNullable<zod.ZodString>;
40
41
  parts: zod.ZodArray<zod.ZodObject<{
41
42
  number: zod.ZodInt;
42
43
  byteSize: zod.ZodInt;
@@ -20,10 +20,11 @@
20
20
  * outlines the person's messages for navigating a long conversation.
21
21
  *
22
22
  * Upload large files with /api/v1/uploads: read /api/v1/upload-configuration first, send exact-sized
23
- * parts, then complete the upload and send its attachment id in a message.
23
+ * parts, then complete the upload and send its file id in a message.
24
24
  *
25
- * Files uploaded that way are listed by search-attachments. Renaming or removing one does not change
26
- * the conversations that already use it; downloading keeps working.
25
+ * Files the person attached are listed by search-files. Renaming or removing one does not change
26
+ * the conversations that already use it; downloading keeps working. Files the assistant hands over
27
+ * are artifacts: they appear on the tool call that created them and are listed by list-artifacts.
27
28
  * OpenAPI spec version: 2.0.0
28
29
  */
29
30
  import * as zod from "zod";
@@ -20,10 +20,11 @@
20
20
  * outlines the person's messages for navigating a long conversation.
21
21
  *
22
22
  * Upload large files with /api/v1/uploads: read /api/v1/upload-configuration first, send exact-sized
23
- * parts, then complete the upload and send its attachment id in a message.
23
+ * parts, then complete the upload and send its file id in a message.
24
24
  *
25
- * Files uploaded that way are listed by search-attachments. Renaming or removing one does not change
26
- * the conversations that already use it; downloading keeps working.
25
+ * Files the person attached are listed by search-files. Renaming or removing one does not change
26
+ * the conversations that already use it; downloading keeps working. Files the assistant hands over
27
+ * are artifacts: they appear on the tool call that created them and are listed by list-artifacts.
27
28
  * OpenAPI spec version: 2.0.0
28
29
  */
29
30
  import * as zod from "zod";
@@ -20,10 +20,11 @@
20
20
  * outlines the person's messages for navigating a long conversation.
21
21
  *
22
22
  * Upload large files with /api/v1/uploads: read /api/v1/upload-configuration first, send exact-sized
23
- * parts, then complete the upload and send its attachment id in a message.
23
+ * parts, then complete the upload and send its file id in a message.
24
24
  *
25
- * Files uploaded that way are listed by search-attachments. Renaming or removing one does not change
26
- * the conversations that already use it; downloading keeps working.
25
+ * Files the person attached are listed by search-files. Renaming or removing one does not change
26
+ * the conversations that already use it; downloading keeps working. Files the assistant hands over
27
+ * are artifacts: they appear on the tool call that created them and are listed by list-artifacts.
27
28
  * OpenAPI spec version: 2.0.0
28
29
  */
29
30
  import * as zod from "zod";
@@ -20,10 +20,11 @@
20
20
  * outlines the person's messages for navigating a long conversation.
21
21
  *
22
22
  * Upload large files with /api/v1/uploads: read /api/v1/upload-configuration first, send exact-sized
23
- * parts, then complete the upload and send its attachment id in a message.
23
+ * parts, then complete the upload and send its file id in a message.
24
24
  *
25
- * Files uploaded that way are listed by search-attachments. Renaming or removing one does not change
26
- * the conversations that already use it; downloading keeps working.
25
+ * Files the person attached are listed by search-files. Renaming or removing one does not change
26
+ * the conversations that already use it; downloading keeps working. Files the assistant hands over
27
+ * are artifacts: they appear on the tool call that created them and are listed by list-artifacts.
27
28
  * OpenAPI spec version: 2.0.0
28
29
  */
29
30
  import * as zod from "zod";
@@ -35,7 +36,7 @@ export declare const UploadResource: zod.ZodObject<{
35
36
  policyId: zod.ZodString;
36
37
  expiresAt: zod.z.ZodISODateTime;
37
38
  status: zod.ZodString;
38
- attachmentId: zod.ZodNullable<zod.ZodString>;
39
+ fileId: zod.ZodNullable<zod.ZodString>;
39
40
  parts: zod.ZodArray<zod.ZodObject<{
40
41
  number: zod.ZodInt;
41
42
  byteSize: zod.ZodInt;
@@ -20,10 +20,11 @@
20
20
  * outlines the person's messages for navigating a long conversation.
21
21
  *
22
22
  * Upload large files with /api/v1/uploads: read /api/v1/upload-configuration first, send exact-sized
23
- * parts, then complete the upload and send its attachment id in a message.
23
+ * parts, then complete the upload and send its file id in a message.
24
24
  *
25
- * Files uploaded that way are listed by search-attachments. Renaming or removing one does not change
26
- * the conversations that already use it; downloading keeps working.
25
+ * Files the person attached are listed by search-files. Renaming or removing one does not change
26
+ * the conversations that already use it; downloading keeps working. Files the assistant hands over
27
+ * are artifacts: they appear on the tool call that created them and are listed by list-artifacts.
27
28
  * OpenAPI spec version: 2.0.0
28
29
  */
29
30
  import * as zod from "zod";
@@ -36,6 +37,9 @@ export const UploadResource = zod.strictObject({
36
37
  policyId: zod.string(),
37
38
  expiresAt: zod.iso.datetime({ offset: true }),
38
39
  status: zod.string(),
39
- attachmentId: zod.string().nullable(),
40
+ fileId: zod
41
+ .string()
42
+ .nullable()
43
+ .describe("The file the upload became. Null until the upload is complete."),
40
44
  parts: zod.array(UploadPartResource),
41
45
  });
@@ -20,10 +20,11 @@
20
20
  * outlines the person's messages for navigating a long conversation.
21
21
  *
22
22
  * Upload large files with /api/v1/uploads: read /api/v1/upload-configuration first, send exact-sized
23
- * parts, then complete the upload and send its attachment id in a message.
23
+ * parts, then complete the upload and send its file id in a message.
24
24
  *
25
- * Files uploaded that way are listed by search-attachments. Renaming or removing one does not change
26
- * the conversations that already use it; downloading keeps working.
25
+ * Files the person attached are listed by search-files. Renaming or removing one does not change
26
+ * the conversations that already use it; downloading keeps working. Files the assistant hands over
27
+ * are artifacts: they appear on the tool call that created them and are listed by list-artifacts.
27
28
  * OpenAPI spec version: 2.0.0
28
29
  */
29
30
  import * as zod from "zod";
@@ -20,10 +20,11 @@
20
20
  * outlines the person's messages for navigating a long conversation.
21
21
  *
22
22
  * Upload large files with /api/v1/uploads: read /api/v1/upload-configuration first, send exact-sized
23
- * parts, then complete the upload and send its attachment id in a message.
23
+ * parts, then complete the upload and send its file id in a message.
24
24
  *
25
- * Files uploaded that way are listed by search-attachments. Renaming or removing one does not change
26
- * the conversations that already use it; downloading keeps working.
25
+ * Files the person attached are listed by search-files. Renaming or removing one does not change
26
+ * the conversations that already use it; downloading keeps working. Files the assistant hands over
27
+ * are artifacts: they appear on the tool call that created them and are listed by list-artifacts.
27
28
  * OpenAPI spec version: 2.0.0
28
29
  */
29
30
  import * as zod from "zod";
@@ -20,10 +20,11 @@
20
20
  * outlines the person's messages for navigating a long conversation.
21
21
  *
22
22
  * Upload large files with /api/v1/uploads: read /api/v1/upload-configuration first, send exact-sized
23
- * parts, then complete the upload and send its attachment id in a message.
23
+ * parts, then complete the upload and send its file id in a message.
24
24
  *
25
- * Files uploaded that way are listed by search-attachments. Renaming or removing one does not change
26
- * the conversations that already use it; downloading keeps working.
25
+ * Files the person attached are listed by search-files. Renaming or removing one does not change
26
+ * the conversations that already use it; downloading keeps working. Files the assistant hands over
27
+ * are artifacts: they appear on the tool call that created them and are listed by list-artifacts.
27
28
  * OpenAPI spec version: 2.0.0
28
29
  */
29
30
  import * as zod from "zod";
@@ -20,10 +20,11 @@
20
20
  * outlines the person's messages for navigating a long conversation.
21
21
  *
22
22
  * Upload large files with /api/v1/uploads: read /api/v1/upload-configuration first, send exact-sized
23
- * parts, then complete the upload and send its attachment id in a message.
23
+ * parts, then complete the upload and send its file id in a message.
24
24
  *
25
- * Files uploaded that way are listed by search-attachments. Renaming or removing one does not change
26
- * the conversations that already use it; downloading keeps working.
25
+ * Files the person attached are listed by search-files. Renaming or removing one does not change
26
+ * the conversations that already use it; downloading keeps working. Files the assistant hands over
27
+ * are artifacts: they appear on the tool call that created them and are listed by list-artifacts.
27
28
  * OpenAPI spec version: 2.0.0
28
29
  */
29
30
  import * as zod from "zod";
@@ -20,10 +20,11 @@
20
20
  * outlines the person's messages for navigating a long conversation.
21
21
  *
22
22
  * Upload large files with /api/v1/uploads: read /api/v1/upload-configuration first, send exact-sized
23
- * parts, then complete the upload and send its attachment id in a message.
23
+ * parts, then complete the upload and send its file id in a message.
24
24
  *
25
- * Files uploaded that way are listed by search-attachments. Renaming or removing one does not change
26
- * the conversations that already use it; downloading keeps working.
25
+ * Files the person attached are listed by search-files. Renaming or removing one does not change
26
+ * the conversations that already use it; downloading keeps working. Files the assistant hands over
27
+ * are artifacts: they appear on the tool call that created them and are listed by list-artifacts.
27
28
  * OpenAPI spec version: 2.0.0
28
29
  */
29
30
  import * as zod from "zod";
@@ -20,10 +20,11 @@
20
20
  * outlines the person's messages for navigating a long conversation.
21
21
  *
22
22
  * Upload large files with /api/v1/uploads: read /api/v1/upload-configuration first, send exact-sized
23
- * parts, then complete the upload and send its attachment id in a message.
23
+ * parts, then complete the upload and send its file id in a message.
24
24
  *
25
- * Files uploaded that way are listed by search-attachments. Renaming or removing one does not change
26
- * the conversations that already use it; downloading keeps working.
25
+ * Files the person attached are listed by search-files. Renaming or removing one does not change
26
+ * the conversations that already use it; downloading keeps working. Files the assistant hands over
27
+ * are artifacts: they appear on the tool call that created them and are listed by list-artifacts.
27
28
  * OpenAPI spec version: 2.0.0
28
29
  */
29
30
  import * as zod from "zod";
@@ -38,13 +38,85 @@
38
38
  * - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates Billing holds for each model's `billing`.
39
39
  * OpenAPI spec version: 1.0.0
40
40
  */
41
- import type { APIKeyResource, APIKeyUsageListResponseBody, ChatCompletion, ChatCompletionRequest, ConflictResponse, CreateAPIKeyRequestBody, CreateServiceRequestBody, CreateServiceResponseBody, CursorPageRequestResource, EmbeddingRequest, EmbeddingResponse, Error, GetUsageSummaryParams, GetUsageTimelineParams, InferenceError, IssuedAPIKeyResource, LengthAwarePageAPIKeyResource, ListApiKeysParams, ListRequestsParams, ListUsageByApiKeyParams, ListUsageByModelParams, Model, ModelList, ModelListResponseBody, ModelResource, ModelUsageListResponseBody, NativeRequest, NativeResponse, RequestResource, ResponseCreate, ResponseDeleted, ResponseResource, ServiceResource, StreamGenerateContentParams, TotalsResource, UpdateAPIKeyRequestBody, UsageTimelineResponseBody } from "./models.js";
41
+ import type { APIKeyResource, APIKeyUsageListResponseBody, ChatCompletion, ChatCompletionRequest, ConflictResponse, CreateAPIKeyRequestBody, CreateServiceRequestBody, CreateServiceResponseBody, CursorPageRequestResource, EmbeddingRequest, EmbeddingResponse, Error, GetUsageSummaryParams, GetUsageTimelineParams, GetVideoContentHeaders, InferenceError, IssuedAPIKeyResource, LengthAwarePageAPIKeyResource, ListApiKeysParams, ListRequestsParams, ListUsageByApiKeyParams, ListUsageByModelParams, Model, ModelList, ModelListResponseBody, ModelResource, ModelUsageListResponseBody, NativeRequest, NativeResponse, RequestResource, ResponseCreate, ResponseDeleted, ResponseResource, ServiceResource, StreamGenerateContentParams, TotalsResource, UpdateAPIKeyRequestBody, UsageTimelineResponseBody, VideoCreateRequest, VideoTask } from "./models.js";
42
42
  export type HTTPStatusCode1xx = 100 | 101 | 102 | 103;
43
43
  export type HTTPStatusCode2xx = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207;
44
44
  export type HTTPStatusCode3xx = 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308;
45
45
  export type HTTPStatusCode4xx = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 426 | 428 | 429 | 431 | 451;
46
46
  export type HTTPStatusCode5xx = 500 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
47
47
  export type HTTPStatusCodes = HTTPStatusCode1xx | HTTPStatusCode2xx | HTTPStatusCode3xx | HTTPStatusCode4xx | HTTPStatusCode5xx;
48
+ export type createVideoResponse200 = {
49
+ data: VideoTask;
50
+ status: 200;
51
+ };
52
+ export type createVideoResponseDefault = {
53
+ data: InferenceError;
54
+ status: Exclude<HTTPStatusCodes, 200>;
55
+ };
56
+ export type createVideoResponseSuccess = createVideoResponse200 & {
57
+ headers: Headers;
58
+ };
59
+ export type createVideoResponseError = createVideoResponseDefault & {
60
+ headers: Headers;
61
+ };
62
+ export type createVideoResponse = createVideoResponseSuccess | createVideoResponseError;
63
+ export declare const getCreateVideoUrl: () => string;
64
+ /**
65
+ * Create an asynchronous video task in the verified project. Model and upstream support
66
+ * determine the accepted duration, resolution and references. Poll the returned task id.
67
+ * `reference_media` is a Canopy extension for ordered, typed image, video and audio URLs.
68
+ * Existing `input_reference` remains a first frame.
69
+ * The runtime also accepts OpenAI multipart uploads; send reference_media as a JSON text field.
70
+ * No remote reference is downloaded or retained by Canopy during request preparation.
71
+ * @summary Create a video
72
+ */
73
+ export declare const createVideo: (videoCreateRequest: VideoCreateRequest, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<createVideoResponse>;
74
+ export type getVideoResponse200 = {
75
+ data: VideoTask;
76
+ status: 200;
77
+ };
78
+ export type getVideoResponseDefault = {
79
+ data: InferenceError;
80
+ status: Exclude<HTTPStatusCodes, 200>;
81
+ };
82
+ export type getVideoResponseSuccess = getVideoResponse200 & {
83
+ headers: Headers;
84
+ };
85
+ export type getVideoResponseError = getVideoResponseDefault & {
86
+ headers: Headers;
87
+ };
88
+ export type getVideoResponse = getVideoResponseSuccess | getVideoResponseError;
89
+ export declare const getGetVideoUrl: (video: string) => string;
90
+ /**
91
+ * Read an existing task owned by the verified project; does not create another video.
92
+ * @summary Get a video task
93
+ */
94
+ export declare const getVideo: (video: string, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<getVideoResponse>;
95
+ export type getVideoContentResponse200 = {
96
+ data: Blob;
97
+ status: 200;
98
+ };
99
+ export type getVideoContentResponse206 = {
100
+ data: Blob;
101
+ status: 206;
102
+ };
103
+ export type getVideoContentResponseDefault = {
104
+ data: InferenceError;
105
+ status: Exclude<HTTPStatusCodes, 200 | 206>;
106
+ };
107
+ export type getVideoContentResponseSuccess = (getVideoContentResponse200 | getVideoContentResponse206) & {
108
+ headers: Headers;
109
+ };
110
+ export type getVideoContentResponseError = getVideoContentResponseDefault & {
111
+ headers: Headers;
112
+ };
113
+ export type getVideoContentResponse = getVideoContentResponseSuccess | getVideoContentResponseError;
114
+ export declare const getGetVideoContentUrl: (video: string) => string;
115
+ /**
116
+ * Stream a completed video owned by the verified project. Supports HTTP Range.
117
+ * @summary Get generated video content
118
+ */
119
+ export declare const getVideoContent: (video: string, headers?: GetVideoContentHeaders, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<getVideoContentResponse>;
48
120
  export type createResponseResponse200ApplicationJson = {
49
121
  data: ResponseResource;
50
122
  status: 200;
@@ -1,3 +1,93 @@
1
+ export const getCreateVideoUrl = () => {
2
+ return `https://canopy.leaflow.cloud/v1/videos`;
3
+ };
4
+ /**
5
+ * Create an asynchronous video task in the verified project. Model and upstream support
6
+ * determine the accepted duration, resolution and references. Poll the returned task id.
7
+ * `reference_media` is a Canopy extension for ordered, typed image, video and audio URLs.
8
+ * Existing `input_reference` remains a first frame.
9
+ * The runtime also accepts OpenAI multipart uploads; send reference_media as a JSON text field.
10
+ * No remote reference is downloaded or retained by Canopy during request preparation.
11
+ * @summary Create a video
12
+ */
13
+ export const createVideo = async (videoCreateRequest, options, fetchFn) => {
14
+ const getHeaders = (h) => {
15
+ if (!h)
16
+ return {};
17
+ if (h instanceof Headers)
18
+ return Object.fromEntries(h.entries());
19
+ if (Symbol.iterator in h) {
20
+ return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
21
+ }
22
+ const headers = {};
23
+ for (const [name, value] of Object.entries(h)) {
24
+ if (value !== undefined)
25
+ headers[name] = value;
26
+ }
27
+ return headers;
28
+ };
29
+ const res = await (fetchFn ?? fetch)(getCreateVideoUrl(), {
30
+ ...options,
31
+ method: "POST",
32
+ headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
33
+ body: JSON.stringify(videoCreateRequest),
34
+ });
35
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
36
+ const data = body ? JSON.parse(body) : {};
37
+ return { data, status: res.status, headers: res.headers };
38
+ };
39
+ export const getGetVideoUrl = (video) => {
40
+ return `https://canopy.leaflow.cloud/v1/videos/${encodeURIComponent(String(video))}`;
41
+ };
42
+ /**
43
+ * Read an existing task owned by the verified project; does not create another video.
44
+ * @summary Get a video task
45
+ */
46
+ export const getVideo = async (video, options, fetchFn) => {
47
+ const res = await (fetchFn ?? fetch)(getGetVideoUrl(video), {
48
+ ...options,
49
+ method: "GET",
50
+ });
51
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
52
+ const data = body ? JSON.parse(body) : {};
53
+ return { data, status: res.status, headers: res.headers };
54
+ };
55
+ export const getGetVideoContentUrl = (video) => {
56
+ return `https://canopy.leaflow.cloud/v1/videos/${encodeURIComponent(String(video))}/content`;
57
+ };
58
+ /**
59
+ * Stream a completed video owned by the verified project. Supports HTTP Range.
60
+ * @summary Get generated video content
61
+ */
62
+ export const getVideoContent = async (video, headers, options, fetchFn) => {
63
+ const getHeaders = (h) => {
64
+ if (!h)
65
+ return {};
66
+ if (h instanceof Headers)
67
+ return Object.fromEntries(h.entries());
68
+ if (Symbol.iterator in h) {
69
+ return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
70
+ }
71
+ const headers = {};
72
+ for (const [name, value] of Object.entries(h)) {
73
+ if (value !== undefined)
74
+ headers[name] = value;
75
+ }
76
+ return headers;
77
+ };
78
+ const res = await (fetchFn ?? fetch)(getGetVideoContentUrl(video), {
79
+ ...options,
80
+ method: "GET",
81
+ headers: { ...headers, ...getHeaders(options?.headers) },
82
+ });
83
+ const body = [204, 205, 304].includes(res.status)
84
+ ? null
85
+ : res.headers.get("content-type")?.includes("application/json")
86
+ ? JSON.parse(await res.text())
87
+ : await res.blob();
88
+ const data = body;
89
+ return { data, status: res.status, headers: res.headers };
90
+ };
1
91
  export const getCreateResponseUrl = () => {
2
92
  return `https://canopy.leaflow.cloud/v1/responses`;
3
93
  };
@@ -27,11 +117,7 @@ export const createResponse = async (responseCreate, options, fetchFn) => {
27
117
  headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
28
118
  body: JSON.stringify(responseCreate),
29
119
  });
30
- const body = [204, 205, 304].includes(res.status)
31
- ? null
32
- : res.headers.get("content-type")?.includes("application/json")
33
- ? JSON.parse(await res.text())
34
- : await res.blob();
120
+ const body = [204, 205, 304].includes(res.status) ? null : res.headers.get("content-type")?.includes("application/json") ? JSON.parse(await res.text()) : await res.blob();
35
121
  const data = body;
36
122
  return { data, status: res.status, headers: res.headers };
37
123
  };
@@ -94,7 +180,7 @@ export const createChatCompletion = async (chatCompletionRequest, options, fetch
94
180
  headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
95
181
  body: JSON.stringify(chatCompletionRequest),
96
182
  });
97
- const body = [204, 205, 304].includes(res.status) ? null : res.headers.get("content-type")?.includes("application/json") ? JSON.parse(await res.text()) : await res.blob();
183
+ const body = [204, 205, 304].includes(res.status) ? null : await res.blob();
98
184
  const data = body;
99
185
  return { data, status: res.status, headers: res.headers };
100
186
  };
@@ -637,6 +637,36 @@ export interface MediaUsage {
637
637
  export interface ModelListResponseBody {
638
638
  items: ModelResource[];
639
639
  }
640
+ export type MediaUsageDetailsReferenceCounts = {
641
+ [key: string]: number;
642
+ };
643
+ /**
644
+ * Per-request media measurements. Omitted values are unknown, not zero.
645
+ * Reference counts are audit data, not an additional billable quantity.
646
+ * video_quantity is the exact decimal quantity for the existing video_seconds
647
+ * meter; video_seconds in the summary remains a rounded compatibility counter.
648
+ * No monetary price or refund is calculated by Canopy.
649
+ */
650
+ export interface MediaUsageDetails {
651
+ /** @minimum 0 */
652
+ input_video_seconds?: number;
653
+ /** @minimum 0 */
654
+ output_video_seconds?: number;
655
+ /** @minimum 0 */
656
+ input_audio_seconds?: number;
657
+ /**
658
+ * Recorded input quantity for the input_images meter, independent of its Billing price. Absent when unmeasured or not separately metered.
659
+ * @pattern ^[0-9]+$
660
+ */
661
+ input_image_quantity?: string;
662
+ /** @minimum 0 */
663
+ input_images?: number;
664
+ /** @minimum 0 */
665
+ output_images?: number;
666
+ /** @pattern ^[0-9]+([.][0-9]+)?$ */
667
+ video_quantity?: string;
668
+ reference_counts?: MediaUsageDetailsReferenceCounts;
669
+ }
640
670
  export type RequestResourceStatus = (typeof RequestResourceStatus)[keyof typeof RequestResourceStatus];
641
671
  export declare const RequestResourceStatus: {
642
672
  readonly in_flight: "in_flight";
@@ -716,6 +746,7 @@ export interface RequestResource {
716
746
  reasoning: ReasoningDiagnostics | null;
717
747
  /** Media quantities and their rate dimensions. Null for a token-only request. */
718
748
  media?: MediaUsage | null;
749
+ media_details?: MediaUsageDetails;
719
750
  }
720
751
  export interface CursorPageRequestResource {
721
752
  /** The items in this page */
@@ -987,6 +1018,120 @@ export interface CreateServiceResponseBody {
987
1018
  */
988
1019
  order_id: string | null;
989
1020
  }
1021
+ export type VideoReferenceMediaType = (typeof VideoReferenceMediaType)[keyof typeof VideoReferenceMediaType];
1022
+ export declare const VideoReferenceMediaType: {
1023
+ readonly first_frame: "first_frame";
1024
+ readonly last_frame: "last_frame";
1025
+ readonly reference_image: "reference_image";
1026
+ readonly reference_video: "reference_video";
1027
+ readonly reference_audio: "reference_audio";
1028
+ };
1029
+ /**
1030
+ * A typed reference asset. Order is preserved, including order within each media type.
1031
+ * Wan 3.0 accepts at most one first frame, one last frame, ten reference images,
1032
+ * five reference videos and five reference audio clips. A last frame needs a first frame.
1033
+ * First/last frames cannot be combined with reference_image, reference_video or reference_audio.
1034
+ * Reference images, videos and audio may be combined. Other models can accept fewer roles.
1035
+ * Images accept public HTTP(S) or base64 image data URLs. Video and audio accept public
1036
+ * HTTP(S) URLs only. Wan 3.0 limits reference videos and audio to 1-15 seconds each and
1037
+ * 15 seconds total per media type; input video plus output duration must not exceed 30 seconds.
1038
+ * The upstream validates remote asset size, format and duration. Canopy does not fetch them.
1039
+ */
1040
+ export interface VideoReferenceMedia {
1041
+ type: VideoReferenceMediaType;
1042
+ /** @minLength 1 */
1043
+ url: string;
1044
+ }
1045
+ /**
1046
+ * Provide a prompt, reference media, or both. Extra fields depend on the selected model and adapter.
1047
+ */
1048
+ export interface VideoCreateRequest {
1049
+ /** @minLength 1 */
1050
+ model: string;
1051
+ prompt?: string;
1052
+ /** @minimum 1 */
1053
+ seconds?: number;
1054
+ size?: string;
1055
+ resolution?: string;
1056
+ /**
1057
+ * Backward-compatible first-frame image URL. May be combined with a last_frame, not another first_frame.
1058
+ * @minLength 1
1059
+ */
1060
+ input_reference?: string;
1061
+ /**
1062
+ * @minItems 1
1063
+ * @maxItems 20
1064
+ */
1065
+ reference_media?: VideoReferenceMedia[];
1066
+ /** Whether the output has audio; separate from a reference_audio input. */
1067
+ audio?: boolean;
1068
+ prompt_extend?: boolean;
1069
+ watermark?: boolean;
1070
+ seed?: number;
1071
+ negative_prompt?: string;
1072
+ [key: string]: unknown;
1073
+ }
1074
+ /**
1075
+ * Provider measurements on a task; only completed tasks are settled.
1076
+ */
1077
+ export interface VideoUsage {
1078
+ /**
1079
+ * Output duration, kept for compatibility.
1080
+ * @minimum 0
1081
+ */
1082
+ seconds?: number;
1083
+ resolution?: string;
1084
+ /** @minimum 0 */
1085
+ input_seconds?: number;
1086
+ /** @minimum 0 */
1087
+ output_seconds?: number;
1088
+ /**
1089
+ * Total measured input and output video duration, not a monetary quote.
1090
+ * @minimum 0
1091
+ */
1092
+ billable_seconds?: number;
1093
+ [key: string]: unknown;
1094
+ }
1095
+ export type VideoTaskStatus = (typeof VideoTaskStatus)[keyof typeof VideoTaskStatus];
1096
+ export declare const VideoTaskStatus: {
1097
+ readonly queued: "queued";
1098
+ readonly in_progress: "in_progress";
1099
+ readonly completed: "completed";
1100
+ readonly failed: "failed";
1101
+ };
1102
+ export type VideoTaskError = {
1103
+ code?: string;
1104
+ message?: string;
1105
+ [key: string]: unknown;
1106
+ };
1107
+ export interface VideoTask {
1108
+ id: string;
1109
+ object: string;
1110
+ status: VideoTaskStatus;
1111
+ model?: string;
1112
+ usage?: VideoUsage;
1113
+ /** Output duration, not the duration of input references. */
1114
+ seconds?: string;
1115
+ size?: string;
1116
+ created_at?: number;
1117
+ completed_at?: number;
1118
+ expires_at?: number;
1119
+ progress?: number;
1120
+ error?: VideoTaskError;
1121
+ [key: string]: unknown;
1122
+ }
1123
+ /**
1124
+ * A request body in the endpoint's own protocol. Canopy reads only the model name and forwards the rest unchanged.
1125
+ */
1126
+ export interface NativeRequest {
1127
+ [key: string]: unknown;
1128
+ }
1129
+ /**
1130
+ * A response body in the endpoint's own protocol, as the upstream returned it.
1131
+ */
1132
+ export interface NativeResponse {
1133
+ [key: string]: unknown;
1134
+ }
990
1135
  export type ResponseCreateReasoning = {
991
1136
  [key: string]: unknown;
992
1137
  };
@@ -1019,18 +1164,6 @@ export interface ResponseDeleted {
1019
1164
  object: string;
1020
1165
  deleted: boolean;
1021
1166
  }
1022
- /**
1023
- * A request body in the endpoint's own protocol. Canopy reads only the model name and forwards the rest unchanged.
1024
- */
1025
- export interface NativeRequest {
1026
- [key: string]: unknown;
1027
- }
1028
- /**
1029
- * A response body in the endpoint's own protocol, as the upstream returned it.
1030
- */
1031
- export interface NativeResponse {
1032
- [key: string]: unknown;
1033
- }
1034
1167
  /**
1035
1168
  * Pagination metadata for stable numbered pages. total_count is returned only when the operation can determine it without an unbounded scan.
1036
1169
  */
@@ -1055,6 +1188,9 @@ export interface CursorPagination {
1055
1188
  * The request conflicts with the current state of the service. The codes are described where they apply.
1056
1189
  */
1057
1190
  export type ConflictResponse = Error;
1191
+ export type GetVideoContentHeaders = {
1192
+ Range?: string;
1193
+ };
1058
1194
  export type StreamGenerateContentParams = {
1059
1195
  alt?: StreamGenerateContentAlt;
1060
1196
  };