sarvam-agents-client 0.1.2 → 0.2.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 (298) hide show
  1. package/README.md +15 -0
  2. package/dist/apis/AgentConversationsApi.d.ts +44 -1
  3. package/dist/apis/AgentConversationsApi.js +104 -1
  4. package/dist/apis/AgentsApi.d.ts +77 -5
  5. package/dist/apis/AgentsApi.js +163 -5
  6. package/dist/apis/AppsApi.d.ts +43 -1
  7. package/dist/apis/AppsApi.js +108 -0
  8. package/dist/apis/ArtifactsApi.d.ts +31 -1
  9. package/dist/apis/ArtifactsApi.js +82 -0
  10. package/dist/apis/CustomAPIsApi.d.ts +124 -0
  11. package/dist/apis/CustomAPIsApi.js +305 -0
  12. package/dist/apis/ModelsApi.d.ts +26 -0
  13. package/dist/apis/ModelsApi.js +52 -0
  14. package/dist/apis/index.d.ts +2 -0
  15. package/dist/apis/index.js +2 -0
  16. package/dist/compose/agent.d.ts +40 -0
  17. package/dist/compose/agent.js +191 -0
  18. package/dist/compose/deploy.d.ts +30 -0
  19. package/dist/compose/deploy.js +146 -0
  20. package/dist/compose/errors.d.ts +48 -0
  21. package/dist/compose/errors.js +68 -0
  22. package/dist/compose/events.d.ts +63 -0
  23. package/dist/compose/events.js +100 -0
  24. package/dist/compose/fingerprint.d.ts +6 -0
  25. package/dist/compose/fingerprint.js +83 -0
  26. package/dist/compose/index.d.ts +13 -0
  27. package/dist/compose/index.js +33 -0
  28. package/dist/compose/run.d.ts +100 -0
  29. package/dist/compose/run.js +536 -0
  30. package/dist/compose/runState.d.ts +26 -0
  31. package/dist/compose/runState.js +79 -0
  32. package/dist/compose/settingsTransport.d.ts +24 -0
  33. package/dist/compose/settingsTransport.js +280 -0
  34. package/dist/compose/tools.d.ts +17 -0
  35. package/dist/compose/tools.js +29 -0
  36. package/dist/compose/transport.d.ts +34 -0
  37. package/dist/compose/transport.js +2 -0
  38. package/dist/esm/apis/AgentConversationsApi.d.ts +44 -1
  39. package/dist/esm/apis/AgentConversationsApi.js +104 -1
  40. package/dist/esm/apis/AgentsApi.d.ts +77 -5
  41. package/dist/esm/apis/AgentsApi.js +163 -5
  42. package/dist/esm/apis/AppsApi.d.ts +43 -1
  43. package/dist/esm/apis/AppsApi.js +109 -1
  44. package/dist/esm/apis/ArtifactsApi.d.ts +31 -1
  45. package/dist/esm/apis/ArtifactsApi.js +83 -1
  46. package/dist/esm/apis/CustomAPIsApi.d.ts +124 -0
  47. package/dist/esm/apis/CustomAPIsApi.js +301 -0
  48. package/dist/esm/apis/ModelsApi.d.ts +26 -0
  49. package/dist/esm/apis/ModelsApi.js +48 -0
  50. package/dist/esm/apis/index.d.ts +2 -0
  51. package/dist/esm/apis/index.js +2 -0
  52. package/dist/esm/compose/agent.d.ts +40 -0
  53. package/dist/esm/compose/agent.js +187 -0
  54. package/dist/esm/compose/deploy.d.ts +30 -0
  55. package/dist/esm/compose/deploy.js +137 -0
  56. package/dist/esm/compose/errors.d.ts +48 -0
  57. package/dist/esm/compose/errors.js +53 -0
  58. package/dist/esm/compose/events.d.ts +63 -0
  59. package/dist/esm/compose/events.js +97 -0
  60. package/dist/esm/compose/fingerprint.d.ts +6 -0
  61. package/dist/esm/compose/fingerprint.js +78 -0
  62. package/dist/esm/compose/index.d.ts +13 -0
  63. package/dist/esm/compose/index.js +8 -0
  64. package/dist/esm/compose/run.d.ts +100 -0
  65. package/dist/esm/compose/run.js +530 -0
  66. package/dist/esm/compose/runState.d.ts +26 -0
  67. package/dist/esm/compose/runState.js +75 -0
  68. package/dist/esm/compose/settingsTransport.d.ts +24 -0
  69. package/dist/esm/compose/settingsTransport.js +276 -0
  70. package/dist/esm/compose/tools.d.ts +17 -0
  71. package/dist/esm/compose/tools.js +19 -0
  72. package/dist/esm/compose/transport.d.ts +34 -0
  73. package/dist/esm/compose/transport.js +1 -0
  74. package/dist/esm/models/AgentChannelRef.d.ts +1 -0
  75. package/dist/esm/models/AgentChannelRef.js +2 -1
  76. package/dist/esm/models/AgentConversationDetail.d.ts +15 -2
  77. package/dist/esm/models/AgentConversationDetail.js +6 -4
  78. package/dist/esm/models/AgentConversationView.d.ts +11 -5
  79. package/dist/esm/models/AgentConversationView.js +4 -4
  80. package/dist/esm/models/AgentCreate.d.ts +8 -0
  81. package/dist/esm/models/AgentCreate.js +2 -0
  82. package/dist/esm/models/AgentCustomApiList.d.ts +33 -0
  83. package/dist/esm/models/AgentCustomApiList.js +44 -0
  84. package/dist/esm/models/AgentResource.d.ts +14 -0
  85. package/dist/esm/models/AgentResource.js +4 -0
  86. package/dist/esm/models/AgentSettingsResponse.d.ts +53 -0
  87. package/dist/esm/models/AgentSettingsResponse.js +52 -0
  88. package/dist/esm/models/AgentUpdate.d.ts +8 -0
  89. package/dist/esm/models/AgentUpdate.js +2 -0
  90. package/dist/esm/models/AppAccountView.d.ts +88 -0
  91. package/dist/esm/models/AppAccountView.js +79 -0
  92. package/dist/esm/models/AppAccountsView.d.ts +66 -0
  93. package/dist/esm/models/AppAccountsView.js +60 -0
  94. package/dist/esm/models/AppResource.d.ts +36 -0
  95. package/dist/esm/models/AppResource.js +12 -0
  96. package/dist/esm/models/AppResourceCheckView.d.ts +74 -0
  97. package/dist/esm/models/AppResourceCheckView.js +63 -0
  98. package/dist/esm/models/AppResourceView.d.ts +68 -0
  99. package/dist/esm/models/AppResourceView.js +67 -0
  100. package/dist/esm/models/AppResourcesView.d.ts +54 -0
  101. package/dist/esm/models/AppResourcesView.js +56 -0
  102. package/dist/esm/models/AppToolsResponse.d.ts +14 -0
  103. package/dist/esm/models/AppToolsResponse.js +4 -0
  104. package/dist/esm/models/AppView.d.ts +42 -0
  105. package/dist/esm/models/AppView.js +14 -0
  106. package/dist/esm/models/ArtifactVersionResponse.d.ts +94 -0
  107. package/dist/esm/models/ArtifactVersionResponse.js +80 -0
  108. package/dist/esm/models/AttachedAgent.d.ts +44 -0
  109. package/dist/esm/models/AttachedAgent.js +49 -0
  110. package/dist/esm/models/Auth.d.ts +30 -0
  111. package/dist/esm/models/Auth.js +52 -0
  112. package/dist/esm/models/BindCustomApiBody.d.ts +32 -0
  113. package/dist/esm/models/BindCustomApiBody.js +43 -0
  114. package/dist/esm/models/ConversationArtifact.d.ts +14 -0
  115. package/dist/esm/models/ConversationArtifact.js +9 -0
  116. package/dist/esm/models/CustomApi.d.ts +102 -0
  117. package/dist/esm/models/CustomApi.js +90 -0
  118. package/dist/esm/models/CustomApiBasicAuth.d.ts +51 -0
  119. package/dist/esm/models/CustomApiBasicAuth.js +57 -0
  120. package/dist/esm/models/CustomApiBearerAuth.d.ts +45 -0
  121. package/dist/esm/models/CustomApiBearerAuth.js +53 -0
  122. package/dist/esm/models/CustomApiCreate.d.ts +57 -0
  123. package/dist/esm/models/CustomApiCreate.js +56 -0
  124. package/dist/esm/models/CustomApiHeader.d.ts +44 -0
  125. package/dist/esm/models/CustomApiHeader.js +47 -0
  126. package/dist/esm/models/CustomApiHeadersAuth.d.ts +46 -0
  127. package/dist/esm/models/CustomApiHeadersAuth.js +54 -0
  128. package/dist/esm/models/CustomApiList.d.ts +64 -0
  129. package/dist/esm/models/CustomApiList.js +64 -0
  130. package/dist/esm/models/CustomApiName.d.ts +44 -0
  131. package/dist/esm/models/CustomApiName.js +49 -0
  132. package/dist/esm/models/CustomApiUpdate.d.ts +58 -0
  133. package/dist/esm/models/CustomApiUpdate.js +50 -0
  134. package/dist/esm/models/CustomApiUpdateAuth.d.ts +30 -0
  135. package/dist/esm/models/CustomApiUpdateAuth.js +52 -0
  136. package/dist/esm/models/ErrorDetailItem.d.ts +5 -0
  137. package/dist/esm/models/ListModels403Response.d.ts +23 -0
  138. package/dist/esm/models/ListModels403Response.js +45 -0
  139. package/dist/esm/models/ModelEndpointView.d.ts +38 -0
  140. package/dist/esm/models/ModelEndpointView.js +45 -0
  141. package/dist/esm/models/ModelView.d.ts +69 -0
  142. package/dist/esm/models/ModelView.js +56 -0
  143. package/dist/esm/models/ModelsResponse.d.ts +33 -0
  144. package/dist/esm/models/ModelsResponse.js +44 -0
  145. package/dist/esm/models/SettingsIssueView.d.ts +44 -0
  146. package/dist/esm/models/SettingsIssueView.js +51 -0
  147. package/dist/esm/models/VersionCommitBody.d.ts +44 -0
  148. package/dist/esm/models/VersionCommitBody.js +51 -0
  149. package/dist/esm/models/VersionUploadUrlBody.d.ts +32 -0
  150. package/dist/esm/models/VersionUploadUrlBody.js +43 -0
  151. package/dist/esm/models/index.d.ts +28 -0
  152. package/dist/esm/models/index.js +28 -0
  153. package/dist/models/AgentChannelRef.d.ts +1 -0
  154. package/dist/models/AgentChannelRef.js +2 -1
  155. package/dist/models/AgentConversationDetail.d.ts +15 -2
  156. package/dist/models/AgentConversationDetail.js +6 -4
  157. package/dist/models/AgentConversationView.d.ts +11 -5
  158. package/dist/models/AgentConversationView.js +4 -4
  159. package/dist/models/AgentCreate.d.ts +8 -0
  160. package/dist/models/AgentCreate.js +2 -0
  161. package/dist/models/AgentCustomApiList.d.ts +33 -0
  162. package/dist/models/AgentCustomApiList.js +51 -0
  163. package/dist/models/AgentResource.d.ts +14 -0
  164. package/dist/models/AgentResource.js +4 -0
  165. package/dist/models/AgentSettingsResponse.d.ts +53 -0
  166. package/dist/models/AgentSettingsResponse.js +59 -0
  167. package/dist/models/AgentUpdate.d.ts +8 -0
  168. package/dist/models/AgentUpdate.js +2 -0
  169. package/dist/models/AppAccountView.d.ts +88 -0
  170. package/dist/models/AppAccountView.js +87 -0
  171. package/dist/models/AppAccountsView.d.ts +66 -0
  172. package/dist/models/AppAccountsView.js +68 -0
  173. package/dist/models/AppResource.d.ts +36 -0
  174. package/dist/models/AppResource.js +12 -0
  175. package/dist/models/AppResourceCheckView.d.ts +74 -0
  176. package/dist/models/AppResourceCheckView.js +71 -0
  177. package/dist/models/AppResourceView.d.ts +68 -0
  178. package/dist/models/AppResourceView.js +74 -0
  179. package/dist/models/AppResourcesView.d.ts +54 -0
  180. package/dist/models/AppResourcesView.js +64 -0
  181. package/dist/models/AppToolsResponse.d.ts +14 -0
  182. package/dist/models/AppToolsResponse.js +4 -0
  183. package/dist/models/AppView.d.ts +42 -0
  184. package/dist/models/AppView.js +14 -0
  185. package/dist/models/ArtifactVersionResponse.d.ts +94 -0
  186. package/dist/models/ArtifactVersionResponse.js +88 -0
  187. package/dist/models/AttachedAgent.d.ts +44 -0
  188. package/dist/models/AttachedAgent.js +56 -0
  189. package/dist/models/Auth.d.ts +30 -0
  190. package/dist/models/Auth.js +58 -0
  191. package/dist/models/BindCustomApiBody.d.ts +32 -0
  192. package/dist/models/BindCustomApiBody.js +50 -0
  193. package/dist/models/ConversationArtifact.d.ts +14 -0
  194. package/dist/models/ConversationArtifact.js +10 -0
  195. package/dist/models/CustomApi.d.ts +102 -0
  196. package/dist/models/CustomApi.js +98 -0
  197. package/dist/models/CustomApiBasicAuth.d.ts +51 -0
  198. package/dist/models/CustomApiBasicAuth.js +65 -0
  199. package/dist/models/CustomApiBearerAuth.d.ts +45 -0
  200. package/dist/models/CustomApiBearerAuth.js +61 -0
  201. package/dist/models/CustomApiCreate.d.ts +57 -0
  202. package/dist/models/CustomApiCreate.js +63 -0
  203. package/dist/models/CustomApiHeader.d.ts +44 -0
  204. package/dist/models/CustomApiHeader.js +54 -0
  205. package/dist/models/CustomApiHeadersAuth.d.ts +46 -0
  206. package/dist/models/CustomApiHeadersAuth.js +62 -0
  207. package/dist/models/CustomApiList.d.ts +64 -0
  208. package/dist/models/CustomApiList.js +71 -0
  209. package/dist/models/CustomApiName.d.ts +44 -0
  210. package/dist/models/CustomApiName.js +56 -0
  211. package/dist/models/CustomApiUpdate.d.ts +58 -0
  212. package/dist/models/CustomApiUpdate.js +57 -0
  213. package/dist/models/CustomApiUpdateAuth.d.ts +30 -0
  214. package/dist/models/CustomApiUpdateAuth.js +58 -0
  215. package/dist/models/ErrorDetailItem.d.ts +5 -0
  216. package/dist/models/ListModels403Response.d.ts +23 -0
  217. package/dist/models/ListModels403Response.js +51 -0
  218. package/dist/models/ModelEndpointView.d.ts +38 -0
  219. package/dist/models/ModelEndpointView.js +52 -0
  220. package/dist/models/ModelView.d.ts +69 -0
  221. package/dist/models/ModelView.js +63 -0
  222. package/dist/models/ModelsResponse.d.ts +33 -0
  223. package/dist/models/ModelsResponse.js +51 -0
  224. package/dist/models/SettingsIssueView.d.ts +44 -0
  225. package/dist/models/SettingsIssueView.js +58 -0
  226. package/dist/models/VersionCommitBody.d.ts +44 -0
  227. package/dist/models/VersionCommitBody.js +58 -0
  228. package/dist/models/VersionUploadUrlBody.d.ts +32 -0
  229. package/dist/models/VersionUploadUrlBody.js +50 -0
  230. package/dist/models/index.d.ts +28 -0
  231. package/dist/models/index.js +28 -0
  232. package/package.json +15 -2
  233. package/src/apis/AgentConversationsApi.ts +172 -3
  234. package/src/apis/AgentsApi.ts +242 -7
  235. package/src/apis/AppsApi.ts +174 -3
  236. package/src/apis/ArtifactsApi.ts +144 -0
  237. package/src/apis/ClarifyApi.ts +3 -3
  238. package/src/apis/CollectionsApi.ts +3 -3
  239. package/src/apis/ConversationsApi.ts +3 -3
  240. package/src/apis/CronsApi.ts +3 -3
  241. package/src/apis/CustomAPIsApi.ts +471 -0
  242. package/src/apis/MessagesApi.ts +3 -3
  243. package/src/apis/ModelsApi.ts +70 -0
  244. package/src/apis/QueueApi.ts +3 -3
  245. package/src/apis/ResponsesApi.ts +3 -3
  246. package/src/apis/SkillsApi.ts +3 -3
  247. package/src/apis/index.ts +2 -0
  248. package/src/compose/agent.ts +223 -0
  249. package/src/compose/deploy.ts +168 -0
  250. package/src/compose/errors.ts +66 -0
  251. package/src/compose/events.ts +122 -0
  252. package/src/compose/fingerprint.ts +74 -0
  253. package/src/compose/index.ts +13 -0
  254. package/src/compose/run.ts +601 -0
  255. package/src/compose/runState.ts +95 -0
  256. package/src/compose/settingsTransport.ts +299 -0
  257. package/src/compose/tools.ts +27 -0
  258. package/src/compose/transport.ts +48 -0
  259. package/src/models/AgentChannelRef.ts +2 -1
  260. package/src/models/AgentConversationDetail.ts +21 -5
  261. package/src/models/AgentConversationView.ts +15 -8
  262. package/src/models/AgentCreate.ts +8 -0
  263. package/src/models/AgentCustomApiList.ts +74 -0
  264. package/src/models/AgentResource.ts +16 -0
  265. package/src/models/AgentSettingsResponse.ts +99 -0
  266. package/src/models/AgentUpdate.ts +8 -0
  267. package/src/models/AppAccountView.ts +143 -0
  268. package/src/models/AppAccountsView.ts +118 -0
  269. package/src/models/AppResource.ts +48 -0
  270. package/src/models/AppResourceCheckView.ts +117 -0
  271. package/src/models/AppResourceView.ts +120 -0
  272. package/src/models/AppResourcesView.ts +102 -0
  273. package/src/models/AppToolsResponse.ts +16 -0
  274. package/src/models/AppView.ts +56 -0
  275. package/src/models/ArtifactVersionResponse.ts +155 -0
  276. package/src/models/AttachedAgent.ts +83 -0
  277. package/src/models/Auth.ts +84 -0
  278. package/src/models/BindCustomApiBody.ts +66 -0
  279. package/src/models/ConversationArtifact.ts +19 -0
  280. package/src/models/CustomApi.ts +175 -0
  281. package/src/models/CustomApiBasicAuth.ts +94 -0
  282. package/src/models/CustomApiBearerAuth.ts +85 -0
  283. package/src/models/CustomApiCreate.ts +108 -0
  284. package/src/models/CustomApiHeader.ts +82 -0
  285. package/src/models/CustomApiHeadersAuth.ts +93 -0
  286. package/src/models/CustomApiList.ts +120 -0
  287. package/src/models/CustomApiName.ts +83 -0
  288. package/src/models/CustomApiUpdate.ts +106 -0
  289. package/src/models/CustomApiUpdateAuth.ts +84 -0
  290. package/src/models/ErrorDetailItem.ts +5 -0
  291. package/src/models/ListModels403Response.ts +73 -0
  292. package/src/models/ModelEndpointView.ts +74 -0
  293. package/src/models/ModelView.ts +122 -0
  294. package/src/models/ModelsResponse.ts +74 -0
  295. package/src/models/SettingsIssueView.ts +84 -0
  296. package/src/models/VersionCommitBody.ts +84 -0
  297. package/src/models/VersionUploadUrlBody.ts +66 -0
  298. package/src/models/index.ts +28 -0
@@ -10,10 +10,15 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime.js';
13
- import type { ArtifactResponse, CommitBody, ConversationArtifactsResponse, DownloadUrlResponse, ExportBody, ExportResponse, UploadUrlBody, UploadUrlResponse } from '../models/index.js';
13
+ import type { ArtifactResponse, ArtifactVersionResponse, CommitBody, ConversationArtifactsResponse, DownloadUrlResponse, ExportBody, ExportResponse, UploadUrlBody, UploadUrlResponse, VersionCommitBody, VersionUploadUrlBody } from '../models/index.js';
14
14
  export interface CommitArtifactRequest {
15
15
  commitBody: CommitBody;
16
16
  }
17
+ export interface CommitVersionRequest {
18
+ conversationId: string;
19
+ artifactId: string;
20
+ versionCommitBody: VersionCommitBody;
21
+ }
17
22
  export interface DeleteArtifactRequest {
18
23
  conversationId: string;
19
24
  artifactId: string;
@@ -35,6 +40,11 @@ export interface ListConversationArtifactsRequest {
35
40
  export interface MintUploadUrlRequest {
36
41
  uploadUrlBody: UploadUrlBody;
37
42
  }
43
+ export interface MintVersionUploadUrlRequest {
44
+ conversationId: string;
45
+ artifactId: string;
46
+ versionUploadUrlBody: VersionUploadUrlBody;
47
+ }
38
48
  /**
39
49
  *
40
50
  */
@@ -47,6 +57,16 @@ export declare class ArtifactsApi extends runtime.BaseAPI {
47
57
  * Commit Artifact Route
48
58
  */
49
59
  commitArtifact(requestParameters: CommitArtifactRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ArtifactResponse>;
60
+ /**
61
+ * Save a staged edit of ``artifact_id`` as the next version of the same file. Writes no message: the new version reaches clients through the artifact list (``GET /v1/conversations/:id/artifacts``) and the agent through ``/scratch/saved/<name>``.
62
+ * Commit Version Route
63
+ */
64
+ commitVersionRaw(requestParameters: CommitVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ArtifactVersionResponse>>;
65
+ /**
66
+ * Save a staged edit of ``artifact_id`` as the next version of the same file. Writes no message: the new version reaches clients through the artifact list (``GET /v1/conversations/:id/artifacts``) and the agent through ``/scratch/saved/<name>``.
67
+ * Commit Version Route
68
+ */
69
+ commitVersion(requestParameters: CommitVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ArtifactVersionResponse>;
50
70
  /**
51
71
  * Detach a file the user removed from a composer before sending. Uploads commit on attach, so a removed chip would otherwise leave a committed artifact nobody references: invisible in the UI (both panes derive from messages) but real in storage, and never TTL\'d because user uploads are PERSISTENT. The gateway hard-deletes the blob and soft-deletes the row. ``conversation_id`` is an ownership gate, not artifact scoping: the gateway authorizes on ``(tenant_id, owner_user_id)`` and never checks that the artifact belongs to this conversation. That is sound because a caller can only ever delete artifacts they uploaded themselves, but it does mean this route will happily delete a caller\'s artifact via any conversation they own. Deleting the file also withdraws every link to it. The share rows would otherwise outlive the blob: the viewer\'s resolve already fails safe (the gateway 404s on a soft-deleted artefact, and the public route answers 404), but the **owner** would keep seeing live links in their share dialog for a file that no longer exists, and could re-scope or copy one. This is the only writer of ``revoked_reason = \'artifact_deleted\'``, which is what distinguishes \"the file went away\" from \"someone unshared it\" in an audit.
52
72
  * Delete Artifact Route
@@ -93,6 +113,16 @@ export declare class ArtifactsApi extends runtime.BaseAPI {
93
113
  * Mint Upload Url Route
94
114
  */
95
115
  mintUploadUrl(requestParameters: MintUploadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadUrlResponse>;
116
+ /**
117
+ * Presign the PUT for a user\'s edit of ``artifact_id``, saved as its next version. ``artifact_id`` is the version the client edited. 409 ``CHAT_CONFLICT`` (``details[0].latest_artifact_id`` / ``latest_version``) when a newer one has landed; 422 when the artifact has no version chain (uploads, exports).
118
+ * Mint Version Upload Url Route
119
+ */
120
+ mintVersionUploadUrlRaw(requestParameters: MintVersionUploadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadUrlResponse>>;
121
+ /**
122
+ * Presign the PUT for a user\'s edit of ``artifact_id``, saved as its next version. ``artifact_id`` is the version the client edited. 409 ``CHAT_CONFLICT`` (``details[0].latest_artifact_id`` / ``latest_version``) when a newer one has landed; 422 when the artifact has no version chain (uploads, exports).
123
+ * Mint Version Upload Url Route
124
+ */
125
+ mintVersionUploadUrl(requestParameters: MintVersionUploadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadUrlResponse>;
96
126
  }
97
127
  /**
98
128
  * @export
@@ -12,7 +12,7 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  import * as runtime from '../runtime.js';
15
- import { ArtifactResponseFromJSON, CommitBodyToJSON, ConversationArtifactsResponseFromJSON, DownloadUrlResponseFromJSON, ExportBodyToJSON, ExportResponseFromJSON, UploadUrlBodyToJSON, UploadUrlResponseFromJSON, } from '../models/index.js';
15
+ import { ArtifactResponseFromJSON, ArtifactVersionResponseFromJSON, CommitBodyToJSON, ConversationArtifactsResponseFromJSON, DownloadUrlResponseFromJSON, ExportBodyToJSON, ExportResponseFromJSON, UploadUrlBodyToJSON, UploadUrlResponseFromJSON, VersionCommitBodyToJSON, VersionUploadUrlBodyToJSON, } from '../models/index.js';
16
16
  /**
17
17
  *
18
18
  */
@@ -50,6 +50,47 @@ export class ArtifactsApi extends runtime.BaseAPI {
50
50
  const response = await this.commitArtifactRaw(requestParameters, initOverrides);
51
51
  return await response.value();
52
52
  }
53
+ /**
54
+ * Save a staged edit of ``artifact_id`` as the next version of the same file. Writes no message: the new version reaches clients through the artifact list (``GET /v1/conversations/:id/artifacts``) and the agent through ``/scratch/saved/<name>``.
55
+ * Commit Version Route
56
+ */
57
+ async commitVersionRaw(requestParameters, initOverrides) {
58
+ if (requestParameters['conversationId'] == null) {
59
+ throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling commitVersion().');
60
+ }
61
+ if (requestParameters['artifactId'] == null) {
62
+ throw new runtime.RequiredError('artifactId', 'Required parameter "artifactId" was null or undefined when calling commitVersion().');
63
+ }
64
+ if (requestParameters['versionCommitBody'] == null) {
65
+ throw new runtime.RequiredError('versionCommitBody', 'Required parameter "versionCommitBody" was null or undefined when calling commitVersion().');
66
+ }
67
+ const queryParameters = {};
68
+ const headerParameters = {};
69
+ headerParameters['Content-Type'] = 'application/json';
70
+ if (this.configuration && this.configuration.accessToken) {
71
+ const token = this.configuration.accessToken;
72
+ const tokenString = await token("bearerAuth", []);
73
+ if (tokenString) {
74
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
75
+ }
76
+ }
77
+ const response = await this.request({
78
+ path: `/v1/conversations/{conversationId}/artifacts/{artifactId}/versions`.replace(`{${"conversationId"}}`, runtime.encodePathParam('conversationId', requestParameters['conversationId'])).replace(`{${"artifactId"}}`, runtime.encodePathParam('artifactId', requestParameters['artifactId'])),
79
+ method: 'POST',
80
+ headers: headerParameters,
81
+ query: queryParameters,
82
+ body: VersionCommitBodyToJSON(requestParameters['versionCommitBody']),
83
+ }, initOverrides);
84
+ return new runtime.JSONApiResponse(response, (jsonValue) => ArtifactVersionResponseFromJSON(jsonValue));
85
+ }
86
+ /**
87
+ * Save a staged edit of ``artifact_id`` as the next version of the same file. Writes no message: the new version reaches clients through the artifact list (``GET /v1/conversations/:id/artifacts``) and the agent through ``/scratch/saved/<name>``.
88
+ * Commit Version Route
89
+ */
90
+ async commitVersion(requestParameters, initOverrides) {
91
+ const response = await this.commitVersionRaw(requestParameters, initOverrides);
92
+ return await response.value();
93
+ }
53
94
  /**
54
95
  * Detach a file the user removed from a composer before sending. Uploads commit on attach, so a removed chip would otherwise leave a committed artifact nobody references: invisible in the UI (both panes derive from messages) but real in storage, and never TTL\'d because user uploads are PERSISTENT. The gateway hard-deletes the blob and soft-deletes the row. ``conversation_id`` is an ownership gate, not artifact scoping: the gateway authorizes on ``(tenant_id, owner_user_id)`` and never checks that the artifact belongs to this conversation. That is sound because a caller can only ever delete artifacts they uploaded themselves, but it does mean this route will happily delete a caller\'s artifact via any conversation they own. Deleting the file also withdraws every link to it. The share rows would otherwise outlive the blob: the viewer\'s resolve already fails safe (the gateway 404s on a soft-deleted artefact, and the public route answers 404), but the **owner** would keep seeing live links in their share dialog for a file that no longer exists, and could re-scope or copy one. This is the only writer of ``revoked_reason = \'artifact_deleted\'``, which is what distinguishes \"the file went away\" from \"someone unshared it\" in an audit.
55
96
  * Delete Artifact Route
@@ -232,6 +273,47 @@ export class ArtifactsApi extends runtime.BaseAPI {
232
273
  const response = await this.mintUploadUrlRaw(requestParameters, initOverrides);
233
274
  return await response.value();
234
275
  }
276
+ /**
277
+ * Presign the PUT for a user\'s edit of ``artifact_id``, saved as its next version. ``artifact_id`` is the version the client edited. 409 ``CHAT_CONFLICT`` (``details[0].latest_artifact_id`` / ``latest_version``) when a newer one has landed; 422 when the artifact has no version chain (uploads, exports).
278
+ * Mint Version Upload Url Route
279
+ */
280
+ async mintVersionUploadUrlRaw(requestParameters, initOverrides) {
281
+ if (requestParameters['conversationId'] == null) {
282
+ throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling mintVersionUploadUrl().');
283
+ }
284
+ if (requestParameters['artifactId'] == null) {
285
+ throw new runtime.RequiredError('artifactId', 'Required parameter "artifactId" was null or undefined when calling mintVersionUploadUrl().');
286
+ }
287
+ if (requestParameters['versionUploadUrlBody'] == null) {
288
+ throw new runtime.RequiredError('versionUploadUrlBody', 'Required parameter "versionUploadUrlBody" was null or undefined when calling mintVersionUploadUrl().');
289
+ }
290
+ const queryParameters = {};
291
+ const headerParameters = {};
292
+ headerParameters['Content-Type'] = 'application/json';
293
+ if (this.configuration && this.configuration.accessToken) {
294
+ const token = this.configuration.accessToken;
295
+ const tokenString = await token("bearerAuth", []);
296
+ if (tokenString) {
297
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
298
+ }
299
+ }
300
+ const response = await this.request({
301
+ path: `/v1/conversations/{conversationId}/artifacts/{artifactId}/versions/upload-url`.replace(`{${"conversationId"}}`, runtime.encodePathParam('conversationId', requestParameters['conversationId'])).replace(`{${"artifactId"}}`, runtime.encodePathParam('artifactId', requestParameters['artifactId'])),
302
+ method: 'POST',
303
+ headers: headerParameters,
304
+ query: queryParameters,
305
+ body: VersionUploadUrlBodyToJSON(requestParameters['versionUploadUrlBody']),
306
+ }, initOverrides);
307
+ return new runtime.JSONApiResponse(response, (jsonValue) => UploadUrlResponseFromJSON(jsonValue));
308
+ }
309
+ /**
310
+ * Presign the PUT for a user\'s edit of ``artifact_id``, saved as its next version. ``artifact_id`` is the version the client edited. 409 ``CHAT_CONFLICT`` (``details[0].latest_artifact_id`` / ``latest_version``) when a newer one has landed; 422 when the artifact has no version chain (uploads, exports).
311
+ * Mint Version Upload Url Route
312
+ */
313
+ async mintVersionUploadUrl(requestParameters, initOverrides) {
314
+ const response = await this.mintVersionUploadUrlRaw(requestParameters, initOverrides);
315
+ return await response.value();
316
+ }
235
317
  }
236
318
  /**
237
319
  * @export
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Sarvam Agents API
3
+ * Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ * Contact: support@sarvam.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime.js';
13
+ import type { AgentCustomApiList, BindCustomApiBody, CustomApi, CustomApiCreate, CustomApiList, CustomApiUpdate, Scope } from '../models/index.js';
14
+ export interface BindCustomApiRequest {
15
+ agentId: string;
16
+ bindCustomApiBody: BindCustomApiBody;
17
+ }
18
+ export interface CreateCustomApiRequest {
19
+ customApiCreate: CustomApiCreate;
20
+ }
21
+ export interface DeleteCustomApiRequest {
22
+ customApiId: string;
23
+ }
24
+ export interface GetCustomApiRequest {
25
+ customApiId: string;
26
+ }
27
+ export interface ListAgentCustomApisRequest {
28
+ agentId: string;
29
+ }
30
+ export interface ListCustomApisRequest {
31
+ scope?: Scope | null;
32
+ q?: string | null;
33
+ limit?: number;
34
+ offset?: number;
35
+ }
36
+ export interface UnbindCustomApiRequest {
37
+ agentId: string;
38
+ customApiId: string;
39
+ }
40
+ export interface UpdateCustomApiRequest {
41
+ customApiId: string;
42
+ customApiUpdate: CustomApiUpdate;
43
+ }
44
+ /**
45
+ *
46
+ */
47
+ export declare class CustomAPIsApi extends runtime.BaseAPI {
48
+ /**
49
+ * Attach one of the caller\'s own Custom APIs to an agent they own.
50
+ * Bind Custom Api
51
+ */
52
+ bindCustomApiRaw(requestParameters: BindCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
53
+ /**
54
+ * Attach one of the caller\'s own Custom APIs to an agent they own.
55
+ * Bind Custom Api
56
+ */
57
+ bindCustomApi(requestParameters: BindCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
58
+ /**
59
+ * Create a Custom API; with ``enabledForChats`` (default) it is also attached to the caller\'s personal chats. Never attached to other agents. If that attach hits the personal-chat rules, the API is still saved, disabled, with ``enabledForChatsError`` saying why.
60
+ * Create Custom Api
61
+ */
62
+ createCustomApiRaw(requestParameters: CreateCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomApi>>;
63
+ /**
64
+ * Create a Custom API; with ``enabledForChats`` (default) it is also attached to the caller\'s personal chats. Never attached to other agents. If that attach hits the personal-chat rules, the API is still saved, disabled, with ``enabledForChatsError`` saying why.
65
+ * Create Custom Api
66
+ */
67
+ createCustomApi(requestParameters: CreateCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomApi>;
68
+ /**
69
+ * Delete the API and every attachment (agents and personal chats).
70
+ * Delete Custom Api
71
+ */
72
+ deleteCustomApiRaw(requestParameters: DeleteCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
73
+ /**
74
+ * Delete the API and every attachment (agents and personal chats).
75
+ * Delete Custom Api
76
+ */
77
+ deleteCustomApi(requestParameters: DeleteCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
78
+ /**
79
+ * Get Custom Api
80
+ */
81
+ getCustomApiRaw(requestParameters: GetCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomApi>>;
82
+ /**
83
+ * Get Custom Api
84
+ */
85
+ getCustomApi(requestParameters: GetCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomApi>;
86
+ /**
87
+ * Names of the Custom APIs attached to an agent — for any viewer of it. The host is filled only for the caller\'s own APIs.
88
+ * List Agent Custom Apis
89
+ */
90
+ listAgentCustomApisRaw(requestParameters: ListAgentCustomApisRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentCustomApiList>>;
91
+ /**
92
+ * Names of the Custom APIs attached to an agent — for any viewer of it. The host is filled only for the caller\'s own APIs.
93
+ * List Agent Custom Apis
94
+ */
95
+ listAgentCustomApis(requestParameters: ListAgentCustomApisRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentCustomApiList>;
96
+ /**
97
+ * The caller\'s own Custom APIs, newest first. ``q`` matches name, description or host; ``scope`` is ignored (the list is owner-only).
98
+ * List Custom Apis
99
+ */
100
+ listCustomApisRaw(requestParameters: ListCustomApisRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomApiList>>;
101
+ /**
102
+ * The caller\'s own Custom APIs, newest first. ``q`` matches name, description or host; ``scope`` is ignored (the list is owner-only).
103
+ * List Custom Apis
104
+ */
105
+ listCustomApis(requestParameters?: ListCustomApisRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomApiList>;
106
+ /**
107
+ * Unbind Custom Api
108
+ */
109
+ unbindCustomApiRaw(requestParameters: UnbindCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
110
+ /**
111
+ * Unbind Custom Api
112
+ */
113
+ unbindCustomApi(requestParameters: UnbindCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
114
+ /**
115
+ * Edit details and/or replace credentials. Attachments are kept.
116
+ * Update Custom Api
117
+ */
118
+ updateCustomApiRaw(requestParameters: UpdateCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomApi>>;
119
+ /**
120
+ * Edit details and/or replace credentials. Attachments are kept.
121
+ * Update Custom Api
122
+ */
123
+ updateCustomApi(requestParameters: UpdateCustomApiRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomApi>;
124
+ }
@@ -0,0 +1,301 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Sarvam Agents API
5
+ * Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ * Contact: support@sarvam.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ import * as runtime from '../runtime.js';
15
+ import { AgentCustomApiListFromJSON, BindCustomApiBodyToJSON, CustomApiFromJSON, CustomApiCreateToJSON, CustomApiListFromJSON, CustomApiUpdateToJSON, } from '../models/index.js';
16
+ /**
17
+ *
18
+ */
19
+ export class CustomAPIsApi extends runtime.BaseAPI {
20
+ /**
21
+ * Attach one of the caller\'s own Custom APIs to an agent they own.
22
+ * Bind Custom Api
23
+ */
24
+ async bindCustomApiRaw(requestParameters, initOverrides) {
25
+ if (requestParameters['agentId'] == null) {
26
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling bindCustomApi().');
27
+ }
28
+ if (requestParameters['bindCustomApiBody'] == null) {
29
+ throw new runtime.RequiredError('bindCustomApiBody', 'Required parameter "bindCustomApiBody" was null or undefined when calling bindCustomApi().');
30
+ }
31
+ const queryParameters = {};
32
+ const headerParameters = {};
33
+ headerParameters['Content-Type'] = 'application/json';
34
+ if (this.configuration && this.configuration.accessToken) {
35
+ const token = this.configuration.accessToken;
36
+ const tokenString = await token("bearerAuth", []);
37
+ if (tokenString) {
38
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
39
+ }
40
+ }
41
+ const response = await this.request({
42
+ path: `/v1/agents/{agentId}/custom-apis`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])),
43
+ method: 'POST',
44
+ headers: headerParameters,
45
+ query: queryParameters,
46
+ body: BindCustomApiBodyToJSON(requestParameters['bindCustomApiBody']),
47
+ }, initOverrides);
48
+ return new runtime.VoidApiResponse(response);
49
+ }
50
+ /**
51
+ * Attach one of the caller\'s own Custom APIs to an agent they own.
52
+ * Bind Custom Api
53
+ */
54
+ async bindCustomApi(requestParameters, initOverrides) {
55
+ await this.bindCustomApiRaw(requestParameters, initOverrides);
56
+ }
57
+ /**
58
+ * Create a Custom API; with ``enabledForChats`` (default) it is also attached to the caller\'s personal chats. Never attached to other agents. If that attach hits the personal-chat rules, the API is still saved, disabled, with ``enabledForChatsError`` saying why.
59
+ * Create Custom Api
60
+ */
61
+ async createCustomApiRaw(requestParameters, initOverrides) {
62
+ if (requestParameters['customApiCreate'] == null) {
63
+ throw new runtime.RequiredError('customApiCreate', 'Required parameter "customApiCreate" was null or undefined when calling createCustomApi().');
64
+ }
65
+ const queryParameters = {};
66
+ const headerParameters = {};
67
+ headerParameters['Content-Type'] = 'application/json';
68
+ if (this.configuration && this.configuration.accessToken) {
69
+ const token = this.configuration.accessToken;
70
+ const tokenString = await token("bearerAuth", []);
71
+ if (tokenString) {
72
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
73
+ }
74
+ }
75
+ const response = await this.request({
76
+ path: `/v2/custom-apis`,
77
+ method: 'POST',
78
+ headers: headerParameters,
79
+ query: queryParameters,
80
+ body: CustomApiCreateToJSON(requestParameters['customApiCreate']),
81
+ }, initOverrides);
82
+ return new runtime.JSONApiResponse(response, (jsonValue) => CustomApiFromJSON(jsonValue));
83
+ }
84
+ /**
85
+ * Create a Custom API; with ``enabledForChats`` (default) it is also attached to the caller\'s personal chats. Never attached to other agents. If that attach hits the personal-chat rules, the API is still saved, disabled, with ``enabledForChatsError`` saying why.
86
+ * Create Custom Api
87
+ */
88
+ async createCustomApi(requestParameters, initOverrides) {
89
+ const response = await this.createCustomApiRaw(requestParameters, initOverrides);
90
+ return await response.value();
91
+ }
92
+ /**
93
+ * Delete the API and every attachment (agents and personal chats).
94
+ * Delete Custom Api
95
+ */
96
+ async deleteCustomApiRaw(requestParameters, initOverrides) {
97
+ if (requestParameters['customApiId'] == null) {
98
+ throw new runtime.RequiredError('customApiId', 'Required parameter "customApiId" was null or undefined when calling deleteCustomApi().');
99
+ }
100
+ const queryParameters = {};
101
+ const headerParameters = {};
102
+ if (this.configuration && this.configuration.accessToken) {
103
+ const token = this.configuration.accessToken;
104
+ const tokenString = await token("bearerAuth", []);
105
+ if (tokenString) {
106
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
107
+ }
108
+ }
109
+ const response = await this.request({
110
+ path: `/v2/custom-apis/{customApiId}`.replace(`{${"customApiId"}}`, runtime.encodePathParam('customApiId', requestParameters['customApiId'])),
111
+ method: 'DELETE',
112
+ headers: headerParameters,
113
+ query: queryParameters,
114
+ }, initOverrides);
115
+ return new runtime.VoidApiResponse(response);
116
+ }
117
+ /**
118
+ * Delete the API and every attachment (agents and personal chats).
119
+ * Delete Custom Api
120
+ */
121
+ async deleteCustomApi(requestParameters, initOverrides) {
122
+ await this.deleteCustomApiRaw(requestParameters, initOverrides);
123
+ }
124
+ /**
125
+ * Get Custom Api
126
+ */
127
+ async getCustomApiRaw(requestParameters, initOverrides) {
128
+ if (requestParameters['customApiId'] == null) {
129
+ throw new runtime.RequiredError('customApiId', 'Required parameter "customApiId" was null or undefined when calling getCustomApi().');
130
+ }
131
+ const queryParameters = {};
132
+ const headerParameters = {};
133
+ if (this.configuration && this.configuration.accessToken) {
134
+ const token = this.configuration.accessToken;
135
+ const tokenString = await token("bearerAuth", []);
136
+ if (tokenString) {
137
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
138
+ }
139
+ }
140
+ const response = await this.request({
141
+ path: `/v2/custom-apis/{customApiId}`.replace(`{${"customApiId"}}`, runtime.encodePathParam('customApiId', requestParameters['customApiId'])),
142
+ method: 'GET',
143
+ headers: headerParameters,
144
+ query: queryParameters,
145
+ }, initOverrides);
146
+ return new runtime.JSONApiResponse(response, (jsonValue) => CustomApiFromJSON(jsonValue));
147
+ }
148
+ /**
149
+ * Get Custom Api
150
+ */
151
+ async getCustomApi(requestParameters, initOverrides) {
152
+ const response = await this.getCustomApiRaw(requestParameters, initOverrides);
153
+ return await response.value();
154
+ }
155
+ /**
156
+ * Names of the Custom APIs attached to an agent — for any viewer of it. The host is filled only for the caller\'s own APIs.
157
+ * List Agent Custom Apis
158
+ */
159
+ async listAgentCustomApisRaw(requestParameters, initOverrides) {
160
+ if (requestParameters['agentId'] == null) {
161
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling listAgentCustomApis().');
162
+ }
163
+ const queryParameters = {};
164
+ const headerParameters = {};
165
+ if (this.configuration && this.configuration.accessToken) {
166
+ const token = this.configuration.accessToken;
167
+ const tokenString = await token("bearerAuth", []);
168
+ if (tokenString) {
169
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
170
+ }
171
+ }
172
+ const response = await this.request({
173
+ path: `/v1/agents/{agentId}/custom-apis`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])),
174
+ method: 'GET',
175
+ headers: headerParameters,
176
+ query: queryParameters,
177
+ }, initOverrides);
178
+ return new runtime.JSONApiResponse(response, (jsonValue) => AgentCustomApiListFromJSON(jsonValue));
179
+ }
180
+ /**
181
+ * Names of the Custom APIs attached to an agent — for any viewer of it. The host is filled only for the caller\'s own APIs.
182
+ * List Agent Custom Apis
183
+ */
184
+ async listAgentCustomApis(requestParameters, initOverrides) {
185
+ const response = await this.listAgentCustomApisRaw(requestParameters, initOverrides);
186
+ return await response.value();
187
+ }
188
+ /**
189
+ * The caller\'s own Custom APIs, newest first. ``q`` matches name, description or host; ``scope`` is ignored (the list is owner-only).
190
+ * List Custom Apis
191
+ */
192
+ async listCustomApisRaw(requestParameters, initOverrides) {
193
+ const queryParameters = {};
194
+ if (requestParameters['scope'] != null) {
195
+ queryParameters['scope'] = requestParameters['scope'];
196
+ }
197
+ if (requestParameters['q'] != null) {
198
+ queryParameters['q'] = requestParameters['q'];
199
+ }
200
+ if (requestParameters['limit'] != null) {
201
+ queryParameters['limit'] = requestParameters['limit'];
202
+ }
203
+ if (requestParameters['offset'] != null) {
204
+ queryParameters['offset'] = requestParameters['offset'];
205
+ }
206
+ const headerParameters = {};
207
+ if (this.configuration && this.configuration.accessToken) {
208
+ const token = this.configuration.accessToken;
209
+ const tokenString = await token("bearerAuth", []);
210
+ if (tokenString) {
211
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
212
+ }
213
+ }
214
+ const response = await this.request({
215
+ path: `/v2/custom-apis`,
216
+ method: 'GET',
217
+ headers: headerParameters,
218
+ query: queryParameters,
219
+ }, initOverrides);
220
+ return new runtime.JSONApiResponse(response, (jsonValue) => CustomApiListFromJSON(jsonValue));
221
+ }
222
+ /**
223
+ * The caller\'s own Custom APIs, newest first. ``q`` matches name, description or host; ``scope`` is ignored (the list is owner-only).
224
+ * List Custom Apis
225
+ */
226
+ async listCustomApis(requestParameters = {}, initOverrides) {
227
+ const response = await this.listCustomApisRaw(requestParameters, initOverrides);
228
+ return await response.value();
229
+ }
230
+ /**
231
+ * Unbind Custom Api
232
+ */
233
+ async unbindCustomApiRaw(requestParameters, initOverrides) {
234
+ if (requestParameters['agentId'] == null) {
235
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling unbindCustomApi().');
236
+ }
237
+ if (requestParameters['customApiId'] == null) {
238
+ throw new runtime.RequiredError('customApiId', 'Required parameter "customApiId" was null or undefined when calling unbindCustomApi().');
239
+ }
240
+ const queryParameters = {};
241
+ const headerParameters = {};
242
+ if (this.configuration && this.configuration.accessToken) {
243
+ const token = this.configuration.accessToken;
244
+ const tokenString = await token("bearerAuth", []);
245
+ if (tokenString) {
246
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
247
+ }
248
+ }
249
+ const response = await this.request({
250
+ path: `/v1/agents/{agentId}/custom-apis/{customApiId}`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"customApiId"}}`, runtime.encodePathParam('customApiId', requestParameters['customApiId'])),
251
+ method: 'DELETE',
252
+ headers: headerParameters,
253
+ query: queryParameters,
254
+ }, initOverrides);
255
+ return new runtime.VoidApiResponse(response);
256
+ }
257
+ /**
258
+ * Unbind Custom Api
259
+ */
260
+ async unbindCustomApi(requestParameters, initOverrides) {
261
+ await this.unbindCustomApiRaw(requestParameters, initOverrides);
262
+ }
263
+ /**
264
+ * Edit details and/or replace credentials. Attachments are kept.
265
+ * Update Custom Api
266
+ */
267
+ async updateCustomApiRaw(requestParameters, initOverrides) {
268
+ if (requestParameters['customApiId'] == null) {
269
+ throw new runtime.RequiredError('customApiId', 'Required parameter "customApiId" was null or undefined when calling updateCustomApi().');
270
+ }
271
+ if (requestParameters['customApiUpdate'] == null) {
272
+ throw new runtime.RequiredError('customApiUpdate', 'Required parameter "customApiUpdate" was null or undefined when calling updateCustomApi().');
273
+ }
274
+ const queryParameters = {};
275
+ const headerParameters = {};
276
+ headerParameters['Content-Type'] = 'application/json';
277
+ if (this.configuration && this.configuration.accessToken) {
278
+ const token = this.configuration.accessToken;
279
+ const tokenString = await token("bearerAuth", []);
280
+ if (tokenString) {
281
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
282
+ }
283
+ }
284
+ const response = await this.request({
285
+ path: `/v2/custom-apis/{customApiId}`.replace(`{${"customApiId"}}`, runtime.encodePathParam('customApiId', requestParameters['customApiId'])),
286
+ method: 'PATCH',
287
+ headers: headerParameters,
288
+ query: queryParameters,
289
+ body: CustomApiUpdateToJSON(requestParameters['customApiUpdate']),
290
+ }, initOverrides);
291
+ return new runtime.JSONApiResponse(response, (jsonValue) => CustomApiFromJSON(jsonValue));
292
+ }
293
+ /**
294
+ * Edit details and/or replace credentials. Attachments are kept.
295
+ * Update Custom Api
296
+ */
297
+ async updateCustomApi(requestParameters, initOverrides) {
298
+ const response = await this.updateCustomApiRaw(requestParameters, initOverrides);
299
+ return await response.value();
300
+ }
301
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Sarvam Agents API
3
+ * Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ * Contact: support@sarvam.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime.js';
13
+ import type { ModelsResponse } from '../models/index.js';
14
+ /**
15
+ *
16
+ */
17
+ export declare class ModelsApi extends runtime.BaseAPI {
18
+ /**
19
+ * List Models
20
+ */
21
+ listModelsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelsResponse>>;
22
+ /**
23
+ * List Models
24
+ */
25
+ listModels(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelsResponse>;
26
+ }