mavenagi 1.2.63 → 1.2.64

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 (83) hide show
  1. package/BaseClient.js +2 -2
  2. package/api/resources/agents/client/requests/AgentPatchRequest.d.ts +13 -1
  3. package/api/resources/agents/types/Agent.d.ts +6 -0
  4. package/api/resources/agents/types/AgentPrompting.d.ts +2 -0
  5. package/api/resources/capabilities/client/Client.d.ts +35 -0
  6. package/api/resources/capabilities/client/Client.js +117 -0
  7. package/api/resources/capabilities/client/requests/CapabilitiesSearchRequest.d.ts +4 -1
  8. package/api/resources/capabilities/client/requests/CapabilityExecutionsSearchRequest.d.ts +36 -0
  9. package/api/resources/capabilities/client/requests/CapabilityExecutionsSearchRequest.js +3 -0
  10. package/api/resources/capabilities/client/requests/GetCapabilityByTypeRequest.d.ts +4 -1
  11. package/api/resources/capabilities/client/requests/index.d.ts +1 -0
  12. package/api/resources/capabilities/types/CapabilityExecution.d.ts +14 -0
  13. package/api/resources/capabilities/types/CapabilityExecution.js +3 -0
  14. package/api/resources/capabilities/types/CapabilityExecutionBase.d.ts +32 -0
  15. package/api/resources/capabilities/types/CapabilityExecutionBase.js +3 -0
  16. package/api/resources/capabilities/types/CapabilityExecutionCompletionReason.d.ts +36 -0
  17. package/api/resources/capabilities/types/CapabilityExecutionCompletionReason.js +39 -0
  18. package/api/resources/capabilities/types/CapabilityExecutionRetryability.d.ts +17 -0
  19. package/api/resources/capabilities/types/CapabilityExecutionRetryability.js +20 -0
  20. package/api/resources/capabilities/types/CapabilityExecutionStatus.d.ts +10 -0
  21. package/api/resources/capabilities/types/CapabilityExecutionStatus.js +13 -0
  22. package/api/resources/capabilities/types/CapabilityExecutionsSearchResponse.d.ts +62 -0
  23. package/api/resources/capabilities/types/CapabilityExecutionsSearchResponse.js +3 -0
  24. package/api/resources/capabilities/types/ConversationKickoffCapabilityExecution.d.ts +7 -0
  25. package/api/resources/capabilities/types/ConversationKickoffCapabilityExecution.js +3 -0
  26. package/api/resources/capabilities/types/TriggerCapabilityExecution.d.ts +19 -0
  27. package/api/resources/capabilities/types/TriggerCapabilityExecution.js +3 -0
  28. package/api/resources/capabilities/types/index.d.ts +8 -0
  29. package/api/resources/capabilities/types/index.js +8 -0
  30. package/api/resources/charters/client/Client.js +3 -1
  31. package/api/resources/charters/client/requests/CharterDeleteRequest.d.ts +6 -6
  32. package/api/resources/charters/client/requests/CharterGetAncestorsRequest.d.ts +12 -0
  33. package/api/resources/charters/client/requests/CharterGetRequest.d.ts +9 -1
  34. package/api/resources/charters/client/requests/CharterPatchRequest.d.ts +5 -6
  35. package/api/resources/charters/types/CharterBase.d.ts +4 -3
  36. package/api/resources/charters/types/CharterListChildrenRequest.d.ts +10 -0
  37. package/api/resources/charters/types/CharterSearchFilter.d.ts +9 -1
  38. package/api/resources/commons/types/BotLogicCharterDetail.d.ts +1 -1
  39. package/api/resources/commons/types/BotLogicSegmentsItem.d.ts +3 -0
  40. package/api/resources/commons/types/ConversationAnalysis.d.ts +1 -1
  41. package/api/resources/commons/types/ErrorReason.d.ts +3 -0
  42. package/api/resources/commons/types/ErrorReason.js +3 -0
  43. package/api/resources/conversation/client/Client.d.ts +6 -2
  44. package/api/resources/conversation/client/Client.js +6 -2
  45. package/api/resources/customers/types/CustomerFilter.d.ts +14 -1
  46. package/api/resources/intelligentFields/client/Client.d.ts +1 -1
  47. package/api/resources/intelligentFields/client/Client.js +1 -1
  48. package/api/resources/intelligentFields/client/requests/IntelligentFieldGetRequest.d.ts +9 -1
  49. package/api/resources/intelligentFields/types/IntelligentFieldValueSearchRequest.d.ts +5 -4
  50. package/package.json +1 -1
  51. package/reference.md +85 -2
  52. package/serialization/resources/agents/client/requests/AgentPatchRequest.d.ts +2 -0
  53. package/serialization/resources/agents/client/requests/AgentPatchRequest.js +2 -0
  54. package/serialization/resources/agents/types/Agent.d.ts +2 -0
  55. package/serialization/resources/agents/types/Agent.js +2 -0
  56. package/serialization/resources/capabilities/client/requests/CapabilityExecutionsSearchRequest.d.ts +16 -0
  57. package/serialization/resources/capabilities/client/requests/CapabilityExecutionsSearchRequest.js +50 -0
  58. package/serialization/resources/capabilities/client/requests/index.d.ts +1 -0
  59. package/serialization/resources/capabilities/client/requests/index.js +3 -1
  60. package/serialization/resources/capabilities/types/CapabilityExecution.d.ts +15 -0
  61. package/serialization/resources/capabilities/types/CapabilityExecution.js +49 -0
  62. package/serialization/resources/capabilities/types/CapabilityExecutionBase.d.ts +20 -0
  63. package/serialization/resources/capabilities/types/CapabilityExecutionBase.js +52 -0
  64. package/serialization/resources/capabilities/types/CapabilityExecutionCompletionReason.d.ts +7 -0
  65. package/serialization/resources/capabilities/types/CapabilityExecutionCompletionReason.js +50 -0
  66. package/serialization/resources/capabilities/types/CapabilityExecutionRetryability.d.ts +7 -0
  67. package/serialization/resources/capabilities/types/CapabilityExecutionRetryability.js +39 -0
  68. package/serialization/resources/capabilities/types/CapabilityExecutionStatus.d.ts +7 -0
  69. package/serialization/resources/capabilities/types/CapabilityExecutionStatus.js +39 -0
  70. package/serialization/resources/capabilities/types/CapabilityExecutionsSearchResponse.d.ts +11 -0
  71. package/serialization/resources/capabilities/types/CapabilityExecutionsSearchResponse.js +45 -0
  72. package/serialization/resources/capabilities/types/ConversationKickoffCapabilityExecution.d.ts +9 -0
  73. package/serialization/resources/capabilities/types/ConversationKickoffCapabilityExecution.js +40 -0
  74. package/serialization/resources/capabilities/types/TriggerCapabilityExecution.d.ts +15 -0
  75. package/serialization/resources/capabilities/types/TriggerCapabilityExecution.js +49 -0
  76. package/serialization/resources/capabilities/types/index.d.ts +8 -0
  77. package/serialization/resources/capabilities/types/index.js +8 -0
  78. package/serialization/resources/charters/types/CharterListChildrenRequest.d.ts +2 -0
  79. package/serialization/resources/charters/types/CharterListChildrenRequest.js +2 -0
  80. package/serialization/resources/commons/types/ErrorReason.d.ts +1 -1
  81. package/serialization/resources/commons/types/ErrorReason.js +1 -0
  82. package/version.d.ts +1 -1
  83. package/version.js +1 -1
package/BaseClient.js CHANGED
@@ -44,8 +44,8 @@ function normalizeClientOptions(options) {
44
44
  const headers = (0, headers_1.mergeHeaders)({
45
45
  "X-Fern-Language": "JavaScript",
46
46
  "X-Fern-SDK-Name": "mavenagi",
47
- "X-Fern-SDK-Version": "1.2.63",
48
- "User-Agent": "mavenagi/1.2.63",
47
+ "X-Fern-SDK-Version": "1.2.64",
48
+ "User-Agent": "mavenagi/1.2.64",
49
49
  "X-Fern-Runtime": core.RUNTIME.type,
50
50
  "X-Fern-Runtime-Version": core.RUNTIME.version,
51
51
  "X-Organization-Id": options === null || options === void 0 ? void 0 : options.organizationId,
@@ -18,8 +18,20 @@ export interface AgentPatchRequest {
18
18
  persona?: MavenAGI.LlmPersona;
19
19
  /** Deprecated. Superseded by charters, which determine agent behavior per round. Has no effect for agents using charters. */
20
20
  additionalPromptText?: string | null;
21
- /** LLM prompt for category generation. */
21
+ /**
22
+ * Deprecated. Use `categoryIntelligentFieldId` instead. Not supported on new agents, and ignored while `categoryIntelligentFieldId` is set.
23
+ *
24
+ * LLM prompt for category generation.
25
+ */
22
26
  categoryGenerationPromptText?: string | null;
27
+ /**
28
+ * The intelligent field whose value becomes each conversation's category. Send null to clear it.
29
+ *
30
+ * Must be a `STRING` conversation field on this agent. Giving the field `enumOptions` is highly recommended, so the category comes from a fixed list.
31
+ *
32
+ * The field must be `ACTIVE` to produce values. While it is inactive, conversations get no category. With agent variants, a conversation gets a category only if the field is active in its variant. Categories are capped at 280 characters.
33
+ */
34
+ categoryIntelligentFieldId?: MavenAGI.EntityIdWithoutAgent | null;
23
35
  /** LLM prompt for generating a response when the user's question has been detected as unsafe. */
24
36
  contentSafetyViolationResponsePromptText?: string | null;
25
37
  /**
@@ -28,4 +28,10 @@ export interface Agent {
28
28
  systemFallbackMessage?: string;
29
29
  /** Agent prompting settings. */
30
30
  prompting: MavenAGI.AgentPrompting;
31
+ /**
32
+ * The intelligent field whose value becomes each conversation's category.
33
+ * When set, its value replaces the category generated from `prompting.categoryGenerationPromptText`.
34
+ * An inactive field produces no values, so conversations get no category until it is activated.
35
+ */
36
+ categoryIntelligentFieldId?: MavenAGI.EntityIdWithoutAgent;
31
37
  }
@@ -5,6 +5,8 @@ export interface AgentPrompting {
5
5
  /** Deprecated. Superseded by charters, which determine agent behavior per round. Has no effect for agents using charters. */
6
6
  additionalPromptText?: string;
7
7
  /**
8
+ * Deprecated. Use `categoryIntelligentFieldId` instead. Not supported on new agents, and ignored while `categoryIntelligentFieldId` is set.
9
+ *
8
10
  * LLM prompt for category generation.
9
11
  *
10
12
  * Use this to specify a fixed set of categories that an LLM should choose from when analyzing a conversation.
@@ -115,4 +115,39 @@ export declare class CapabilitiesClient {
115
115
  */
116
116
  searchCapabilities(request?: MavenAGI.CapabilitiesSearchRequest, requestOptions?: CapabilitiesClient.RequestOptions): core.HttpResponsePromise<MavenAGI.CapabilitiesSearchResponse>;
117
117
  private __searchCapabilities;
118
+ /**
119
+ * Search the recorded runs of an agent's capabilities, newest first by default. An execution
120
+ * is one run of one capability for one subject, with its outcome and timing: an Event
121
+ * Trigger notifying its app, or a Conversation Kickoff running when a conversation started.
122
+ *
123
+ * Pass a conversation in `subjectIds` to get the executions recorded against it. An
124
+ * `EVENT_CREATED` trigger records the event as its subject, so pass the event's ID to find
125
+ * those.
126
+ *
127
+ * Results can trail a run by a few seconds. Executions are searchable for 90 days.
128
+ *
129
+ * @param {MavenAGI.CapabilityExecutionsSearchRequest} request
130
+ * @param {CapabilitiesClient.RequestOptions} requestOptions - Request-specific configuration.
131
+ *
132
+ * @throws {@link MavenAGI.NotFoundError}
133
+ * @throws {@link MavenAGI.BadRequestError}
134
+ * @throws {@link MavenAGI.PayloadTooLargeError}
135
+ * @throws {@link MavenAGI.TooManyRequestsError}
136
+ * @throws {@link MavenAGI.ServerError}
137
+ * @throws {@link errors.MavenAGIError}
138
+ * @throws {@link errors.MavenAGITimeoutError}
139
+ *
140
+ * @example
141
+ * await client.capabilities.searchCapabilityExecutions({
142
+ * subjectIds: [{
143
+ * referenceId: "conversation-123",
144
+ * appId: "zendesk",
145
+ * organizationId: "acme",
146
+ * agentId: "support",
147
+ * type: "CONVERSATION"
148
+ * }]
149
+ * })
150
+ */
151
+ searchCapabilityExecutions(request?: MavenAGI.CapabilityExecutionsSearchRequest, requestOptions?: CapabilitiesClient.RequestOptions): core.HttpResponsePromise<MavenAGI.CapabilityExecutionsSearchResponse>;
152
+ private __searchCapabilityExecutions;
118
153
  }
@@ -517,5 +517,122 @@ class CapabilitiesClient {
517
517
  return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/capabilities/search");
518
518
  });
519
519
  }
520
+ /**
521
+ * Search the recorded runs of an agent's capabilities, newest first by default. An execution
522
+ * is one run of one capability for one subject, with its outcome and timing: an Event
523
+ * Trigger notifying its app, or a Conversation Kickoff running when a conversation started.
524
+ *
525
+ * Pass a conversation in `subjectIds` to get the executions recorded against it. An
526
+ * `EVENT_CREATED` trigger records the event as its subject, so pass the event's ID to find
527
+ * those.
528
+ *
529
+ * Results can trail a run by a few seconds. Executions are searchable for 90 days.
530
+ *
531
+ * @param {MavenAGI.CapabilityExecutionsSearchRequest} request
532
+ * @param {CapabilitiesClient.RequestOptions} requestOptions - Request-specific configuration.
533
+ *
534
+ * @throws {@link MavenAGI.NotFoundError}
535
+ * @throws {@link MavenAGI.BadRequestError}
536
+ * @throws {@link MavenAGI.PayloadTooLargeError}
537
+ * @throws {@link MavenAGI.TooManyRequestsError}
538
+ * @throws {@link MavenAGI.ServerError}
539
+ * @throws {@link errors.MavenAGIError}
540
+ * @throws {@link errors.MavenAGITimeoutError}
541
+ *
542
+ * @example
543
+ * await client.capabilities.searchCapabilityExecutions({
544
+ * subjectIds: [{
545
+ * referenceId: "conversation-123",
546
+ * appId: "zendesk",
547
+ * organizationId: "acme",
548
+ * agentId: "support",
549
+ * type: "CONVERSATION"
550
+ * }]
551
+ * })
552
+ */
553
+ searchCapabilityExecutions(request = {}, requestOptions) {
554
+ return core.HttpResponsePromise.fromPromise(this.__searchCapabilityExecutions(request, requestOptions));
555
+ }
556
+ __searchCapabilityExecutions() {
557
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
558
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
559
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
560
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
561
+ "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,
562
+ "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,
563
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
564
+ const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
565
+ 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/capabilities/executions/search"),
566
+ method: "POST",
567
+ headers: _headers,
568
+ contentType: "application/json",
569
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
570
+ requestType: "json",
571
+ body: (0, requestBody_1.mergeAdditionalBodyParameters)(serializers.CapabilityExecutionsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
572
+ 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,
573
+ 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,
574
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
575
+ fetchFn: (_p = this._options) === null || _p === void 0 ? void 0 : _p.fetch,
576
+ logging: this._options.logging,
577
+ });
578
+ if (_response.ok) {
579
+ return {
580
+ data: serializers.CapabilityExecutionsSearchResponse.parseOrThrow(_response.body, {
581
+ unrecognizedObjectKeys: "passthrough",
582
+ allowUnrecognizedUnionMembers: true,
583
+ allowUnrecognizedEnumValues: true,
584
+ breadcrumbsPrefix: ["response"],
585
+ }),
586
+ rawResponse: _response.rawResponse,
587
+ };
588
+ }
589
+ if (_response.error.reason === "status-code") {
590
+ switch (_response.error.statusCode) {
591
+ case 404:
592
+ throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
593
+ unrecognizedObjectKeys: "passthrough",
594
+ allowUnrecognizedUnionMembers: true,
595
+ allowUnrecognizedEnumValues: true,
596
+ breadcrumbsPrefix: ["response"],
597
+ }), _response.rawResponse);
598
+ case 400:
599
+ throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
600
+ unrecognizedObjectKeys: "passthrough",
601
+ allowUnrecognizedUnionMembers: true,
602
+ allowUnrecognizedEnumValues: true,
603
+ breadcrumbsPrefix: ["response"],
604
+ }), _response.rawResponse);
605
+ case 413:
606
+ throw new MavenAGI.PayloadTooLargeError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
607
+ unrecognizedObjectKeys: "passthrough",
608
+ allowUnrecognizedUnionMembers: true,
609
+ allowUnrecognizedEnumValues: true,
610
+ breadcrumbsPrefix: ["response"],
611
+ }), _response.rawResponse);
612
+ case 429:
613
+ throw new MavenAGI.TooManyRequestsError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
614
+ unrecognizedObjectKeys: "passthrough",
615
+ allowUnrecognizedUnionMembers: true,
616
+ allowUnrecognizedEnumValues: true,
617
+ breadcrumbsPrefix: ["response"],
618
+ }), _response.rawResponse);
619
+ case 500:
620
+ throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
621
+ unrecognizedObjectKeys: "passthrough",
622
+ allowUnrecognizedUnionMembers: true,
623
+ allowUnrecognizedEnumValues: true,
624
+ breadcrumbsPrefix: ["response"],
625
+ }), _response.rawResponse);
626
+ default:
627
+ throw new errors.MavenAGIError({
628
+ statusCode: _response.error.statusCode,
629
+ body: _response.error.body,
630
+ rawResponse: _response.rawResponse,
631
+ });
632
+ }
633
+ }
634
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/capabilities/executions/search");
635
+ });
636
+ }
520
637
  }
521
638
  exports.CapabilitiesClient = CapabilitiesClient;
@@ -28,7 +28,10 @@ export interface CapabilitiesSearchRequest extends MavenAGI.BaseCappedPaginatedR
28
28
  * The agent variant to read intelligent field versions through. Required on an agent
29
29
  * with versioned intelligent fields unless `capabilityTypes` excludes them; a
30
30
  * request that omits it there is rejected with reason `VARIANT_REQUIRED`. Otherwise,
31
- * if omitted, the agent's only variant is used.
31
+ * if omitted, the agent's only variant is used, as its snapshot has it. When a
32
+ * variant is named, its staged edits are included: each field is listed once, at its
33
+ * staged edit if it has one, and a field deleted in the variant, whether the delete is
34
+ * staged or already in its snapshot, is left out.
32
35
  */
33
36
  variantId?: MavenAGI.EntityIdWithoutAgent;
34
37
  /** Deprecated, use `variantId`, which wins when both are set. */
@@ -0,0 +1,36 @@
1
+ import type * as MavenAGI from "../../../../index";
2
+ /**
3
+ * @example
4
+ * {
5
+ * subjectIds: [{
6
+ * referenceId: "conversation-123",
7
+ * appId: "zendesk",
8
+ * organizationId: "acme",
9
+ * agentId: "support",
10
+ * type: "CONVERSATION"
11
+ * }]
12
+ * }
13
+ */
14
+ export interface CapabilityExecutionsSearchRequest extends MavenAGI.BaseCappedPaginatedRequest {
15
+ /**
16
+ * Only return executions for these subjects: conversations, inbox items or events.
17
+ * Same shape as the `subjectId` on a returned execution. At most 100 ids.
18
+ *
19
+ * Filtering by feedback is not supported and is rejected with a 400. Feedback
20
+ * subjects come only from deprecated `FEEDBACK_CREATED` triggers; switch those to
21
+ * `EVENT_CREATED` triggers, whose event subjects can be filtered on.
22
+ */
23
+ subjectIds?: MavenAGI.EntityId[];
24
+ /**
25
+ * Only return executions of these kinds of capability. Event Triggers and
26
+ * Conversation Kickoffs record executions today.
27
+ */
28
+ capabilityTypes?: MavenAGI.CapabilityType[];
29
+ /**
30
+ * Only return executions of these capabilities. Same shape as the `capabilityId` on
31
+ * a returned execution. At most 100 ids.
32
+ */
33
+ capabilityIds?: MavenAGI.EntityId[];
34
+ /** Only return executions in these states. */
35
+ statuses?: MavenAGI.CapabilityExecutionStatus[];
36
+ }
@@ -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 });
@@ -12,7 +12,10 @@ export interface GetCapabilityByTypeRequest {
12
12
  * The agent variant to read an intelligent field through, by reference ID.
13
13
  * Required for an intelligent field on an agent with versioned intelligent fields; a
14
14
  * request that omits it there is rejected with reason `VARIANT_REQUIRED`. Otherwise,
15
- * if omitted, the agent's only variant is used.
15
+ * if omitted, the agent's only variant is used, as its snapshot has it. When a variant
16
+ * is named, its staged edits are included: a field with a staged edit is returned at
17
+ * that edit, a field created in the variant is returned, and a field deleted in the
18
+ * variant, whether the delete is staged or already in its snapshot, returns 404.
16
19
  * The other capability types aren't versioned and are the same in every variant,
17
20
  * though a named variant must still exist.
18
21
  */
@@ -1,4 +1,5 @@
1
1
  export type { CapabilitiesSearchRequest } from "./CapabilitiesSearchRequest";
2
+ export type { CapabilityExecutionsSearchRequest } from "./CapabilityExecutionsSearchRequest";
2
3
  export type { DeleteCapabilityByTypeRequest } from "./DeleteCapabilityByTypeRequest";
3
4
  export type { GetCapabilityByTypeRequest } from "./GetCapabilityByTypeRequest";
4
5
  export type { PatchCapabilityByTypeRequest } from "./PatchCapabilityByTypeRequest";
@@ -0,0 +1,14 @@
1
+ import type * as MavenAGI from "../../../index";
2
+ /**
3
+ * One run of one capability for one subject, with its outcome and timing. The fields every
4
+ * kind of execution has are on CapabilityExecutionBase; the rest sit with its `capabilityType`.
5
+ */
6
+ export type CapabilityExecution = MavenAGI.CapabilityExecution.Trigger | MavenAGI.CapabilityExecution.ConversationKickoff;
7
+ export declare namespace CapabilityExecution {
8
+ interface Trigger extends MavenAGI.TriggerCapabilityExecution {
9
+ capabilityType: "TRIGGER";
10
+ }
11
+ interface ConversationKickoff extends MavenAGI.ConversationKickoffCapabilityExecution {
12
+ capabilityType: "CONVERSATION_KICKOFF";
13
+ }
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 });
@@ -0,0 +1,32 @@
1
+ import type * as MavenAGI from "../../../index";
2
+ export interface CapabilityExecutionBase {
3
+ /** The capability that ran. */
4
+ capabilityId: MavenAGI.EntityId;
5
+ /**
6
+ * What it ran for: a conversation, inbox item or event. The same shape `subjectIds`
7
+ * accepts, so it can be fed straight back in as a filter.
8
+ *
9
+ * A deprecated `FEEDBACK_CREATED` trigger records a feedback here, which `subjectIds`
10
+ * cannot filter on. Switch those triggers to `EVENT_CREATED`.
11
+ */
12
+ subjectId: MavenAGI.EntityId;
13
+ status: MavenAGI.CapabilityExecutionStatus;
14
+ /** Why the execution ended the way it did. Absent while RUNNING. */
15
+ completionReason?: MavenAGI.CapabilityExecutionCompletionReason;
16
+ /**
17
+ * Detail from the app, truncated. Cleared when the subject conversation is
18
+ * wiped.
19
+ */
20
+ message?: string;
21
+ /** When the execution began. */
22
+ startedAt: Date;
23
+ /** When it ended. Absent while RUNNING. */
24
+ completedAt?: Date;
25
+ /**
26
+ * End-to-end duration in milliseconds. Includes Maven's own work, so it is not purely the
27
+ * app's response time.
28
+ */
29
+ durationMs?: number;
30
+ /** When the execution was recorded. Results are ordered by this field. */
31
+ createdAt: Date;
32
+ }
@@ -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,36 @@
1
+ /** Why an execution ended the way it did. SUCCESS is the only reason whose status is SUCCESS. */
2
+ export declare const CapabilityExecutionCompletionReason: {
3
+ /**
4
+ * The app's handler accepted the call. Not a claim that its work finished. */
5
+ readonly Success: "SUCCESS";
6
+ /**
7
+ * Never reached the app, such as a refused connection or a 502/503. */
8
+ readonly DispatchError: "DISPATCH_ERROR";
9
+ /**
10
+ * Rate limited by Maven or the app's own upstream. */
11
+ readonly RateLimited: "RATE_LIMITED";
12
+ /**
13
+ * Maven stopped waiting. The app may have completed after that. */
14
+ readonly Timeout: "TIMEOUT";
15
+ /**
16
+ * The app's handler failed or returned an error; its side effects may or may not have run. */
17
+ readonly HandlerError: "HANDLER_ERROR";
18
+ /**
19
+ * The app does not implement this hook. */
20
+ readonly NoHandler: "NO_HANDLER";
21
+ /**
22
+ * Authorization for the app or capability version failed. */
23
+ readonly Forbidden: "FORBIDDEN";
24
+ /**
25
+ * Never reported back. The run was still going long after any live one would have
26
+ * finished, so the process running it went away first. The app may or may not have been
27
+ * called. */
28
+ readonly OutcomeUnknown: "OUTCOME_UNKNOWN";
29
+ /**
30
+ * The app reported a failure and said running it again is safe. */
31
+ readonly AppRetryable: "APP_RETRYABLE";
32
+ /**
33
+ * The app reported a failure and did not ask for it to be run again. */
34
+ readonly AppRejected: "APP_REJECTED";
35
+ };
36
+ export type CapabilityExecutionCompletionReason = (typeof CapabilityExecutionCompletionReason)[keyof typeof CapabilityExecutionCompletionReason] | string;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CapabilityExecutionCompletionReason = void 0;
5
+ /** Why an execution ended the way it did. SUCCESS is the only reason whose status is SUCCESS. */
6
+ exports.CapabilityExecutionCompletionReason = {
7
+ /**
8
+ * The app's handler accepted the call. Not a claim that its work finished. */
9
+ Success: "SUCCESS",
10
+ /**
11
+ * Never reached the app, such as a refused connection or a 502/503. */
12
+ DispatchError: "DISPATCH_ERROR",
13
+ /**
14
+ * Rate limited by Maven or the app's own upstream. */
15
+ RateLimited: "RATE_LIMITED",
16
+ /**
17
+ * Maven stopped waiting. The app may have completed after that. */
18
+ Timeout: "TIMEOUT",
19
+ /**
20
+ * The app's handler failed or returned an error; its side effects may or may not have run. */
21
+ HandlerError: "HANDLER_ERROR",
22
+ /**
23
+ * The app does not implement this hook. */
24
+ NoHandler: "NO_HANDLER",
25
+ /**
26
+ * Authorization for the app or capability version failed. */
27
+ Forbidden: "FORBIDDEN",
28
+ /**
29
+ * Never reported back. The run was still going long after any live one would have
30
+ * finished, so the process running it went away first. The app may or may not have been
31
+ * called. */
32
+ OutcomeUnknown: "OUTCOME_UNKNOWN",
33
+ /**
34
+ * The app reported a failure and said running it again is safe. */
35
+ AppRetryable: "APP_RETRYABLE",
36
+ /**
37
+ * The app reported a failure and did not ask for it to be run again. */
38
+ AppRejected: "APP_REJECTED",
39
+ };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Whether running a failed execution again would be safe and worthwhile: whether the failure is
3
+ * transient, and whether a side effect may already have happened. Only the intersection is safe
4
+ * to retry automatically.
5
+ */
6
+ export declare const CapabilityExecutionRetryability: {
7
+ /**
8
+ * Transient, and running it again is safe -- the app provably never received the call, or it said so. */
9
+ readonly Retryable: "RETRYABLE";
10
+ /**
11
+ * Possibly transient, but the app may already have applied side effects. */
12
+ readonly Unsafe: "UNSAFE";
13
+ /**
14
+ * Running it again cannot succeed without a change on the app's side. */
15
+ readonly Permanent: "PERMANENT";
16
+ };
17
+ export type CapabilityExecutionRetryability = (typeof CapabilityExecutionRetryability)[keyof typeof CapabilityExecutionRetryability] | string;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CapabilityExecutionRetryability = void 0;
5
+ /**
6
+ * Whether running a failed execution again would be safe and worthwhile: whether the failure is
7
+ * transient, and whether a side effect may already have happened. Only the intersection is safe
8
+ * to retry automatically.
9
+ */
10
+ exports.CapabilityExecutionRetryability = {
11
+ /**
12
+ * Transient, and running it again is safe -- the app provably never received the call, or it said so. */
13
+ Retryable: "RETRYABLE",
14
+ /**
15
+ * Possibly transient, but the app may already have applied side effects. */
16
+ Unsafe: "UNSAFE",
17
+ /**
18
+ * Running it again cannot succeed without a change on the app's side. */
19
+ Permanent: "PERMANENT",
20
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Where an execution stands. RUNNING covers both "in flight" and "outcome never recorded", so
3
+ * an execution that stays RUNNING well past its timeout should be read as outcome unknown.
4
+ */
5
+ export declare const CapabilityExecutionStatus: {
6
+ readonly Running: "RUNNING";
7
+ readonly Success: "SUCCESS";
8
+ readonly Failed: "FAILED";
9
+ };
10
+ export type CapabilityExecutionStatus = (typeof CapabilityExecutionStatus)[keyof typeof CapabilityExecutionStatus] | string;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CapabilityExecutionStatus = void 0;
5
+ /**
6
+ * Where an execution stands. RUNNING covers both "in flight" and "outcome never recorded", so
7
+ * an execution that stays RUNNING well past its timeout should be read as outcome unknown.
8
+ */
9
+ exports.CapabilityExecutionStatus = {
10
+ Running: "RUNNING",
11
+ Success: "SUCCESS",
12
+ Failed: "FAILED",
13
+ };
@@ -0,0 +1,62 @@
1
+ import type * as MavenAGI from "../../../index";
2
+ /**
3
+ * @example
4
+ * {
5
+ * number: 0,
6
+ * size: 2,
7
+ * totalElements: 2,
8
+ * totalPages: 1,
9
+ * executions: [{
10
+ * capabilityType: "TRIGGER",
11
+ * capabilityId: {
12
+ * referenceId: "store-in-snowflake",
13
+ * appId: "snowflake",
14
+ * organizationId: "acme",
15
+ * agentId: "support",
16
+ * type: MavenAGI.EntityType.EventTrigger
17
+ * },
18
+ * subjectId: {
19
+ * referenceId: "conversation-123",
20
+ * appId: "zendesk",
21
+ * organizationId: "acme",
22
+ * agentId: "support",
23
+ * type: MavenAGI.EntityType.Conversation
24
+ * },
25
+ * status: MavenAGI.CapabilityExecutionStatus.Success,
26
+ * completionReason: MavenAGI.CapabilityExecutionCompletionReason.Success,
27
+ * startedAt: new Date("2026-08-31T10:30:05.000Z"),
28
+ * completedAt: new Date("2026-08-31T10:30:06.000Z"),
29
+ * durationMs: 1120,
30
+ * createdAt: new Date("2026-08-31T10:30:05.000Z"),
31
+ * eventType: MavenAGI.EventTriggerType.ConversationCreated,
32
+ * attempt: 1
33
+ * }, {
34
+ * capabilityType: "CONVERSATION_KICKOFF",
35
+ * capabilityId: {
36
+ * referenceId: "greet-returning-customer",
37
+ * appId: "my-billing-system",
38
+ * organizationId: "acme",
39
+ * agentId: "support",
40
+ * type: MavenAGI.EntityType.ConversationKickoff
41
+ * },
42
+ * subjectId: {
43
+ * referenceId: "conversation-123",
44
+ * appId: "zendesk",
45
+ * organizationId: "acme",
46
+ * agentId: "support",
47
+ * type: MavenAGI.EntityType.Conversation
48
+ * },
49
+ * status: MavenAGI.CapabilityExecutionStatus.Failed,
50
+ * completionReason: MavenAGI.CapabilityExecutionCompletionReason.Timeout,
51
+ * message: "Conversation Kickoff timed out",
52
+ * startedAt: new Date("2026-08-31T10:30:00.000Z"),
53
+ * completedAt: new Date("2026-08-31T10:30:04.000Z"),
54
+ * durationMs: 4000,
55
+ * createdAt: new Date("2026-08-31T10:30:00.000Z")
56
+ * }]
57
+ * }
58
+ */
59
+ export interface CapabilityExecutionsSearchResponse extends MavenAGI.Page {
60
+ /** The executions on this page, ordered by `createdAt`, newest first by default. */
61
+ executions: MavenAGI.CapabilityExecution[];
62
+ }
@@ -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,7 @@
1
+ import type * as MavenAGI from "../../../index";
2
+ /**
3
+ * A Conversation Kickoff running as its conversation started. Kickoffs run to completion before
4
+ * the conversation's first reply, so they are never RUNNING.
5
+ */
6
+ export interface ConversationKickoffCapabilityExecution extends MavenAGI.CapabilityExecutionBase {
7
+ }
@@ -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,19 @@
1
+ import type * as MavenAGI from "../../../index";
2
+ /**
3
+ * An Event Trigger notifying its app of an event. `SUCCESS` means the app's handler
4
+ * acknowledged the event, not that the app finished the work it was notified about.
5
+ */
6
+ export interface TriggerCapabilityExecution extends MavenAGI.CapabilityExecutionBase {
7
+ /** The kind of event that caused this run. */
8
+ eventType: MavenAGI.EventTriggerType;
9
+ /**
10
+ * Which delivery attempt this is, starting at 1. Retries are recorded as further
11
+ * executions, so several executions for one trigger and subject with ascending attempts are
12
+ * one delivery retried, while several all at attempt 1 are separate fires.
13
+ */
14
+ attempt: number;
15
+ /** How a failure should be treated. Present only on FAILED executions. */
16
+ retryability?: MavenAGI.CapabilityExecutionRetryability;
17
+ /** HTTP status returned by the app, when the failure carried one. */
18
+ httpStatus?: number;
19
+ }
@@ -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 });
@@ -1,4 +1,12 @@
1
1
  export * from "./CapabilitiesSearchResponse";
2
+ export * from "./CapabilityExecution";
3
+ export * from "./CapabilityExecutionBase";
4
+ export * from "./CapabilityExecutionCompletionReason";
5
+ export * from "./CapabilityExecutionRetryability";
6
+ export * from "./CapabilityExecutionStatus";
7
+ export * from "./CapabilityExecutionsSearchResponse";
2
8
  export * from "./CapabilityResponse";
3
9
  export * from "./CapabilitySortField";
4
10
  export * from "./CapabilitySummary";
11
+ export * from "./ConversationKickoffCapabilityExecution";
12
+ export * from "./TriggerCapabilityExecution";
@@ -15,6 +15,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./CapabilitiesSearchResponse"), exports);
18
+ __exportStar(require("./CapabilityExecution"), exports);
19
+ __exportStar(require("./CapabilityExecutionBase"), exports);
20
+ __exportStar(require("./CapabilityExecutionCompletionReason"), exports);
21
+ __exportStar(require("./CapabilityExecutionRetryability"), exports);
22
+ __exportStar(require("./CapabilityExecutionStatus"), exports);
23
+ __exportStar(require("./CapabilityExecutionsSearchResponse"), exports);
18
24
  __exportStar(require("./CapabilityResponse"), exports);
19
25
  __exportStar(require("./CapabilitySortField"), exports);
20
26
  __exportStar(require("./CapabilitySummary"), exports);
27
+ __exportStar(require("./ConversationKickoffCapabilityExecution"), exports);
28
+ __exportStar(require("./TriggerCapabilityExecution"), exports);