@athenaintel/sdk 4.3.2166 → 4.3.2167

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 (51) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/api/resources/aop/client/Client.d.ts +54 -0
  4. package/dist/cjs/api/resources/aop/client/Client.js +196 -0
  5. package/dist/cjs/api/resources/aop/client/requests/AopBatchExecuteRequestIn.d.ts +34 -0
  6. package/dist/cjs/api/resources/aop/client/requests/AopBatchExecuteRequestIn.js +3 -0
  7. package/dist/cjs/api/resources/aop/client/requests/GetBatchStatusAopRequest.d.ts +18 -0
  8. package/dist/cjs/api/resources/aop/client/requests/GetBatchStatusAopRequest.js +3 -0
  9. package/dist/cjs/api/resources/aop/client/requests/index.d.ts +2 -0
  10. package/dist/cjs/api/types/AopBatchExecuteResponseOut.d.ts +14 -0
  11. package/dist/cjs/api/types/AopBatchExecuteResponseOut.js +3 -0
  12. package/dist/cjs/api/types/AopBatchRunIn.d.ts +11 -0
  13. package/dist/cjs/api/types/AopBatchRunIn.js +3 -0
  14. package/dist/cjs/api/types/AopBatchRunLaunchOut.d.ts +15 -0
  15. package/dist/cjs/api/types/AopBatchRunLaunchOut.js +3 -0
  16. package/dist/cjs/api/types/AopBatchRunStatusOut.d.ts +21 -0
  17. package/dist/cjs/api/types/AopBatchRunStatusOut.js +3 -0
  18. package/dist/cjs/api/types/AopBatchStatusCountsOut.d.ts +12 -0
  19. package/dist/cjs/api/types/AopBatchStatusCountsOut.js +3 -0
  20. package/dist/cjs/api/types/AopBatchStatusResponseOut.d.ts +20 -0
  21. package/dist/cjs/api/types/AopBatchStatusResponseOut.js +3 -0
  22. package/dist/cjs/api/types/index.d.ts +6 -0
  23. package/dist/cjs/api/types/index.js +6 -0
  24. package/dist/cjs/version.d.ts +1 -1
  25. package/dist/cjs/version.js +1 -1
  26. package/dist/esm/BaseClient.mjs +2 -2
  27. package/dist/esm/api/resources/aop/client/Client.d.mts +54 -0
  28. package/dist/esm/api/resources/aop/client/Client.mjs +196 -0
  29. package/dist/esm/api/resources/aop/client/requests/AopBatchExecuteRequestIn.d.mts +34 -0
  30. package/dist/esm/api/resources/aop/client/requests/AopBatchExecuteRequestIn.mjs +2 -0
  31. package/dist/esm/api/resources/aop/client/requests/GetBatchStatusAopRequest.d.mts +18 -0
  32. package/dist/esm/api/resources/aop/client/requests/GetBatchStatusAopRequest.mjs +2 -0
  33. package/dist/esm/api/resources/aop/client/requests/index.d.mts +2 -0
  34. package/dist/esm/api/types/AopBatchExecuteResponseOut.d.mts +14 -0
  35. package/dist/esm/api/types/AopBatchExecuteResponseOut.mjs +2 -0
  36. package/dist/esm/api/types/AopBatchRunIn.d.mts +11 -0
  37. package/dist/esm/api/types/AopBatchRunIn.mjs +2 -0
  38. package/dist/esm/api/types/AopBatchRunLaunchOut.d.mts +15 -0
  39. package/dist/esm/api/types/AopBatchRunLaunchOut.mjs +2 -0
  40. package/dist/esm/api/types/AopBatchRunStatusOut.d.mts +21 -0
  41. package/dist/esm/api/types/AopBatchRunStatusOut.mjs +2 -0
  42. package/dist/esm/api/types/AopBatchStatusCountsOut.d.mts +12 -0
  43. package/dist/esm/api/types/AopBatchStatusCountsOut.mjs +2 -0
  44. package/dist/esm/api/types/AopBatchStatusResponseOut.d.mts +20 -0
  45. package/dist/esm/api/types/AopBatchStatusResponseOut.mjs +2 -0
  46. package/dist/esm/api/types/index.d.mts +6 -0
  47. package/dist/esm/api/types/index.mjs +6 -0
  48. package/dist/esm/version.d.mts +1 -1
  49. package/dist/esm/version.mjs +1 -1
  50. package/package.json +1 -1
  51. package/reference.md +147 -0
package/README.md CHANGED
@@ -61,7 +61,7 @@ following namespace:
61
61
  ```typescript
62
62
  import { AthenaIntelligence } from "@athenaintel/sdk";
63
63
 
64
- const request: AthenaIntelligence.AopCreateRequestIn = {
64
+ const request: AthenaIntelligence.GetBatchStatusAopRequest = {
65
65
  ...
66
66
  };
67
67
  ```
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@athenaintel/sdk",
46
- "X-Fern-SDK-Version": "4.3.2166",
47
- "User-Agent": "@athenaintel/sdk/4.3.2166",
46
+ "X-Fern-SDK-Version": "4.3.2167",
47
+ "User-Agent": "@athenaintel/sdk/4.3.2167",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -11,6 +11,26 @@ export declare namespace AopClient {
11
11
  export declare class AopClient {
12
12
  protected readonly _options: NormalizedClientOptionsWithAuth<AopClient.Options>;
13
13
  constructor(options?: AopClient.Options);
14
+ /**
15
+ * Aggregate lifecycle status of every run launched under a batch handle from `POST /aop/execute-batch`: counts per canonical run status, an `is_complete` flag, and a cursor-paged list of runs. Poll this once per batch instead of `GET /threads/{thread_id}/status` per thread; fetch a run's messages from the thread status endpoint only once it is terminal. This read never loads transcripts.
16
+ *
17
+ * @param {AthenaIntelligence.GetBatchStatusAopRequest} request
18
+ * @param {AopClient.RequestOptions} requestOptions - Request-specific configuration.
19
+ *
20
+ * @throws {@link AthenaIntelligence.BadRequestError}
21
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
22
+ * @throws {@link AthenaIntelligence.NotFoundError}
23
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
24
+ *
25
+ * @example
26
+ * await client.aop.getBatchStatus({
27
+ * batch_id: "batch_0f4c3c3e-1c1a-4a3e-9a5f-0d3f1a2b3c4d",
28
+ * status: "terminal",
29
+ * limit: 200
30
+ * })
31
+ */
32
+ getBatchStatus(request: AthenaIntelligence.GetBatchStatusAopRequest, requestOptions?: AopClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.AopBatchStatusResponseOut>;
33
+ private __getBatchStatus;
14
34
  /**
15
35
  * Create a new AOP (Agent Operating Procedure) asset with the given configuration. The created AOP can then be executed via /aop/execute-async, inspected via /aop/{asset_id}/config, and updated via PUT /aop/{asset_id}/config. Use [[ placeholder ]] syntax in the prompt for user inputs supplied at execution time.
16
36
  *
@@ -91,6 +111,40 @@ export declare class AopClient {
91
111
  */
92
112
  executeAsync(request: AthenaIntelligence.AopExecuteRequestIn, requestOptions?: AopClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.AopAsyncExecuteResponseOut>;
93
113
  private __executeAsync;
114
+ /**
115
+ * Start many Agent Operating Procedure (AOP) runs under one batch handle. Each run is queued exactly like `POST /aop/execute-async`; the response returns a `batch_id` so the caller polls `GET /aop/batches/{batch_id}` once per batch instead of once per thread. Pass the `batch_id` back to append more runs to the same batch. Runs are launched independently: a run that fails to launch is reported with an error and does not stop the others.
116
+ *
117
+ * @param {AthenaIntelligence.AopBatchExecuteRequestIn} request
118
+ * @param {AopClient.RequestOptions} requestOptions - Request-specific configuration.
119
+ *
120
+ * @throws {@link AthenaIntelligence.BadRequestError}
121
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
122
+ * @throws {@link AthenaIntelligence.NotFoundError}
123
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
124
+ * @throws {@link AthenaIntelligence.InternalServerError}
125
+ *
126
+ * @example
127
+ * await client.aop.executeBatch({
128
+ * asset_id: "asset_9249292-d118-42d3-95b4-00eccfe0754f",
129
+ * run_budget: {
130
+ * max_cost_usd: 30,
131
+ * max_model_calls: 80
132
+ * },
133
+ * runs: [{
134
+ * client_ref: "row-1",
135
+ * user_inputs: {
136
+ * "company": "Acme Corp"
137
+ * }
138
+ * }, {
139
+ * client_ref: "row-2",
140
+ * user_inputs: {
141
+ * "company": "Globex"
142
+ * }
143
+ * }]
144
+ * })
145
+ */
146
+ executeBatch(request: AthenaIntelligence.AopBatchExecuteRequestIn, requestOptions?: AopClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.AopBatchExecuteResponseOut>;
147
+ private __executeBatch;
94
148
  /**
95
149
  * Retrieve the full configuration of an AOP asset by its ID. Returns prompt, agent config, structured output schema, and other settings.
96
150
  *
@@ -65,6 +65,100 @@ class AopClient {
65
65
  constructor(options = {}) {
66
66
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
67
67
  }
68
+ /**
69
+ * Aggregate lifecycle status of every run launched under a batch handle from `POST /aop/execute-batch`: counts per canonical run status, an `is_complete` flag, and a cursor-paged list of runs. Poll this once per batch instead of `GET /threads/{thread_id}/status` per thread; fetch a run's messages from the thread status endpoint only once it is terminal. This read never loads transcripts.
70
+ *
71
+ * @param {AthenaIntelligence.GetBatchStatusAopRequest} request
72
+ * @param {AopClient.RequestOptions} requestOptions - Request-specific configuration.
73
+ *
74
+ * @throws {@link AthenaIntelligence.BadRequestError}
75
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
76
+ * @throws {@link AthenaIntelligence.NotFoundError}
77
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
78
+ *
79
+ * @example
80
+ * await client.aop.getBatchStatus({
81
+ * batch_id: "batch_0f4c3c3e-1c1a-4a3e-9a5f-0d3f1a2b3c4d",
82
+ * status: "terminal",
83
+ * limit: 200
84
+ * })
85
+ */
86
+ getBatchStatus(request, requestOptions) {
87
+ return core.HttpResponsePromise.fromPromise(this.__getBatchStatus(request, requestOptions));
88
+ }
89
+ __getBatchStatus(request, requestOptions) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
92
+ const { batch_id: batchId, status, cursor, limit } = request;
93
+ const _queryParams = {};
94
+ if (status != null) {
95
+ _queryParams.status = status;
96
+ }
97
+ if (cursor !== undefined) {
98
+ _queryParams.cursor = cursor;
99
+ }
100
+ if (limit != null) {
101
+ _queryParams.limit = limit.toString();
102
+ }
103
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
104
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
105
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
106
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/aop/batches/${core.url.encodePathParam(batchId)}`),
107
+ method: "GET",
108
+ headers: _headers,
109
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
110
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
111
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
112
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
113
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
114
+ logging: this._options.logging,
115
+ });
116
+ if (_response.ok) {
117
+ return {
118
+ data: _response.body,
119
+ rawResponse: _response.rawResponse,
120
+ };
121
+ }
122
+ if (_response.error.reason === "status-code") {
123
+ switch (_response.error.statusCode) {
124
+ case 400:
125
+ throw new AthenaIntelligence.BadRequestError(_response.error.body, _response.rawResponse);
126
+ case 401:
127
+ throw new AthenaIntelligence.UnauthorizedError(_response.error.body, _response.rawResponse);
128
+ case 404:
129
+ throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
130
+ case 422:
131
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
132
+ default:
133
+ throw new errors.AthenaIntelligenceError({
134
+ statusCode: _response.error.statusCode,
135
+ body: _response.error.body,
136
+ rawResponse: _response.rawResponse,
137
+ });
138
+ }
139
+ }
140
+ switch (_response.error.reason) {
141
+ case "non-json":
142
+ throw new errors.AthenaIntelligenceError({
143
+ statusCode: _response.error.statusCode,
144
+ body: _response.error.rawBody,
145
+ rawResponse: _response.rawResponse,
146
+ });
147
+ case "body-is-null":
148
+ throw new errors.AthenaIntelligenceError({
149
+ statusCode: _response.error.statusCode,
150
+ rawResponse: _response.rawResponse,
151
+ });
152
+ case "timeout":
153
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling GET /api/v0/aop/batches/{batch_id}.");
154
+ case "unknown":
155
+ throw new errors.AthenaIntelligenceError({
156
+ message: _response.error.errorMessage,
157
+ rawResponse: _response.rawResponse,
158
+ });
159
+ }
160
+ });
161
+ }
68
162
  /**
69
163
  * Create a new AOP (Agent Operating Procedure) asset with the given configuration. The created AOP can then be executed via /aop/execute-async, inspected via /aop/{asset_id}/config, and updated via PUT /aop/{asset_id}/config. Use [[ placeholder ]] syntax in the prompt for user inputs supplied at execution time.
70
164
  *
@@ -349,6 +443,108 @@ class AopClient {
349
443
  }
350
444
  });
351
445
  }
446
+ /**
447
+ * Start many Agent Operating Procedure (AOP) runs under one batch handle. Each run is queued exactly like `POST /aop/execute-async`; the response returns a `batch_id` so the caller polls `GET /aop/batches/{batch_id}` once per batch instead of once per thread. Pass the `batch_id` back to append more runs to the same batch. Runs are launched independently: a run that fails to launch is reported with an error and does not stop the others.
448
+ *
449
+ * @param {AthenaIntelligence.AopBatchExecuteRequestIn} request
450
+ * @param {AopClient.RequestOptions} requestOptions - Request-specific configuration.
451
+ *
452
+ * @throws {@link AthenaIntelligence.BadRequestError}
453
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
454
+ * @throws {@link AthenaIntelligence.NotFoundError}
455
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
456
+ * @throws {@link AthenaIntelligence.InternalServerError}
457
+ *
458
+ * @example
459
+ * await client.aop.executeBatch({
460
+ * asset_id: "asset_9249292-d118-42d3-95b4-00eccfe0754f",
461
+ * run_budget: {
462
+ * max_cost_usd: 30,
463
+ * max_model_calls: 80
464
+ * },
465
+ * runs: [{
466
+ * client_ref: "row-1",
467
+ * user_inputs: {
468
+ * "company": "Acme Corp"
469
+ * }
470
+ * }, {
471
+ * client_ref: "row-2",
472
+ * user_inputs: {
473
+ * "company": "Globex"
474
+ * }
475
+ * }]
476
+ * })
477
+ */
478
+ executeBatch(request, requestOptions) {
479
+ return core.HttpResponsePromise.fromPromise(this.__executeBatch(request, requestOptions));
480
+ }
481
+ __executeBatch(request, requestOptions) {
482
+ return __awaiter(this, void 0, void 0, function* () {
483
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
484
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
485
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
486
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
487
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, "api/v0/aop/execute-batch"),
488
+ method: "POST",
489
+ headers: _headers,
490
+ contentType: "application/json",
491
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
492
+ requestType: "json",
493
+ body: request,
494
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
495
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
496
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
497
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
498
+ logging: this._options.logging,
499
+ });
500
+ if (_response.ok) {
501
+ return {
502
+ data: _response.body,
503
+ rawResponse: _response.rawResponse,
504
+ };
505
+ }
506
+ if (_response.error.reason === "status-code") {
507
+ switch (_response.error.statusCode) {
508
+ case 400:
509
+ throw new AthenaIntelligence.BadRequestError(_response.error.body, _response.rawResponse);
510
+ case 401:
511
+ throw new AthenaIntelligence.UnauthorizedError(_response.error.body, _response.rawResponse);
512
+ case 404:
513
+ throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
514
+ case 422:
515
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
516
+ case 500:
517
+ throw new AthenaIntelligence.InternalServerError(_response.error.body, _response.rawResponse);
518
+ default:
519
+ throw new errors.AthenaIntelligenceError({
520
+ statusCode: _response.error.statusCode,
521
+ body: _response.error.body,
522
+ rawResponse: _response.rawResponse,
523
+ });
524
+ }
525
+ }
526
+ switch (_response.error.reason) {
527
+ case "non-json":
528
+ throw new errors.AthenaIntelligenceError({
529
+ statusCode: _response.error.statusCode,
530
+ body: _response.error.rawBody,
531
+ rawResponse: _response.rawResponse,
532
+ });
533
+ case "body-is-null":
534
+ throw new errors.AthenaIntelligenceError({
535
+ statusCode: _response.error.statusCode,
536
+ rawResponse: _response.rawResponse,
537
+ });
538
+ case "timeout":
539
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/aop/execute-batch.");
540
+ case "unknown":
541
+ throw new errors.AthenaIntelligenceError({
542
+ message: _response.error.errorMessage,
543
+ rawResponse: _response.rawResponse,
544
+ });
545
+ }
546
+ });
547
+ }
352
548
  /**
353
549
  * Retrieve the full configuration of an AOP asset by its ID. Returns prompt, agent config, structured output schema, and other settings.
354
550
  *
@@ -0,0 +1,34 @@
1
+ import type * as AthenaIntelligence from "../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {
5
+ * asset_id: "asset_9249292-d118-42d3-95b4-00eccfe0754f",
6
+ * run_budget: {
7
+ * max_cost_usd: 30,
8
+ * max_model_calls: 80
9
+ * },
10
+ * runs: [{
11
+ * client_ref: "row-1",
12
+ * user_inputs: {
13
+ * "company": "Acme Corp"
14
+ * }
15
+ * }, {
16
+ * client_ref: "row-2",
17
+ * user_inputs: {
18
+ * "company": "Globex"
19
+ * }
20
+ * }]
21
+ * }
22
+ */
23
+ export interface AopBatchExecuteRequestIn {
24
+ /** Default AOP asset ID for runs that omit their own `asset_id` */
25
+ asset_id?: string | null;
26
+ /** Existing batch to append these runs to (returned by a previous execute-batch call). Omit to start a new batch. */
27
+ batch_id?: string | null;
28
+ /** Execute every run in dry-run mode: side-effectful tool calls are validated and captured instead of executed. */
29
+ dry_run?: boolean;
30
+ /** Per-run spend cap (max_model_calls / max_cost_usd) applied to every run in the request. */
31
+ run_budget?: AthenaIntelligence.RunBudget | null;
32
+ /** Runs to launch (1-100 per request). Launch more into the same batch by repeating the call with the returned `batch_id`. */
33
+ runs: AthenaIntelligence.AopBatchRunIn[];
34
+ }
@@ -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,18 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * batch_id: "batch_0f4c3c3e-1c1a-4a3e-9a5f-0d3f1a2b3c4d",
5
+ * status: "terminal",
6
+ * limit: 200
7
+ * }
8
+ */
9
+ export interface GetBatchStatusAopRequest {
10
+ /** Batch handle returned by execute-batch */
11
+ batch_id: string;
12
+ /** Which runs to list: `terminal` (completed/failed/canceled), `active` (everything else) or `all`. Counts always cover the whole batch. */
13
+ status?: string;
14
+ /** `next_cursor` from the previous page */
15
+ cursor?: string | null;
16
+ /** Maximum runs to return in this page */
17
+ limit?: number;
18
+ }
@@ -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,3 +1,5 @@
1
+ export type { AopBatchExecuteRequestIn } from "./AopBatchExecuteRequestIn.js";
1
2
  export type { AopConfigUpdateRequestIn } from "./AopConfigUpdateRequestIn.js";
2
3
  export type { AopCreateRequestIn } from "./AopCreateRequestIn.js";
4
+ export type { GetBatchStatusAopRequest } from "./GetBatchStatusAopRequest.js";
3
5
  export type { GetConfigAopRequest } from "./GetConfigAopRequest.js";
@@ -0,0 +1,14 @@
1
+ import type * as AthenaIntelligence from "../index.js";
2
+ /**
3
+ * Response model for launching a batch of AOP runs.
4
+ */
5
+ export interface AopBatchExecuteResponseOut {
6
+ /** Batch handle. Poll `GET /aop/batches/{batch_id}` for the whole batch instead of every thread, and pass it back to `POST /aop/execute-batch` to append more runs. Null when a new batch launched no runs: there is nothing to poll or append to, so no handle is issued. */
7
+ batch_id?: string | null;
8
+ /** Runs in this request that could not be launched */
9
+ failed: number;
10
+ /** Runs accepted and queued in this request */
11
+ launched: number;
12
+ /** Per-run launch outcome, in request order */
13
+ runs: AthenaIntelligence.AopBatchRunLaunchOut[];
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,11 @@
1
+ /**
2
+ * One AOP run inside an execute-batch request.
3
+ */
4
+ export interface AopBatchRunIn {
5
+ /** ID of the AOP asset to execute for this run. Defaults to the batch-level `asset_id` when omitted. */
6
+ asset_id?: string | null;
7
+ /** Caller-supplied correlation key (e.g. a row id) echoed back on the run in the batch status response. */
8
+ client_ref?: string | null;
9
+ /** Optional user inputs to append to the AOP's prompt as key-value pairs */
10
+ user_inputs?: Record<string, string | null> | null;
11
+ }
@@ -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,15 @@
1
+ /**
2
+ * Outcome of launching one run of an execute-batch request.
3
+ */
4
+ export interface AopBatchRunLaunchOut {
5
+ /** ID of the AOP asset the run executes */
6
+ aop_asset_id?: string | null;
7
+ /** Caller-supplied correlation key from the request */
8
+ client_ref?: string | null;
9
+ /** Why the run could not be launched; null on success */
10
+ error?: string | null;
11
+ /** Position of the run in the request's `runs` list */
12
+ index: number;
13
+ /** Thread ID of the launched run; null when the launch failed */
14
+ thread_id?: string | null;
15
+ }
@@ -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,21 @@
1
+ /**
2
+ * Lifecycle status of one run in a batch (no messages).
3
+ */
4
+ export interface AopBatchRunStatusOut {
5
+ /** ID of the AOP asset the run executes */
6
+ aop_asset_id?: string | null;
7
+ /** Caller-supplied correlation key from the launch request */
8
+ client_ref?: string | null;
9
+ /** ISO timestamp when the run reached a terminal state */
10
+ completed_at?: string | null;
11
+ /** When the run was queued */
12
+ created_at?: string | null;
13
+ /** Error message when the run failed */
14
+ error?: string | null;
15
+ /** True once the run is completed, failed or canceled */
16
+ is_terminal: boolean;
17
+ /** Canonical run status: scheduled, queued, running, needs_input, completed, failed or canceled */
18
+ status: string;
19
+ /** Thread ID; use `GET /threads/{thread_id}/status` for the result */
20
+ thread_id: string;
21
+ }
@@ -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,12 @@
1
+ /**
2
+ * Run counts of a batch by canonical run status.
3
+ */
4
+ export interface AopBatchStatusCountsOut {
5
+ canceled?: number;
6
+ completed?: number;
7
+ failed?: number;
8
+ needs_input?: number;
9
+ queued?: number;
10
+ running?: number;
11
+ scheduled?: number;
12
+ }
@@ -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,20 @@
1
+ import type * as AthenaIntelligence from "../index.js";
2
+ /**
3
+ * Response model for the status of an execute-batch.
4
+ */
5
+ export interface AopBatchStatusResponseOut {
6
+ /** The batch handle that was checked */
7
+ batch_id: string;
8
+ /** Runs per canonical status */
9
+ counts: AthenaIntelligence.AopBatchStatusCountsOut;
10
+ /** True when every run in the batch has finished */
11
+ is_complete: boolean;
12
+ /** Opaque cursor for the next page of `runs`; null when this page is the last one. Pass it as `cursor` on the next call. */
13
+ next_cursor?: string | null;
14
+ /** One page of runs matching the `status` filter, ordered by cursor */
15
+ runs: AthenaIntelligence.AopBatchRunStatusOut[];
16
+ /** Runs that have finished (completed + failed + canceled) */
17
+ terminal: number;
18
+ /** Runs launched into the batch so far */
19
+ total: number;
20
+ }
@@ -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 });
@@ -2,6 +2,12 @@ export * from "./ActivityClockRangeIn.js";
2
2
  export * from "./ActivityDeltaOut.js";
3
3
  export * from "./ActivityItemOut.js";
4
4
  export * from "./AopAsyncExecuteResponseOut.js";
5
+ export * from "./AopBatchExecuteResponseOut.js";
6
+ export * from "./AopBatchRunIn.js";
7
+ export * from "./AopBatchRunLaunchOut.js";
8
+ export * from "./AopBatchRunStatusOut.js";
9
+ export * from "./AopBatchStatusCountsOut.js";
10
+ export * from "./AopBatchStatusResponseOut.js";
5
11
  export * from "./AopConfigResponseOut.js";
6
12
  export * from "./AopConfigUpdateResponseOut.js";
7
13
  export * from "./AopCreateResponseOut.js";
@@ -18,6 +18,12 @@ __exportStar(require("./ActivityClockRangeIn.js"), exports);
18
18
  __exportStar(require("./ActivityDeltaOut.js"), exports);
19
19
  __exportStar(require("./ActivityItemOut.js"), exports);
20
20
  __exportStar(require("./AopAsyncExecuteResponseOut.js"), exports);
21
+ __exportStar(require("./AopBatchExecuteResponseOut.js"), exports);
22
+ __exportStar(require("./AopBatchRunIn.js"), exports);
23
+ __exportStar(require("./AopBatchRunLaunchOut.js"), exports);
24
+ __exportStar(require("./AopBatchRunStatusOut.js"), exports);
25
+ __exportStar(require("./AopBatchStatusCountsOut.js"), exports);
26
+ __exportStar(require("./AopBatchStatusResponseOut.js"), exports);
21
27
  __exportStar(require("./AopConfigResponseOut.js"), exports);
22
28
  __exportStar(require("./AopConfigUpdateResponseOut.js"), exports);
23
29
  __exportStar(require("./AopCreateResponseOut.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.2166";
1
+ export declare const SDK_VERSION = "4.3.2167";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "4.3.2166";
4
+ exports.SDK_VERSION = "4.3.2167";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@athenaintel/sdk",
9
- "X-Fern-SDK-Version": "4.3.2166",
10
- "User-Agent": "@athenaintel/sdk/4.3.2166",
9
+ "X-Fern-SDK-Version": "4.3.2167",
10
+ "User-Agent": "@athenaintel/sdk/4.3.2167",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -11,6 +11,26 @@ export declare namespace AopClient {
11
11
  export declare class AopClient {
12
12
  protected readonly _options: NormalizedClientOptionsWithAuth<AopClient.Options>;
13
13
  constructor(options?: AopClient.Options);
14
+ /**
15
+ * Aggregate lifecycle status of every run launched under a batch handle from `POST /aop/execute-batch`: counts per canonical run status, an `is_complete` flag, and a cursor-paged list of runs. Poll this once per batch instead of `GET /threads/{thread_id}/status` per thread; fetch a run's messages from the thread status endpoint only once it is terminal. This read never loads transcripts.
16
+ *
17
+ * @param {AthenaIntelligence.GetBatchStatusAopRequest} request
18
+ * @param {AopClient.RequestOptions} requestOptions - Request-specific configuration.
19
+ *
20
+ * @throws {@link AthenaIntelligence.BadRequestError}
21
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
22
+ * @throws {@link AthenaIntelligence.NotFoundError}
23
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
24
+ *
25
+ * @example
26
+ * await client.aop.getBatchStatus({
27
+ * batch_id: "batch_0f4c3c3e-1c1a-4a3e-9a5f-0d3f1a2b3c4d",
28
+ * status: "terminal",
29
+ * limit: 200
30
+ * })
31
+ */
32
+ getBatchStatus(request: AthenaIntelligence.GetBatchStatusAopRequest, requestOptions?: AopClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.AopBatchStatusResponseOut>;
33
+ private __getBatchStatus;
14
34
  /**
15
35
  * Create a new AOP (Agent Operating Procedure) asset with the given configuration. The created AOP can then be executed via /aop/execute-async, inspected via /aop/{asset_id}/config, and updated via PUT /aop/{asset_id}/config. Use [[ placeholder ]] syntax in the prompt for user inputs supplied at execution time.
16
36
  *
@@ -91,6 +111,40 @@ export declare class AopClient {
91
111
  */
92
112
  executeAsync(request: AthenaIntelligence.AopExecuteRequestIn, requestOptions?: AopClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.AopAsyncExecuteResponseOut>;
93
113
  private __executeAsync;
114
+ /**
115
+ * Start many Agent Operating Procedure (AOP) runs under one batch handle. Each run is queued exactly like `POST /aop/execute-async`; the response returns a `batch_id` so the caller polls `GET /aop/batches/{batch_id}` once per batch instead of once per thread. Pass the `batch_id` back to append more runs to the same batch. Runs are launched independently: a run that fails to launch is reported with an error and does not stop the others.
116
+ *
117
+ * @param {AthenaIntelligence.AopBatchExecuteRequestIn} request
118
+ * @param {AopClient.RequestOptions} requestOptions - Request-specific configuration.
119
+ *
120
+ * @throws {@link AthenaIntelligence.BadRequestError}
121
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
122
+ * @throws {@link AthenaIntelligence.NotFoundError}
123
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
124
+ * @throws {@link AthenaIntelligence.InternalServerError}
125
+ *
126
+ * @example
127
+ * await client.aop.executeBatch({
128
+ * asset_id: "asset_9249292-d118-42d3-95b4-00eccfe0754f",
129
+ * run_budget: {
130
+ * max_cost_usd: 30,
131
+ * max_model_calls: 80
132
+ * },
133
+ * runs: [{
134
+ * client_ref: "row-1",
135
+ * user_inputs: {
136
+ * "company": "Acme Corp"
137
+ * }
138
+ * }, {
139
+ * client_ref: "row-2",
140
+ * user_inputs: {
141
+ * "company": "Globex"
142
+ * }
143
+ * }]
144
+ * })
145
+ */
146
+ executeBatch(request: AthenaIntelligence.AopBatchExecuteRequestIn, requestOptions?: AopClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.AopBatchExecuteResponseOut>;
147
+ private __executeBatch;
94
148
  /**
95
149
  * Retrieve the full configuration of an AOP asset by its ID. Returns prompt, agent config, structured output schema, and other settings.
96
150
  *