mavenagi 1.2.56 → 1.2.57

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 (219) hide show
  1. package/BaseClient.js +2 -2
  2. package/Client.d.ts +3 -0
  3. package/Client.js +21 -16
  4. package/api/resources/analytics/types/ConversationBasicMetric.d.ts +5 -0
  5. package/api/resources/analytics/types/ConversationGroupBy.d.ts +9 -1
  6. package/api/resources/analytics/types/ConversationNumericMetric.d.ts +5 -0
  7. package/api/resources/analytics/types/ConversationTableRequest.d.ts +6 -0
  8. package/api/resources/charters/index.d.ts +1 -0
  9. package/api/resources/charters/index.js +17 -0
  10. package/api/resources/charters/types/CharterChildrenExclusionPolicy.d.ts +17 -0
  11. package/api/resources/charters/types/CharterChildrenExclusionPolicy.js +20 -0
  12. package/api/resources/charters/types/CharterStatus.d.ts +16 -0
  13. package/api/resources/charters/types/CharterStatus.js +19 -0
  14. package/api/resources/charters/types/CharterSummary.d.ts +28 -0
  15. package/api/resources/charters/types/CharterType.d.ts +25 -0
  16. package/api/resources/charters/types/CharterType.js +28 -0
  17. package/api/resources/charters/types/index.d.ts +4 -0
  18. package/api/resources/charters/types/index.js +20 -0
  19. package/api/resources/commons/types/ActionParameter.d.ts +2 -2
  20. package/api/resources/commons/types/BotObjectResponse.d.ts +2 -4
  21. package/api/resources/commons/types/FieldCondition.d.ts +45 -0
  22. package/api/resources/commons/types/FieldCondition.js +3 -0
  23. package/api/resources/commons/types/IntelligentFieldPrecondition.d.ts +1 -1
  24. package/api/resources/commons/types/IntelligentFieldPreconditionResponse.d.ts +1 -1
  25. package/api/resources/commons/types/KeyValueEntryCondition.d.ts +1 -1
  26. package/api/resources/commons/types/TextFormat.d.ts +13 -0
  27. package/api/resources/commons/types/TextFormat.js +3 -0
  28. package/api/resources/commons/types/TextFormatJsonSchema.d.ts +35 -0
  29. package/api/resources/commons/types/TextFormatJsonSchema.js +3 -0
  30. package/api/resources/commons/types/TextFormatText.d.ts +4 -0
  31. package/api/resources/commons/types/TextFormatText.js +3 -0
  32. package/api/resources/commons/types/UniversalCondition.d.ts +3 -3
  33. package/api/resources/commons/types/index.d.ts +4 -1
  34. package/api/resources/commons/types/index.js +4 -1
  35. package/api/resources/conversation/types/AskRequest.d.ts +59 -0
  36. package/api/resources/conversation/types/AskStreamObjectEvent.d.ts +7 -0
  37. package/api/resources/conversation/types/AskStreamObjectEvent.js +3 -0
  38. package/api/resources/conversation/types/ConversationField.d.ts +8 -0
  39. package/api/resources/conversation/types/ConversationField.js +8 -0
  40. package/api/resources/conversation/types/ConversationsSearchRequest.d.ts +5 -0
  41. package/api/resources/conversation/types/NumericConversationField.d.ts +4 -0
  42. package/api/resources/conversation/types/NumericConversationField.js +4 -0
  43. package/api/resources/conversation/types/StreamResponse.d.ts +4 -1
  44. package/api/resources/conversation/types/index.d.ts +1 -0
  45. package/api/resources/conversation/types/index.js +1 -0
  46. package/api/resources/index.d.ts +5 -0
  47. package/api/resources/index.js +6 -1
  48. package/api/resources/intelligentFields/client/Client.d.ts +156 -0
  49. package/api/resources/intelligentFields/client/Client.js +627 -0
  50. package/api/resources/intelligentFields/client/index.d.ts +1 -0
  51. package/api/resources/intelligentFields/client/index.js +17 -0
  52. package/api/resources/intelligentFields/client/requests/IntelligentFieldDeleteRequest.d.ts +12 -0
  53. package/api/resources/intelligentFields/client/requests/IntelligentFieldDeleteRequest.js +3 -0
  54. package/api/resources/intelligentFields/client/requests/IntelligentFieldGetRequest.d.ts +8 -0
  55. package/api/resources/intelligentFields/client/requests/IntelligentFieldGetRequest.js +3 -0
  56. package/api/resources/intelligentFields/client/requests/IntelligentFieldPatchRequest.d.ts +26 -0
  57. package/api/resources/intelligentFields/client/requests/IntelligentFieldPatchRequest.js +3 -0
  58. package/api/resources/intelligentFields/client/requests/index.d.ts +3 -0
  59. package/api/resources/intelligentFields/client/requests/index.js +2 -0
  60. package/api/resources/intelligentFields/exports.d.ts +2 -0
  61. package/api/resources/intelligentFields/exports.js +21 -0
  62. package/api/resources/intelligentFields/index.d.ts +2 -0
  63. package/api/resources/intelligentFields/index.js +18 -0
  64. package/api/resources/intelligentFields/types/EnumOption.d.ts +9 -0
  65. package/api/resources/intelligentFields/types/EnumOption.js +3 -0
  66. package/api/resources/intelligentFields/types/IntelligentFieldBase.d.ts +7 -0
  67. package/api/resources/intelligentFields/types/IntelligentFieldBase.js +3 -0
  68. package/api/resources/intelligentFields/types/IntelligentFieldCore.d.ts +28 -0
  69. package/api/resources/intelligentFields/types/IntelligentFieldCore.js +3 -0
  70. package/api/resources/intelligentFields/types/IntelligentFieldDetailResponse.d.ts +36 -0
  71. package/api/resources/intelligentFields/types/IntelligentFieldDetailResponse.js +3 -0
  72. package/api/resources/intelligentFields/types/IntelligentFieldRequest.d.ts +28 -0
  73. package/api/resources/intelligentFields/types/IntelligentFieldRequest.js +3 -0
  74. package/api/resources/intelligentFields/types/IntelligentFieldResponse.d.ts +41 -0
  75. package/api/resources/intelligentFields/types/IntelligentFieldResponse.js +3 -0
  76. package/api/resources/intelligentFields/types/IntelligentFieldStatus.d.ts +7 -0
  77. package/api/resources/intelligentFields/types/IntelligentFieldStatus.js +10 -0
  78. package/api/resources/intelligentFields/types/IntelligentFieldType.d.ts +9 -0
  79. package/api/resources/intelligentFields/types/IntelligentFieldType.js +12 -0
  80. package/api/resources/intelligentFields/types/IntelligentFieldValueEntityFilter.d.ts +8 -0
  81. package/api/resources/intelligentFields/types/IntelligentFieldValueEntityFilter.js +3 -0
  82. package/api/resources/intelligentFields/types/IntelligentFieldValueFieldFilter.d.ts +10 -0
  83. package/api/resources/intelligentFields/types/IntelligentFieldValueFieldFilter.js +3 -0
  84. package/api/resources/intelligentFields/types/IntelligentFieldValueSearchRequest.d.ts +17 -0
  85. package/api/resources/intelligentFields/types/IntelligentFieldValueSearchRequest.js +3 -0
  86. package/api/resources/intelligentFields/types/IntelligentFieldValueSearchResponse.d.ts +35 -0
  87. package/api/resources/intelligentFields/types/IntelligentFieldValueSearchResponse.js +3 -0
  88. package/api/resources/intelligentFields/types/IntelligentFieldValueSortField.d.ts +5 -0
  89. package/api/resources/intelligentFields/types/IntelligentFieldValueSortField.js +8 -0
  90. package/api/resources/intelligentFields/types/index.d.ts +13 -0
  91. package/api/resources/intelligentFields/types/index.js +29 -0
  92. package/api/resources/knowledge/client/Client.d.ts +33 -0
  93. package/api/resources/knowledge/client/Client.js +117 -0
  94. package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +5 -0
  95. package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +25 -0
  96. package/api/resources/knowledge/types/KnowledgeBaseVersionProgress.d.ts +29 -0
  97. package/api/resources/knowledge/types/KnowledgeBaseVersionProgress.js +3 -0
  98. package/api/resources/knowledge/types/KnowledgeBaseVersionProgressRequest.d.ts +24 -0
  99. package/api/resources/knowledge/types/KnowledgeBaseVersionProgressRequest.js +3 -0
  100. package/api/resources/knowledge/types/index.d.ts +2 -0
  101. package/api/resources/knowledge/types/index.js +2 -0
  102. package/api/resources/segments/client/Client.js +3 -1
  103. package/api/resources/segments/client/requests/SegmentDeleteRequest.d.ts +12 -0
  104. package/api/resources/segments/types/SegmentPatchRequest.d.ts +8 -0
  105. package/api/resources/segments/types/SegmentRequest.d.ts +8 -0
  106. package/api/resources/segments/types/SegmentSummary.d.ts +14 -0
  107. package/api/resources/segments/types/SegmentSummary.js +3 -0
  108. package/api/resources/segments/types/index.d.ts +1 -0
  109. package/api/resources/segments/types/index.js +1 -0
  110. package/package.json +1 -1
  111. package/reference.md +476 -0
  112. package/serialization/resources/analytics/types/ConversationBasicMetric.d.ts +2 -0
  113. package/serialization/resources/analytics/types/ConversationBasicMetric.js +2 -0
  114. package/serialization/resources/analytics/types/ConversationGroupBy.d.ts +2 -0
  115. package/serialization/resources/analytics/types/ConversationGroupBy.js +2 -0
  116. package/serialization/resources/analytics/types/ConversationNumericMetric.d.ts +2 -0
  117. package/serialization/resources/analytics/types/ConversationNumericMetric.js +2 -0
  118. package/serialization/resources/charters/index.d.ts +1 -0
  119. package/serialization/resources/charters/index.js +17 -0
  120. package/serialization/resources/charters/types/CharterChildrenExclusionPolicy.d.ts +7 -0
  121. package/serialization/resources/charters/types/CharterChildrenExclusionPolicy.js +39 -0
  122. package/serialization/resources/charters/types/CharterStatus.d.ts +7 -0
  123. package/serialization/resources/charters/types/CharterStatus.js +39 -0
  124. package/serialization/resources/charters/types/CharterSummary.d.ts +22 -0
  125. package/serialization/resources/charters/types/CharterSummary.js +54 -0
  126. package/serialization/resources/charters/types/CharterType.d.ts +7 -0
  127. package/serialization/resources/charters/types/CharterType.js +39 -0
  128. package/serialization/resources/charters/types/index.d.ts +4 -0
  129. package/serialization/resources/charters/types/index.js +20 -0
  130. package/serialization/resources/commons/types/BotObjectResponse.d.ts +0 -1
  131. package/serialization/resources/commons/types/BotObjectResponse.js +0 -1
  132. package/serialization/resources/commons/types/{IntelligentFieldCondition.d.ts → FieldCondition.d.ts} +3 -3
  133. package/serialization/resources/commons/types/{IntelligentFieldCondition.js → FieldCondition.js} +2 -2
  134. package/serialization/resources/commons/types/IntelligentFieldPrecondition.d.ts +2 -2
  135. package/serialization/resources/commons/types/IntelligentFieldPrecondition.js +2 -2
  136. package/serialization/resources/commons/types/IntelligentFieldPreconditionResponse.d.ts +2 -2
  137. package/serialization/resources/commons/types/IntelligentFieldPreconditionResponse.js +2 -2
  138. package/serialization/resources/commons/types/KeyValueEntryCondition.d.ts +2 -2
  139. package/serialization/resources/commons/types/KeyValueEntryCondition.js +2 -2
  140. package/serialization/resources/commons/types/TextFormat.d.ts +15 -0
  141. package/serialization/resources/commons/types/TextFormat.js +49 -0
  142. package/serialization/resources/commons/types/TextFormatJsonSchema.d.ts +10 -0
  143. package/serialization/resources/commons/types/TextFormatJsonSchema.js +42 -0
  144. package/serialization/resources/commons/types/TextFormatText.d.ts +7 -0
  145. package/serialization/resources/commons/types/TextFormatText.js +39 -0
  146. package/serialization/resources/commons/types/index.d.ts +4 -1
  147. package/serialization/resources/commons/types/index.js +4 -1
  148. package/serialization/resources/conversation/types/AskRequest.d.ts +2 -0
  149. package/serialization/resources/conversation/types/AskRequest.js +2 -0
  150. package/serialization/resources/conversation/types/AskStreamObjectEvent.d.ts +9 -0
  151. package/serialization/resources/conversation/types/AskStreamObjectEvent.js +40 -0
  152. package/serialization/resources/conversation/types/ConversationField.d.ts +1 -1
  153. package/serialization/resources/conversation/types/ConversationField.js +2 -0
  154. package/serialization/resources/conversation/types/NumericConversationField.d.ts +1 -1
  155. package/serialization/resources/conversation/types/NumericConversationField.js +1 -0
  156. package/serialization/resources/conversation/types/StreamResponse.d.ts +5 -1
  157. package/serialization/resources/conversation/types/StreamResponse.js +2 -0
  158. package/serialization/resources/conversation/types/index.d.ts +1 -0
  159. package/serialization/resources/conversation/types/index.js +1 -0
  160. package/serialization/resources/index.d.ts +5 -0
  161. package/serialization/resources/index.js +6 -1
  162. package/serialization/resources/intelligentFields/client/index.d.ts +1 -0
  163. package/serialization/resources/intelligentFields/client/index.js +17 -0
  164. package/serialization/resources/intelligentFields/client/requests/IntelligentFieldPatchRequest.d.ts +17 -0
  165. package/serialization/resources/intelligentFields/client/requests/IntelligentFieldPatchRequest.js +49 -0
  166. package/serialization/resources/intelligentFields/client/requests/index.d.ts +1 -0
  167. package/serialization/resources/intelligentFields/client/requests/index.js +5 -0
  168. package/serialization/resources/intelligentFields/index.d.ts +2 -0
  169. package/serialization/resources/intelligentFields/index.js +18 -0
  170. package/serialization/resources/intelligentFields/types/EnumOption.d.ts +10 -0
  171. package/serialization/resources/intelligentFields/types/EnumOption.js +42 -0
  172. package/serialization/resources/intelligentFields/types/IntelligentFieldBase.d.ts +13 -0
  173. package/serialization/resources/intelligentFields/types/IntelligentFieldBase.js +47 -0
  174. package/serialization/resources/intelligentFields/types/IntelligentFieldCore.d.ts +15 -0
  175. package/serialization/resources/intelligentFields/types/IntelligentFieldCore.js +47 -0
  176. package/serialization/resources/intelligentFields/types/IntelligentFieldDetailResponse.d.ts +11 -0
  177. package/serialization/resources/intelligentFields/types/IntelligentFieldDetailResponse.js +45 -0
  178. package/serialization/resources/intelligentFields/types/IntelligentFieldRequest.d.ts +11 -0
  179. package/serialization/resources/intelligentFields/types/IntelligentFieldRequest.js +45 -0
  180. package/serialization/resources/intelligentFields/types/IntelligentFieldResponse.d.ts +15 -0
  181. package/serialization/resources/intelligentFields/types/IntelligentFieldResponse.js +49 -0
  182. package/serialization/resources/intelligentFields/types/IntelligentFieldStatus.d.ts +7 -0
  183. package/serialization/resources/intelligentFields/types/IntelligentFieldStatus.js +39 -0
  184. package/serialization/resources/intelligentFields/types/IntelligentFieldType.d.ts +7 -0
  185. package/serialization/resources/intelligentFields/types/IntelligentFieldType.js +39 -0
  186. package/serialization/resources/intelligentFields/types/IntelligentFieldValueEntityFilter.d.ts +10 -0
  187. package/serialization/resources/intelligentFields/types/IntelligentFieldValueEntityFilter.js +42 -0
  188. package/serialization/resources/intelligentFields/types/IntelligentFieldValueFieldFilter.d.ts +12 -0
  189. package/serialization/resources/intelligentFields/types/IntelligentFieldValueFieldFilter.js +44 -0
  190. package/serialization/resources/intelligentFields/types/IntelligentFieldValueSearchRequest.d.ts +20 -0
  191. package/serialization/resources/intelligentFields/types/IntelligentFieldValueSearchRequest.js +54 -0
  192. package/serialization/resources/intelligentFields/types/IntelligentFieldValueSearchResponse.d.ts +11 -0
  193. package/serialization/resources/intelligentFields/types/IntelligentFieldValueSearchResponse.js +45 -0
  194. package/serialization/resources/intelligentFields/types/IntelligentFieldValueSortField.d.ts +7 -0
  195. package/serialization/resources/intelligentFields/types/IntelligentFieldValueSortField.js +39 -0
  196. package/serialization/resources/intelligentFields/types/index.d.ts +13 -0
  197. package/serialization/resources/intelligentFields/types/index.js +29 -0
  198. package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +2 -0
  199. package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +2 -0
  200. package/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +2 -0
  201. package/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +2 -0
  202. package/serialization/resources/knowledge/types/KnowledgeBaseVersionProgress.d.ts +11 -0
  203. package/serialization/resources/knowledge/types/KnowledgeBaseVersionProgress.js +43 -0
  204. package/serialization/resources/knowledge/types/KnowledgeBaseVersionProgressRequest.d.ts +13 -0
  205. package/serialization/resources/knowledge/types/KnowledgeBaseVersionProgressRequest.js +45 -0
  206. package/serialization/resources/knowledge/types/index.d.ts +2 -0
  207. package/serialization/resources/knowledge/types/index.js +2 -0
  208. package/serialization/resources/segments/types/SegmentPatchRequest.d.ts +2 -0
  209. package/serialization/resources/segments/types/SegmentPatchRequest.js +2 -0
  210. package/serialization/resources/segments/types/SegmentRequest.d.ts +2 -0
  211. package/serialization/resources/segments/types/SegmentRequest.js +2 -0
  212. package/serialization/resources/segments/types/SegmentSummary.d.ts +14 -0
  213. package/serialization/resources/segments/types/SegmentSummary.js +47 -0
  214. package/serialization/resources/segments/types/index.d.ts +1 -0
  215. package/serialization/resources/segments/types/index.js +1 -0
  216. package/version.d.ts +1 -1
  217. package/version.js +1 -1
  218. package/api/resources/commons/types/IntelligentFieldCondition.d.ts +0 -37
  219. /package/api/resources/{commons/types/IntelligentFieldCondition.js → charters/types/CharterSummary.js} +0 -0
@@ -975,6 +975,123 @@ class KnowledgeClient {
975
975
  return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/knowledge/{knowledgeBaseReferenceId}/version/finalize");
976
976
  });
977
977
  }
978
+ /**
979
+ * Report refresh progress for an in-progress knowledge base version.
980
+ *
981
+ * Progress is advisory and shown to users while a refresh runs. Each call replaces the
982
+ * version's entire progress state - no history is kept, only the most recent value is
983
+ * retained. Will throw an exception if the target version is not in progress.
984
+ *
985
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to report progress for. All other entity ID fields are inferred from the request.
986
+ * @param {MavenAGI.KnowledgeBaseVersionProgressRequest} request
987
+ * @param {KnowledgeClient.RequestOptions} requestOptions - Request-specific configuration.
988
+ *
989
+ * @throws {@link MavenAGI.NotFoundError}
990
+ * @throws {@link MavenAGI.BadRequestError}
991
+ * @throws {@link MavenAGI.PayloadTooLargeError}
992
+ * @throws {@link MavenAGI.TooManyRequestsError}
993
+ * @throws {@link MavenAGI.ServerError}
994
+ *
995
+ * @example
996
+ * await client.knowledge.updateKnowledgeBaseVersionProgress("help-center", {
997
+ * versionId: {
998
+ * type: "KNOWLEDGE_BASE_VERSION",
999
+ * referenceId: "versionId",
1000
+ * appId: "maven"
1001
+ * },
1002
+ * progress: {
1003
+ * message: "Fetching articles from the help center",
1004
+ * completedCount: 120,
1005
+ * totalCount: 500
1006
+ * }
1007
+ * })
1008
+ */
1009
+ updateKnowledgeBaseVersionProgress(knowledgeBaseReferenceId, request, requestOptions) {
1010
+ return core.HttpResponsePromise.fromPromise(this.__updateKnowledgeBaseVersionProgress(knowledgeBaseReferenceId, request, requestOptions));
1011
+ }
1012
+ __updateKnowledgeBaseVersionProgress(knowledgeBaseReferenceId, request, requestOptions) {
1013
+ return __awaiter(this, void 0, void 0, function* () {
1014
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1015
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1016
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
1017
+ "X-Organization-Id": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationId,
1018
+ "X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
1019
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1020
+ const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
1021
+ url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${core.url.encodePathParam(knowledgeBaseReferenceId)}/version/progress`),
1022
+ method: "POST",
1023
+ headers: _headers,
1024
+ contentType: "application/json",
1025
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
1026
+ requestType: "json",
1027
+ body: serializers.KnowledgeBaseVersionProgressRequest.jsonOrThrow(request, {
1028
+ unrecognizedObjectKeys: "strip",
1029
+ }),
1030
+ timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
1031
+ maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
1032
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1033
+ fetchFn: (_p = this._options) === null || _p === void 0 ? void 0 : _p.fetch,
1034
+ logging: this._options.logging,
1035
+ });
1036
+ if (_response.ok) {
1037
+ return {
1038
+ data: serializers.KnowledgeBaseVersion.parseOrThrow(_response.body, {
1039
+ unrecognizedObjectKeys: "passthrough",
1040
+ allowUnrecognizedUnionMembers: true,
1041
+ allowUnrecognizedEnumValues: true,
1042
+ breadcrumbsPrefix: ["response"],
1043
+ }),
1044
+ rawResponse: _response.rawResponse,
1045
+ };
1046
+ }
1047
+ if (_response.error.reason === "status-code") {
1048
+ switch (_response.error.statusCode) {
1049
+ case 404:
1050
+ throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
1051
+ unrecognizedObjectKeys: "passthrough",
1052
+ allowUnrecognizedUnionMembers: true,
1053
+ allowUnrecognizedEnumValues: true,
1054
+ breadcrumbsPrefix: ["response"],
1055
+ }), _response.rawResponse);
1056
+ case 400:
1057
+ throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
1058
+ unrecognizedObjectKeys: "passthrough",
1059
+ allowUnrecognizedUnionMembers: true,
1060
+ allowUnrecognizedEnumValues: true,
1061
+ breadcrumbsPrefix: ["response"],
1062
+ }), _response.rawResponse);
1063
+ case 413:
1064
+ throw new MavenAGI.PayloadTooLargeError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
1065
+ unrecognizedObjectKeys: "passthrough",
1066
+ allowUnrecognizedUnionMembers: true,
1067
+ allowUnrecognizedEnumValues: true,
1068
+ breadcrumbsPrefix: ["response"],
1069
+ }), _response.rawResponse);
1070
+ case 429:
1071
+ throw new MavenAGI.TooManyRequestsError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
1072
+ unrecognizedObjectKeys: "passthrough",
1073
+ allowUnrecognizedUnionMembers: true,
1074
+ allowUnrecognizedEnumValues: true,
1075
+ breadcrumbsPrefix: ["response"],
1076
+ }), _response.rawResponse);
1077
+ case 500:
1078
+ throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
1079
+ unrecognizedObjectKeys: "passthrough",
1080
+ allowUnrecognizedUnionMembers: true,
1081
+ allowUnrecognizedEnumValues: true,
1082
+ breadcrumbsPrefix: ["response"],
1083
+ }), _response.rawResponse);
1084
+ default:
1085
+ throw new errors.MavenAGIError({
1086
+ statusCode: _response.error.statusCode,
1087
+ body: _response.error.body,
1088
+ rawResponse: _response.rawResponse,
1089
+ });
1090
+ }
1091
+ }
1092
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/knowledge/{knowledgeBaseReferenceId}/version/progress");
1093
+ });
1094
+ }
978
1095
  /**
979
1096
  * List all active versions for a knowledge base. Returns the most recent versions first.
980
1097
  *
@@ -83,4 +83,9 @@ export interface KnowledgeBaseResponse extends MavenAGI.KnowledgeBaseProperties
83
83
  url?: string;
84
84
  /** The indexing status of the latest version of the knowledge base. */
85
85
  indexingState?: MavenAGI.KnowledgeBaseIndexingProgressState;
86
+ /**
87
+ * Refresh progress most recently reported by the app that owns this knowledge base.
88
+ * Only populated while the latest version is in progress - absent once it has completed.
89
+ */
90
+ progress?: MavenAGI.KnowledgeBaseVersionProgress;
86
91
  }
@@ -14,6 +14,26 @@ import type * as MavenAGI from "../../../index";
14
14
  * createdAt: new Date("2024-01-01T00:00:00.000Z"),
15
15
  * updatedAt: new Date("2024-02-02T00:00:00.000Z")
16
16
  * }
17
+ *
18
+ * @example
19
+ * {
20
+ * versionId: {
21
+ * type: MavenAGI.EntityType.KnowledgeBaseVersion,
22
+ * referenceId: "versionId",
23
+ * appId: "maven",
24
+ * organizationId: "acme",
25
+ * agentId: "support"
26
+ * },
27
+ * type: MavenAGI.KnowledgeBaseVersionType.Full,
28
+ * status: MavenAGI.KnowledgeBaseVersionStatus.InProgress,
29
+ * createdAt: new Date("2024-01-01T00:00:00.000Z"),
30
+ * updatedAt: new Date("2024-02-02T00:00:00.000Z"),
31
+ * progress: {
32
+ * message: "Fetching articles from the help center",
33
+ * completedCount: 120,
34
+ * totalCount: 500
35
+ * }
36
+ * }
17
37
  */
18
38
  export interface KnowledgeBaseVersion extends MavenAGI.KnowledgeBaseVersionRequest {
19
39
  /** The unique ID of the knowledge base version. */
@@ -28,4 +48,9 @@ export interface KnowledgeBaseVersion extends MavenAGI.KnowledgeBaseVersionReque
28
48
  updatedAt: Date;
29
49
  /** The indexing status of the knowledge base version. */
30
50
  indexingState?: MavenAGI.KnowledgeBaseIndexingProgressState;
51
+ /**
52
+ * Refresh progress most recently reported by the app that owns this knowledge base.
53
+ * Only populated while the version is in progress - absent once the version has completed.
54
+ */
55
+ progress?: MavenAGI.KnowledgeBaseVersionProgress;
31
56
  }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Refresh progress reported by the app that owns a knowledge base, surfaced to users while
3
+ * a version is being built. Shared by the progress update request and the version response.
4
+ *
5
+ * The `message` is always present. The two counts are optional but must be supplied
6
+ * together - providing one without the other is rejected, since a progress bar needs both.
7
+ *
8
+ * @example
9
+ * {
10
+ * message: "Fetching articles from the help center",
11
+ * completedCount: 120,
12
+ * totalCount: 500
13
+ * }
14
+ */
15
+ export interface KnowledgeBaseVersionProgress {
16
+ /** A user-facing message describing what the refresh is currently doing. */
17
+ message: string;
18
+ /**
19
+ * How many units of work the refresh has finished so far. The numerator of a progress bar.
20
+ * Must be supplied together with `totalCount`.
21
+ */
22
+ completedCount?: number;
23
+ /**
24
+ * How many units of work the refresh expects in total. The denominator of a progress bar.
25
+ * Must be supplied together with `completedCount`. Apps may revise this as a refresh
26
+ * discovers more work.
27
+ */
28
+ totalCount?: number;
29
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,24 @@
1
+ import type * as MavenAGI from "../../../index";
2
+ /**
3
+ * @example
4
+ * {
5
+ * versionId: {
6
+ * type: MavenAGI.EntityType.KnowledgeBaseVersion,
7
+ * referenceId: "versionId",
8
+ * appId: "maven"
9
+ * },
10
+ * progress: {
11
+ * message: "Fetching articles from the help center",
12
+ * completedCount: 120,
13
+ * totalCount: 500
14
+ * }
15
+ * }
16
+ */
17
+ export interface KnowledgeBaseVersionProgressRequest {
18
+ /** The App ID of the knowledge base to report progress for. If not provided the ID of the calling app will be used. */
19
+ appId?: string;
20
+ /** ID that uniquely identifies which knowledge base version to report progress for. */
21
+ versionId: MavenAGI.EntityIdWithoutAgent;
22
+ /** The progress state to store on the version, replacing any previously reported progress. */
23
+ progress: MavenAGI.KnowledgeBaseVersionProgress;
24
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -15,6 +15,8 @@ export * from "./KnowledgeBasesResponse";
15
15
  export * from "./KnowledgeBaseType";
16
16
  export * from "./KnowledgeBaseVersion";
17
17
  export * from "./KnowledgeBaseVersionFinalizeStatus";
18
+ export * from "./KnowledgeBaseVersionProgress";
19
+ export * from "./KnowledgeBaseVersionProgressRequest";
18
20
  export * from "./KnowledgeBaseVersionRequest";
19
21
  export * from "./KnowledgeBaseVersionStatus";
20
22
  export * from "./KnowledgeBaseVersionsListResponse";
@@ -31,6 +31,8 @@ __exportStar(require("./KnowledgeBasesResponse"), exports);
31
31
  __exportStar(require("./KnowledgeBaseType"), exports);
32
32
  __exportStar(require("./KnowledgeBaseVersion"), exports);
33
33
  __exportStar(require("./KnowledgeBaseVersionFinalizeStatus"), exports);
34
+ __exportStar(require("./KnowledgeBaseVersionProgress"), exports);
35
+ __exportStar(require("./KnowledgeBaseVersionProgressRequest"), exports);
34
36
  __exportStar(require("./KnowledgeBaseVersionRequest"), exports);
35
37
  __exportStar(require("./KnowledgeBaseVersionStatus"), exports);
36
38
  __exportStar(require("./KnowledgeBaseVersionsListResponse"), exports);
@@ -502,9 +502,11 @@ class SegmentsClient {
502
502
  __delete(segmentReferenceId_1) {
503
503
  return __awaiter(this, arguments, void 0, function* (segmentReferenceId, request = {}, requestOptions) {
504
504
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
505
- const { appId } = request;
505
+ const { appId, variantReferenceId, variantAppId } = request;
506
506
  const _queryParams = {
507
507
  appId,
508
+ variantReferenceId,
509
+ variantAppId,
508
510
  };
509
511
  const _authRequest = yield this._options.authProvider.getAuthRequest();
510
512
  const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
@@ -5,4 +5,16 @@
5
5
  export interface SegmentDeleteRequest {
6
6
  /** The App ID of the segment to delete. If not provided, the ID of the calling app will be used. */
7
7
  appId?: string;
8
+ /**
9
+ * The reference ID of the agent variant this delete is scoped to. When set, the
10
+ * deletion is staged in that variant's working set instead of being applied to the
11
+ * agent's live configuration.
12
+ *
13
+ * Omit this parameter to delete directly from the agent. Variant scoping is not
14
+ * active yet: a variant supplied today is accepted and ignored, and the delete applies
15
+ * to the agent.
16
+ */
17
+ variantReferenceId?: string;
18
+ /** The App ID of the agent variant named by `variantReferenceId`. If not provided, the ID of the calling app will be used. */
19
+ variantAppId?: string;
8
20
  }
@@ -10,4 +10,12 @@ export interface SegmentPatchRequest {
10
10
  precondition?: MavenAGI.Precondition;
11
11
  /** The status of the segment. Segments can only be deactivated if they are not set on any actions or active knowledge bases. */
12
12
  status?: MavenAGI.SegmentStatus;
13
+ /**
14
+ * The agent variant this patch is scoped to. When set, the patch is staged in that
15
+ * variant's working set instead of being applied to the agent's live configuration.
16
+ *
17
+ * Omit this field to patch the agent directly. Variant scoping is not active yet: a
18
+ * variant supplied today is accepted and ignored, and the patch applies to the agent.
19
+ */
20
+ variantId?: MavenAGI.EntityIdWithoutAgent;
13
21
  }
@@ -22,6 +22,14 @@ import type * as MavenAGI from "../../../index";
22
22
  export interface SegmentRequest extends MavenAGI.SegmentBase {
23
23
  /** ID that uniquely identifies this segment */
24
24
  segmentId: MavenAGI.EntityIdBase;
25
+ /**
26
+ * The agent variant this write is scoped to. When set, the segment content is staged in
27
+ * that variant's working set instead of being applied to the agent's live configuration.
28
+ *
29
+ * Omit this field to write directly to the agent. Variant scoping is not active yet: a
30
+ * variant supplied today is accepted and ignored, and the write applies to the agent.
31
+ */
32
+ variantId?: MavenAGI.EntityIdWithoutAgent;
25
33
  /** The precondition that must be met for a conversation message to be included in the segment. */
26
34
  precondition: MavenAGI.Precondition;
27
35
  /** Desired status for the segment. If omitted, defaults to ACTIVE. In the future this will become required, so specify ACTIVE or INACTIVE if possible. */
@@ -0,0 +1,14 @@
1
+ import type * as MavenAGI from "../../../index";
2
+ /**
3
+ * A lightweight segment representation containing identity, name, status, and precondition.
4
+ */
5
+ export interface SegmentSummary {
6
+ /** ID that uniquely identifies this segment. */
7
+ segmentId: MavenAGI.EntityId;
8
+ /** The display name of the segment. */
9
+ name: string;
10
+ /** The lifecycle status of the segment. */
11
+ status: MavenAGI.SegmentStatus;
12
+ /** The precondition that must be met for a conversation message to match this segment. */
13
+ precondition: MavenAGI.PreconditionResponse;
14
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,5 +5,6 @@ export * from "./SegmentPatchRequest";
5
5
  export * from "./SegmentRequest";
6
6
  export * from "./SegmentResponse";
7
7
  export * from "./SegmentStatus";
8
+ export * from "./SegmentSummary";
8
9
  export * from "./SegmentsSearchRequest";
9
10
  export * from "./SegmentsSearchResponse";
@@ -21,5 +21,6 @@ __exportStar(require("./SegmentPatchRequest"), exports);
21
21
  __exportStar(require("./SegmentRequest"), exports);
22
22
  __exportStar(require("./SegmentResponse"), exports);
23
23
  __exportStar(require("./SegmentStatus"), exports);
24
+ __exportStar(require("./SegmentSummary"), exports);
24
25
  __exportStar(require("./SegmentsSearchRequest"), exports);
25
26
  __exportStar(require("./SegmentsSearchResponse"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mavenagi",
3
- "version": "1.2.56",
3
+ "version": "1.2.57",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",