diff --git a/.changeset/x32hq.md b/.changeset/x32hq.md new file mode 100644 index 000000000..e7cbaad61 --- /dev/null +++ b/.changeset/x32hq.md @@ -0,0 +1,5 @@ +--- +"netlify-api": minor +--- + +Add new API endpoints for managing agent runners including create, update, and delete operations \ No newline at end of file diff --git a/packages/netlify-api/src/api/components.ts b/packages/netlify-api/src/api/components.ts index 0ca98793e..ea6f0d743 100644 --- a/packages/netlify-api/src/api/components.ts +++ b/packages/netlify-api/src/api/components.ts @@ -1,7 +1,7 @@ /** * Generated by @openapi-codegen * - * @version 2.37.0 + * @version 2.41.0 */ import type * as Fetcher from "./fetcher"; import { fetch, FetcherExtraProps } from "./fetcher"; @@ -3989,6 +3989,7 @@ export type NotifyBuildStartPathParams = { export type NotifyBuildStartQueryParams = { buildbot_version?: string; build_version?: string; + task_id?: string; }; export type NotifyBuildStartError = Fetcher.ErrorWrapper<{ @@ -6641,6 +6642,939 @@ export const listAccountAuditEvents = ( signal, }); +export type ListAgentRunnersQueryParams = { + account_id: string; + site_id: string; + /** + * @format int32 + */ + page?: number; + /** + * @format int32 + */ + per_page?: number; + state?: "live" | "error"; + title?: string; + branch?: string; + result_branch?: string; + from?: number; + to?: number; +}; + +export type ListAgentRunnersError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type ListAgentRunnersResponse = { + id?: string; + site_id?: string; + parent_agent_runner_id?: string; + state?: string; + /** + * @format dateTime + */ + created_at?: string; + /** + * @format dateTime + */ + updated_at?: string; + /** + * @format dateTime + */ + done_at?: string; + title?: string; + branch?: string; + result_branch?: string; + pr_url?: string; + pr_branch?: string; + pr_state?: string; + pr_number?: number; + pr_is_being_created?: boolean; + pr_error?: string; + current_task?: string; + result_diff?: string; + sha?: string; + merge_commit_sha?: string; + merge_commit_error?: string; + merge_commit_is_being_created?: boolean; + base_deploy_id?: string; + attached_file_keys?: string[]; + /** + * @format dateTime + */ + active_session_created_at?: string; + latest_session_deploy_id?: string; + latest_session_deploy_url?: string; + user?: { + id?: string; + full_name?: string; + email?: string; + avatar_url?: string; + }; +}[]; + +export type ListAgentRunnersVariables = { + queryParams: ListAgentRunnersQueryParams; +} & FetcherExtraProps; + +export const listAgentRunners = ( + variables: ListAgentRunnersVariables, + signal?: AbortSignal, +) => + fetch< + ListAgentRunnersResponse, + ListAgentRunnersError, + undefined, + {}, + ListAgentRunnersQueryParams, + {} + >({ url: "/agent_runners", method: "get", ...variables, signal }); + +export type CreateAgentRunnerQueryParams = { + site_id: string; + deploy_id?: string; + branch?: string; + prompt?: string; + agent?: string; + model?: string; + parent_agent_runner_id?: string; + dev_server_image?: string; + file_keys?: string[]; +}; + +export type CreateAgentRunnerError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type CreateAgentRunnerResponse = { + id?: string; + site_id?: string; + parent_agent_runner_id?: string; + state?: string; + /** + * @format dateTime + */ + created_at?: string; + /** + * @format dateTime + */ + updated_at?: string; + /** + * @format dateTime + */ + done_at?: string; + title?: string; + branch?: string; + result_branch?: string; + pr_url?: string; + pr_branch?: string; + pr_state?: string; + pr_number?: number; + pr_is_being_created?: boolean; + pr_error?: string; + current_task?: string; + result_diff?: string; + sha?: string; + merge_commit_sha?: string; + merge_commit_error?: string; + merge_commit_is_being_created?: boolean; + base_deploy_id?: string; + attached_file_keys?: string[]; + /** + * @format dateTime + */ + active_session_created_at?: string; + latest_session_deploy_id?: string; + latest_session_deploy_url?: string; + user?: { + id?: string; + full_name?: string; + email?: string; + avatar_url?: string; + }; +}; + +export type CreateAgentRunnerVariables = { + queryParams: CreateAgentRunnerQueryParams; +} & FetcherExtraProps; + +export const createAgentRunner = ( + variables: CreateAgentRunnerVariables, + signal?: AbortSignal, +) => + fetch< + CreateAgentRunnerResponse, + CreateAgentRunnerError, + undefined, + {}, + CreateAgentRunnerQueryParams, + {} + >({ url: "/agent_runners", method: "post", ...variables, signal }); + +export type CreateAgentRunnerUploadUrlQueryParams = { + account_id: string; + filename: string; + content_type: string; +}; + +export type CreateAgentRunnerUploadUrlError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type CreateAgentRunnerUploadUrlVariables = { + queryParams: CreateAgentRunnerUploadUrlQueryParams; +} & FetcherExtraProps; + +export const createAgentRunnerUploadUrl = ( + variables: CreateAgentRunnerUploadUrlVariables, + signal?: AbortSignal, +) => + fetch< + undefined, + CreateAgentRunnerUploadUrlError, + undefined, + {}, + CreateAgentRunnerUploadUrlQueryParams, + {} + >({ url: "/agent_runners/upload_url", method: "post", ...variables, signal }); + +export type GetAgentRunnerPathParams = { + agentRunnerId: string; +}; + +export type GetAgentRunnerError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type GetAgentRunnerResponse = { + id?: string; + site_id?: string; + parent_agent_runner_id?: string; + state?: string; + /** + * @format dateTime + */ + created_at?: string; + /** + * @format dateTime + */ + updated_at?: string; + /** + * @format dateTime + */ + done_at?: string; + title?: string; + branch?: string; + result_branch?: string; + pr_url?: string; + pr_branch?: string; + pr_state?: string; + pr_number?: number; + pr_is_being_created?: boolean; + pr_error?: string; + current_task?: string; + result_diff?: string; + sha?: string; + merge_commit_sha?: string; + merge_commit_error?: string; + merge_commit_is_being_created?: boolean; + base_deploy_id?: string; + attached_file_keys?: string[]; + /** + * @format dateTime + */ + active_session_created_at?: string; + latest_session_deploy_id?: string; + latest_session_deploy_url?: string; + user?: { + id?: string; + full_name?: string; + email?: string; + avatar_url?: string; + }; +}; + +export type GetAgentRunnerVariables = { + pathParams: GetAgentRunnerPathParams; +} & FetcherExtraProps; + +export const getAgentRunner = ( + variables: GetAgentRunnerVariables, + signal?: AbortSignal, +) => + fetch< + GetAgentRunnerResponse, + GetAgentRunnerError, + undefined, + {}, + {}, + GetAgentRunnerPathParams + >({ + url: "/agent_runners/{agentRunnerId}", + method: "get", + ...variables, + signal, + }); + +export type UpdateAgentRunnerPathParams = { + agentRunnerId: string; +}; + +export type UpdateAgentRunnerError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type UpdateAgentRunnerResponse = { + id?: string; + site_id?: string; + parent_agent_runner_id?: string; + state?: string; + /** + * @format dateTime + */ + created_at?: string; + /** + * @format dateTime + */ + updated_at?: string; + /** + * @format dateTime + */ + done_at?: string; + title?: string; + branch?: string; + result_branch?: string; + pr_url?: string; + pr_branch?: string; + pr_state?: string; + pr_number?: number; + pr_is_being_created?: boolean; + pr_error?: string; + current_task?: string; + result_diff?: string; + sha?: string; + merge_commit_sha?: string; + merge_commit_error?: string; + merge_commit_is_being_created?: boolean; + base_deploy_id?: string; + attached_file_keys?: string[]; + /** + * @format dateTime + */ + active_session_created_at?: string; + latest_session_deploy_id?: string; + latest_session_deploy_url?: string; + user?: { + id?: string; + full_name?: string; + email?: string; + avatar_url?: string; + }; +}; + +export type UpdateAgentRunnerVariables = { + pathParams: UpdateAgentRunnerPathParams; +} & FetcherExtraProps; + +export const updateAgentRunner = ( + variables: UpdateAgentRunnerVariables, + signal?: AbortSignal, +) => + fetch< + UpdateAgentRunnerResponse, + UpdateAgentRunnerError, + undefined, + {}, + {}, + UpdateAgentRunnerPathParams + >({ + url: "/agent_runners/{agentRunnerId}", + method: "patch", + ...variables, + signal, + }); + +export type DeleteAgentRunnerPathParams = { + agentRunnerId: string; +}; + +export type DeleteAgentRunnerError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type DeleteAgentRunnerVariables = { + pathParams: DeleteAgentRunnerPathParams; +} & FetcherExtraProps; + +export const deleteAgentRunner = ( + variables: DeleteAgentRunnerVariables, + signal?: AbortSignal, +) => + fetch< + undefined, + DeleteAgentRunnerError, + undefined, + {}, + {}, + DeleteAgentRunnerPathParams + >({ + url: "/agent_runners/{agentRunnerId}", + method: "delete", + ...variables, + signal, + }); + +export type ArchiveAgentRunnerPathParams = { + agentRunnerId: string; +}; + +export type ArchiveAgentRunnerError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type ArchiveAgentRunnerVariables = { + pathParams: ArchiveAgentRunnerPathParams; +} & FetcherExtraProps; + +export const archiveAgentRunner = ( + variables: ArchiveAgentRunnerVariables, + signal?: AbortSignal, +) => + fetch< + undefined, + ArchiveAgentRunnerError, + undefined, + {}, + {}, + ArchiveAgentRunnerPathParams + >({ + url: "/agent_runners/{agentRunnerId}/archive", + method: "post", + ...variables, + signal, + }); + +export type AgentRunnerPullRequestPathParams = { + agentRunnerId: string; +}; + +export type AgentRunnerPullRequestError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type AgentRunnerPullRequestVariables = { + pathParams: AgentRunnerPullRequestPathParams; +} & FetcherExtraProps; + +export const agentRunnerPullRequest = ( + variables: AgentRunnerPullRequestVariables, + signal?: AbortSignal, +) => + fetch< + undefined, + AgentRunnerPullRequestError, + undefined, + {}, + {}, + AgentRunnerPullRequestPathParams + >({ + url: "/agent_runners/{agentRunnerId}/pull_request", + method: "post", + ...variables, + signal, + }); + +export type AgentRunnerCommitToBranchPathParams = { + agentRunnerId: string; +}; + +export type AgentRunnerCommitToBranchQueryParams = { + target_branch: string; +}; + +export type AgentRunnerCommitToBranchError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type AgentRunnerCommitToBranchVariables = { + pathParams: AgentRunnerCommitToBranchPathParams; + queryParams: AgentRunnerCommitToBranchQueryParams; +} & FetcherExtraProps; + +export const agentRunnerCommitToBranch = ( + variables: AgentRunnerCommitToBranchVariables, + signal?: AbortSignal, +) => + fetch< + undefined, + AgentRunnerCommitToBranchError, + undefined, + {}, + AgentRunnerCommitToBranchQueryParams, + AgentRunnerCommitToBranchPathParams + >({ + url: "/agent_runners/{agentRunnerId}/commit", + method: "post", + ...variables, + signal, + }); + +export type ListAgentRunnerSessionsPathParams = { + agentRunnerId: string; +}; + +export type ListAgentRunnerSessionsQueryParams = { + /** + * @format int32 + */ + page?: number; + /** + * @format int32 + */ + per_page?: number; + state?: "live" | "error"; + from?: number; + to?: number; + order_by?: "asc" | "desc"; +}; + +export type ListAgentRunnerSessionsError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type ListAgentRunnerSessionsResponse = { + id?: string; + agent_runner_id?: string; + dev_server_id?: string; + state?: string; + /** + * @format dateTime + */ + created_at?: string; + /** + * @format dateTime + */ + updated_at?: string; + /** + * @format dateTime + */ + done_at?: string; + title?: string; + prompt?: string; + agent_config?: { + agent?: string; + model?: string; + }; + result?: string; + result_diff?: string; + commit_sha?: string; + deploy_id?: string; + deploy_url?: string; + duration?: number; + steps?: { + title?: string; + message?: string; + }[]; + user?: { + id?: string; + full_name?: string; + email?: string; + avatar_url?: string; + }; + attached_file_keys?: string[]; + result_zip_file_name?: string; + is_published?: boolean; +}[]; + +export type ListAgentRunnerSessionsVariables = { + pathParams: ListAgentRunnerSessionsPathParams; + queryParams?: ListAgentRunnerSessionsQueryParams; +} & FetcherExtraProps; + +export const listAgentRunnerSessions = ( + variables: ListAgentRunnerSessionsVariables, + signal?: AbortSignal, +) => + fetch< + ListAgentRunnerSessionsResponse, + ListAgentRunnerSessionsError, + undefined, + {}, + ListAgentRunnerSessionsQueryParams, + ListAgentRunnerSessionsPathParams + >({ + url: "/agent_runners/{agentRunnerId}/sessions", + method: "get", + ...variables, + signal, + }); + +export type CreateAgentRunnerSessionPathParams = { + agentRunnerId: string; +}; + +export type CreateAgentRunnerSessionQueryParams = { + prompt?: string; + agent?: string; + model?: string; + file_keys?: string[]; +}; + +export type CreateAgentRunnerSessionError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type CreateAgentRunnerSessionResponse = { + id?: string; + agent_runner_id?: string; + dev_server_id?: string; + state?: string; + /** + * @format dateTime + */ + created_at?: string; + /** + * @format dateTime + */ + updated_at?: string; + /** + * @format dateTime + */ + done_at?: string; + title?: string; + prompt?: string; + agent_config?: { + agent?: string; + model?: string; + }; + result?: string; + result_diff?: string; + commit_sha?: string; + deploy_id?: string; + deploy_url?: string; + duration?: number; + steps?: { + title?: string; + message?: string; + }[]; + user?: { + id?: string; + full_name?: string; + email?: string; + avatar_url?: string; + }; + attached_file_keys?: string[]; + result_zip_file_name?: string; + is_published?: boolean; +}; + +export type CreateAgentRunnerSessionVariables = { + pathParams: CreateAgentRunnerSessionPathParams; + queryParams?: CreateAgentRunnerSessionQueryParams; +} & FetcherExtraProps; + +export const createAgentRunnerSession = ( + variables: CreateAgentRunnerSessionVariables, + signal?: AbortSignal, +) => + fetch< + CreateAgentRunnerSessionResponse, + CreateAgentRunnerSessionError, + undefined, + {}, + CreateAgentRunnerSessionQueryParams, + CreateAgentRunnerSessionPathParams + >({ + url: "/agent_runners/{agentRunnerId}/sessions", + method: "post", + ...variables, + signal, + }); + +export type GetAgentRunnerSessionPathParams = { + agentRunnerId: string; + agentRunnerSessionId: string; +}; + +export type GetAgentRunnerSessionError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type GetAgentRunnerSessionResponse = { + id?: string; + agent_runner_id?: string; + dev_server_id?: string; + state?: string; + /** + * @format dateTime + */ + created_at?: string; + /** + * @format dateTime + */ + updated_at?: string; + /** + * @format dateTime + */ + done_at?: string; + title?: string; + prompt?: string; + agent_config?: { + agent?: string; + model?: string; + }; + result?: string; + result_diff?: string; + commit_sha?: string; + deploy_id?: string; + deploy_url?: string; + duration?: number; + steps?: { + title?: string; + message?: string; + }[]; + user?: { + id?: string; + full_name?: string; + email?: string; + avatar_url?: string; + }; + attached_file_keys?: string[]; + result_zip_file_name?: string; + is_published?: boolean; +}; + +export type GetAgentRunnerSessionVariables = { + pathParams: GetAgentRunnerSessionPathParams; +} & FetcherExtraProps; + +export const getAgentRunnerSession = ( + variables: GetAgentRunnerSessionVariables, + signal?: AbortSignal, +) => + fetch< + GetAgentRunnerSessionResponse, + GetAgentRunnerSessionError, + undefined, + {}, + {}, + GetAgentRunnerSessionPathParams + >({ + url: "/agent_runners/{agentRunnerId}/sessions/{agentRunnerSessionId}", + method: "get", + ...variables, + signal, + }); + +export type UpdateAgentRunnerSessionPathParams = { + agentRunnerId: string; + agentRunnerSessionId: string; +}; + +export type UpdateAgentRunnerSessionQueryParams = { + is_published?: boolean; +}; + +export type UpdateAgentRunnerSessionError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type UpdateAgentRunnerSessionResponse = { + id?: string; + agent_runner_id?: string; + dev_server_id?: string; + state?: string; + /** + * @format dateTime + */ + created_at?: string; + /** + * @format dateTime + */ + updated_at?: string; + /** + * @format dateTime + */ + done_at?: string; + title?: string; + prompt?: string; + agent_config?: { + agent?: string; + model?: string; + }; + result?: string; + result_diff?: string; + commit_sha?: string; + deploy_id?: string; + deploy_url?: string; + duration?: number; + steps?: { + title?: string; + message?: string; + }[]; + user?: { + id?: string; + full_name?: string; + email?: string; + avatar_url?: string; + }; + attached_file_keys?: string[]; + result_zip_file_name?: string; + is_published?: boolean; +}; + +export type UpdateAgentRunnerSessionVariables = { + pathParams: UpdateAgentRunnerSessionPathParams; + queryParams?: UpdateAgentRunnerSessionQueryParams; +} & FetcherExtraProps; + +export const updateAgentRunnerSession = ( + variables: UpdateAgentRunnerSessionVariables, + signal?: AbortSignal, +) => + fetch< + UpdateAgentRunnerSessionResponse, + UpdateAgentRunnerSessionError, + undefined, + {}, + UpdateAgentRunnerSessionQueryParams, + UpdateAgentRunnerSessionPathParams + >({ + url: "/agent_runners/{agentRunnerId}/sessions/{agentRunnerSessionId}", + method: "patch", + ...variables, + signal, + }); + +export type DeleteAgentRunnerSessionPathParams = { + agentRunnerId: string; + agentRunnerSessionId: string; +}; + +export type DeleteAgentRunnerSessionError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type DeleteAgentRunnerSessionVariables = { + pathParams: DeleteAgentRunnerSessionPathParams; +} & FetcherExtraProps; + +export const deleteAgentRunnerSession = ( + variables: DeleteAgentRunnerSessionVariables, + signal?: AbortSignal, +) => + fetch< + undefined, + DeleteAgentRunnerSessionError, + undefined, + {}, + {}, + DeleteAgentRunnerSessionPathParams + >({ + url: "/agent_runners/{agentRunnerId}/sessions/{agentRunnerSessionId}", + method: "delete", + ...variables, + signal, + }); + export type ListFormSubmissionPathParams = { submissionId: string; }; @@ -8395,6 +9329,75 @@ export const markDevServerActivity = ( signal, }); +export type UpdateDevServerStatePathParams = { + siteId: string; + devServerId: string; +}; + +export type UpdateDevServerStateError = Fetcher.ErrorWrapper; + +export type UpdateDevServerStateResponse = { + id?: string; + site_id?: string; + branch?: string; + url?: string; + state?: string; + /** + * @format dateTime + */ + created_at?: string; + /** + * @format dateTime + */ + updated_at?: string; + /** + * @format dateTime + */ + starting_at?: string; + /** + * @format dateTime + */ + error_at?: string; + /** + * @format dateTime + */ + live_at?: string; + /** + * @format dateTime + */ + done_at?: string; + title?: string; +}; + +export type UpdateDevServerStateRequestBody = { + state: "starting" | "live" | "error" | "done"; + task_id?: string; + error?: string; +}; + +export type UpdateDevServerStateVariables = { + body: UpdateDevServerStateRequestBody; + pathParams: UpdateDevServerStatePathParams; +} & FetcherExtraProps; + +export const updateDevServerState = ( + variables: UpdateDevServerStateVariables, + signal?: AbortSignal, +) => + fetch< + UpdateDevServerStateResponse, + UpdateDevServerStateError, + UpdateDevServerStateRequestBody, + {}, + {}, + UpdateDevServerStatePathParams + >({ + url: "/sites/{siteId}/dev_servers/{devServerId}/state", + method: "post", + ...variables, + signal, + }); + export type ListSiteDevServerHooksPathParams = { siteId: string; }; @@ -8624,6 +9627,96 @@ export const deleteSiteDevServerHook = ( signal, }); +export type GetAIGatewayProvidersError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type GetAIGatewayProvidersResponse = { + providers?: void; +}; + +export type GetAIGatewayProvidersVariables = FetcherExtraProps; + +export const getAIGatewayProviders = ( + variables: GetAIGatewayProvidersVariables, + signal?: AbortSignal, +) => + fetch< + GetAIGatewayProvidersResponse, + GetAIGatewayProvidersError, + undefined, + {}, + {}, + {} + >({ url: "/ai-gateway/providers", method: "get", ...variables, signal }); + +export type GetAIGatewayTokenPathParams = { + /** + * The site ID + */ + siteId: string; +}; + +export type GetAIGatewayTokenError = Fetcher.ErrorWrapper<{ + status: Exclude; + payload: { + /** + * @format int64 + */ + code?: number; + message: string; + }; +}>; + +export type GetAIGatewayTokenResponse = { + /** + * The AI Gateway authentication token + */ + token?: string; + /** + * AI gateway base url + */ + url?: string; + /** + * Unix timestamp when the token expires + * + * @format int64 + */ + expires_at?: number; +}; + +export type GetAIGatewayTokenVariables = { + pathParams: GetAIGatewayTokenPathParams; +} & FetcherExtraProps; + +/** + * Returns an AI Gateway token for a specific site + */ +export const getAIGatewayToken = ( + variables: GetAIGatewayTokenVariables, + signal?: AbortSignal, +) => + fetch< + GetAIGatewayTokenResponse, + GetAIGatewayTokenError, + undefined, + {}, + {}, + GetAIGatewayTokenPathParams + >({ + url: "/api/v1/sites/{siteId}/ai-gateway/token", + method: "get", + ...variables, + signal, + }); + export const operationsByTag = { site: { listSites, @@ -8750,6 +9843,24 @@ export const operationsByTag = { cancelAccount, }, auditLog: { listAccountAuditEvents }, + agentRunner: { + listAgentRunners, + createAgentRunner, + createAgentRunnerUploadUrl, + getAgentRunner, + updateAgentRunner, + deleteAgentRunner, + archiveAgentRunner, + agentRunnerPullRequest, + agentRunnerCommitToBranch, + }, + agentRunnerSession: { + listAgentRunnerSessions, + createAgentRunnerSession, + getAgentRunnerSession, + updateAgentRunnerSession, + deleteAgentRunnerSession, + }, serviceInstance: { listServiceInstancesForSite, createServiceInstance, @@ -8773,6 +9884,7 @@ export const operationsByTag = { deleteSiteDevServers, getSiteDevServer, markDevServerActivity, + updateDevServerState, }, devServerHook: { listSiteDevServerHooks, @@ -8781,4 +9893,5 @@ export const operationsByTag = { updateSiteDevServerHook, deleteSiteDevServerHook, }, + aiGateway: { getAIGatewayProviders, getAIGatewayToken }, }; diff --git a/packages/netlify-api/src/api/extra.ts b/packages/netlify-api/src/api/extra.ts index 093bbbe5e..a4aa9cd60 100644 --- a/packages/netlify-api/src/api/extra.ts +++ b/packages/netlify-api/src/api/extra.ts @@ -98,6 +98,20 @@ import { updateAccount, cancelAccount, listAccountAuditEvents, + listAgentRunners, + createAgentRunner, + createAgentRunnerUploadUrl, + getAgentRunner, + updateAgentRunner, + deleteAgentRunner, + archiveAgentRunner, + agentRunnerPullRequest, + agentRunnerCommitToBranch, + listAgentRunnerSessions, + createAgentRunnerSession, + getAgentRunnerSession, + updateAgentRunnerSession, + deleteAgentRunnerSession, listFormSubmission, deleteSubmission, listServiceInstancesForSite, @@ -129,11 +143,14 @@ import { deleteSiteDevServers, getSiteDevServer, markDevServerActivity, + updateDevServerState, listSiteDevServerHooks, createSiteDevServerHook, getSiteDevServerHook, updateSiteDevServerHook, deleteSiteDevServerHook, + getAIGatewayProviders, + getAIGatewayToken, } from "./components"; export const operationsByPath = { @@ -237,6 +254,23 @@ export const operationsByPath = { "PUT /accounts/{account_id}": updateAccount, "DELETE /accounts/{account_id}": cancelAccount, "GET /accounts/{account_id}/audit": listAccountAuditEvents, + "GET /agent_runners": listAgentRunners, + "POST /agent_runners": createAgentRunner, + "POST /agent_runners/upload_url": createAgentRunnerUploadUrl, + "GET /agent_runners/{agent_runner_id}": getAgentRunner, + "PATCH /agent_runners/{agent_runner_id}": updateAgentRunner, + "DELETE /agent_runners/{agent_runner_id}": deleteAgentRunner, + "POST /agent_runners/{agent_runner_id}/archive": archiveAgentRunner, + "POST /agent_runners/{agent_runner_id}/pull_request": agentRunnerPullRequest, + "POST /agent_runners/{agent_runner_id}/commit": agentRunnerCommitToBranch, + "GET /agent_runners/{agent_runner_id}/sessions": listAgentRunnerSessions, + "POST /agent_runners/{agent_runner_id}/sessions": createAgentRunnerSession, + "GET /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}": + getAgentRunnerSession, + "PATCH /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}": + updateAgentRunnerSession, + "DELETE /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}": + deleteAgentRunnerSession, "GET /submissions/{submission_id}": listFormSubmission, "DELETE /submissions/{submission_id}": deleteSubmission, "GET /sites/{site_id}/service-instances": listServiceInstancesForSite, @@ -275,9 +309,13 @@ export const operationsByPath = { "GET /sites/{site_id}/dev_servers/{dev_server_id}": getSiteDevServer, "POST /sites/{site_id}/dev_servers/{dev_server_id}/activity": markDevServerActivity, + "POST /sites/{site_id}/dev_servers/{dev_server_id}/state": + updateDevServerState, "GET /sites/{site_id}/dev_server_hooks": listSiteDevServerHooks, "POST /sites/{site_id}/dev_server_hooks": createSiteDevServerHook, "GET /sites/{site_id}/dev_server_hooks/{id}": getSiteDevServerHook, "PUT /sites/{site_id}/dev_server_hooks/{id}": updateSiteDevServerHook, "DELETE /sites/{site_id}/dev_server_hooks/{id}": deleteSiteDevServerHook, + "GET /ai-gateway/providers": getAIGatewayProviders, + "GET /api/v1/sites/{site_id}/ai-gateway/token": getAIGatewayToken, }; diff --git a/packages/netlify-api/src/api/parameters.ts b/packages/netlify-api/src/api/parameters.ts index 85713ec4a..0932bcad3 100644 --- a/packages/netlify-api/src/api/parameters.ts +++ b/packages/netlify-api/src/api/parameters.ts @@ -1,7 +1,7 @@ /** * Generated by @openapi-codegen * - * @version 2.37.0 + * @version 2.41.0 */ /** * @format int32 diff --git a/packages/netlify-api/src/api/requestBodies.ts b/packages/netlify-api/src/api/requestBodies.ts index a7e764142..23f500a1e 100644 --- a/packages/netlify-api/src/api/requestBodies.ts +++ b/packages/netlify-api/src/api/requestBodies.ts @@ -1,7 +1,7 @@ /** * Generated by @openapi-codegen * - * @version 2.37.0 + * @version 2.41.0 */ export type UpdateSiteMetadataMetadata = Record; diff --git a/packages/netlify-api/src/api/responses.ts b/packages/netlify-api/src/api/responses.ts index 4a963d52f..f82461cbf 100644 --- a/packages/netlify-api/src/api/responses.ts +++ b/packages/netlify-api/src/api/responses.ts @@ -1,7 +1,7 @@ /** * Generated by @openapi-codegen * - * @version 2.37.0 + * @version 2.41.0 */ export type Error = { /** diff --git a/packages/netlify-api/src/api/schemas.ts b/packages/netlify-api/src/api/schemas.ts index 82ea423fe..1df4635b4 100644 --- a/packages/netlify-api/src/api/schemas.ts +++ b/packages/netlify-api/src/api/schemas.ts @@ -1,7 +1,7 @@ /** * Generated by @openapi-codegen * - * @version 2.37.0 + * @version 2.41.0 */ export type DeployValidationsReport = { /** @@ -1203,6 +1203,115 @@ export type AuditLog = { }; }; +export type AgentRunner = { + id?: string; + site_id?: string; + parent_agent_runner_id?: string; + state?: string; + /** + * @format dateTime + */ + created_at?: string; + /** + * @format dateTime + */ + updated_at?: string; + /** + * @format dateTime + */ + done_at?: string; + title?: string; + branch?: string; + result_branch?: string; + pr_url?: string; + pr_branch?: string; + pr_state?: string; + pr_number?: number; + pr_is_being_created?: boolean; + pr_error?: string; + current_task?: string; + result_diff?: string; + sha?: string; + merge_commit_sha?: string; + merge_commit_error?: string; + merge_commit_is_being_created?: boolean; + base_deploy_id?: string; + attached_file_keys?: string[]; + /** + * @format dateTime + */ + active_session_created_at?: string; + latest_session_deploy_id?: string; + latest_session_deploy_url?: string; + user?: { + id?: string; + full_name?: string; + email?: string; + avatar_url?: string; + }; +}; + +export type AgentRunnerSession = { + id?: string; + agent_runner_id?: string; + dev_server_id?: string; + state?: string; + /** + * @format dateTime + */ + created_at?: string; + /** + * @format dateTime + */ + updated_at?: string; + /** + * @format dateTime + */ + done_at?: string; + title?: string; + prompt?: string; + agent_config?: { + agent?: string; + model?: string; + }; + result?: string; + result_diff?: string; + commit_sha?: string; + deploy_id?: string; + deploy_url?: string; + duration?: number; + steps?: { + title?: string; + message?: string; + }[]; + user?: { + id?: string; + full_name?: string; + email?: string; + avatar_url?: string; + }; + attached_file_keys?: string[]; + result_zip_file_name?: string; + is_published?: boolean; +}; + +export type AgentRunnerSessionStep = { + title?: string; + message?: string; +}; + +export type AgentRunnerSessionConfig = { + agent?: string; + model?: string; +}; + +export type AgentRunnerUser = { + id?: string; + full_name?: string; + email?: string; + avatar_url?: string; +}; + export type AccountUsageCapability = { included?: number; used?: number; @@ -1422,3 +1531,26 @@ export type DevServerHookSetup = { branch?: string; type?: "new_dev_server" | "content_refresh"; }; + +export type ProviderDefinition = { + token_env_var?: string; + url_env_var?: string; + models?: string[]; +}; + +export type AiGatewayToken = { + /** + * The AI Gateway authentication token + */ + token?: string; + /** + * AI gateway base url + */ + url?: string; + /** + * Unix timestamp when the token expires + * + * @format int64 + */ + expires_at?: number; +};