Skip to content

Commit 7e27cd4

Browse files
committed
chore(web): regenerate Fern client for the sessions query flags
Regenerated the TS client from the #5436 backend OpenAPI spec so `SessionQueryRequest` carries `include_ended`/`include_archived` and `SessionStream` carries `archived_at` as first-class typed fields, and dropped the runtime cast on `querySessions` that stood in for them. Pulls in the rest of the #5436 sessions/mounts drift the checked-in client predated (SessionTurn `turn_id`, a SessionTurnComplete request, the mount file-order enum). No new tsc error signatures introduced (verified against the pre-regen baseline).
1 parent 65e0bf4 commit 7e27cd4

16 files changed

Lines changed: 111 additions & 20 deletions

File tree

web/packages/agenta-api-client/src/generated/api/resources/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export * as legacy from "./legacy/index.js";
2828
export * from "./legacy/types/index.js";
2929
export * from "./mounts/client/requests/index.js";
3030
export * as mounts from "./mounts/index.js";
31+
export * from "./mounts/types/index.js";
3132
export * from "./organizations/client/requests/index.js";
3233
export * as organizations from "./organizations/index.js";
3334
export * from "./projects/client/requests/index.js";

web/packages/agenta-api-client/src/generated/api/resources/mounts/client/Client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ export class MountsClient {
10101010
const _queryParams: Record<string, unknown> = {
10111011
path,
10121012
read,
1013-
order,
1013+
order: order !== undefined ? order : undefined,
10141014
limit,
10151015
depth,
10161016
with_counts: withCounts,

web/packages/agenta-api-client/src/generated/api/resources/mounts/client/requests/GetMountFilesRequest.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// This file was auto-generated by Fern from our API Definition.
22

3+
import type * as AgentaApi from "../../../../index.js";
4+
35
/**
46
* @example
57
* {
@@ -10,7 +12,7 @@ export interface GetMountFilesRequest {
1012
mount_id: string;
1113
path?: string | null;
1214
read?: string | null;
13-
order?: string | null;
15+
order?: AgentaApi.GetMountFilesRequestOrder | null;
1416
limit?: number | null;
1517
depth?: number | null;
1618
with_counts?: boolean;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from "./client/index.js";
2+
export * from "./types/index.js";
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// This file was auto-generated by Fern from our API Definition.
2+
3+
export const GetMountFilesRequestOrder = {
4+
Recent: "recent",
5+
Name: "name",
6+
Path: "path",
7+
} as const;
8+
export type GetMountFilesRequestOrder = (typeof GetMountFilesRequestOrder)[keyof typeof GetMountFilesRequestOrder];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./GetMountFilesRequestOrder.js";

web/packages/agenta-api-client/src/generated/api/resources/sessions/client/Client.ts

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,79 @@ export class SessionsClient {
16541654
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/sessions/turns/");
16551655
}
16561656

1657+
/**
1658+
* @param {AgentaApi.SessionTurnCompleteRequest} request
1659+
* @param {SessionsClient.RequestOptions} requestOptions - Request-specific configuration.
1660+
*
1661+
* @throws {@link AgentaApi.UnprocessableEntityError}
1662+
*
1663+
* @example
1664+
* await client.sessions.completeTurn({
1665+
* session_id: "session_id",
1666+
* turn_index: 1,
1667+
* end_time: "2024-01-15T09:30:00Z"
1668+
* })
1669+
*/
1670+
public completeTurn(
1671+
request: AgentaApi.SessionTurnCompleteRequest,
1672+
requestOptions?: SessionsClient.RequestOptions,
1673+
): core.HttpResponsePromise<AgentaApi.SessionTurnResponse> {
1674+
return core.HttpResponsePromise.fromPromise(this.__completeTurn(request, requestOptions));
1675+
}
1676+
1677+
private async __completeTurn(
1678+
request: AgentaApi.SessionTurnCompleteRequest,
1679+
requestOptions?: SessionsClient.RequestOptions,
1680+
): Promise<core.WithRawResponse<AgentaApi.SessionTurnResponse>> {
1681+
const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
1682+
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
1683+
_authRequest.headers,
1684+
this._options?.headers,
1685+
requestOptions?.headers,
1686+
);
1687+
const _response = await core.fetcher({
1688+
url: core.url.join(
1689+
(await core.Supplier.get(this._options.baseUrl)) ??
1690+
(await core.Supplier.get(this._options.environment)) ??
1691+
environments.AgentaApiEnvironment.Default,
1692+
"sessions/turns/complete",
1693+
),
1694+
method: "POST",
1695+
headers: _headers,
1696+
contentType: "application/json",
1697+
queryParameters: requestOptions?.queryParams,
1698+
requestType: "json",
1699+
body: request,
1700+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 30) * 1000,
1701+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
1702+
withCredentials: true,
1703+
abortSignal: requestOptions?.abortSignal,
1704+
fetchFn: this._options?.fetch,
1705+
logging: this._options.logging,
1706+
});
1707+
if (_response.ok) {
1708+
return { data: _response.body as AgentaApi.SessionTurnResponse, rawResponse: _response.rawResponse };
1709+
}
1710+
1711+
if (_response.error.reason === "status-code") {
1712+
switch (_response.error.statusCode) {
1713+
case 422:
1714+
throw new AgentaApi.UnprocessableEntityError(
1715+
_response.error.body as AgentaApi.HttpValidationError,
1716+
_response.rawResponse,
1717+
);
1718+
default:
1719+
throw new errors.AgentaApiError({
1720+
statusCode: _response.error.statusCode,
1721+
body: _response.error.body,
1722+
rawResponse: _response.rawResponse,
1723+
});
1724+
}
1725+
}
1726+
1727+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/sessions/turns/complete");
1728+
}
1729+
16571730
/**
16581731
* @param {AgentaApi.SessionTurnQueryRequest} request
16591732
* @param {SessionsClient.RequestOptions} requestOptions - Request-specific configuration.

web/packages/agenta-api-client/src/generated/api/resources/sessions/client/requests/SessionQueryRequest.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ import type * as AgentaApi from "../../../../index.js";
99
export interface SessionQueryRequest {
1010
references?: AgentaApi.Reference[] | null;
1111
windowing?: AgentaApi.Windowing | null;
12+
include_ended?: boolean;
13+
include_archived?: boolean;
1214
}

web/packages/agenta-api-client/src/generated/api/resources/sessions/client/requests/SessionTurnAppendRequest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type * as AgentaApi from "../../../../index.js";
1313
*/
1414
export interface SessionTurnAppendRequest {
1515
session_id: string;
16+
turn_id?: string | null;
1617
stream_id: string;
1718
turn_index: number;
1819
harness_kind: AgentaApi.HarnessKind;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This file was auto-generated by Fern from our API Definition.
2+
3+
/**
4+
* @example
5+
* {
6+
* session_id: "session_id",
7+
* turn_index: 1,
8+
* end_time: "2024-01-15T09:30:00Z"
9+
* }
10+
*/
11+
export interface SessionTurnCompleteRequest {
12+
session_id: string;
13+
turn_index: number;
14+
agent_session_id?: string | null;
15+
end_time: string;
16+
}

0 commit comments

Comments
 (0)