sarvam-agents-client 0.1.2 → 0.2.1

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 (303) 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 +44 -0
  17. package/dist/compose/agent.js +222 -0
  18. package/dist/compose/builtins.d.ts +4 -0
  19. package/dist/compose/builtins.js +22 -0
  20. package/dist/compose/deploy.d.ts +30 -0
  21. package/dist/compose/deploy.js +146 -0
  22. package/dist/compose/errors.d.ts +48 -0
  23. package/dist/compose/errors.js +68 -0
  24. package/dist/compose/events.d.ts +63 -0
  25. package/dist/compose/events.js +100 -0
  26. package/dist/compose/fingerprint.d.ts +6 -0
  27. package/dist/compose/fingerprint.js +83 -0
  28. package/dist/compose/index.d.ts +13 -0
  29. package/dist/compose/index.js +33 -0
  30. package/dist/compose/run.d.ts +100 -0
  31. package/dist/compose/run.js +536 -0
  32. package/dist/compose/runState.d.ts +26 -0
  33. package/dist/compose/runState.js +79 -0
  34. package/dist/compose/settingsTransport.d.ts +24 -0
  35. package/dist/compose/settingsTransport.js +280 -0
  36. package/dist/compose/tools.d.ts +17 -0
  37. package/dist/compose/tools.js +44 -0
  38. package/dist/compose/transport.d.ts +34 -0
  39. package/dist/compose/transport.js +2 -0
  40. package/dist/esm/apis/AgentConversationsApi.d.ts +44 -1
  41. package/dist/esm/apis/AgentConversationsApi.js +104 -1
  42. package/dist/esm/apis/AgentsApi.d.ts +77 -5
  43. package/dist/esm/apis/AgentsApi.js +163 -5
  44. package/dist/esm/apis/AppsApi.d.ts +43 -1
  45. package/dist/esm/apis/AppsApi.js +109 -1
  46. package/dist/esm/apis/ArtifactsApi.d.ts +31 -1
  47. package/dist/esm/apis/ArtifactsApi.js +83 -1
  48. package/dist/esm/apis/CustomAPIsApi.d.ts +124 -0
  49. package/dist/esm/apis/CustomAPIsApi.js +301 -0
  50. package/dist/esm/apis/ModelsApi.d.ts +26 -0
  51. package/dist/esm/apis/ModelsApi.js +48 -0
  52. package/dist/esm/apis/index.d.ts +2 -0
  53. package/dist/esm/apis/index.js +2 -0
  54. package/dist/esm/compose/agent.d.ts +44 -0
  55. package/dist/esm/compose/agent.js +218 -0
  56. package/dist/esm/compose/builtins.d.ts +4 -0
  57. package/dist/esm/compose/builtins.js +18 -0
  58. package/dist/esm/compose/deploy.d.ts +30 -0
  59. package/dist/esm/compose/deploy.js +137 -0
  60. package/dist/esm/compose/errors.d.ts +48 -0
  61. package/dist/esm/compose/errors.js +53 -0
  62. package/dist/esm/compose/events.d.ts +63 -0
  63. package/dist/esm/compose/events.js +97 -0
  64. package/dist/esm/compose/fingerprint.d.ts +6 -0
  65. package/dist/esm/compose/fingerprint.js +78 -0
  66. package/dist/esm/compose/index.d.ts +13 -0
  67. package/dist/esm/compose/index.js +8 -0
  68. package/dist/esm/compose/run.d.ts +100 -0
  69. package/dist/esm/compose/run.js +530 -0
  70. package/dist/esm/compose/runState.d.ts +26 -0
  71. package/dist/esm/compose/runState.js +75 -0
  72. package/dist/esm/compose/settingsTransport.d.ts +24 -0
  73. package/dist/esm/compose/settingsTransport.js +276 -0
  74. package/dist/esm/compose/tools.d.ts +17 -0
  75. package/dist/esm/compose/tools.js +34 -0
  76. package/dist/esm/compose/transport.d.ts +34 -0
  77. package/dist/esm/compose/transport.js +1 -0
  78. package/dist/esm/models/AgentChannelRef.d.ts +1 -0
  79. package/dist/esm/models/AgentChannelRef.js +2 -1
  80. package/dist/esm/models/AgentConversationDetail.d.ts +15 -2
  81. package/dist/esm/models/AgentConversationDetail.js +6 -4
  82. package/dist/esm/models/AgentConversationView.d.ts +11 -5
  83. package/dist/esm/models/AgentConversationView.js +4 -4
  84. package/dist/esm/models/AgentCreate.d.ts +8 -0
  85. package/dist/esm/models/AgentCreate.js +2 -0
  86. package/dist/esm/models/AgentCustomApiList.d.ts +33 -0
  87. package/dist/esm/models/AgentCustomApiList.js +44 -0
  88. package/dist/esm/models/AgentResource.d.ts +14 -0
  89. package/dist/esm/models/AgentResource.js +4 -0
  90. package/dist/esm/models/AgentSettingsResponse.d.ts +53 -0
  91. package/dist/esm/models/AgentSettingsResponse.js +52 -0
  92. package/dist/esm/models/AgentUpdate.d.ts +8 -0
  93. package/dist/esm/models/AgentUpdate.js +2 -0
  94. package/dist/esm/models/AppAccountView.d.ts +88 -0
  95. package/dist/esm/models/AppAccountView.js +79 -0
  96. package/dist/esm/models/AppAccountsView.d.ts +66 -0
  97. package/dist/esm/models/AppAccountsView.js +60 -0
  98. package/dist/esm/models/AppResource.d.ts +36 -0
  99. package/dist/esm/models/AppResource.js +12 -0
  100. package/dist/esm/models/AppResourceCheckView.d.ts +74 -0
  101. package/dist/esm/models/AppResourceCheckView.js +63 -0
  102. package/dist/esm/models/AppResourceView.d.ts +68 -0
  103. package/dist/esm/models/AppResourceView.js +67 -0
  104. package/dist/esm/models/AppResourcesView.d.ts +54 -0
  105. package/dist/esm/models/AppResourcesView.js +56 -0
  106. package/dist/esm/models/AppToolsResponse.d.ts +14 -0
  107. package/dist/esm/models/AppToolsResponse.js +4 -0
  108. package/dist/esm/models/AppView.d.ts +42 -0
  109. package/dist/esm/models/AppView.js +14 -0
  110. package/dist/esm/models/ArtifactVersionResponse.d.ts +94 -0
  111. package/dist/esm/models/ArtifactVersionResponse.js +80 -0
  112. package/dist/esm/models/AttachedAgent.d.ts +44 -0
  113. package/dist/esm/models/AttachedAgent.js +49 -0
  114. package/dist/esm/models/Auth.d.ts +30 -0
  115. package/dist/esm/models/Auth.js +52 -0
  116. package/dist/esm/models/BindCustomApiBody.d.ts +32 -0
  117. package/dist/esm/models/BindCustomApiBody.js +43 -0
  118. package/dist/esm/models/ConversationArtifact.d.ts +14 -0
  119. package/dist/esm/models/ConversationArtifact.js +9 -0
  120. package/dist/esm/models/CustomApi.d.ts +102 -0
  121. package/dist/esm/models/CustomApi.js +90 -0
  122. package/dist/esm/models/CustomApiBasicAuth.d.ts +51 -0
  123. package/dist/esm/models/CustomApiBasicAuth.js +57 -0
  124. package/dist/esm/models/CustomApiBearerAuth.d.ts +45 -0
  125. package/dist/esm/models/CustomApiBearerAuth.js +53 -0
  126. package/dist/esm/models/CustomApiCreate.d.ts +57 -0
  127. package/dist/esm/models/CustomApiCreate.js +56 -0
  128. package/dist/esm/models/CustomApiHeader.d.ts +44 -0
  129. package/dist/esm/models/CustomApiHeader.js +47 -0
  130. package/dist/esm/models/CustomApiHeadersAuth.d.ts +46 -0
  131. package/dist/esm/models/CustomApiHeadersAuth.js +54 -0
  132. package/dist/esm/models/CustomApiList.d.ts +64 -0
  133. package/dist/esm/models/CustomApiList.js +64 -0
  134. package/dist/esm/models/CustomApiName.d.ts +44 -0
  135. package/dist/esm/models/CustomApiName.js +49 -0
  136. package/dist/esm/models/CustomApiUpdate.d.ts +58 -0
  137. package/dist/esm/models/CustomApiUpdate.js +50 -0
  138. package/dist/esm/models/CustomApiUpdateAuth.d.ts +30 -0
  139. package/dist/esm/models/CustomApiUpdateAuth.js +52 -0
  140. package/dist/esm/models/ErrorDetailItem.d.ts +5 -0
  141. package/dist/esm/models/ListModels403Response.d.ts +23 -0
  142. package/dist/esm/models/ListModels403Response.js +45 -0
  143. package/dist/esm/models/ModelEndpointView.d.ts +38 -0
  144. package/dist/esm/models/ModelEndpointView.js +45 -0
  145. package/dist/esm/models/ModelView.d.ts +69 -0
  146. package/dist/esm/models/ModelView.js +56 -0
  147. package/dist/esm/models/ModelsResponse.d.ts +33 -0
  148. package/dist/esm/models/ModelsResponse.js +44 -0
  149. package/dist/esm/models/SettingsIssueView.d.ts +44 -0
  150. package/dist/esm/models/SettingsIssueView.js +51 -0
  151. package/dist/esm/models/VersionCommitBody.d.ts +44 -0
  152. package/dist/esm/models/VersionCommitBody.js +51 -0
  153. package/dist/esm/models/VersionUploadUrlBody.d.ts +32 -0
  154. package/dist/esm/models/VersionUploadUrlBody.js +43 -0
  155. package/dist/esm/models/index.d.ts +28 -0
  156. package/dist/esm/models/index.js +28 -0
  157. package/dist/models/AgentChannelRef.d.ts +1 -0
  158. package/dist/models/AgentChannelRef.js +2 -1
  159. package/dist/models/AgentConversationDetail.d.ts +15 -2
  160. package/dist/models/AgentConversationDetail.js +6 -4
  161. package/dist/models/AgentConversationView.d.ts +11 -5
  162. package/dist/models/AgentConversationView.js +4 -4
  163. package/dist/models/AgentCreate.d.ts +8 -0
  164. package/dist/models/AgentCreate.js +2 -0
  165. package/dist/models/AgentCustomApiList.d.ts +33 -0
  166. package/dist/models/AgentCustomApiList.js +51 -0
  167. package/dist/models/AgentResource.d.ts +14 -0
  168. package/dist/models/AgentResource.js +4 -0
  169. package/dist/models/AgentSettingsResponse.d.ts +53 -0
  170. package/dist/models/AgentSettingsResponse.js +59 -0
  171. package/dist/models/AgentUpdate.d.ts +8 -0
  172. package/dist/models/AgentUpdate.js +2 -0
  173. package/dist/models/AppAccountView.d.ts +88 -0
  174. package/dist/models/AppAccountView.js +87 -0
  175. package/dist/models/AppAccountsView.d.ts +66 -0
  176. package/dist/models/AppAccountsView.js +68 -0
  177. package/dist/models/AppResource.d.ts +36 -0
  178. package/dist/models/AppResource.js +12 -0
  179. package/dist/models/AppResourceCheckView.d.ts +74 -0
  180. package/dist/models/AppResourceCheckView.js +71 -0
  181. package/dist/models/AppResourceView.d.ts +68 -0
  182. package/dist/models/AppResourceView.js +74 -0
  183. package/dist/models/AppResourcesView.d.ts +54 -0
  184. package/dist/models/AppResourcesView.js +64 -0
  185. package/dist/models/AppToolsResponse.d.ts +14 -0
  186. package/dist/models/AppToolsResponse.js +4 -0
  187. package/dist/models/AppView.d.ts +42 -0
  188. package/dist/models/AppView.js +14 -0
  189. package/dist/models/ArtifactVersionResponse.d.ts +94 -0
  190. package/dist/models/ArtifactVersionResponse.js +88 -0
  191. package/dist/models/AttachedAgent.d.ts +44 -0
  192. package/dist/models/AttachedAgent.js +56 -0
  193. package/dist/models/Auth.d.ts +30 -0
  194. package/dist/models/Auth.js +58 -0
  195. package/dist/models/BindCustomApiBody.d.ts +32 -0
  196. package/dist/models/BindCustomApiBody.js +50 -0
  197. package/dist/models/ConversationArtifact.d.ts +14 -0
  198. package/dist/models/ConversationArtifact.js +10 -0
  199. package/dist/models/CustomApi.d.ts +102 -0
  200. package/dist/models/CustomApi.js +98 -0
  201. package/dist/models/CustomApiBasicAuth.d.ts +51 -0
  202. package/dist/models/CustomApiBasicAuth.js +65 -0
  203. package/dist/models/CustomApiBearerAuth.d.ts +45 -0
  204. package/dist/models/CustomApiBearerAuth.js +61 -0
  205. package/dist/models/CustomApiCreate.d.ts +57 -0
  206. package/dist/models/CustomApiCreate.js +63 -0
  207. package/dist/models/CustomApiHeader.d.ts +44 -0
  208. package/dist/models/CustomApiHeader.js +54 -0
  209. package/dist/models/CustomApiHeadersAuth.d.ts +46 -0
  210. package/dist/models/CustomApiHeadersAuth.js +62 -0
  211. package/dist/models/CustomApiList.d.ts +64 -0
  212. package/dist/models/CustomApiList.js +71 -0
  213. package/dist/models/CustomApiName.d.ts +44 -0
  214. package/dist/models/CustomApiName.js +56 -0
  215. package/dist/models/CustomApiUpdate.d.ts +58 -0
  216. package/dist/models/CustomApiUpdate.js +57 -0
  217. package/dist/models/CustomApiUpdateAuth.d.ts +30 -0
  218. package/dist/models/CustomApiUpdateAuth.js +58 -0
  219. package/dist/models/ErrorDetailItem.d.ts +5 -0
  220. package/dist/models/ListModels403Response.d.ts +23 -0
  221. package/dist/models/ListModels403Response.js +51 -0
  222. package/dist/models/ModelEndpointView.d.ts +38 -0
  223. package/dist/models/ModelEndpointView.js +52 -0
  224. package/dist/models/ModelView.d.ts +69 -0
  225. package/dist/models/ModelView.js +63 -0
  226. package/dist/models/ModelsResponse.d.ts +33 -0
  227. package/dist/models/ModelsResponse.js +51 -0
  228. package/dist/models/SettingsIssueView.d.ts +44 -0
  229. package/dist/models/SettingsIssueView.js +58 -0
  230. package/dist/models/VersionCommitBody.d.ts +44 -0
  231. package/dist/models/VersionCommitBody.js +58 -0
  232. package/dist/models/VersionUploadUrlBody.d.ts +32 -0
  233. package/dist/models/VersionUploadUrlBody.js +50 -0
  234. package/dist/models/index.d.ts +28 -0
  235. package/dist/models/index.js +28 -0
  236. package/package.json +15 -2
  237. package/src/apis/AgentConversationsApi.ts +172 -3
  238. package/src/apis/AgentsApi.ts +242 -7
  239. package/src/apis/AppsApi.ts +174 -3
  240. package/src/apis/ArtifactsApi.ts +144 -0
  241. package/src/apis/ClarifyApi.ts +3 -3
  242. package/src/apis/CollectionsApi.ts +3 -3
  243. package/src/apis/ConversationsApi.ts +3 -3
  244. package/src/apis/CronsApi.ts +3 -3
  245. package/src/apis/CustomAPIsApi.ts +471 -0
  246. package/src/apis/MessagesApi.ts +3 -3
  247. package/src/apis/ModelsApi.ts +70 -0
  248. package/src/apis/QueueApi.ts +3 -3
  249. package/src/apis/ResponsesApi.ts +3 -3
  250. package/src/apis/SkillsApi.ts +3 -3
  251. package/src/apis/index.ts +2 -0
  252. package/src/compose/agent.ts +254 -0
  253. package/src/compose/builtins.ts +19 -0
  254. package/src/compose/deploy.ts +168 -0
  255. package/src/compose/errors.ts +66 -0
  256. package/src/compose/events.ts +122 -0
  257. package/src/compose/fingerprint.ts +74 -0
  258. package/src/compose/index.ts +13 -0
  259. package/src/compose/run.ts +601 -0
  260. package/src/compose/runState.ts +95 -0
  261. package/src/compose/settingsTransport.ts +299 -0
  262. package/src/compose/tools.ts +42 -0
  263. package/src/compose/transport.ts +48 -0
  264. package/src/models/AgentChannelRef.ts +2 -1
  265. package/src/models/AgentConversationDetail.ts +21 -5
  266. package/src/models/AgentConversationView.ts +15 -8
  267. package/src/models/AgentCreate.ts +8 -0
  268. package/src/models/AgentCustomApiList.ts +74 -0
  269. package/src/models/AgentResource.ts +16 -0
  270. package/src/models/AgentSettingsResponse.ts +99 -0
  271. package/src/models/AgentUpdate.ts +8 -0
  272. package/src/models/AppAccountView.ts +143 -0
  273. package/src/models/AppAccountsView.ts +118 -0
  274. package/src/models/AppResource.ts +48 -0
  275. package/src/models/AppResourceCheckView.ts +117 -0
  276. package/src/models/AppResourceView.ts +120 -0
  277. package/src/models/AppResourcesView.ts +102 -0
  278. package/src/models/AppToolsResponse.ts +16 -0
  279. package/src/models/AppView.ts +56 -0
  280. package/src/models/ArtifactVersionResponse.ts +155 -0
  281. package/src/models/AttachedAgent.ts +83 -0
  282. package/src/models/Auth.ts +84 -0
  283. package/src/models/BindCustomApiBody.ts +66 -0
  284. package/src/models/ConversationArtifact.ts +19 -0
  285. package/src/models/CustomApi.ts +175 -0
  286. package/src/models/CustomApiBasicAuth.ts +94 -0
  287. package/src/models/CustomApiBearerAuth.ts +85 -0
  288. package/src/models/CustomApiCreate.ts +108 -0
  289. package/src/models/CustomApiHeader.ts +82 -0
  290. package/src/models/CustomApiHeadersAuth.ts +93 -0
  291. package/src/models/CustomApiList.ts +120 -0
  292. package/src/models/CustomApiName.ts +83 -0
  293. package/src/models/CustomApiUpdate.ts +106 -0
  294. package/src/models/CustomApiUpdateAuth.ts +84 -0
  295. package/src/models/ErrorDetailItem.ts +5 -0
  296. package/src/models/ListModels403Response.ts +73 -0
  297. package/src/models/ModelEndpointView.ts +74 -0
  298. package/src/models/ModelView.ts +122 -0
  299. package/src/models/ModelsResponse.ts +74 -0
  300. package/src/models/SettingsIssueView.ts +84 -0
  301. package/src/models/VersionCommitBody.ts +84 -0
  302. package/src/models/VersionUploadUrlBody.ts +66 -0
  303. package/src/models/index.ts +28 -0
package/README.md CHANGED
@@ -134,6 +134,21 @@ one with `ArtifactsApi.downloadUrl`.
134
134
  | Knowledge bases | `CollectionsApi.listAgentCollections`, `bindAgentToCollection`, then upload files: `initFileUpload` → PUT → `completeFileUpload` → poll `getFile` |
135
135
  | Connectors | `AppsApi.listApps`, `listAgentApps`, `bindApp`, `unbindApp`, `connectApp` |
136
136
 
137
+ ## Compose
138
+
139
+ Define an agent in code, deploy it by name and run it with `sarvam-agents-client/compose` (a separate import path; the
140
+ package root is unchanged):
141
+
142
+ ```ts
143
+ import { Agent, run, deploy } from "sarvam-agents-client/compose";
144
+
145
+ const agent = new Agent({ name: "support-bot", instructions: "Answer billing questions." });
146
+ await deploy(agent, { client: config });
147
+ console.log((await run(agent, "How do I update my card?", { client: config })).finalOutput);
148
+ ```
149
+
150
+ See [docs/compose.md](../docs/compose.md#typescript) for the full guide.
151
+
137
152
  ## Errors
138
153
 
139
154
  If an ID passed as a path parameter is empty, `.` or `..`, the SDK throws `InvalidPathParameterError` before
@@ -10,21 +10,46 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime.js';
13
- import type { AgentConversationDetail, PageAgentConversationView } from '../models/index.js';
13
+ import type { AgentConversationDetail, DownloadUrlResponse, MessagesResponse, PageAgentConversationView } from '../models/index.js';
14
+ export interface AgentConversationArtifactDownloadUrlRequest {
15
+ agentId: string;
16
+ conversationId: string;
17
+ artifactId: string;
18
+ expires?: number;
19
+ disposition?: AgentConversationArtifactDownloadUrlDispositionEnum;
20
+ }
14
21
  export interface GetAgentConversationRequest {
15
22
  agentId: string;
16
23
  conversationId: string;
17
24
  }
25
+ export interface ListAgentConversationMessagesRequest {
26
+ agentId: string;
27
+ conversationId: string;
28
+ before: string;
29
+ turnLimit?: number | null;
30
+ }
18
31
  export interface ListAgentConversationsRequest {
19
32
  agentId: string;
20
33
  limit?: number;
21
34
  cursor?: string | null;
22
35
  sessionType?: ListAgentConversationsSessionTypeEnum;
36
+ workspaceId?: Array<string>;
37
+ mine?: boolean | null;
23
38
  }
24
39
  /**
25
40
  *
26
41
  */
27
42
  export declare class AgentConversationsApi extends runtime.BaseAPI {
43
+ /**
44
+ * Presign one file of a session from the log, signed on each click. The file belongs to the session\'s user, not to the caller, so the in-app presign (scoped to the caller) would 404. Instead: 1. List the session\'s artifacts as its owner and require ``artifact_id`` among them. Without this check, an agent owner could presign any file of that user by guessing an id, not just this session\'s. 2. Presign through the owner-identity route the share links use. The gateway still checks the ids against the artifact\'s real owner.
45
+ * Agent Conversation Artifact Download Url Route
46
+ */
47
+ agentConversationArtifactDownloadUrlRaw(requestParameters: AgentConversationArtifactDownloadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DownloadUrlResponse>>;
48
+ /**
49
+ * Presign one file of a session from the log, signed on each click. The file belongs to the session\'s user, not to the caller, so the in-app presign (scoped to the caller) would 404. Instead: 1. List the session\'s artifacts as its owner and require ``artifact_id`` among them. Without this check, an agent owner could presign any file of that user by guessing an id, not just this session\'s. 2. Presign through the owner-identity route the share links use. The gateway still checks the ids against the artifact\'s real owner.
50
+ * Agent Conversation Artifact Download Url Route
51
+ */
52
+ agentConversationArtifactDownloadUrl(requestParameters: AgentConversationArtifactDownloadUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DownloadUrlResponse>;
28
53
  /**
29
54
  * One session from the log, with its projected history and tool calls. Read-only: unlike the self route this never marks the row read, because ``last_read_at`` is the owning user\'s unread state, not the agent owner\'s.
30
55
  * Get Agent Conversation Route
@@ -35,6 +60,16 @@ export declare class AgentConversationsApi extends runtime.BaseAPI {
35
60
  * Get Agent Conversation Route
36
61
  */
37
62
  getAgentConversation(requestParameters: GetAgentConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentConversationDetail>;
63
+ /**
64
+ * Older history of one session from the log: the backward page of the self route ``GET /v1/conversations/{id}/messages?before=``. Only the backward path is offered, because the detail already returns the newest window and there is no live stream to catch up with.
65
+ * List Agent Conversation Messages Route
66
+ */
67
+ listAgentConversationMessagesRaw(requestParameters: ListAgentConversationMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MessagesResponse>>;
68
+ /**
69
+ * Older history of one session from the log: the backward page of the self route ``GET /v1/conversations/{id}/messages?before=``. Only the backward path is offered, because the detail already returns the newest window and there is no live stream to catch up with.
70
+ * List Agent Conversation Messages Route
71
+ */
72
+ listAgentConversationMessages(requestParameters: ListAgentConversationMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessagesResponse>;
38
73
  /**
39
74
  * The agent owner\'s session log: conversations every user in the tenant has had with this agent on the selected surface, newest-active first.
40
75
  * List Agent Conversations Route
@@ -46,6 +81,14 @@ export declare class AgentConversationsApi extends runtime.BaseAPI {
46
81
  */
47
82
  listAgentConversations(requestParameters: ListAgentConversationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PageAgentConversationView>;
48
83
  }
84
+ /**
85
+ * @export
86
+ */
87
+ export declare const AgentConversationArtifactDownloadUrlDispositionEnum: {
88
+ readonly Inline: "inline";
89
+ readonly Attachment: "attachment";
90
+ };
91
+ export type AgentConversationArtifactDownloadUrlDispositionEnum = typeof AgentConversationArtifactDownloadUrlDispositionEnum[keyof typeof AgentConversationArtifactDownloadUrlDispositionEnum];
49
92
  /**
50
93
  * @export
51
94
  */
@@ -13,13 +13,58 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ListAgentConversationsSessionTypeEnum = exports.AgentConversationsApi = void 0;
16
+ exports.ListAgentConversationsSessionTypeEnum = exports.AgentConversationArtifactDownloadUrlDispositionEnum = exports.AgentConversationsApi = void 0;
17
17
  const runtime = require("../runtime.js");
18
18
  const index_js_1 = require("../models/index.js");
19
19
  /**
20
20
  *
21
21
  */
22
22
  class AgentConversationsApi extends runtime.BaseAPI {
23
+ /**
24
+ * Presign one file of a session from the log, signed on each click. The file belongs to the session\'s user, not to the caller, so the in-app presign (scoped to the caller) would 404. Instead: 1. List the session\'s artifacts as its owner and require ``artifact_id`` among them. Without this check, an agent owner could presign any file of that user by guessing an id, not just this session\'s. 2. Presign through the owner-identity route the share links use. The gateway still checks the ids against the artifact\'s real owner.
25
+ * Agent Conversation Artifact Download Url Route
26
+ */
27
+ async agentConversationArtifactDownloadUrlRaw(requestParameters, initOverrides) {
28
+ if (requestParameters['agentId'] == null) {
29
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling agentConversationArtifactDownloadUrl().');
30
+ }
31
+ if (requestParameters['conversationId'] == null) {
32
+ throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling agentConversationArtifactDownloadUrl().');
33
+ }
34
+ if (requestParameters['artifactId'] == null) {
35
+ throw new runtime.RequiredError('artifactId', 'Required parameter "artifactId" was null or undefined when calling agentConversationArtifactDownloadUrl().');
36
+ }
37
+ const queryParameters = {};
38
+ if (requestParameters['expires'] != null) {
39
+ queryParameters['expires'] = requestParameters['expires'];
40
+ }
41
+ if (requestParameters['disposition'] != null) {
42
+ queryParameters['disposition'] = requestParameters['disposition'];
43
+ }
44
+ const headerParameters = {};
45
+ if (this.configuration && this.configuration.accessToken) {
46
+ const token = this.configuration.accessToken;
47
+ const tokenString = await token("bearerAuth", []);
48
+ if (tokenString) {
49
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
50
+ }
51
+ }
52
+ const response = await this.request({
53
+ path: `/v1/agents/{agentId}/conversations/{conversationId}/artifacts/{artifactId}/download-url`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"conversationId"}}`, runtime.encodePathParam('conversationId', requestParameters['conversationId'])).replace(`{${"artifactId"}}`, runtime.encodePathParam('artifactId', requestParameters['artifactId'])),
54
+ method: 'GET',
55
+ headers: headerParameters,
56
+ query: queryParameters,
57
+ }, initOverrides);
58
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.DownloadUrlResponseFromJSON)(jsonValue));
59
+ }
60
+ /**
61
+ * Presign one file of a session from the log, signed on each click. The file belongs to the session\'s user, not to the caller, so the in-app presign (scoped to the caller) would 404. Instead: 1. List the session\'s artifacts as its owner and require ``artifact_id`` among them. Without this check, an agent owner could presign any file of that user by guessing an id, not just this session\'s. 2. Presign through the owner-identity route the share links use. The gateway still checks the ids against the artifact\'s real owner.
62
+ * Agent Conversation Artifact Download Url Route
63
+ */
64
+ async agentConversationArtifactDownloadUrl(requestParameters, initOverrides) {
65
+ const response = await this.agentConversationArtifactDownloadUrlRaw(requestParameters, initOverrides);
66
+ return await response.value();
67
+ }
23
68
  /**
24
69
  * One session from the log, with its projected history and tool calls. Read-only: unlike the self route this never marks the row read, because ``last_read_at`` is the owning user\'s unread state, not the agent owner\'s.
25
70
  * Get Agent Conversation Route
@@ -56,6 +101,51 @@ class AgentConversationsApi extends runtime.BaseAPI {
56
101
  const response = await this.getAgentConversationRaw(requestParameters, initOverrides);
57
102
  return await response.value();
58
103
  }
104
+ /**
105
+ * Older history of one session from the log: the backward page of the self route ``GET /v1/conversations/{id}/messages?before=``. Only the backward path is offered, because the detail already returns the newest window and there is no live stream to catch up with.
106
+ * List Agent Conversation Messages Route
107
+ */
108
+ async listAgentConversationMessagesRaw(requestParameters, initOverrides) {
109
+ if (requestParameters['agentId'] == null) {
110
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling listAgentConversationMessages().');
111
+ }
112
+ if (requestParameters['conversationId'] == null) {
113
+ throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling listAgentConversationMessages().');
114
+ }
115
+ if (requestParameters['before'] == null) {
116
+ throw new runtime.RequiredError('before', 'Required parameter "before" was null or undefined when calling listAgentConversationMessages().');
117
+ }
118
+ const queryParameters = {};
119
+ if (requestParameters['before'] != null) {
120
+ queryParameters['before'] = requestParameters['before'];
121
+ }
122
+ if (requestParameters['turnLimit'] != null) {
123
+ queryParameters['turnLimit'] = requestParameters['turnLimit'];
124
+ }
125
+ const headerParameters = {};
126
+ if (this.configuration && this.configuration.accessToken) {
127
+ const token = this.configuration.accessToken;
128
+ const tokenString = await token("bearerAuth", []);
129
+ if (tokenString) {
130
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
131
+ }
132
+ }
133
+ const response = await this.request({
134
+ path: `/v1/agents/{agentId}/conversations/{conversationId}/messages`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])).replace(`{${"conversationId"}}`, runtime.encodePathParam('conversationId', requestParameters['conversationId'])),
135
+ method: 'GET',
136
+ headers: headerParameters,
137
+ query: queryParameters,
138
+ }, initOverrides);
139
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.MessagesResponseFromJSON)(jsonValue));
140
+ }
141
+ /**
142
+ * Older history of one session from the log: the backward page of the self route ``GET /v1/conversations/{id}/messages?before=``. Only the backward path is offered, because the detail already returns the newest window and there is no live stream to catch up with.
143
+ * List Agent Conversation Messages Route
144
+ */
145
+ async listAgentConversationMessages(requestParameters, initOverrides) {
146
+ const response = await this.listAgentConversationMessagesRaw(requestParameters, initOverrides);
147
+ return await response.value();
148
+ }
59
149
  /**
60
150
  * The agent owner\'s session log: conversations every user in the tenant has had with this agent on the selected surface, newest-active first.
61
151
  * List Agent Conversations Route
@@ -74,6 +164,12 @@ class AgentConversationsApi extends runtime.BaseAPI {
74
164
  if (requestParameters['sessionType'] != null) {
75
165
  queryParameters['sessionType'] = requestParameters['sessionType'];
76
166
  }
167
+ if (requestParameters['workspaceId'] != null) {
168
+ queryParameters['workspaceId'] = requestParameters['workspaceId'];
169
+ }
170
+ if (requestParameters['mine'] != null) {
171
+ queryParameters['mine'] = requestParameters['mine'];
172
+ }
77
173
  const headerParameters = {};
78
174
  if (this.configuration && this.configuration.accessToken) {
79
175
  const token = this.configuration.accessToken;
@@ -100,6 +196,13 @@ class AgentConversationsApi extends runtime.BaseAPI {
100
196
  }
101
197
  }
102
198
  exports.AgentConversationsApi = AgentConversationsApi;
199
+ /**
200
+ * @export
201
+ */
202
+ exports.AgentConversationArtifactDownloadUrlDispositionEnum = {
203
+ Inline: 'inline',
204
+ Attachment: 'attachment'
205
+ };
103
206
  /**
104
207
  * @export
105
208
  */
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime.js';
13
- import type { AgentCreate, AgentResource, AgentSearchChannel, AgentTemplateResource, AgentUpdate, EntityCategory, EntityListAgentResource, EntityListAgentTemplateResource, FileNodeView, FileWriteBody, InstructionsBody, InstructionsResponse, PageFileNodeView, PublishRequest, Scope } from '../models/index.js';
13
+ import type { AgentCreate, AgentResource, AgentSearchChannel, AgentSettingsResponse, AgentTemplateResource, AgentUpdate, EntityCategory, EntityListAgentResource, EntityListAgentTemplateResource, FileNodeView, FileWriteBody, InstructionsBody, InstructionsResponse, PageFileNodeView, PublishRequest, Scope } from '../models/index.js';
14
14
  export interface CloneAgentRequest {
15
15
  agentId: string;
16
16
  origin?: CloneAgentOriginEnum;
@@ -29,11 +29,19 @@ export interface DeployAgentRequest {
29
29
  }
30
30
  export interface GetAgentRequest {
31
31
  agentId: string;
32
+ origin?: GetAgentOriginEnum;
33
+ xPanjaOrigin?: GetAgentXPanjaOriginEnum;
32
34
  }
33
35
  export interface GetAgentFileRequest {
34
36
  agentId: string;
35
37
  filePath: string;
36
38
  }
39
+ export interface GetAgentSettingsRequest {
40
+ agentId: string;
41
+ }
42
+ export interface GetAgentSettingsSchemaRequest {
43
+ agentId: string;
44
+ }
37
45
  export interface GetAgentTemplateRequest {
38
46
  templateId: string;
39
47
  }
@@ -68,6 +76,10 @@ export interface ListAgentsRequest {
68
76
  origin?: ListAgentsOriginEnum;
69
77
  xPanjaOrigin?: ListAgentsXPanjaOriginEnum;
70
78
  }
79
+ export interface PatchAgentSettingsRequest {
80
+ agentId: string;
81
+ body: object;
82
+ }
71
83
  export interface PublishAgentRequest {
72
84
  agentId: string;
73
85
  publishRequest?: PublishRequest;
@@ -77,6 +89,10 @@ export interface PutAgentFileRequest {
77
89
  filePath: string;
78
90
  fileWriteBody: FileWriteBody;
79
91
  }
92
+ export interface PutAgentSettingsRequest {
93
+ agentId: string;
94
+ body: object;
95
+ }
80
96
  export interface PutInstructionsRequest {
81
97
  agentId: string;
82
98
  instructionsBody: InstructionsBody;
@@ -137,12 +153,12 @@ export declare class AgentsApi extends runtime.BaseAPI {
137
153
  */
138
154
  deployAgent(requestParameters: DeployAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource>;
139
155
  /**
140
- * One agent the caller can see, or 404 (missing and non-visible are indistinguishable).
156
+ * One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents`` is owner-only, matching the managed list: a teammate\'s published agent is a 404 here (not a 403, so the Managed Agents surface never confirms it exists).
141
157
  * Get Agent
142
158
  */
143
159
  getAgentRaw(requestParameters: GetAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentResource>>;
144
160
  /**
145
- * One agent the caller can see, or 404 (missing and non-visible are indistinguishable).
161
+ * One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents`` is owner-only, matching the managed list: a teammate\'s published agent is a 404 here (not a 403, so the Managed Agents surface never confirms it exists).
146
162
  * Get Agent
147
163
  */
148
164
  getAgent(requestParameters: GetAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource>;
@@ -154,6 +170,28 @@ export declare class AgentsApi extends runtime.BaseAPI {
154
170
  * Get Agent File Route
155
171
  */
156
172
  getAgentFile(requestParameters: GetAgentFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileNodeView>;
173
+ /**
174
+ * Get Agent Settings
175
+ */
176
+ getAgentSettingsRaw(requestParameters: GetAgentSettingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentSettingsResponse>>;
177
+ /**
178
+ * Get Agent Settings
179
+ */
180
+ getAgentSettings(requestParameters: GetAgentSettingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentSettingsResponse>;
181
+ /**
182
+ * JSON Schema of the settings file, with model/endpoint enums from the caller\'s tenant catalog (plain strings when the catalog is empty).
183
+ * Get Agent Settings Schema
184
+ */
185
+ getAgentSettingsSchemaRaw(requestParameters: GetAgentSettingsSchemaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{
186
+ [key: string]: any;
187
+ }>>;
188
+ /**
189
+ * JSON Schema of the settings file, with model/endpoint enums from the caller\'s tenant catalog (plain strings when the catalog is empty).
190
+ * Get Agent Settings Schema
191
+ */
192
+ getAgentSettingsSchema(requestParameters: GetAgentSettingsSchemaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{
193
+ [key: string]: any;
194
+ }>;
157
195
  /**
158
196
  * One template\'s detail card — the same shape the list returns. 404s for an ordinary agent id: the gateway\'s template route enforces ``is_template=true``, so the gallery detail view can never surface a non-template agent.
159
197
  * Get Agent Template
@@ -199,15 +237,25 @@ export declare class AgentsApi extends runtime.BaseAPI {
199
237
  */
200
238
  listAgentTemplates(requestParameters?: ListAgentTemplatesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EntityListAgentTemplateResource>;
201
239
  /**
202
- * Flat, scope-filterable agent catalog (contract replaces v1\'s grouped ``GET /v1/agents``; the FE re-groups client-side from each row\'s ``scope``). One gateway call returns the caller\'s full visible set (the triple powers the gateway\'s ``visibility_scope`` clause). We then drop the operator-seeded editor agents, re-apply the visibility predicate (defence in depth — the gateway is identity-agnostic), and apply the ``?scope=``/``q`` filters before counting, so ``total`` is authoritative for the returned set. ``origin=managed_agents`` keeps only managed agents. It always takes the fetch-all path below: the SQL catalog pages at the gateway, which knows nothing about ``managed_agents``, so filtering its page here would return short pages and a wrong ``total``. Catalog-only filters are therefore a 400 with ``origin`` rather than silently ignored.
240
+ * Flat, scope-filterable agent catalog (contract replaces v1\'s grouped ``GET /v1/agents``; the FE re-groups client-side from each row\'s ``scope``). One gateway call returns the caller\'s full visible set (the triple powers the gateway\'s ``visibility_scope`` clause). We then drop the operator-seeded editor agents, re-apply the visibility predicate (defence in depth — the gateway is identity-agnostic), and apply the ``?scope=``/``q`` filters before counting, so ``total`` is authoritative for the returned set. ``origin=managed_agents`` keeps only managed agents the caller owns (:func:`is_owner`). A teammate\'s published managed agent is visible to the caller but its sessions are owner-only, so listing it would only lead to a 403 on the session log. It always takes the fetch-all path below: the SQL catalog pages at the gateway, which knows nothing about ``managed_agents``, so filtering its page here would return short pages and a wrong ``total``. Catalog-only filters are therefore a 400 with ``origin`` rather than silently ignored.
203
241
  * List Agents
204
242
  */
205
243
  listAgentsRaw(requestParameters: ListAgentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EntityListAgentResource>>;
206
244
  /**
207
- * Flat, scope-filterable agent catalog (contract replaces v1\'s grouped ``GET /v1/agents``; the FE re-groups client-side from each row\'s ``scope``). One gateway call returns the caller\'s full visible set (the triple powers the gateway\'s ``visibility_scope`` clause). We then drop the operator-seeded editor agents, re-apply the visibility predicate (defence in depth — the gateway is identity-agnostic), and apply the ``?scope=``/``q`` filters before counting, so ``total`` is authoritative for the returned set. ``origin=managed_agents`` keeps only managed agents. It always takes the fetch-all path below: the SQL catalog pages at the gateway, which knows nothing about ``managed_agents``, so filtering its page here would return short pages and a wrong ``total``. Catalog-only filters are therefore a 400 with ``origin`` rather than silently ignored.
245
+ * Flat, scope-filterable agent catalog (contract replaces v1\'s grouped ``GET /v1/agents``; the FE re-groups client-side from each row\'s ``scope``). One gateway call returns the caller\'s full visible set (the triple powers the gateway\'s ``visibility_scope`` clause). We then drop the operator-seeded editor agents, re-apply the visibility predicate (defence in depth — the gateway is identity-agnostic), and apply the ``?scope=``/``q`` filters before counting, so ``total`` is authoritative for the returned set. ``origin=managed_agents`` keeps only managed agents the caller owns (:func:`is_owner`). A teammate\'s published managed agent is visible to the caller but its sessions are owner-only, so listing it would only lead to a 403 on the session log. It always takes the fetch-all path below: the SQL catalog pages at the gateway, which knows nothing about ``managed_agents``, so filtering its page here would return short pages and a wrong ``total``. Catalog-only filters are therefore a 400 with ``origin`` rather than silently ignored.
208
246
  * List Agents
209
247
  */
210
248
  listAgents(requestParameters?: ListAgentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EntityListAgentResource>;
249
+ /**
250
+ * JSON Merge Patch (RFC 7396) onto the latest settings; ``null`` removes a key.
251
+ * Patch Agent Settings
252
+ */
253
+ patchAgentSettingsRaw(requestParameters: PatchAgentSettingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentSettingsResponse>>;
254
+ /**
255
+ * JSON Merge Patch (RFC 7396) onto the latest settings; ``null`` removes a key.
256
+ * Patch Agent Settings
257
+ */
258
+ patchAgentSettings(requestParameters: PatchAgentSettingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentSettingsResponse>;
211
259
  /**
212
260
  * Set the agent\'s audience, cascading owned dependencies gateway-side. Two shapes, one route. With no ``targetScope`` the agent widens exactly one step (user → workspace → organisation) — the original behaviour, kept so existing callers are untouched. With ``targetScope`` it lands on that audience directly, in either direction. Owner-only (checked here for a clean 403 before the gateway call). Gateway 409s (a dependency the caller can\'t widen) surface as ``CHAT_CONFLICT`` with the blocker message. ``targetScope: \"user\"`` is routed to the gateway\'s *unpublish*, not publish: narrowing to private is a different gateway operation (it also heals a legacy null owner), and publish has no ``user`` target at all. Folding it in here rather than making the FE pick an endpoint keeps the share picker a single call for all three options.
213
261
  * Publish Agent
@@ -226,6 +274,16 @@ export declare class AgentsApi extends runtime.BaseAPI {
226
274
  * Put Agent File Route
227
275
  */
228
276
  putAgentFile(requestParameters: PutAgentFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileNodeView>;
277
+ /**
278
+ * Replace the whole settings object. Body is the settings object itself.
279
+ * Put Agent Settings
280
+ */
281
+ putAgentSettingsRaw(requestParameters: PutAgentSettingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentSettingsResponse>>;
282
+ /**
283
+ * Replace the whole settings object. Body is the settings object itself.
284
+ * Put Agent Settings
285
+ */
286
+ putAgentSettings(requestParameters: PutAgentSettingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentSettingsResponse>;
229
287
  /**
230
288
  * Put Instructions
231
289
  */
@@ -293,6 +351,20 @@ export declare const CreateAgentXPanjaOriginEnum: {
293
351
  readonly ManagedAgents: "managed_agents";
294
352
  };
295
353
  export type CreateAgentXPanjaOriginEnum = typeof CreateAgentXPanjaOriginEnum[keyof typeof CreateAgentXPanjaOriginEnum];
354
+ /**
355
+ * @export
356
+ */
357
+ export declare const GetAgentOriginEnum: {
358
+ readonly ManagedAgents: "managed_agents";
359
+ };
360
+ export type GetAgentOriginEnum = typeof GetAgentOriginEnum[keyof typeof GetAgentOriginEnum];
361
+ /**
362
+ * @export
363
+ */
364
+ export declare const GetAgentXPanjaOriginEnum: {
365
+ readonly ManagedAgents: "managed_agents";
366
+ };
367
+ export type GetAgentXPanjaOriginEnum = typeof GetAgentXPanjaOriginEnum[keyof typeof GetAgentXPanjaOriginEnum];
296
368
  /**
297
369
  * @export
298
370
  */
@@ -13,7 +13,7 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ListAgentsXPanjaOriginEnum = exports.ListAgentsOriginEnum = exports.CreateAgentXPanjaOriginEnum = exports.CreateAgentOriginEnum = exports.CloneAgentXPanjaOriginEnum = exports.CloneAgentOriginEnum = exports.AgentsApi = void 0;
16
+ exports.ListAgentsXPanjaOriginEnum = exports.ListAgentsOriginEnum = exports.GetAgentXPanjaOriginEnum = exports.GetAgentOriginEnum = exports.CreateAgentXPanjaOriginEnum = exports.CreateAgentOriginEnum = exports.CloneAgentXPanjaOriginEnum = exports.CloneAgentOriginEnum = exports.AgentsApi = void 0;
17
17
  const runtime = require("../runtime.js");
18
18
  const index_js_1 = require("../models/index.js");
19
19
  /**
@@ -166,7 +166,7 @@ class AgentsApi extends runtime.BaseAPI {
166
166
  return await response.value();
167
167
  }
168
168
  /**
169
- * One agent the caller can see, or 404 (missing and non-visible are indistinguishable).
169
+ * One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents`` is owner-only, matching the managed list: a teammate\'s published agent is a 404 here (not a 403, so the Managed Agents surface never confirms it exists).
170
170
  * Get Agent
171
171
  */
172
172
  async getAgentRaw(requestParameters, initOverrides) {
@@ -174,7 +174,13 @@ class AgentsApi extends runtime.BaseAPI {
174
174
  throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling getAgent().');
175
175
  }
176
176
  const queryParameters = {};
177
+ if (requestParameters['origin'] != null) {
178
+ queryParameters['origin'] = requestParameters['origin'];
179
+ }
177
180
  const headerParameters = {};
181
+ if (requestParameters['xPanjaOrigin'] != null) {
182
+ headerParameters['X-Panja-Origin'] = String(requestParameters['xPanjaOrigin']);
183
+ }
178
184
  if (this.configuration && this.configuration.accessToken) {
179
185
  const token = this.configuration.accessToken;
180
186
  const tokenString = await token("bearerAuth", []);
@@ -191,7 +197,7 @@ class AgentsApi extends runtime.BaseAPI {
191
197
  return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.AgentResourceFromJSON)(jsonValue));
192
198
  }
193
199
  /**
194
- * One agent the caller can see, or 404 (missing and non-visible are indistinguishable).
200
+ * One agent the caller can see, or 404 (missing and non-visible are indistinguishable). ``origin=managed_agents`` is owner-only, matching the managed list: a teammate\'s published agent is a 404 here (not a 403, so the Managed Agents surface never confirms it exists).
195
201
  * Get Agent
196
202
  */
197
203
  async getAgent(requestParameters, initOverrides) {
@@ -232,6 +238,70 @@ class AgentsApi extends runtime.BaseAPI {
232
238
  const response = await this.getAgentFileRaw(requestParameters, initOverrides);
233
239
  return await response.value();
234
240
  }
241
+ /**
242
+ * Get Agent Settings
243
+ */
244
+ async getAgentSettingsRaw(requestParameters, initOverrides) {
245
+ if (requestParameters['agentId'] == null) {
246
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling getAgentSettings().');
247
+ }
248
+ const queryParameters = {};
249
+ const headerParameters = {};
250
+ if (this.configuration && this.configuration.accessToken) {
251
+ const token = this.configuration.accessToken;
252
+ const tokenString = await token("bearerAuth", []);
253
+ if (tokenString) {
254
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
255
+ }
256
+ }
257
+ const response = await this.request({
258
+ path: `/v1/agents/{agentId}/settings`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])),
259
+ method: 'GET',
260
+ headers: headerParameters,
261
+ query: queryParameters,
262
+ }, initOverrides);
263
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.AgentSettingsResponseFromJSON)(jsonValue));
264
+ }
265
+ /**
266
+ * Get Agent Settings
267
+ */
268
+ async getAgentSettings(requestParameters, initOverrides) {
269
+ const response = await this.getAgentSettingsRaw(requestParameters, initOverrides);
270
+ return await response.value();
271
+ }
272
+ /**
273
+ * JSON Schema of the settings file, with model/endpoint enums from the caller\'s tenant catalog (plain strings when the catalog is empty).
274
+ * Get Agent Settings Schema
275
+ */
276
+ async getAgentSettingsSchemaRaw(requestParameters, initOverrides) {
277
+ if (requestParameters['agentId'] == null) {
278
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling getAgentSettingsSchema().');
279
+ }
280
+ const queryParameters = {};
281
+ const headerParameters = {};
282
+ if (this.configuration && this.configuration.accessToken) {
283
+ const token = this.configuration.accessToken;
284
+ const tokenString = await token("bearerAuth", []);
285
+ if (tokenString) {
286
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
287
+ }
288
+ }
289
+ const response = await this.request({
290
+ path: `/v1/agents/{agentId}/settings/schema`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])),
291
+ method: 'GET',
292
+ headers: headerParameters,
293
+ query: queryParameters,
294
+ }, initOverrides);
295
+ return new runtime.JSONApiResponse(response);
296
+ }
297
+ /**
298
+ * JSON Schema of the settings file, with model/endpoint enums from the caller\'s tenant catalog (plain strings when the catalog is empty).
299
+ * Get Agent Settings Schema
300
+ */
301
+ async getAgentSettingsSchema(requestParameters, initOverrides) {
302
+ const response = await this.getAgentSettingsSchemaRaw(requestParameters, initOverrides);
303
+ return await response.value();
304
+ }
235
305
  /**
236
306
  * One template\'s detail card — the same shape the list returns. 404s for an ordinary agent id: the gateway\'s template route enforces ``is_template=true``, so the gallery detail view can never surface a non-template agent.
237
307
  * Get Agent Template
@@ -407,7 +477,7 @@ class AgentsApi extends runtime.BaseAPI {
407
477
  return await response.value();
408
478
  }
409
479
  /**
410
- * Flat, scope-filterable agent catalog (contract replaces v1\'s grouped ``GET /v1/agents``; the FE re-groups client-side from each row\'s ``scope``). One gateway call returns the caller\'s full visible set (the triple powers the gateway\'s ``visibility_scope`` clause). We then drop the operator-seeded editor agents, re-apply the visibility predicate (defence in depth — the gateway is identity-agnostic), and apply the ``?scope=``/``q`` filters before counting, so ``total`` is authoritative for the returned set. ``origin=managed_agents`` keeps only managed agents. It always takes the fetch-all path below: the SQL catalog pages at the gateway, which knows nothing about ``managed_agents``, so filtering its page here would return short pages and a wrong ``total``. Catalog-only filters are therefore a 400 with ``origin`` rather than silently ignored.
480
+ * Flat, scope-filterable agent catalog (contract replaces v1\'s grouped ``GET /v1/agents``; the FE re-groups client-side from each row\'s ``scope``). One gateway call returns the caller\'s full visible set (the triple powers the gateway\'s ``visibility_scope`` clause). We then drop the operator-seeded editor agents, re-apply the visibility predicate (defence in depth — the gateway is identity-agnostic), and apply the ``?scope=``/``q`` filters before counting, so ``total`` is authoritative for the returned set. ``origin=managed_agents`` keeps only managed agents the caller owns (:func:`is_owner`). A teammate\'s published managed agent is visible to the caller but its sessions are owner-only, so listing it would only lead to a 403 on the session log. It always takes the fetch-all path below: the SQL catalog pages at the gateway, which knows nothing about ``managed_agents``, so filtering its page here would return short pages and a wrong ``total``. Catalog-only filters are therefore a 400 with ``origin`` rather than silently ignored.
411
481
  * List Agents
412
482
  */
413
483
  async listAgentsRaw(requestParameters, initOverrides) {
@@ -465,13 +535,51 @@ class AgentsApi extends runtime.BaseAPI {
465
535
  return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.EntityListAgentResourceFromJSON)(jsonValue));
466
536
  }
467
537
  /**
468
- * Flat, scope-filterable agent catalog (contract replaces v1\'s grouped ``GET /v1/agents``; the FE re-groups client-side from each row\'s ``scope``). One gateway call returns the caller\'s full visible set (the triple powers the gateway\'s ``visibility_scope`` clause). We then drop the operator-seeded editor agents, re-apply the visibility predicate (defence in depth — the gateway is identity-agnostic), and apply the ``?scope=``/``q`` filters before counting, so ``total`` is authoritative for the returned set. ``origin=managed_agents`` keeps only managed agents. It always takes the fetch-all path below: the SQL catalog pages at the gateway, which knows nothing about ``managed_agents``, so filtering its page here would return short pages and a wrong ``total``. Catalog-only filters are therefore a 400 with ``origin`` rather than silently ignored.
538
+ * Flat, scope-filterable agent catalog (contract replaces v1\'s grouped ``GET /v1/agents``; the FE re-groups client-side from each row\'s ``scope``). One gateway call returns the caller\'s full visible set (the triple powers the gateway\'s ``visibility_scope`` clause). We then drop the operator-seeded editor agents, re-apply the visibility predicate (defence in depth — the gateway is identity-agnostic), and apply the ``?scope=``/``q`` filters before counting, so ``total`` is authoritative for the returned set. ``origin=managed_agents`` keeps only managed agents the caller owns (:func:`is_owner`). A teammate\'s published managed agent is visible to the caller but its sessions are owner-only, so listing it would only lead to a 403 on the session log. It always takes the fetch-all path below: the SQL catalog pages at the gateway, which knows nothing about ``managed_agents``, so filtering its page here would return short pages and a wrong ``total``. Catalog-only filters are therefore a 400 with ``origin`` rather than silently ignored.
469
539
  * List Agents
470
540
  */
471
541
  async listAgents(requestParameters = {}, initOverrides) {
472
542
  const response = await this.listAgentsRaw(requestParameters, initOverrides);
473
543
  return await response.value();
474
544
  }
545
+ /**
546
+ * JSON Merge Patch (RFC 7396) onto the latest settings; ``null`` removes a key.
547
+ * Patch Agent Settings
548
+ */
549
+ async patchAgentSettingsRaw(requestParameters, initOverrides) {
550
+ if (requestParameters['agentId'] == null) {
551
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling patchAgentSettings().');
552
+ }
553
+ if (requestParameters['body'] == null) {
554
+ throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling patchAgentSettings().');
555
+ }
556
+ const queryParameters = {};
557
+ const headerParameters = {};
558
+ headerParameters['Content-Type'] = 'application/json';
559
+ if (this.configuration && this.configuration.accessToken) {
560
+ const token = this.configuration.accessToken;
561
+ const tokenString = await token("bearerAuth", []);
562
+ if (tokenString) {
563
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
564
+ }
565
+ }
566
+ const response = await this.request({
567
+ path: `/v1/agents/{agentId}/settings`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])),
568
+ method: 'PATCH',
569
+ headers: headerParameters,
570
+ query: queryParameters,
571
+ body: requestParameters['body'],
572
+ }, initOverrides);
573
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.AgentSettingsResponseFromJSON)(jsonValue));
574
+ }
575
+ /**
576
+ * JSON Merge Patch (RFC 7396) onto the latest settings; ``null`` removes a key.
577
+ * Patch Agent Settings
578
+ */
579
+ async patchAgentSettings(requestParameters, initOverrides) {
580
+ const response = await this.patchAgentSettingsRaw(requestParameters, initOverrides);
581
+ return await response.value();
582
+ }
475
583
  /**
476
584
  * Set the agent\'s audience, cascading owned dependencies gateway-side. Two shapes, one route. With no ``targetScope`` the agent widens exactly one step (user → workspace → organisation) — the original behaviour, kept so existing callers are untouched. With ``targetScope`` it lands on that audience directly, in either direction. Owner-only (checked here for a clean 403 before the gateway call). Gateway 409s (a dependency the caller can\'t widen) surface as ``CHAT_CONFLICT`` with the blocker message. ``targetScope: \"user\"`` is routed to the gateway\'s *unpublish*, not publish: narrowing to private is a different gateway operation (it also heals a legacy null owner), and publish has no ``user`` target at all. Folding it in here rather than making the FE pick an endpoint keeps the share picker a single call for all three options.
477
585
  * Publish Agent
@@ -546,6 +654,44 @@ class AgentsApi extends runtime.BaseAPI {
546
654
  const response = await this.putAgentFileRaw(requestParameters, initOverrides);
547
655
  return await response.value();
548
656
  }
657
+ /**
658
+ * Replace the whole settings object. Body is the settings object itself.
659
+ * Put Agent Settings
660
+ */
661
+ async putAgentSettingsRaw(requestParameters, initOverrides) {
662
+ if (requestParameters['agentId'] == null) {
663
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling putAgentSettings().');
664
+ }
665
+ if (requestParameters['body'] == null) {
666
+ throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling putAgentSettings().');
667
+ }
668
+ const queryParameters = {};
669
+ const headerParameters = {};
670
+ headerParameters['Content-Type'] = 'application/json';
671
+ if (this.configuration && this.configuration.accessToken) {
672
+ const token = this.configuration.accessToken;
673
+ const tokenString = await token("bearerAuth", []);
674
+ if (tokenString) {
675
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
676
+ }
677
+ }
678
+ const response = await this.request({
679
+ path: `/v1/agents/{agentId}/settings`.replace(`{${"agentId"}}`, runtime.encodePathParam('agentId', requestParameters['agentId'])),
680
+ method: 'PUT',
681
+ headers: headerParameters,
682
+ query: queryParameters,
683
+ body: requestParameters['body'],
684
+ }, initOverrides);
685
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.AgentSettingsResponseFromJSON)(jsonValue));
686
+ }
687
+ /**
688
+ * Replace the whole settings object. Body is the settings object itself.
689
+ * Put Agent Settings
690
+ */
691
+ async putAgentSettings(requestParameters, initOverrides) {
692
+ const response = await this.putAgentSettingsRaw(requestParameters, initOverrides);
693
+ return await response.value();
694
+ }
549
695
  /**
550
696
  * Put Instructions
551
697
  */
@@ -714,6 +860,18 @@ exports.CreateAgentOriginEnum = {
714
860
  exports.CreateAgentXPanjaOriginEnum = {
715
861
  ManagedAgents: 'managed_agents'
716
862
  };
863
+ /**
864
+ * @export
865
+ */
866
+ exports.GetAgentOriginEnum = {
867
+ ManagedAgents: 'managed_agents'
868
+ };
869
+ /**
870
+ * @export
871
+ */
872
+ exports.GetAgentXPanjaOriginEnum = {
873
+ ManagedAgents: 'managed_agents'
874
+ };
717
875
  /**
718
876
  * @export
719
877
  */