// This file is auto-generated by @hey-api/openapi-ts import { oc } from '@orpc/contract' import * as z from 'zod' import { zDeleteAgentByAgentIdApiKeysByApiKeyIdPath, zDeleteAgentByAgentIdApiKeysByApiKeyIdResponse, zDeleteAgentByAgentIdBuildDraftPath, zDeleteAgentByAgentIdBuildDraftResponse, zDeleteAgentByAgentIdConfigFilesByNamePath, zDeleteAgentByAgentIdConfigFilesByNameQuery, zDeleteAgentByAgentIdConfigFilesByNameResponse, zDeleteAgentByAgentIdConfigSkillsByNamePath, zDeleteAgentByAgentIdConfigSkillsByNameQuery, zDeleteAgentByAgentIdConfigSkillsByNameResponse, zDeleteAgentByAgentIdPath, zDeleteAgentByAgentIdResponse, zGetAgentByAgentIdApiAccessPath, zGetAgentByAgentIdApiAccessResponse, zGetAgentByAgentIdApiKeysPath, zGetAgentByAgentIdApiKeysResponse, zGetAgentByAgentIdBuildDraftPath, zGetAgentByAgentIdBuildDraftResponse, zGetAgentByAgentIdChatMessagesByMessageIdSuggestedQuestionsPath, zGetAgentByAgentIdChatMessagesByMessageIdSuggestedQuestionsResponse, zGetAgentByAgentIdChatMessagesPath, zGetAgentByAgentIdChatMessagesQuery, zGetAgentByAgentIdChatMessagesResponse, zGetAgentByAgentIdComposerCandidatesPath, zGetAgentByAgentIdComposerCandidatesResponse, zGetAgentByAgentIdComposerPath, zGetAgentByAgentIdComposerResponse, zGetAgentByAgentIdConfigFilesByNameDownloadPath, zGetAgentByAgentIdConfigFilesByNameDownloadQuery, zGetAgentByAgentIdConfigFilesByNameDownloadResponse, zGetAgentByAgentIdConfigFilesByNamePreviewPath, zGetAgentByAgentIdConfigFilesByNamePreviewQuery, zGetAgentByAgentIdConfigFilesByNamePreviewResponse, zGetAgentByAgentIdConfigFilesPath, zGetAgentByAgentIdConfigFilesQuery, zGetAgentByAgentIdConfigFilesResponse, zGetAgentByAgentIdConfigManifestPath, zGetAgentByAgentIdConfigManifestQuery, zGetAgentByAgentIdConfigManifestResponse, zGetAgentByAgentIdConfigSkillsByNameDownloadPath, zGetAgentByAgentIdConfigSkillsByNameDownloadQuery, zGetAgentByAgentIdConfigSkillsByNameDownloadResponse, zGetAgentByAgentIdConfigSkillsByNameFilesContentPath, zGetAgentByAgentIdConfigSkillsByNameFilesContentResponse, zGetAgentByAgentIdConfigSkillsByNameFilesDownloadPath, zGetAgentByAgentIdConfigSkillsByNameFilesDownloadQuery, zGetAgentByAgentIdConfigSkillsByNameFilesDownloadResponse, zGetAgentByAgentIdConfigSkillsByNameFilesPreviewPath, zGetAgentByAgentIdConfigSkillsByNameFilesPreviewQuery, zGetAgentByAgentIdConfigSkillsByNameFilesPreviewResponse, zGetAgentByAgentIdConfigSkillsByNameInspectPath, zGetAgentByAgentIdConfigSkillsByNameInspectQuery, zGetAgentByAgentIdConfigSkillsByNameInspectResponse, zGetAgentByAgentIdConfigSkillsPath, zGetAgentByAgentIdConfigSkillsQuery, zGetAgentByAgentIdConfigSkillsResponse, zGetAgentByAgentIdLogsByConversationIdMessagesPath, zGetAgentByAgentIdLogsByConversationIdMessagesQuery, zGetAgentByAgentIdLogsByConversationIdMessagesResponse, zGetAgentByAgentIdLogSourcesPath, zGetAgentByAgentIdLogSourcesResponse, zGetAgentByAgentIdLogsPath, zGetAgentByAgentIdLogsQuery, zGetAgentByAgentIdLogsResponse, zGetAgentByAgentIdMessagesByMessageIdPath, zGetAgentByAgentIdMessagesByMessageIdResponse, zGetAgentByAgentIdPath, zGetAgentByAgentIdReferencingWorkflowsPath, zGetAgentByAgentIdReferencingWorkflowsResponse, zGetAgentByAgentIdResponse, zGetAgentByAgentIdSandboxFilesPath, zGetAgentByAgentIdSandboxFilesQuery, zGetAgentByAgentIdSandboxFilesReadPath, zGetAgentByAgentIdSandboxFilesReadQuery, zGetAgentByAgentIdSandboxFilesReadResponse, zGetAgentByAgentIdSandboxFilesResponse, zGetAgentByAgentIdSandboxPath, zGetAgentByAgentIdSandboxQuery, zGetAgentByAgentIdSandboxResponse, zGetAgentByAgentIdStatisticsSummaryPath, zGetAgentByAgentIdStatisticsSummaryQuery, zGetAgentByAgentIdStatisticsSummaryResponse, zGetAgentByAgentIdVersionsByVersionIdPath, zGetAgentByAgentIdVersionsByVersionIdResponse, zGetAgentByAgentIdVersionsPath, zGetAgentByAgentIdVersionsResponse, zGetAgentInviteOptionsQuery, zGetAgentInviteOptionsResponse, zGetAgentQuery, zGetAgentResponse, zPostAgentBody, zPostAgentByAgentIdApiEnableBody, zPostAgentByAgentIdApiEnablePath, zPostAgentByAgentIdApiEnableResponse, zPostAgentByAgentIdApiKeysPath, zPostAgentByAgentIdApiKeysResponse, zPostAgentByAgentIdAudioToTextBody, zPostAgentByAgentIdAudioToTextPath, zPostAgentByAgentIdAudioToTextResponse, zPostAgentByAgentIdBuildChatFinalizePath, zPostAgentByAgentIdBuildChatFinalizeResponse, zPostAgentByAgentIdBuildDraftApplyPath, zPostAgentByAgentIdBuildDraftApplyResponse, zPostAgentByAgentIdBuildDraftCheckoutBody, zPostAgentByAgentIdBuildDraftCheckoutPath, zPostAgentByAgentIdBuildDraftCheckoutResponse, zPostAgentByAgentIdChatMessagesByTaskIdStopPath, zPostAgentByAgentIdChatMessagesByTaskIdStopResponse, zPostAgentByAgentIdComposerValidateBody, zPostAgentByAgentIdComposerValidatePath, zPostAgentByAgentIdComposerValidateResponse, zPostAgentByAgentIdConfigFilesBody, zPostAgentByAgentIdConfigFilesPath, zPostAgentByAgentIdConfigFilesQuery, zPostAgentByAgentIdConfigFilesResponse, zPostAgentByAgentIdConfigSkillsUploadBody, zPostAgentByAgentIdConfigSkillsUploadPath, zPostAgentByAgentIdConfigSkillsUploadQuery, zPostAgentByAgentIdConfigSkillsUploadResponse, zPostAgentByAgentIdCopyBody, zPostAgentByAgentIdCopyPath, zPostAgentByAgentIdCopyResponse, zPostAgentByAgentIdDebugConversationRefreshPath, zPostAgentByAgentIdDebugConversationRefreshResponse, zPostAgentByAgentIdFeaturesBody, zPostAgentByAgentIdFeaturesPath, zPostAgentByAgentIdFeaturesResponse, zPostAgentByAgentIdFeedbacksBody, zPostAgentByAgentIdFeedbacksPath, zPostAgentByAgentIdFeedbacksResponse, zPostAgentByAgentIdPublishBody, zPostAgentByAgentIdPublishPath, zPostAgentByAgentIdPublishResponse, zPostAgentByAgentIdSandboxFilesDownloadBody, zPostAgentByAgentIdSandboxFilesDownloadPath, zPostAgentByAgentIdSandboxFilesDownloadResponse, zPostAgentByAgentIdVersionsByVersionIdRestorePath, zPostAgentByAgentIdVersionsByVersionIdRestoreResponse, zPostAgentResponse, zPutAgentByAgentIdBody, zPutAgentByAgentIdBuildDraftBody, zPutAgentByAgentIdBuildDraftPath, zPutAgentByAgentIdBuildDraftResponse, zPutAgentByAgentIdComposerBody, zPutAgentByAgentIdComposerPath, zPutAgentByAgentIdComposerResponse, zPutAgentByAgentIdPath, zPutAgentByAgentIdResponse, } from './zod.gen' export const get = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentInviteOptions', path: '/agent/invite-options', tags: ['console'], }) .input(z.object({ query: zGetAgentInviteOptionsQuery.optional() })) .output(zGetAgentInviteOptionsResponse) export const inviteOptions = { get, } export const get2 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdApiAccess', path: '/agent/{agent_id}/api-access', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdApiAccessPath })) .output(zGetAgentByAgentIdApiAccessResponse) export const apiAccess = { get: get2, } export const post = oc .route({ inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdApiEnable', path: '/agent/{agent_id}/api-enable', tags: ['console'], }) .input( z.object({ body: zPostAgentByAgentIdApiEnableBody, params: zPostAgentByAgentIdApiEnablePath }), ) .output(zPostAgentByAgentIdApiEnableResponse) export const apiEnable = { post, } export const delete_ = oc .route({ inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteAgentByAgentIdApiKeysByApiKeyId', path: '/agent/{agent_id}/api-keys/{api_key_id}', successStatus: 204, tags: ['console'], }) .input(z.object({ params: zDeleteAgentByAgentIdApiKeysByApiKeyIdPath })) .output(zDeleteAgentByAgentIdApiKeysByApiKeyIdResponse) export const byApiKeyId = { delete: delete_, } export const get3 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdApiKeys', path: '/agent/{agent_id}/api-keys', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdApiKeysPath })) .output(zGetAgentByAgentIdApiKeysResponse) export const post2 = oc .route({ inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdApiKeys', path: '/agent/{agent_id}/api-keys', successStatus: 201, tags: ['console'], }) .input(z.object({ params: zPostAgentByAgentIdApiKeysPath })) .output(zPostAgentByAgentIdApiKeysResponse) export const apiKeys = { get: get3, post: post2, byApiKeyId, } /** * Transcribe audio using the current Agent debug configuration */ export const post3 = oc .route({ description: 'Transcribe audio using the current Agent debug configuration', inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdAudioToText', path: '/agent/{agent_id}/audio-to-text', tags: ['console'], }) .input( z.object({ body: zPostAgentByAgentIdAudioToTextBody, params: zPostAgentByAgentIdAudioToTextPath, }), ) .output(zPostAgentByAgentIdAudioToTextResponse) export const audioToText = { post: post3, } /** * Run a build-draft Agent App turn that asks the agent to push config updates */ export const post4 = oc .route({ description: 'Run a build-draft Agent App turn that asks the agent to push config updates', inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdBuildChatFinalize', path: '/agent/{agent_id}/build-chat/finalize', tags: ['console'], }) .input(z.object({ params: zPostAgentByAgentIdBuildChatFinalizePath })) .output(zPostAgentByAgentIdBuildChatFinalizeResponse) export const finalize = { post: post4, } export const buildChat = { finalize, } export const post5 = oc .route({ inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdBuildDraftApply', path: '/agent/{agent_id}/build-draft/apply', tags: ['console'], }) .input(z.object({ params: zPostAgentByAgentIdBuildDraftApplyPath })) .output(zPostAgentByAgentIdBuildDraftApplyResponse) export const apply = { post: post5, } export const post6 = oc .route({ inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdBuildDraftCheckout', path: '/agent/{agent_id}/build-draft/checkout', tags: ['console'], }) .input( z.object({ body: zPostAgentByAgentIdBuildDraftCheckoutBody, params: zPostAgentByAgentIdBuildDraftCheckoutPath, }), ) .output(zPostAgentByAgentIdBuildDraftCheckoutResponse) export const checkout = { post: post6, } export const delete2 = oc .route({ inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteAgentByAgentIdBuildDraft', path: '/agent/{agent_id}/build-draft', tags: ['console'], }) .input(z.object({ params: zDeleteAgentByAgentIdBuildDraftPath })) .output(zDeleteAgentByAgentIdBuildDraftResponse) export const get4 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdBuildDraft', path: '/agent/{agent_id}/build-draft', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdBuildDraftPath })) .output(zGetAgentByAgentIdBuildDraftResponse) export const put = oc .route({ inputStructure: 'detailed', method: 'PUT', operationId: 'putAgentByAgentIdBuildDraft', path: '/agent/{agent_id}/build-draft', tags: ['console'], }) .input( z.object({ body: zPutAgentByAgentIdBuildDraftBody, params: zPutAgentByAgentIdBuildDraftPath }), ) .output(zPutAgentByAgentIdBuildDraftResponse) export const buildDraft = { delete: delete2, get: get4, put, apply, checkout, } /** * Get suggested questions for an Agent App message */ export const get5 = oc .route({ description: 'Get suggested questions for an Agent App message', inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdChatMessagesByMessageIdSuggestedQuestions', path: '/agent/{agent_id}/chat-messages/{message_id}/suggested-questions', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdChatMessagesByMessageIdSuggestedQuestionsPath })) .output(zGetAgentByAgentIdChatMessagesByMessageIdSuggestedQuestionsResponse) export const suggestedQuestions = { get: get5, } export const byMessageId = { suggestedQuestions, } /** * Stop a running Agent App chat message generation */ export const post7 = oc .route({ description: 'Stop a running Agent App chat message generation', inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdChatMessagesByTaskIdStop', path: '/agent/{agent_id}/chat-messages/{task_id}/stop', tags: ['console'], }) .input(z.object({ params: zPostAgentByAgentIdChatMessagesByTaskIdStopPath })) .output(zPostAgentByAgentIdChatMessagesByTaskIdStopResponse) export const stop = { post: post7, } export const byTaskId = { stop, } /** * Get Agent App chat messages for a conversation with pagination */ export const get6 = oc .route({ description: 'Get Agent App chat messages for a conversation with pagination', inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdChatMessages', path: '/agent/{agent_id}/chat-messages', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdChatMessagesPath, query: zGetAgentByAgentIdChatMessagesQuery, }), ) .output(zGetAgentByAgentIdChatMessagesResponse) export const chatMessages = { get: get6, byMessageId, byTaskId, } export const get7 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdComposerCandidates', path: '/agent/{agent_id}/composer/candidates', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdComposerCandidatesPath })) .output(zGetAgentByAgentIdComposerCandidatesResponse) export const candidates = { get: get7, } export const post8 = oc .route({ inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdComposerValidate', path: '/agent/{agent_id}/composer/validate', tags: ['console'], }) .input( z.object({ body: zPostAgentByAgentIdComposerValidateBody, params: zPostAgentByAgentIdComposerValidatePath, }), ) .output(zPostAgentByAgentIdComposerValidateResponse) export const validate = { post: post8, } export const get8 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdComposer', path: '/agent/{agent_id}/composer', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdComposerPath })) .output(zGetAgentByAgentIdComposerResponse) export const put2 = oc .route({ inputStructure: 'detailed', method: 'PUT', operationId: 'putAgentByAgentIdComposer', path: '/agent/{agent_id}/composer', tags: ['console'], }) .input(z.object({ body: zPutAgentByAgentIdComposerBody, params: zPutAgentByAgentIdComposerPath })) .output(zPutAgentByAgentIdComposerResponse) export const composer = { get: get8, put: put2, candidates, validate, } export const get9 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdConfigFilesByNameDownload', path: '/agent/{agent_id}/config/files/{name}/download', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdConfigFilesByNameDownloadPath, query: zGetAgentByAgentIdConfigFilesByNameDownloadQuery.optional(), }), ) .output(zGetAgentByAgentIdConfigFilesByNameDownloadResponse) export const download = { get: get9, } export const get10 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdConfigFilesByNamePreview', path: '/agent/{agent_id}/config/files/{name}/preview', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdConfigFilesByNamePreviewPath, query: zGetAgentByAgentIdConfigFilesByNamePreviewQuery.optional(), }), ) .output(zGetAgentByAgentIdConfigFilesByNamePreviewResponse) export const preview = { get: get10, } export const delete3 = oc .route({ inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteAgentByAgentIdConfigFilesByName', path: '/agent/{agent_id}/config/files/{name}', tags: ['console'], }) .input( z.object({ params: zDeleteAgentByAgentIdConfigFilesByNamePath, query: zDeleteAgentByAgentIdConfigFilesByNameQuery.optional(), }), ) .output(zDeleteAgentByAgentIdConfigFilesByNameResponse) export const byName = { delete: delete3, download, preview, } export const get11 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdConfigFiles', path: '/agent/{agent_id}/config/files', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdConfigFilesPath, query: zGetAgentByAgentIdConfigFilesQuery.optional(), }), ) .output(zGetAgentByAgentIdConfigFilesResponse) export const post9 = oc .route({ inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdConfigFiles', path: '/agent/{agent_id}/config/files', successStatus: 201, tags: ['console'], }) .input( z.object({ body: zPostAgentByAgentIdConfigFilesBody, params: zPostAgentByAgentIdConfigFilesPath, query: zPostAgentByAgentIdConfigFilesQuery.optional(), }), ) .output(zPostAgentByAgentIdConfigFilesResponse) export const files = { get: get11, post: post9, byName, } export const get12 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdConfigManifest', path: '/agent/{agent_id}/config/manifest', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdConfigManifestPath, query: zGetAgentByAgentIdConfigManifestQuery.optional(), }), ) .output(zGetAgentByAgentIdConfigManifestResponse) export const manifest = { get: get12, } export const post10 = oc .route({ inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdConfigSkillsUpload', path: '/agent/{agent_id}/config/skills/upload', successStatus: 201, tags: ['console'], }) .input( z.object({ body: zPostAgentByAgentIdConfigSkillsUploadBody, params: zPostAgentByAgentIdConfigSkillsUploadPath, query: zPostAgentByAgentIdConfigSkillsUploadQuery.optional(), }), ) .output(zPostAgentByAgentIdConfigSkillsUploadResponse) export const upload = { post: post10, } export const get13 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdConfigSkillsByNameDownload', path: '/agent/{agent_id}/config/skills/{name}/download', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdConfigSkillsByNameDownloadPath, query: zGetAgentByAgentIdConfigSkillsByNameDownloadQuery.optional(), }), ) .output(zGetAgentByAgentIdConfigSkillsByNameDownloadResponse) export const download2 = { get: get13, } export const get14 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdConfigSkillsByNameFilesContent', path: '/agent/{agent_id}/config/skills/{name}/files/content', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdConfigSkillsByNameFilesContentPath })) .output(zGetAgentByAgentIdConfigSkillsByNameFilesContentResponse) export const content = { get: get14, } export const get15 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdConfigSkillsByNameFilesDownload', path: '/agent/{agent_id}/config/skills/{name}/files/download', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdConfigSkillsByNameFilesDownloadPath, query: zGetAgentByAgentIdConfigSkillsByNameFilesDownloadQuery, }), ) .output(zGetAgentByAgentIdConfigSkillsByNameFilesDownloadResponse) export const download3 = { get: get15, } export const get16 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdConfigSkillsByNameFilesPreview', path: '/agent/{agent_id}/config/skills/{name}/files/preview', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdConfigSkillsByNameFilesPreviewPath, query: zGetAgentByAgentIdConfigSkillsByNameFilesPreviewQuery, }), ) .output(zGetAgentByAgentIdConfigSkillsByNameFilesPreviewResponse) export const preview2 = { get: get16, } export const files2 = { content, download: download3, preview: preview2, } export const get17 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdConfigSkillsByNameInspect', path: '/agent/{agent_id}/config/skills/{name}/inspect', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdConfigSkillsByNameInspectPath, query: zGetAgentByAgentIdConfigSkillsByNameInspectQuery.optional(), }), ) .output(zGetAgentByAgentIdConfigSkillsByNameInspectResponse) export const inspect = { get: get17, } export const delete4 = oc .route({ inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteAgentByAgentIdConfigSkillsByName', path: '/agent/{agent_id}/config/skills/{name}', tags: ['console'], }) .input( z.object({ params: zDeleteAgentByAgentIdConfigSkillsByNamePath, query: zDeleteAgentByAgentIdConfigSkillsByNameQuery.optional(), }), ) .output(zDeleteAgentByAgentIdConfigSkillsByNameResponse) export const byName2 = { delete: delete4, download: download2, files: files2, inspect, } export const get18 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdConfigSkills', path: '/agent/{agent_id}/config/skills', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdConfigSkillsPath, query: zGetAgentByAgentIdConfigSkillsQuery.optional(), }), ) .output(zGetAgentByAgentIdConfigSkillsResponse) export const skills = { get: get18, upload, byName: byName2, } export const config = { files, manifest, skills, } export const post11 = oc .route({ inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdCopy', path: '/agent/{agent_id}/copy', successStatus: 201, tags: ['console'], }) .input(z.object({ body: zPostAgentByAgentIdCopyBody, params: zPostAgentByAgentIdCopyPath })) .output(zPostAgentByAgentIdCopyResponse) export const copy = { post: post11, } export const post12 = oc .route({ inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdDebugConversationRefresh', path: '/agent/{agent_id}/debug-conversation/refresh', tags: ['console'], }) .input(z.object({ params: zPostAgentByAgentIdDebugConversationRefreshPath })) .output(zPostAgentByAgentIdDebugConversationRefreshResponse) export const refresh = { post: post12, } export const debugConversation = { refresh, } /** * Update an Agent App's presentation features (opener, follow-up, citations, ...) */ export const post13 = oc .route({ description: "Update an Agent App's presentation features (opener, follow-up, citations, ...)", inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdFeatures', path: '/agent/{agent_id}/features', tags: ['console'], }) .input( z.object({ body: zPostAgentByAgentIdFeaturesBody, params: zPostAgentByAgentIdFeaturesPath }), ) .output(zPostAgentByAgentIdFeaturesResponse) export const features = { post: post13, } /** * Create or update Agent App message feedback */ export const post14 = oc .route({ description: 'Create or update Agent App message feedback', inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdFeedbacks', path: '/agent/{agent_id}/feedbacks', tags: ['console'], }) .input( z.object({ body: zPostAgentByAgentIdFeedbacksBody, params: zPostAgentByAgentIdFeedbacksPath }), ) .output(zPostAgentByAgentIdFeedbacksResponse) export const feedbacks = { post: post14, } export const get19 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdLogSources', path: '/agent/{agent_id}/log-sources', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdLogSourcesPath })) .output(zGetAgentByAgentIdLogSourcesResponse) export const logSources = { get: get19, } export const get20 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdLogsByConversationIdMessages', path: '/agent/{agent_id}/logs/{conversation_id}/messages', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdLogsByConversationIdMessagesPath, query: zGetAgentByAgentIdLogsByConversationIdMessagesQuery.optional(), }), ) .output(zGetAgentByAgentIdLogsByConversationIdMessagesResponse) export const messages = { get: get20, } export const byConversationId = { messages, } export const get21 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdLogs', path: '/agent/{agent_id}/logs', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdLogsPath, query: zGetAgentByAgentIdLogsQuery.optional() }), ) .output(zGetAgentByAgentIdLogsResponse) export const logs = { get: get21, byConversationId, } /** * Get Agent App message details by ID */ export const get22 = oc .route({ description: 'Get Agent App message details by ID', inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdMessagesByMessageId', path: '/agent/{agent_id}/messages/{message_id}', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdMessagesByMessageIdPath })) .output(zGetAgentByAgentIdMessagesByMessageIdResponse) export const byMessageId2 = { get: get22, } export const messages2 = { byMessageId: byMessageId2, } export const post15 = oc .route({ inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdPublish', path: '/agent/{agent_id}/publish', tags: ['console'], }) .input(z.object({ body: zPostAgentByAgentIdPublishBody, params: zPostAgentByAgentIdPublishPath })) .output(zPostAgentByAgentIdPublishResponse) export const publish = { post: post15, } /** * List workflow apps that reference this Agent App's bound Agent (read-only) */ export const get23 = oc .route({ description: "List workflow apps that reference this Agent App's bound Agent (read-only)", inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdReferencingWorkflows', path: '/agent/{agent_id}/referencing-workflows', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdReferencingWorkflowsPath })) .output(zGetAgentByAgentIdReferencingWorkflowsResponse) export const referencingWorkflows = { get: get23, } /** * Create a ToolFile from one Agent App Binding file and return its download URL */ export const post16 = oc .route({ description: 'Create a ToolFile from one Agent App Binding file and return its download URL', inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdSandboxFilesDownload', path: '/agent/{agent_id}/sandbox/files/download', tags: ['console'], }) .input( z.object({ body: zPostAgentByAgentIdSandboxFilesDownloadBody, params: zPostAgentByAgentIdSandboxFilesDownloadPath, }), ) .output(zPostAgentByAgentIdSandboxFilesDownloadResponse) export const download4 = { post: post16, } /** * Read a text/binary preview file in an Agent App conversation sandbox */ export const get24 = oc .route({ description: 'Read a text/binary preview file in an Agent App conversation sandbox', inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdSandboxFilesRead', path: '/agent/{agent_id}/sandbox/files/read', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdSandboxFilesReadPath, query: zGetAgentByAgentIdSandboxFilesReadQuery, }), ) .output(zGetAgentByAgentIdSandboxFilesReadResponse) export const read = { get: get24, } /** * List a directory in an Agent App conversation sandbox */ export const get25 = oc .route({ description: 'List a directory in an Agent App conversation sandbox', inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdSandboxFiles', path: '/agent/{agent_id}/sandbox/files', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdSandboxFilesPath, query: zGetAgentByAgentIdSandboxFilesQuery, }), ) .output(zGetAgentByAgentIdSandboxFilesResponse) export const files3 = { get: get25, download: download4, read, } /** * Get basic information for an Agent App conversation sandbox */ export const get26 = oc .route({ description: 'Get basic information for an Agent App conversation sandbox', inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdSandbox', path: '/agent/{agent_id}/sandbox', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdSandboxPath, query: zGetAgentByAgentIdSandboxQuery })) .output(zGetAgentByAgentIdSandboxResponse) export const sandbox = { get: get26, files: files3, } export const get27 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdStatisticsSummary', path: '/agent/{agent_id}/statistics/summary', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdStatisticsSummaryPath, query: zGetAgentByAgentIdStatisticsSummaryQuery.optional(), }), ) .output(zGetAgentByAgentIdStatisticsSummaryResponse) export const summary = { get: get27, } export const statistics = { summary, } export const post17 = oc .route({ inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdVersionsByVersionIdRestore', path: '/agent/{agent_id}/versions/{version_id}/restore', tags: ['console'], }) .input(z.object({ params: zPostAgentByAgentIdVersionsByVersionIdRestorePath })) .output(zPostAgentByAgentIdVersionsByVersionIdRestoreResponse) export const restore = { post: post17, } export const get28 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdVersionsByVersionId', path: '/agent/{agent_id}/versions/{version_id}', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdVersionsByVersionIdPath })) .output(zGetAgentByAgentIdVersionsByVersionIdResponse) export const byVersionId = { get: get28, restore, } export const get29 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdVersions', path: '/agent/{agent_id}/versions', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdVersionsPath })) .output(zGetAgentByAgentIdVersionsResponse) export const versions = { get: get29, byVersionId, } export const delete5 = oc .route({ inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteAgentByAgentId', path: '/agent/{agent_id}', successStatus: 204, tags: ['console'], }) .input(z.object({ params: zDeleteAgentByAgentIdPath })) .output(zDeleteAgentByAgentIdResponse) export const get30 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentId', path: '/agent/{agent_id}', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdPath })) .output(zGetAgentByAgentIdResponse) export const put3 = oc .route({ inputStructure: 'detailed', method: 'PUT', operationId: 'putAgentByAgentId', path: '/agent/{agent_id}', tags: ['console'], }) .input(z.object({ body: zPutAgentByAgentIdBody, params: zPutAgentByAgentIdPath })) .output(zPutAgentByAgentIdResponse) export const byAgentId = { delete: delete5, get: get30, put: put3, apiAccess, apiEnable, apiKeys, audioToText, buildChat, buildDraft, chatMessages, composer, config, copy, debugConversation, features, feedbacks, logSources, logs, messages: messages2, publish, referencingWorkflows, sandbox, statistics, versions, } export const get31 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgent', path: '/agent', tags: ['console'], }) .input(z.object({ query: zGetAgentQuery.optional() })) .output(zGetAgentResponse) export const post18 = oc .route({ inputStructure: 'detailed', method: 'POST', operationId: 'postAgent', path: '/agent', successStatus: 201, tags: ['console'], }) .input(z.object({ body: zPostAgentBody })) .output(zPostAgentResponse) export const agent = { get: get31, post: post18, inviteOptions, byAgentId, } export const contract = { agent, }