// 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, zGetAgentByAgentIdComposerCandidatesPath, zGetAgentByAgentIdComposerCandidatesResponse, zGetAgentByAgentIdComposerPath, zGetAgentByAgentIdComposerResponse, zGetAgentByAgentIdDriveFilesDownloadPath, zGetAgentByAgentIdDriveFilesDownloadQuery, zGetAgentByAgentIdDriveFilesDownloadResponse, zGetAgentByAgentIdDriveFilesPath, zGetAgentByAgentIdDriveFilesPreviewPath, zGetAgentByAgentIdDriveFilesPreviewQuery, zGetAgentByAgentIdDriveFilesPreviewResponse, zGetAgentByAgentIdDriveFilesQuery, zGetAgentByAgentIdDriveFilesResponse, zGetAgentByAgentIdPath, zGetAgentByAgentIdReferencingWorkflowsPath, zGetAgentByAgentIdReferencingWorkflowsResponse, zGetAgentByAgentIdResponse, zGetAgentByAgentIdSandboxFilesPath, zGetAgentByAgentIdSandboxFilesQuery, zGetAgentByAgentIdSandboxFilesReadPath, zGetAgentByAgentIdSandboxFilesReadQuery, zGetAgentByAgentIdSandboxFilesReadResponse, zGetAgentByAgentIdSandboxFilesResponse, zGetAgentByAgentIdVersionsByVersionIdPath, zGetAgentByAgentIdVersionsByVersionIdResponse, zGetAgentByAgentIdVersionsPath, zGetAgentByAgentIdVersionsResponse, zGetAgentInviteOptionsQuery, zGetAgentInviteOptionsResponse, zGetAgentQuery, zGetAgentResponse, zPostAgentBody, zPostAgentByAgentIdComposerValidateBody, zPostAgentByAgentIdComposerValidatePath, zPostAgentByAgentIdComposerValidateResponse, zPostAgentByAgentIdFeaturesBody, zPostAgentByAgentIdFeaturesPath, zPostAgentByAgentIdFeaturesResponse, 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, } export const get2 = 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: get2, } export const post = 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, } export const get3 = 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: get3, put, candidates, validate, } /** * Time-limited external signed URL for one Agent App drive value */ export const get4 = 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: get4, } /** * Truncated text preview of one Agent App drive value */ export const get5 = 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: get5, } /** * List agent drive entries for an Agent App */ export const get6 = 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: get6, download, preview, } export const drive = { files, } /** * Update an Agent App's presentation features (opener, follow-up, citations, ...) */ export const post2 = 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: post2, } /** * 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 post3 = 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: post3, } /** * List workflow apps that reference this Agent App's bound Agent (read-only) */ export const get7 = 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: get7, } /** * Read a text/binary preview file in an Agent App conversation sandbox */ export const get8 = 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: get8, } /** * Upload one Agent App sandbox file as a Dify ToolFile mapping */ export const post4 = 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: post4, } /** * List a directory in an Agent App conversation sandbox */ export const get9 = 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: get9, read, upload, } export const sandbox = { files: files3, } /** * Validate + standardize a Skill into an Agent App drive */ export const post5 = 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: post5, } /** * Upload + validate a Skill package for an Agent App */ export const post6 = 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: post6, } /** * Infer CLI tool + ENV suggestions from a standardized Agent App skill */ export const post7 = 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: post7, } /** * 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 get10 = 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: get10, } export const get11 = 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: get11, 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 get12 = 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: get12, put: put2, composer, drive, features, files: files2, referencingWorkflows, sandbox, skills, versions, } export const get13 = oc .route({ inputStructure: 'detailed', method: 'GET', operationId: 'getAgent', path: '/agent', tags: ['console'], }) .input(z.object({ query: zGetAgentQuery.optional() })) .output(zGetAgentResponse) export const post8 = 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: get13, post: post8, inviteOptions, byAgentId, } export const contract = { agent, }