// This file is auto-generated by @hey-api/openapi-ts import { oc } from '@orpc/contract' import * as z from 'zod' import { zDeleteAgentByAgentIdFilesPath, zDeleteAgentByAgentIdFilesQuery, zDeleteAgentByAgentIdFilesResponse, zDeleteAgentByAgentIdPath, zDeleteAgentByAgentIdResponse, zDeleteAgentByAgentIdSkillsBySlugPath, zDeleteAgentByAgentIdSkillsBySlugResponse, zGetAgentByAgentIdChatMessagesByMessageIdSuggestedQuestionsPath, zGetAgentByAgentIdChatMessagesByMessageIdSuggestedQuestionsResponse, zGetAgentByAgentIdChatMessagesPath, zGetAgentByAgentIdChatMessagesQuery, zGetAgentByAgentIdChatMessagesResponse, zGetAgentByAgentIdComposerCandidatesPath, zGetAgentByAgentIdComposerCandidatesResponse, zGetAgentByAgentIdComposerPath, zGetAgentByAgentIdComposerResponse, zGetAgentByAgentIdDriveFilesDownloadPath, zGetAgentByAgentIdDriveFilesDownloadQuery, zGetAgentByAgentIdDriveFilesDownloadResponse, zGetAgentByAgentIdDriveFilesPath, zGetAgentByAgentIdDriveFilesPreviewPath, zGetAgentByAgentIdDriveFilesPreviewQuery, zGetAgentByAgentIdDriveFilesPreviewResponse, zGetAgentByAgentIdDriveFilesQuery, zGetAgentByAgentIdDriveFilesResponse, zGetAgentByAgentIdLogsPath, zGetAgentByAgentIdLogsQuery, zGetAgentByAgentIdLogsResponse, zGetAgentByAgentIdMessagesByMessageIdPath, zGetAgentByAgentIdMessagesByMessageIdResponse, zGetAgentByAgentIdPath, zGetAgentByAgentIdReferencingWorkflowsPath, zGetAgentByAgentIdReferencingWorkflowsResponse, zGetAgentByAgentIdResponse, zGetAgentByAgentIdSandboxFilesPath, zGetAgentByAgentIdSandboxFilesQuery, zGetAgentByAgentIdSandboxFilesReadPath, zGetAgentByAgentIdSandboxFilesReadQuery, zGetAgentByAgentIdSandboxFilesReadResponse, zGetAgentByAgentIdSandboxFilesResponse, zGetAgentByAgentIdStatisticsSummaryPath, zGetAgentByAgentIdStatisticsSummaryQuery, zGetAgentByAgentIdStatisticsSummaryResponse, zGetAgentByAgentIdVersionsByVersionIdPath, zGetAgentByAgentIdVersionsByVersionIdResponse, zGetAgentByAgentIdVersionsPath, zGetAgentByAgentIdVersionsResponse, zGetAgentInviteOptionsQuery, zGetAgentInviteOptionsResponse, zGetAgentQuery, zGetAgentResponse, zPostAgentBody, zPostAgentByAgentIdChatMessagesByTaskIdStopPath, zPostAgentByAgentIdChatMessagesByTaskIdStopResponse, zPostAgentByAgentIdComposerValidateBody, zPostAgentByAgentIdComposerValidatePath, zPostAgentByAgentIdComposerValidateResponse, zPostAgentByAgentIdCopyBody, zPostAgentByAgentIdCopyPath, zPostAgentByAgentIdCopyResponse, zPostAgentByAgentIdFeaturesBody, zPostAgentByAgentIdFeaturesPath, zPostAgentByAgentIdFeaturesResponse, zPostAgentByAgentIdFeedbacksBody, zPostAgentByAgentIdFeedbacksPath, zPostAgentByAgentIdFeedbacksResponse, zPostAgentByAgentIdFilesBody, zPostAgentByAgentIdFilesPath, zPostAgentByAgentIdFilesResponse, zPostAgentByAgentIdSandboxFilesUploadBody, zPostAgentByAgentIdSandboxFilesUploadPath, zPostAgentByAgentIdSandboxFilesUploadResponse, zPostAgentByAgentIdSkillsBySlugInferToolsPath, zPostAgentByAgentIdSkillsBySlugInferToolsResponse, zPostAgentByAgentIdSkillsStandardizePath, zPostAgentByAgentIdSkillsStandardizeResponse, zPostAgentByAgentIdSkillsUploadPath, zPostAgentByAgentIdSkillsUploadResponse, zPostAgentResponse, zPutAgentByAgentIdBody, 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, } /** * Get suggested questions for an Agent App message */ export const get2 = 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: get2, } export const byMessageId = { suggestedQuestions, } /** * Stop a running Agent App chat message generation */ export const post = 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, } export const byTaskId = { stop, } /** * Get Agent App chat messages for a conversation with pagination */ export const get3 = 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: get3, byMessageId, byTaskId, } export const get4 = 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: get4, } export const post2 = 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: post2, } export const get5 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdComposer', path: '/agent/{agent_id}/composer', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdComposerPath })) .output(zGetAgentByAgentIdComposerResponse) export const put = 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: get5, put, candidates, validate, } export const post3 = 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: post3, } /** * Time-limited external signed URL for one Agent App drive value */ export const get6 = oc .route({ description: 'Time-limited external signed URL for one Agent App drive value', inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdDriveFilesDownload', path: '/agent/{agent_id}/drive/files/download', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdDriveFilesDownloadPath, query: zGetAgentByAgentIdDriveFilesDownloadQuery, }), ) .output(zGetAgentByAgentIdDriveFilesDownloadResponse) export const download = { get: get6, } /** * Truncated text preview of one Agent App drive value */ export const get7 = oc .route({ description: 'Truncated text preview of one Agent App drive value', inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdDriveFilesPreview', path: '/agent/{agent_id}/drive/files/preview', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdDriveFilesPreviewPath, query: zGetAgentByAgentIdDriveFilesPreviewQuery, }), ) .output(zGetAgentByAgentIdDriveFilesPreviewResponse) export const preview = { get: get7, } /** * List agent drive entries for an Agent App */ export const get8 = oc .route({ description: 'List agent drive entries for an Agent App', inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentIdDriveFiles', path: '/agent/{agent_id}/drive/files', tags: ['console'], }) .input( z.object({ params: zGetAgentByAgentIdDriveFilesPath, query: zGetAgentByAgentIdDriveFilesQuery.optional(), }), ) .output(zGetAgentByAgentIdDriveFilesResponse) export const files = { get: get8, download, preview, } export const drive = { files, } /** * Update an Agent App's presentation features (opener, follow-up, citations, ...) */ export const post4 = 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: post4, } /** * Create or update Agent App message feedback */ export const post5 = 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: post5, } /** * Delete one Agent App drive file by key */ export const delete_ = oc .route({ description: 'Delete one Agent App drive file by key', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteAgentByAgentIdFiles', path: '/agent/{agent_id}/files', tags: ['console'], }) .input( z.object({ params: zDeleteAgentByAgentIdFilesPath, query: zDeleteAgentByAgentIdFilesQuery }), ) .output(zDeleteAgentByAgentIdFilesResponse) /** * Commit an uploaded file into the Agent App drive under files/ */ export const post6 = oc .route({ description: 'Commit an uploaded file into the Agent App drive under files/', inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdFiles', path: '/agent/{agent_id}/files', successStatus: 201, tags: ['console'], }) .input(z.object({ body: zPostAgentByAgentIdFilesBody, params: zPostAgentByAgentIdFilesPath })) .output(zPostAgentByAgentIdFilesResponse) export const files2 = { delete: delete_, post: post6, } export const get9 = 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: get9, } /** * Get Agent App message details by ID */ export const get10 = 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: get10, } export const messages = { byMessageId: byMessageId2, } /** * List workflow apps that reference this Agent App's bound Agent (read-only) */ export const get11 = 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: get11, } /** * Read a text/binary preview file in an Agent App conversation sandbox */ export const get12 = 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: get12, } /** * Upload one Agent App sandbox file as a Dify ToolFile mapping */ export const post7 = oc .route({ description: 'Upload one Agent App sandbox file as a Dify ToolFile mapping', inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdSandboxFilesUpload', path: '/agent/{agent_id}/sandbox/files/upload', tags: ['console'], }) .input( z.object({ body: zPostAgentByAgentIdSandboxFilesUploadBody, params: zPostAgentByAgentIdSandboxFilesUploadPath, }), ) .output(zPostAgentByAgentIdSandboxFilesUploadResponse) export const upload = { post: post7, } /** * List a directory in an Agent App conversation sandbox */ export const get13 = 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: get13, read, upload, } export const sandbox = { files: files3, } /** * Validate + standardize a Skill into an Agent App drive */ export const post8 = oc .route({ description: 'Validate + standardize a Skill into an Agent App drive', inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdSkillsStandardize', path: '/agent/{agent_id}/skills/standardize', successStatus: 201, tags: ['console'], }) .input(z.object({ params: zPostAgentByAgentIdSkillsStandardizePath })) .output(zPostAgentByAgentIdSkillsStandardizeResponse) export const standardize = { post: post8, } /** * Upload + validate a Skill package for an Agent App */ export const post9 = oc .route({ description: 'Upload + validate a Skill package for an Agent App', inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdSkillsUpload', path: '/agent/{agent_id}/skills/upload', successStatus: 201, tags: ['console'], }) .input(z.object({ params: zPostAgentByAgentIdSkillsUploadPath })) .output(zPostAgentByAgentIdSkillsUploadResponse) export const upload2 = { post: post9, } /** * Infer CLI tool + ENV suggestions from a standardized Agent App skill */ export const post10 = oc .route({ description: 'Infer CLI tool + ENV suggestions from a standardized Agent App skill', inputStructure: 'detailed', method: 'POST', operationId: 'postAgentByAgentIdSkillsBySlugInferTools', path: '/agent/{agent_id}/skills/{slug}/infer-tools', tags: ['console'], }) .input(z.object({ params: zPostAgentByAgentIdSkillsBySlugInferToolsPath })) .output(zPostAgentByAgentIdSkillsBySlugInferToolsResponse) export const inferTools = { post: post10, } /** * Delete a standardized skill from an Agent App drive */ export const delete2 = oc .route({ description: 'Delete a standardized skill from an Agent App drive', inputStructure: 'detailed', method: 'DELETE', operationId: 'deleteAgentByAgentIdSkillsBySlug', path: '/agent/{agent_id}/skills/{slug}', tags: ['console'], }) .input(z.object({ params: zDeleteAgentByAgentIdSkillsBySlugPath })) .output(zDeleteAgentByAgentIdSkillsBySlugResponse) export const bySlug = { delete: delete2, inferTools, } export const skills = { standardize, upload: upload2, bySlug, } export const get14 = 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: get14, } export const statistics = { summary, } export const get15 = 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: get15, } export const get16 = 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: get16, byVersionId, } export const delete3 = 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 get17 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgentByAgentId', path: '/agent/{agent_id}', tags: ['console'], }) .input(z.object({ params: zGetAgentByAgentIdPath })) .output(zGetAgentByAgentIdResponse) export const put2 = 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: delete3, get: get17, put: put2, chatMessages, composer, copy, drive, features, feedbacks, files: files2, logs, messages, referencingWorkflows, sandbox, skills, statistics, versions, } export const get18 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgent', path: '/agent', tags: ['console'], }) .input(z.object({ query: zGetAgentQuery.optional() })) .output(zGetAgentResponse) export const post11 = 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: get18, post: post11, inviteOptions, byAgentId, } export const contract = { agent, }