// This file is auto-generated by @hey-api/openapi-ts

import { oc } from '@orpc/contract'
import * as z from 'zod'

import {
  zDeleteAppsByAppIdAgentFilesPath,
  zDeleteAppsByAppIdAgentFilesQuery,
  zDeleteAppsByAppIdAgentFilesResponse,
  zDeleteAppsByAppIdAgentSkillsBySlugPath,
  zDeleteAppsByAppIdAgentSkillsBySlugQuery,
  zDeleteAppsByAppIdAgentSkillsBySlugResponse,
  zDeleteAppsByAppIdAnnotationsByAnnotationIdPath,
  zDeleteAppsByAppIdAnnotationsByAnnotationIdResponse,
  zDeleteAppsByAppIdAnnotationsPath,
  zDeleteAppsByAppIdAnnotationsResponse,
  zDeleteAppsByAppIdChatConversationsByConversationIdPath,
  zDeleteAppsByAppIdChatConversationsByConversationIdResponse,
  zDeleteAppsByAppIdCompletionConversationsByConversationIdPath,
  zDeleteAppsByAppIdCompletionConversationsByConversationIdResponse,
  zDeleteAppsByAppIdPath,
  zDeleteAppsByAppIdResponse,
  zDeleteAppsByAppIdTraceConfigPath,
  zDeleteAppsByAppIdTraceConfigQuery,
  zDeleteAppsByAppIdTraceConfigResponse,
  zDeleteAppsByAppIdWorkflowCommentsByCommentIdPath,
  zDeleteAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdPath,
  zDeleteAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdResponse,
  zDeleteAppsByAppIdWorkflowCommentsByCommentIdResponse,
  zDeleteAppsByAppIdWorkflowsByWorkflowIdPath,
  zDeleteAppsByAppIdWorkflowsByWorkflowIdResponse,
  zDeleteAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesPath,
  zDeleteAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesResponse,
  zDeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdPath,
  zDeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdResponse,
  zDeleteAppsByAppIdWorkflowsDraftVariablesPath,
  zDeleteAppsByAppIdWorkflowsDraftVariablesResponse,
  zDeleteAppsByResourceIdApiKeysByApiKeyIdPath,
  zDeleteAppsByResourceIdApiKeysByApiKeyIdResponse,
  zGetAppsByAppIdAdvancedChatWorkflowRunsCountPath,
  zGetAppsByAppIdAdvancedChatWorkflowRunsCountQuery,
  zGetAppsByAppIdAdvancedChatWorkflowRunsCountResponse,
  zGetAppsByAppIdAdvancedChatWorkflowRunsPath,
  zGetAppsByAppIdAdvancedChatWorkflowRunsQuery,
  zGetAppsByAppIdAdvancedChatWorkflowRunsResponse,
  zGetAppsByAppIdAgentComposerCandidatesPath,
  zGetAppsByAppIdAgentComposerCandidatesResponse,
  zGetAppsByAppIdAgentComposerPath,
  zGetAppsByAppIdAgentComposerResponse,
  zGetAppsByAppIdAgentDriveFilesDownloadPath,
  zGetAppsByAppIdAgentDriveFilesDownloadQuery,
  zGetAppsByAppIdAgentDriveFilesDownloadResponse,
  zGetAppsByAppIdAgentDriveFilesPath,
  zGetAppsByAppIdAgentDriveFilesPreviewPath,
  zGetAppsByAppIdAgentDriveFilesPreviewQuery,
  zGetAppsByAppIdAgentDriveFilesPreviewResponse,
  zGetAppsByAppIdAgentDriveFilesQuery,
  zGetAppsByAppIdAgentDriveFilesResponse,
  zGetAppsByAppIdAgentLogsPath,
  zGetAppsByAppIdAgentLogsQuery,
  zGetAppsByAppIdAgentLogsResponse,
  zGetAppsByAppIdAgentReferencingWorkflowsPath,
  zGetAppsByAppIdAgentReferencingWorkflowsResponse,
  zGetAppsByAppIdAgentSandboxFilesPath,
  zGetAppsByAppIdAgentSandboxFilesQuery,
  zGetAppsByAppIdAgentSandboxFilesReadPath,
  zGetAppsByAppIdAgentSandboxFilesReadQuery,
  zGetAppsByAppIdAgentSandboxFilesReadResponse,
  zGetAppsByAppIdAgentSandboxFilesResponse,
  zGetAppsByAppIdAnnotationReplyByActionStatusByJobIdPath,
  zGetAppsByAppIdAnnotationReplyByActionStatusByJobIdResponse,
  zGetAppsByAppIdAnnotationsBatchImportStatusByJobIdPath,
  zGetAppsByAppIdAnnotationsBatchImportStatusByJobIdResponse,
  zGetAppsByAppIdAnnotationsByAnnotationIdHitHistoriesPath,
  zGetAppsByAppIdAnnotationsByAnnotationIdHitHistoriesQuery,
  zGetAppsByAppIdAnnotationsByAnnotationIdHitHistoriesResponse,
  zGetAppsByAppIdAnnotationsCountPath,
  zGetAppsByAppIdAnnotationsCountResponse,
  zGetAppsByAppIdAnnotationSettingPath,
  zGetAppsByAppIdAnnotationSettingResponse,
  zGetAppsByAppIdAnnotationsExportPath,
  zGetAppsByAppIdAnnotationsExportResponse,
  zGetAppsByAppIdAnnotationsPath,
  zGetAppsByAppIdAnnotationsQuery,
  zGetAppsByAppIdAnnotationsResponse,
  zGetAppsByAppIdChatConversationsByConversationIdPath,
  zGetAppsByAppIdChatConversationsByConversationIdResponse,
  zGetAppsByAppIdChatConversationsPath,
  zGetAppsByAppIdChatConversationsQuery,
  zGetAppsByAppIdChatConversationsResponse,
  zGetAppsByAppIdChatMessagesByMessageIdSuggestedQuestionsPath,
  zGetAppsByAppIdChatMessagesByMessageIdSuggestedQuestionsResponse,
  zGetAppsByAppIdChatMessagesPath,
  zGetAppsByAppIdChatMessagesQuery,
  zGetAppsByAppIdChatMessagesResponse,
  zGetAppsByAppIdCompletionConversationsByConversationIdPath,
  zGetAppsByAppIdCompletionConversationsByConversationIdResponse,
  zGetAppsByAppIdCompletionConversationsPath,
  zGetAppsByAppIdCompletionConversationsQuery,
  zGetAppsByAppIdCompletionConversationsResponse,
  zGetAppsByAppIdConversationVariablesPath,
  zGetAppsByAppIdConversationVariablesQuery,
  zGetAppsByAppIdConversationVariablesResponse,
  zGetAppsByAppIdExportPath,
  zGetAppsByAppIdExportQuery,
  zGetAppsByAppIdExportResponse,
  zGetAppsByAppIdFeedbacksExportPath,
  zGetAppsByAppIdFeedbacksExportQuery,
  zGetAppsByAppIdFeedbacksExportResponse,
  zGetAppsByAppIdMessagesByMessageIdPath,
  zGetAppsByAppIdMessagesByMessageIdResponse,
  zGetAppsByAppIdPath,
  zGetAppsByAppIdResponse,
  zGetAppsByAppIdServerPath,
  zGetAppsByAppIdServerResponse,
  zGetAppsByAppIdStatisticsAverageResponseTimePath,
  zGetAppsByAppIdStatisticsAverageResponseTimeQuery,
  zGetAppsByAppIdStatisticsAverageResponseTimeResponse,
  zGetAppsByAppIdStatisticsAverageSessionInteractionsPath,
  zGetAppsByAppIdStatisticsAverageSessionInteractionsQuery,
  zGetAppsByAppIdStatisticsAverageSessionInteractionsResponse,
  zGetAppsByAppIdStatisticsDailyConversationsPath,
  zGetAppsByAppIdStatisticsDailyConversationsQuery,
  zGetAppsByAppIdStatisticsDailyConversationsResponse,
  zGetAppsByAppIdStatisticsDailyEndUsersPath,
  zGetAppsByAppIdStatisticsDailyEndUsersQuery,
  zGetAppsByAppIdStatisticsDailyEndUsersResponse,
  zGetAppsByAppIdStatisticsDailyMessagesPath,
  zGetAppsByAppIdStatisticsDailyMessagesQuery,
  zGetAppsByAppIdStatisticsDailyMessagesResponse,
  zGetAppsByAppIdStatisticsTokenCostsPath,
  zGetAppsByAppIdStatisticsTokenCostsQuery,
  zGetAppsByAppIdStatisticsTokenCostsResponse,
  zGetAppsByAppIdStatisticsTokensPerSecondPath,
  zGetAppsByAppIdStatisticsTokensPerSecondQuery,
  zGetAppsByAppIdStatisticsTokensPerSecondResponse,
  zGetAppsByAppIdStatisticsUserSatisfactionRatePath,
  zGetAppsByAppIdStatisticsUserSatisfactionRateQuery,
  zGetAppsByAppIdStatisticsUserSatisfactionRateResponse,
  zGetAppsByAppIdTextToAudioVoicesPath,
  zGetAppsByAppIdTextToAudioVoicesQuery,
  zGetAppsByAppIdTextToAudioVoicesResponse,
  zGetAppsByAppIdTraceConfigPath,
  zGetAppsByAppIdTraceConfigQuery,
  zGetAppsByAppIdTraceConfigResponse,
  zGetAppsByAppIdTracePath,
  zGetAppsByAppIdTraceResponse,
  zGetAppsByAppIdTriggersPath,
  zGetAppsByAppIdTriggersResponse,
  zGetAppsByAppIdWorkflowAppLogsPath,
  zGetAppsByAppIdWorkflowAppLogsQuery,
  zGetAppsByAppIdWorkflowAppLogsResponse,
  zGetAppsByAppIdWorkflowArchivedLogsPath,
  zGetAppsByAppIdWorkflowArchivedLogsQuery,
  zGetAppsByAppIdWorkflowArchivedLogsResponse,
  zGetAppsByAppIdWorkflowCommentsByCommentIdPath,
  zGetAppsByAppIdWorkflowCommentsByCommentIdResponse,
  zGetAppsByAppIdWorkflowCommentsMentionUsersPath,
  zGetAppsByAppIdWorkflowCommentsMentionUsersResponse,
  zGetAppsByAppIdWorkflowCommentsPath,
  zGetAppsByAppIdWorkflowCommentsResponse,
  zGetAppsByAppIdWorkflowRunsByRunIdExportPath,
  zGetAppsByAppIdWorkflowRunsByRunIdExportResponse,
  zGetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsPath,
  zGetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsResponse,
  zGetAppsByAppIdWorkflowRunsByRunIdPath,
  zGetAppsByAppIdWorkflowRunsByRunIdResponse,
  zGetAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesPath,
  zGetAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesQuery,
  zGetAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesReadPath,
  zGetAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesReadQuery,
  zGetAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesReadResponse,
  zGetAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesResponse,
  zGetAppsByAppIdWorkflowRunsCountPath,
  zGetAppsByAppIdWorkflowRunsCountQuery,
  zGetAppsByAppIdWorkflowRunsCountResponse,
  zGetAppsByAppIdWorkflowRunsPath,
  zGetAppsByAppIdWorkflowRunsQuery,
  zGetAppsByAppIdWorkflowRunsResponse,
  zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypePath,
  zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeQuery,
  zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeResponse,
  zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsPath,
  zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsResponse,
  zGetAppsByAppIdWorkflowsDraftConversationVariablesPath,
  zGetAppsByAppIdWorkflowsDraftConversationVariablesResponse,
  zGetAppsByAppIdWorkflowsDraftEnvironmentVariablesPath,
  zGetAppsByAppIdWorkflowsDraftEnvironmentVariablesResponse,
  zGetAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerCandidatesPath,
  zGetAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerCandidatesResponse,
  zGetAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerPath,
  zGetAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerResponse,
  zGetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunPath,
  zGetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunResponse,
  zGetAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesPath,
  zGetAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesResponse,
  zGetAppsByAppIdWorkflowsDraftPath,
  zGetAppsByAppIdWorkflowsDraftResponse,
  zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewPath,
  zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewResponse,
  zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdPath,
  zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdResponse,
  zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEventsPath,
  zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEventsResponse,
  zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsPath,
  zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsResponse,
  zGetAppsByAppIdWorkflowsDraftSystemVariablesPath,
  zGetAppsByAppIdWorkflowsDraftSystemVariablesResponse,
  zGetAppsByAppIdWorkflowsDraftVariablesByVariableIdPath,
  zGetAppsByAppIdWorkflowsDraftVariablesByVariableIdResponse,
  zGetAppsByAppIdWorkflowsDraftVariablesPath,
  zGetAppsByAppIdWorkflowsDraftVariablesQuery,
  zGetAppsByAppIdWorkflowsDraftVariablesResponse,
  zGetAppsByAppIdWorkflowsPath,
  zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewPath,
  zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewResponse,
  zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdPath,
  zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdResponse,
  zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEventsPath,
  zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEventsResponse,
  zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsPath,
  zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsResponse,
  zGetAppsByAppIdWorkflowsPublishPath,
  zGetAppsByAppIdWorkflowsPublishResponse,
  zGetAppsByAppIdWorkflowsQuery,
  zGetAppsByAppIdWorkflowsResponse,
  zGetAppsByAppIdWorkflowStatisticsAverageAppInteractionsPath,
  zGetAppsByAppIdWorkflowStatisticsAverageAppInteractionsQuery,
  zGetAppsByAppIdWorkflowStatisticsAverageAppInteractionsResponse,
  zGetAppsByAppIdWorkflowStatisticsDailyConversationsPath,
  zGetAppsByAppIdWorkflowStatisticsDailyConversationsQuery,
  zGetAppsByAppIdWorkflowStatisticsDailyConversationsResponse,
  zGetAppsByAppIdWorkflowStatisticsDailyTerminalsPath,
  zGetAppsByAppIdWorkflowStatisticsDailyTerminalsQuery,
  zGetAppsByAppIdWorkflowStatisticsDailyTerminalsResponse,
  zGetAppsByAppIdWorkflowStatisticsTokenCostsPath,
  zGetAppsByAppIdWorkflowStatisticsTokenCostsQuery,
  zGetAppsByAppIdWorkflowStatisticsTokenCostsResponse,
  zGetAppsByAppIdWorkflowsTriggersWebhookPath,
  zGetAppsByAppIdWorkflowsTriggersWebhookQuery,
  zGetAppsByAppIdWorkflowsTriggersWebhookResponse,
  zGetAppsByResourceIdApiKeysPath,
  zGetAppsByResourceIdApiKeysResponse,
  zGetAppsByServerIdServerRefreshPath,
  zGetAppsByServerIdServerRefreshResponse,
  zGetAppsImportsByAppIdCheckDependenciesPath,
  zGetAppsImportsByAppIdCheckDependenciesResponse,
  zGetAppsQuery,
  zGetAppsResponse,
  zPatchAppsByAppIdTraceConfigBody,
  zPatchAppsByAppIdTraceConfigPath,
  zPatchAppsByAppIdTraceConfigResponse,
  zPatchAppsByAppIdWorkflowsByWorkflowIdBody,
  zPatchAppsByAppIdWorkflowsByWorkflowIdPath,
  zPatchAppsByAppIdWorkflowsByWorkflowIdResponse,
  zPatchAppsByAppIdWorkflowsDraftVariablesByVariableIdBody,
  zPatchAppsByAppIdWorkflowsDraftVariablesByVariableIdPath,
  zPatchAppsByAppIdWorkflowsDraftVariablesByVariableIdResponse,
  zPostAppsBody,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormPreviewBody,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormPreviewPath,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormPreviewResponse,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormRunBody,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormRunPath,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormRunResponse,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunBody,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunPath,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunResponse,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunBody,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunPath,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunResponse,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftRunBody,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftRunPath,
  zPostAppsByAppIdAdvancedChatWorkflowsDraftRunResponse,
  zPostAppsByAppIdAgentComposerValidateBody,
  zPostAppsByAppIdAgentComposerValidatePath,
  zPostAppsByAppIdAgentComposerValidateResponse,
  zPostAppsByAppIdAgentFeaturesBody,
  zPostAppsByAppIdAgentFeaturesPath,
  zPostAppsByAppIdAgentFeaturesResponse,
  zPostAppsByAppIdAgentFilesBody,
  zPostAppsByAppIdAgentFilesPath,
  zPostAppsByAppIdAgentFilesQuery,
  zPostAppsByAppIdAgentFilesResponse,
  zPostAppsByAppIdAgentSandboxFilesUploadBody,
  zPostAppsByAppIdAgentSandboxFilesUploadPath,
  zPostAppsByAppIdAgentSandboxFilesUploadResponse,
  zPostAppsByAppIdAgentSkillsBySlugInferToolsPath,
  zPostAppsByAppIdAgentSkillsBySlugInferToolsQuery,
  zPostAppsByAppIdAgentSkillsBySlugInferToolsResponse,
  zPostAppsByAppIdAgentSkillsStandardizePath,
  zPostAppsByAppIdAgentSkillsStandardizeQuery,
  zPostAppsByAppIdAgentSkillsStandardizeResponse,
  zPostAppsByAppIdAgentSkillsUploadPath,
  zPostAppsByAppIdAgentSkillsUploadResponse,
  zPostAppsByAppIdAnnotationReplyByActionBody,
  zPostAppsByAppIdAnnotationReplyByActionPath,
  zPostAppsByAppIdAnnotationReplyByActionResponse,
  zPostAppsByAppIdAnnotationsBatchImportPath,
  zPostAppsByAppIdAnnotationsBatchImportResponse,
  zPostAppsByAppIdAnnotationsBody,
  zPostAppsByAppIdAnnotationsByAnnotationIdBody,
  zPostAppsByAppIdAnnotationsByAnnotationIdPath,
  zPostAppsByAppIdAnnotationsByAnnotationIdResponse,
  zPostAppsByAppIdAnnotationSettingsByAnnotationSettingIdBody,
  zPostAppsByAppIdAnnotationSettingsByAnnotationSettingIdPath,
  zPostAppsByAppIdAnnotationSettingsByAnnotationSettingIdResponse,
  zPostAppsByAppIdAnnotationsPath,
  zPostAppsByAppIdAnnotationsResponse,
  zPostAppsByAppIdApiEnableBody,
  zPostAppsByAppIdApiEnablePath,
  zPostAppsByAppIdApiEnableResponse,
  zPostAppsByAppIdAudioToTextPath,
  zPostAppsByAppIdAudioToTextResponse,
  zPostAppsByAppIdChatMessagesByTaskIdStopPath,
  zPostAppsByAppIdChatMessagesByTaskIdStopResponse,
  zPostAppsByAppIdCompletionMessagesBody,
  zPostAppsByAppIdCompletionMessagesByTaskIdStopPath,
  zPostAppsByAppIdCompletionMessagesByTaskIdStopResponse,
  zPostAppsByAppIdCompletionMessagesPath,
  zPostAppsByAppIdCompletionMessagesResponse,
  zPostAppsByAppIdConvertToWorkflowBody,
  zPostAppsByAppIdConvertToWorkflowPath,
  zPostAppsByAppIdConvertToWorkflowResponse,
  zPostAppsByAppIdCopyBody,
  zPostAppsByAppIdCopyPath,
  zPostAppsByAppIdCopyResponse,
  zPostAppsByAppIdFeedbacksBody,
  zPostAppsByAppIdFeedbacksPath,
  zPostAppsByAppIdFeedbacksResponse,
  zPostAppsByAppIdIconBody,
  zPostAppsByAppIdIconPath,
  zPostAppsByAppIdIconResponse,
  zPostAppsByAppIdModelConfigBody,
  zPostAppsByAppIdModelConfigPath,
  zPostAppsByAppIdModelConfigResponse,
  zPostAppsByAppIdNameBody,
  zPostAppsByAppIdNamePath,
  zPostAppsByAppIdNameResponse,
  zPostAppsByAppIdPublishToCreatorsPlatformPath,
  zPostAppsByAppIdPublishToCreatorsPlatformResponse,
  zPostAppsByAppIdServerBody,
  zPostAppsByAppIdServerPath,
  zPostAppsByAppIdServerResponse,
  zPostAppsByAppIdSiteAccessTokenResetPath,
  zPostAppsByAppIdSiteAccessTokenResetResponse,
  zPostAppsByAppIdSiteBody,
  zPostAppsByAppIdSiteEnableBody,
  zPostAppsByAppIdSiteEnablePath,
  zPostAppsByAppIdSiteEnableResponse,
  zPostAppsByAppIdSitePath,
  zPostAppsByAppIdSiteResponse,
  zPostAppsByAppIdTextToAudioBody,
  zPostAppsByAppIdTextToAudioPath,
  zPostAppsByAppIdTextToAudioResponse,
  zPostAppsByAppIdTraceBody,
  zPostAppsByAppIdTraceConfigBody,
  zPostAppsByAppIdTraceConfigPath,
  zPostAppsByAppIdTraceConfigResponse,
  zPostAppsByAppIdTracePath,
  zPostAppsByAppIdTraceResponse,
  zPostAppsByAppIdTriggerEnableBody,
  zPostAppsByAppIdTriggerEnablePath,
  zPostAppsByAppIdTriggerEnableResponse,
  zPostAppsByAppIdWorkflowCommentsBody,
  zPostAppsByAppIdWorkflowCommentsByCommentIdRepliesBody,
  zPostAppsByAppIdWorkflowCommentsByCommentIdRepliesPath,
  zPostAppsByAppIdWorkflowCommentsByCommentIdRepliesResponse,
  zPostAppsByAppIdWorkflowCommentsByCommentIdResolvePath,
  zPostAppsByAppIdWorkflowCommentsByCommentIdResolveResponse,
  zPostAppsByAppIdWorkflowCommentsPath,
  zPostAppsByAppIdWorkflowCommentsResponse,
  zPostAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesUploadBody,
  zPostAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesUploadPath,
  zPostAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesUploadResponse,
  zPostAppsByAppIdWorkflowRunsTasksByTaskIdStopPath,
  zPostAppsByAppIdWorkflowRunsTasksByTaskIdStopResponse,
  zPostAppsByAppIdWorkflowsByWorkflowIdRestorePath,
  zPostAppsByAppIdWorkflowsByWorkflowIdRestoreResponse,
  zPostAppsByAppIdWorkflowsDraftBody,
  zPostAppsByAppIdWorkflowsDraftConversationVariablesBody,
  zPostAppsByAppIdWorkflowsDraftConversationVariablesPath,
  zPostAppsByAppIdWorkflowsDraftConversationVariablesResponse,
  zPostAppsByAppIdWorkflowsDraftEnvironmentVariablesBody,
  zPostAppsByAppIdWorkflowsDraftEnvironmentVariablesPath,
  zPostAppsByAppIdWorkflowsDraftEnvironmentVariablesResponse,
  zPostAppsByAppIdWorkflowsDraftFeaturesBody,
  zPostAppsByAppIdWorkflowsDraftFeaturesPath,
  zPostAppsByAppIdWorkflowsDraftFeaturesResponse,
  zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTestBody,
  zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTestPath,
  zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTestResponse,
  zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreviewBody,
  zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreviewPath,
  zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreviewResponse,
  zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRunBody,
  zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRunPath,
  zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRunResponse,
  zPostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunBody,
  zPostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunPath,
  zPostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunResponse,
  zPostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunBody,
  zPostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunPath,
  zPostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunResponse,
  zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerImpactBody,
  zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerImpactPath,
  zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerImpactResponse,
  zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerSaveToRosterBody,
  zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerSaveToRosterPath,
  zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerSaveToRosterResponse,
  zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerValidateBody,
  zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerValidatePath,
  zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerValidateResponse,
  zPostAppsByAppIdWorkflowsDraftNodesByNodeIdRunBody,
  zPostAppsByAppIdWorkflowsDraftNodesByNodeIdRunPath,
  zPostAppsByAppIdWorkflowsDraftNodesByNodeIdRunResponse,
  zPostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunPath,
  zPostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunResponse,
  zPostAppsByAppIdWorkflowsDraftPath,
  zPostAppsByAppIdWorkflowsDraftResponse,
  zPostAppsByAppIdWorkflowsDraftRunBody,
  zPostAppsByAppIdWorkflowsDraftRunPath,
  zPostAppsByAppIdWorkflowsDraftRunResponse,
  zPostAppsByAppIdWorkflowsDraftTriggerRunAllBody,
  zPostAppsByAppIdWorkflowsDraftTriggerRunAllPath,
  zPostAppsByAppIdWorkflowsDraftTriggerRunAllResponse,
  zPostAppsByAppIdWorkflowsDraftTriggerRunBody,
  zPostAppsByAppIdWorkflowsDraftTriggerRunPath,
  zPostAppsByAppIdWorkflowsDraftTriggerRunResponse,
  zPostAppsByAppIdWorkflowsPublishBody,
  zPostAppsByAppIdWorkflowsPublishPath,
  zPostAppsByAppIdWorkflowsPublishResponse,
  zPostAppsByResourceIdApiKeysPath,
  zPostAppsByResourceIdApiKeysResponse,
  zPostAppsImportsBody,
  zPostAppsImportsByImportIdConfirmPath,
  zPostAppsImportsByImportIdConfirmResponse,
  zPostAppsImportsResponse,
  zPostAppsResponse,
  zPostAppsWorkflowsOnlineUsersBody,
  zPostAppsWorkflowsOnlineUsersResponse,
  zPutAppsByAppIdAgentComposerBody,
  zPutAppsByAppIdAgentComposerPath,
  zPutAppsByAppIdAgentComposerResponse,
  zPutAppsByAppIdBody,
  zPutAppsByAppIdPath,
  zPutAppsByAppIdResponse,
  zPutAppsByAppIdServerBody,
  zPutAppsByAppIdServerPath,
  zPutAppsByAppIdServerResponse,
  zPutAppsByAppIdWorkflowCommentsByCommentIdBody,
  zPutAppsByAppIdWorkflowCommentsByCommentIdPath,
  zPutAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdBody,
  zPutAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdPath,
  zPutAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdResponse,
  zPutAppsByAppIdWorkflowCommentsByCommentIdResponse,
  zPutAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerBody,
  zPutAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerPath,
  zPutAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerResponse,
  zPutAppsByAppIdWorkflowsDraftVariablesByVariableIdResetPath,
  zPutAppsByAppIdWorkflowsDraftVariablesByVariableIdResetResponse,
} from './zod.gen'

export const get = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsImportsByAppIdCheckDependencies',
    path: '/apps/imports/{app_id}/check-dependencies',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsImportsByAppIdCheckDependenciesPath }))
  .output(zGetAppsImportsByAppIdCheckDependenciesResponse)

export const checkDependencies = {
  get,
}

export const byAppId = {
  checkDependencies,
}

export const post = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsImportsByImportIdConfirm',
    path: '/apps/imports/{import_id}/confirm',
    tags: ['console'],
  })
  .input(z.object({ params: zPostAppsImportsByImportIdConfirmPath }))
  .output(zPostAppsImportsByImportIdConfirmResponse)

export const confirm = {
  post,
}

export const byImportId = {
  confirm,
}

export const post2 = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsImports',
    path: '/apps/imports',
    tags: ['console'],
  })
  .input(z.object({ body: zPostAppsImportsBody }))
  .output(zPostAppsImportsResponse)

export const imports = {
  post: post2,
  byAppId,
  byImportId,
}

/**
 * Get workflow online users
 */
export const post3 = oc
  .route({
    description: 'Get workflow online users',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsWorkflowsOnlineUsers',
    path: '/apps/workflows/online-users',
    tags: ['console'],
  })
  .input(z.object({ body: zPostAppsWorkflowsOnlineUsersBody }))
  .output(zPostAppsWorkflowsOnlineUsersResponse)

export const onlineUsers = {
  post: post3,
}

export const workflows = {
  onlineUsers,
}

/**
 * Get advanced chat workflow runs count statistics
 *
 * Get advanced chat workflow runs count statistics
 */
export const get2 = oc
  .route({
    description: 'Get advanced chat workflow runs count statistics',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAdvancedChatWorkflowRunsCount',
    path: '/apps/{app_id}/advanced-chat/workflow-runs/count',
    summary: 'Get advanced chat workflow runs count statistics',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdAdvancedChatWorkflowRunsCountPath,
      query: zGetAppsByAppIdAdvancedChatWorkflowRunsCountQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdAdvancedChatWorkflowRunsCountResponse)

export const count = {
  get: get2,
}

/**
 * Get advanced chat app workflow run list
 *
 * Get advanced chat workflow run list
 */
export const get3 = oc
  .route({
    description: 'Get advanced chat workflow run list',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAdvancedChatWorkflowRuns',
    path: '/apps/{app_id}/advanced-chat/workflow-runs',
    summary: 'Get advanced chat app workflow run list',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdAdvancedChatWorkflowRunsPath,
      query: zGetAppsByAppIdAdvancedChatWorkflowRunsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdAdvancedChatWorkflowRunsResponse)

export const workflowRuns = {
  get: get3,
  count,
}

/**
 * Preview human input form content and placeholders
 *
 * Get human input form preview for advanced chat workflow
 */
export const post4 = oc
  .route({
    description: 'Get human input form preview for advanced chat workflow',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormPreview',
    path: '/apps/{app_id}/advanced-chat/workflows/draft/human-input/nodes/{node_id}/form/preview',
    summary: 'Preview human input form content and placeholders',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormPreviewBody,
      params: zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormPreviewPath,
    }),
  )
  .output(zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormPreviewResponse)

export const preview = {
  post: post4,
}

/**
 * Submit human input form preview
 *
 * Submit human input form preview for advanced chat workflow
 */
export const post5 = oc
  .route({
    description: 'Submit human input form preview for advanced chat workflow',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormRun',
    path: '/apps/{app_id}/advanced-chat/workflows/draft/human-input/nodes/{node_id}/form/run',
    summary: 'Submit human input form preview',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormRunBody,
      params: zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormRunPath,
    }),
  )
  .output(zPostAppsByAppIdAdvancedChatWorkflowsDraftHumanInputNodesByNodeIdFormRunResponse)

export const run = {
  post: post5,
}

export const form = {
  preview,
  run,
}

export const byNodeId = {
  form,
}

export const nodes = {
  byNodeId,
}

export const humanInput = {
  nodes,
}

/**
 * Run draft workflow iteration node
 *
 * Run draft workflow iteration node for advanced chat
 */
export const post6 = oc
  .route({
    description: 'Run draft workflow iteration node for advanced chat',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRun',
    path: '/apps/{app_id}/advanced-chat/workflows/draft/iteration/nodes/{node_id}/run',
    summary: 'Run draft workflow iteration node',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunBody,
      params: zPostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunPath,
    }),
  )
  .output(zPostAppsByAppIdAdvancedChatWorkflowsDraftIterationNodesByNodeIdRunResponse)

export const run2 = {
  post: post6,
}

export const byNodeId2 = {
  run: run2,
}

export const nodes2 = {
  byNodeId: byNodeId2,
}

export const iteration = {
  nodes: nodes2,
}

/**
 * Run draft workflow loop node
 *
 * Run draft workflow loop node for advanced chat
 */
export const post7 = oc
  .route({
    description: 'Run draft workflow loop node for advanced chat',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRun',
    path: '/apps/{app_id}/advanced-chat/workflows/draft/loop/nodes/{node_id}/run',
    summary: 'Run draft workflow loop node',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunBody,
      params: zPostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunPath,
    }),
  )
  .output(zPostAppsByAppIdAdvancedChatWorkflowsDraftLoopNodesByNodeIdRunResponse)

export const run3 = {
  post: post7,
}

export const byNodeId3 = {
  run: run3,
}

export const nodes3 = {
  byNodeId: byNodeId3,
}

export const loop = {
  nodes: nodes3,
}

/**
 * Run draft workflow
 *
 * Run draft workflow for advanced chat application
 */
export const post8 = oc
  .route({
    description: 'Run draft workflow for advanced chat application',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAdvancedChatWorkflowsDraftRun',
    path: '/apps/{app_id}/advanced-chat/workflows/draft/run',
    summary: 'Run draft workflow',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdAdvancedChatWorkflowsDraftRunBody,
      params: zPostAppsByAppIdAdvancedChatWorkflowsDraftRunPath,
    }),
  )
  .output(zPostAppsByAppIdAdvancedChatWorkflowsDraftRunResponse)

export const run4 = {
  post: post8,
}

export const draft = {
  humanInput,
  iteration,
  loop,
  run: run4,
}

export const workflows2 = {
  draft,
}

export const advancedChat = {
  workflowRuns,
  workflows: workflows2,
}

export const get4 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAgentComposerCandidates',
    path: '/apps/{app_id}/agent-composer/candidates',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdAgentComposerCandidatesPath }))
  .output(zGetAppsByAppIdAgentComposerCandidatesResponse)

export const candidates = {
  get: get4,
}

export const post9 = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAgentComposerValidate',
    path: '/apps/{app_id}/agent-composer/validate',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdAgentComposerValidateBody,
      params: zPostAppsByAppIdAgentComposerValidatePath,
    }),
  )
  .output(zPostAppsByAppIdAgentComposerValidateResponse)

export const validate = {
  post: post9,
}

export const get5 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAgentComposer',
    path: '/apps/{app_id}/agent-composer',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdAgentComposerPath }))
  .output(zGetAppsByAppIdAgentComposerResponse)

export const put = oc
  .route({
    inputStructure: 'detailed',
    method: 'PUT',
    operationId: 'putAppsByAppIdAgentComposer',
    path: '/apps/{app_id}/agent-composer',
    tags: ['console'],
  })
  .input(
    z.object({ body: zPutAppsByAppIdAgentComposerBody, params: zPutAppsByAppIdAgentComposerPath }),
  )
  .output(zPutAppsByAppIdAgentComposerResponse)

export const agentComposer = {
  get: get5,
  put,
  candidates,
  validate,
}

/**
 * Update an Agent App's presentation features (opener, follow-up, citations, ...)
 */
export const post10 = oc
  .route({
    description: 'Update an Agent App\'s presentation features (opener, follow-up, citations, ...)',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAgentFeatures',
    path: '/apps/{app_id}/agent-features',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdAgentFeaturesBody,
      params: zPostAppsByAppIdAgentFeaturesPath,
    }),
  )
  .output(zPostAppsByAppIdAgentFeaturesResponse)

export const agentFeatures = {
  post: post10,
}

/**
 * List workflow apps that reference this Agent App's bound Agent (read-only)
 */
export const get6 = oc
  .route({
    description: 'List workflow apps that reference this Agent App\'s bound Agent (read-only)',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAgentReferencingWorkflows',
    path: '/apps/{app_id}/agent-referencing-workflows',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdAgentReferencingWorkflowsPath }))
  .output(zGetAppsByAppIdAgentReferencingWorkflowsResponse)

export const agentReferencingWorkflows = {
  get: get6,
}

/**
 * Read a text/binary preview file in an Agent App conversation sandbox
 */
export const get7 = oc
  .route({
    description: 'Read a text/binary preview file in an Agent App conversation sandbox',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAgentSandboxFilesRead',
    path: '/apps/{app_id}/agent-sandbox/files/read',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdAgentSandboxFilesReadPath,
      query: zGetAppsByAppIdAgentSandboxFilesReadQuery,
    }),
  )
  .output(zGetAppsByAppIdAgentSandboxFilesReadResponse)

export const read = {
  get: get7,
}

/**
 * Upload one Agent App sandbox file as a Dify ToolFile mapping
 */
export const post11 = oc
  .route({
    description: 'Upload one Agent App sandbox file as a Dify ToolFile mapping',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAgentSandboxFilesUpload',
    path: '/apps/{app_id}/agent-sandbox/files/upload',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdAgentSandboxFilesUploadBody,
      params: zPostAppsByAppIdAgentSandboxFilesUploadPath,
    }),
  )
  .output(zPostAppsByAppIdAgentSandboxFilesUploadResponse)

export const upload = {
  post: post11,
}

/**
 * List a directory in an Agent App conversation sandbox
 */
export const get8 = oc
  .route({
    description: 'List a directory in an Agent App conversation sandbox',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAgentSandboxFiles',
    path: '/apps/{app_id}/agent-sandbox/files',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdAgentSandboxFilesPath,
      query: zGetAppsByAppIdAgentSandboxFilesQuery,
    }),
  )
  .output(zGetAppsByAppIdAgentSandboxFilesResponse)

export const files = {
  get: get8,
  read,
  upload,
}

export const agentSandbox = {
  files,
}

/**
 * Time-limited external signed URL for one drive value (no streaming proxy)
 */
export const get9 = oc
  .route({
    description: 'Time-limited external signed URL for one drive value (no streaming proxy)',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAgentDriveFilesDownload',
    path: '/apps/{app_id}/agent/drive/files/download',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdAgentDriveFilesDownloadPath,
      query: zGetAppsByAppIdAgentDriveFilesDownloadQuery,
    }),
  )
  .output(zGetAppsByAppIdAgentDriveFilesDownloadResponse)

export const download = {
  get: get9,
}

/**
 * Truncated text preview of one drive value (binary-safe; SKILL.md is the main case)
 */
export const get10 = oc
  .route({
    description:
      'Truncated text preview of one drive value (binary-safe; SKILL.md is the main case)',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAgentDriveFilesPreview',
    path: '/apps/{app_id}/agent/drive/files/preview',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdAgentDriveFilesPreviewPath,
      query: zGetAppsByAppIdAgentDriveFilesPreviewQuery,
    }),
  )
  .output(zGetAppsByAppIdAgentDriveFilesPreviewResponse)

export const preview2 = {
  get: get10,
}

/**
 * List agent drive entries (read-only inspector; one endpoint for both tabs)
 */
export const get11 = oc
  .route({
    description: 'List agent drive entries (read-only inspector; one endpoint for both tabs)',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAgentDriveFiles',
    path: '/apps/{app_id}/agent/drive/files',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdAgentDriveFilesPath,
      query: zGetAppsByAppIdAgentDriveFilesQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdAgentDriveFilesResponse)

export const files2 = {
  get: get11,
  download,
  preview: preview2,
}

export const drive = {
  files: files2,
}

/**
 * Delete one drive file by key; soul ref first, then the KV row (ENG-625 D5)
 */
export const delete_ = oc
  .route({
    description: 'Delete one drive file by key; soul ref first, then the KV row (ENG-625 D5)',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByAppIdAgentFiles',
    path: '/apps/{app_id}/agent/files',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zDeleteAppsByAppIdAgentFilesPath,
      query: zDeleteAppsByAppIdAgentFilesQuery,
    }),
  )
  .output(zDeleteAppsByAppIdAgentFilesResponse)

/**
 * ADD FILE: commit one uploaded file into the bound agent's drive
 *
 * Commit an uploaded file into the agent drive under files/<name> (ENG-625 D3)
 */
export const post12 = oc
  .route({
    description: 'Commit an uploaded file into the agent drive under files/<name> (ENG-625 D3)',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAgentFiles',
    path: '/apps/{app_id}/agent/files',
    successStatus: 201,
    summary: 'ADD FILE: commit one uploaded file into the bound agent\'s drive',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdAgentFilesBody,
      params: zPostAppsByAppIdAgentFilesPath,
      query: zPostAppsByAppIdAgentFilesQuery.optional(),
    }),
  )
  .output(zPostAppsByAppIdAgentFilesResponse)

export const files3 = {
  delete: delete_,
  post: post12,
}

/**
 * Get agent logs
 *
 * Get agent execution logs for an application
 */
export const get12 = oc
  .route({
    description: 'Get agent execution logs for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAgentLogs',
    path: '/apps/{app_id}/agent/logs',
    summary: 'Get agent logs',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdAgentLogsPath, query: zGetAppsByAppIdAgentLogsQuery }))
  .output(zGetAppsByAppIdAgentLogsResponse)

export const logs = {
  get: get12,
}

/**
 * Upload a Skill, validate it, and standardize it into the app agent's drive
 *
 * Validate + standardize a Skill into the agent drive (ENG-594)
 */
export const post13 = oc
  .route({
    description: 'Validate + standardize a Skill into the agent drive (ENG-594)',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAgentSkillsStandardize',
    path: '/apps/{app_id}/agent/skills/standardize',
    successStatus: 201,
    summary: 'Upload a Skill, validate it, and standardize it into the app agent\'s drive',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zPostAppsByAppIdAgentSkillsStandardizePath,
      query: zPostAppsByAppIdAgentSkillsStandardizeQuery.optional(),
    }),
  )
  .output(zPostAppsByAppIdAgentSkillsStandardizeResponse)

export const standardize = {
  post: post13,
}

/**
 * Validate an uploaded Skill package and persist the archive
 *
 * Upload + validate a Skill package (.zip/.skill) and extract its manifest
 * Returns a validated skill ref (to bind into the Agent soul config on save)
 * plus its manifest. Standardizing into the agent drive is ENG-594.
 */
export const post14 = oc
  .route({
    description:
      'Upload + validate a Skill package (.zip/.skill) and extract its manifest\nReturns a validated skill ref (to bind into the Agent soul config on save)\nplus its manifest. Standardizing into the agent drive is ENG-594.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAgentSkillsUpload',
    path: '/apps/{app_id}/agent/skills/upload',
    successStatus: 201,
    summary: 'Validate an uploaded Skill package and persist the archive',
    tags: ['console'],
  })
  .input(z.object({ params: zPostAppsByAppIdAgentSkillsUploadPath }))
  .output(zPostAppsByAppIdAgentSkillsUploadResponse)

export const upload2 = {
  post: post14,
}

/**
 * Suggest CLI tools/env for a skill
 *
 * Infer CLI tool + ENV suggestions from a standardized skill's SKILL.md (draft only, ENG-371)
 * Saving still goes through composer validation.
 */
export const post15 = oc
  .route({
    description:
      'Infer CLI tool + ENV suggestions from a standardized skill\'s SKILL.md (draft only, ENG-371)\nSaving still goes through composer validation.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAgentSkillsBySlugInferTools',
    path: '/apps/{app_id}/agent/skills/{slug}/infer-tools',
    summary: 'Suggest CLI tools/env for a skill',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zPostAppsByAppIdAgentSkillsBySlugInferToolsPath,
      query: zPostAppsByAppIdAgentSkillsBySlugInferToolsQuery.optional(),
    }),
  )
  .output(zPostAppsByAppIdAgentSkillsBySlugInferToolsResponse)

export const inferTools = {
  post: post15,
}

/**
 * Delete a standardized skill: soul ref first, then the <slug>/ drive prefix (ENG-625 D5)
 */
export const delete2 = oc
  .route({
    description:
      'Delete a standardized skill: soul ref first, then the <slug>/ drive prefix (ENG-625 D5)',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByAppIdAgentSkillsBySlug',
    path: '/apps/{app_id}/agent/skills/{slug}',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zDeleteAppsByAppIdAgentSkillsBySlugPath,
      query: zDeleteAppsByAppIdAgentSkillsBySlugQuery.optional(),
    }),
  )
  .output(zDeleteAppsByAppIdAgentSkillsBySlugResponse)

export const bySlug = {
  delete: delete2,
  inferTools,
}

export const skills = {
  standardize,
  upload: upload2,
  bySlug,
}

export const agent = {
  drive,
  files: files3,
  logs,
  skills,
}

/**
 * Get status of annotation reply action job
 */
export const get13 = oc
  .route({
    description: 'Get status of annotation reply action job',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAnnotationReplyByActionStatusByJobId',
    path: '/apps/{app_id}/annotation-reply/{action}/status/{job_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdAnnotationReplyByActionStatusByJobIdPath }))
  .output(zGetAppsByAppIdAnnotationReplyByActionStatusByJobIdResponse)

export const byJobId = {
  get: get13,
}

export const status = {
  byJobId,
}

/**
 * Enable or disable annotation reply for an app
 */
export const post16 = oc
  .route({
    description: 'Enable or disable annotation reply for an app',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAnnotationReplyByAction',
    path: '/apps/{app_id}/annotation-reply/{action}',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdAnnotationReplyByActionBody,
      params: zPostAppsByAppIdAnnotationReplyByActionPath,
    }),
  )
  .output(zPostAppsByAppIdAnnotationReplyByActionResponse)

export const byAction = {
  post: post16,
  status,
}

export const annotationReply = {
  byAction,
}

/**
 * Get annotation settings for an app
 */
export const get14 = oc
  .route({
    description: 'Get annotation settings for an app',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAnnotationSetting',
    path: '/apps/{app_id}/annotation-setting',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdAnnotationSettingPath }))
  .output(zGetAppsByAppIdAnnotationSettingResponse)

export const annotationSetting = {
  get: get14,
}

/**
 * Update annotation settings for an app
 */
export const post17 = oc
  .route({
    description: 'Update annotation settings for an app',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAnnotationSettingsByAnnotationSettingId',
    path: '/apps/{app_id}/annotation-settings/{annotation_setting_id}',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdAnnotationSettingsByAnnotationSettingIdBody,
      params: zPostAppsByAppIdAnnotationSettingsByAnnotationSettingIdPath,
    }),
  )
  .output(zPostAppsByAppIdAnnotationSettingsByAnnotationSettingIdResponse)

export const byAnnotationSettingId = {
  post: post17,
}

export const annotationSettings = {
  byAnnotationSettingId,
}

/**
 * Batch import annotations from CSV file with rate limiting and security checks
 */
export const post18 = oc
  .route({
    description: 'Batch import annotations from CSV file with rate limiting and security checks',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAnnotationsBatchImport',
    path: '/apps/{app_id}/annotations/batch-import',
    tags: ['console'],
  })
  .input(z.object({ params: zPostAppsByAppIdAnnotationsBatchImportPath }))
  .output(zPostAppsByAppIdAnnotationsBatchImportResponse)

export const batchImport = {
  post: post18,
}

/**
 * Get status of batch import job
 */
export const get15 = oc
  .route({
    description: 'Get status of batch import job',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAnnotationsBatchImportStatusByJobId',
    path: '/apps/{app_id}/annotations/batch-import-status/{job_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdAnnotationsBatchImportStatusByJobIdPath }))
  .output(zGetAppsByAppIdAnnotationsBatchImportStatusByJobIdResponse)

export const byJobId2 = {
  get: get15,
}

export const batchImportStatus = {
  byJobId: byJobId2,
}

/**
 * Get count of message annotations for the app
 */
export const get16 = oc
  .route({
    description: 'Get count of message annotations for the app',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAnnotationsCount',
    path: '/apps/{app_id}/annotations/count',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdAnnotationsCountPath }))
  .output(zGetAppsByAppIdAnnotationsCountResponse)

export const count2 = {
  get: get16,
}

/**
 * Export all annotations for an app with CSV injection protection
 */
export const get17 = oc
  .route({
    description: 'Export all annotations for an app with CSV injection protection',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAnnotationsExport',
    path: '/apps/{app_id}/annotations/export',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdAnnotationsExportPath }))
  .output(zGetAppsByAppIdAnnotationsExportResponse)

export const export_ = {
  get: get17,
}

/**
 * Get hit histories for an annotation
 */
export const get18 = oc
  .route({
    description: 'Get hit histories for an annotation',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAnnotationsByAnnotationIdHitHistories',
    path: '/apps/{app_id}/annotations/{annotation_id}/hit-histories',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdAnnotationsByAnnotationIdHitHistoriesPath,
      query: zGetAppsByAppIdAnnotationsByAnnotationIdHitHistoriesQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdAnnotationsByAnnotationIdHitHistoriesResponse)

export const hitHistories = {
  get: get18,
}

export const delete3 = oc
  .route({
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByAppIdAnnotationsByAnnotationId',
    path: '/apps/{app_id}/annotations/{annotation_id}',
    successStatus: 204,
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteAppsByAppIdAnnotationsByAnnotationIdPath }))
  .output(zDeleteAppsByAppIdAnnotationsByAnnotationIdResponse)

/**
 * Update or delete an annotation
 */
export const post19 = oc
  .route({
    description: 'Update or delete an annotation',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAnnotationsByAnnotationId',
    path: '/apps/{app_id}/annotations/{annotation_id}',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdAnnotationsByAnnotationIdBody,
      params: zPostAppsByAppIdAnnotationsByAnnotationIdPath,
    }),
  )
  .output(zPostAppsByAppIdAnnotationsByAnnotationIdResponse)

export const byAnnotationId = {
  delete: delete3,
  post: post19,
  hitHistories,
}

export const delete4 = oc
  .route({
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByAppIdAnnotations',
    path: '/apps/{app_id}/annotations',
    successStatus: 204,
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteAppsByAppIdAnnotationsPath }))
  .output(zDeleteAppsByAppIdAnnotationsResponse)

/**
 * Get annotations for an app with pagination
 */
export const get19 = oc
  .route({
    description: 'Get annotations for an app with pagination',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdAnnotations',
    path: '/apps/{app_id}/annotations',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdAnnotationsPath,
      query: zGetAppsByAppIdAnnotationsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdAnnotationsResponse)

/**
 * Create a new annotation for an app
 */
export const post20 = oc
  .route({
    description: 'Create a new annotation for an app',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAnnotations',
    path: '/apps/{app_id}/annotations',
    successStatus: 201,
    tags: ['console'],
  })
  .input(
    z.object({ body: zPostAppsByAppIdAnnotationsBody, params: zPostAppsByAppIdAnnotationsPath }),
  )
  .output(zPostAppsByAppIdAnnotationsResponse)

export const annotations = {
  delete: delete4,
  get: get19,
  post: post20,
  batchImport,
  batchImportStatus,
  count: count2,
  export: export_,
  byAnnotationId,
}

/**
 * Enable or disable app API
 */
export const post21 = oc
  .route({
    description: 'Enable or disable app API',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdApiEnable',
    path: '/apps/{app_id}/api-enable',
    tags: ['console'],
  })
  .input(z.object({ body: zPostAppsByAppIdApiEnableBody, params: zPostAppsByAppIdApiEnablePath }))
  .output(zPostAppsByAppIdApiEnableResponse)

export const apiEnable = {
  post: post21,
}

/**
 * Transcript audio to text for chat messages
 */
export const post22 = oc
  .route({
    description: 'Transcript audio to text for chat messages',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdAudioToText',
    path: '/apps/{app_id}/audio-to-text',
    tags: ['console'],
  })
  .input(z.object({ params: zPostAppsByAppIdAudioToTextPath }))
  .output(zPostAppsByAppIdAudioToTextResponse)

export const audioToText = {
  post: post22,
}

/**
 * Delete a chat conversation
 */
export const delete5 = oc
  .route({
    description: 'Delete a chat conversation',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByAppIdChatConversationsByConversationId',
    path: '/apps/{app_id}/chat-conversations/{conversation_id}',
    successStatus: 204,
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteAppsByAppIdChatConversationsByConversationIdPath }))
  .output(zDeleteAppsByAppIdChatConversationsByConversationIdResponse)

/**
 * Get chat conversation details
 */
export const get20 = oc
  .route({
    description: 'Get chat conversation details',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdChatConversationsByConversationId',
    path: '/apps/{app_id}/chat-conversations/{conversation_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdChatConversationsByConversationIdPath }))
  .output(zGetAppsByAppIdChatConversationsByConversationIdResponse)

export const byConversationId = {
  delete: delete5,
  get: get20,
}

/**
 * Get chat conversations with pagination, filtering and summary
 */
export const get21 = oc
  .route({
    description: 'Get chat conversations with pagination, filtering and summary',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdChatConversations',
    path: '/apps/{app_id}/chat-conversations',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdChatConversationsPath,
      query: zGetAppsByAppIdChatConversationsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdChatConversationsResponse)

export const chatConversations = {
  get: get21,
  byConversationId,
}

/**
 * Get suggested questions for a message
 */
export const get22 = oc
  .route({
    description: 'Get suggested questions for a message',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdChatMessagesByMessageIdSuggestedQuestions',
    path: '/apps/{app_id}/chat-messages/{message_id}/suggested-questions',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdChatMessagesByMessageIdSuggestedQuestionsPath }))
  .output(zGetAppsByAppIdChatMessagesByMessageIdSuggestedQuestionsResponse)

export const suggestedQuestions = {
  get: get22,
}

export const byMessageId = {
  suggestedQuestions,
}

/**
 * Stop a running chat message generation
 */
export const post23 = oc
  .route({
    description: 'Stop a running chat message generation',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdChatMessagesByTaskIdStop',
    path: '/apps/{app_id}/chat-messages/{task_id}/stop',
    tags: ['console'],
  })
  .input(z.object({ params: zPostAppsByAppIdChatMessagesByTaskIdStopPath }))
  .output(zPostAppsByAppIdChatMessagesByTaskIdStopResponse)

export const stop = {
  post: post23,
}

export const byTaskId = {
  stop,
}

/**
 * Get chat messages for a conversation with pagination
 */
export const get23 = oc
  .route({
    description: 'Get chat messages for a conversation with pagination',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdChatMessages',
    path: '/apps/{app_id}/chat-messages',
    tags: ['console'],
  })
  .input(
    z.object({ params: zGetAppsByAppIdChatMessagesPath, query: zGetAppsByAppIdChatMessagesQuery }),
  )
  .output(zGetAppsByAppIdChatMessagesResponse)

export const chatMessages = {
  get: get23,
  byMessageId,
  byTaskId,
}

/**
 * Delete a completion conversation
 */
export const delete6 = oc
  .route({
    description: 'Delete a completion conversation',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByAppIdCompletionConversationsByConversationId',
    path: '/apps/{app_id}/completion-conversations/{conversation_id}',
    successStatus: 204,
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteAppsByAppIdCompletionConversationsByConversationIdPath }))
  .output(zDeleteAppsByAppIdCompletionConversationsByConversationIdResponse)

/**
 * Get completion conversation details with messages
 */
export const get24 = oc
  .route({
    description: 'Get completion conversation details with messages',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdCompletionConversationsByConversationId',
    path: '/apps/{app_id}/completion-conversations/{conversation_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdCompletionConversationsByConversationIdPath }))
  .output(zGetAppsByAppIdCompletionConversationsByConversationIdResponse)

export const byConversationId2 = {
  delete: delete6,
  get: get24,
}

/**
 * Get completion conversations with pagination and filtering
 */
export const get25 = oc
  .route({
    description: 'Get completion conversations with pagination and filtering',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdCompletionConversations',
    path: '/apps/{app_id}/completion-conversations',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdCompletionConversationsPath,
      query: zGetAppsByAppIdCompletionConversationsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdCompletionConversationsResponse)

export const completionConversations = {
  get: get25,
  byConversationId: byConversationId2,
}

/**
 * Stop a running completion message generation
 */
export const post24 = oc
  .route({
    description: 'Stop a running completion message generation',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdCompletionMessagesByTaskIdStop',
    path: '/apps/{app_id}/completion-messages/{task_id}/stop',
    tags: ['console'],
  })
  .input(z.object({ params: zPostAppsByAppIdCompletionMessagesByTaskIdStopPath }))
  .output(zPostAppsByAppIdCompletionMessagesByTaskIdStopResponse)

export const stop2 = {
  post: post24,
}

export const byTaskId2 = {
  stop: stop2,
}

/**
 * Generate completion message for debugging
 */
export const post25 = oc
  .route({
    description: 'Generate completion message for debugging',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdCompletionMessages',
    path: '/apps/{app_id}/completion-messages',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdCompletionMessagesBody,
      params: zPostAppsByAppIdCompletionMessagesPath,
    }),
  )
  .output(zPostAppsByAppIdCompletionMessagesResponse)

export const completionMessages = {
  post: post25,
  byTaskId: byTaskId2,
}

/**
 * Get conversation variables for an application
 */
export const get26 = oc
  .route({
    description: 'Get conversation variables for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdConversationVariables',
    path: '/apps/{app_id}/conversation-variables',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdConversationVariablesPath,
      query: zGetAppsByAppIdConversationVariablesQuery,
    }),
  )
  .output(zGetAppsByAppIdConversationVariablesResponse)

export const conversationVariables = {
  get: get26,
}

/**
 * Convert basic mode of chatbot app to workflow mode
 *
 * Convert application to workflow mode
 * Convert expert mode of chatbot app to workflow mode
 * Convert Completion App to Workflow App
 */
export const post26 = oc
  .route({
    description:
      'Convert application to workflow mode\nConvert expert mode of chatbot app to workflow mode\nConvert Completion App to Workflow App',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdConvertToWorkflow',
    path: '/apps/{app_id}/convert-to-workflow',
    summary: 'Convert basic mode of chatbot app to workflow mode',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdConvertToWorkflowBody,
      params: zPostAppsByAppIdConvertToWorkflowPath,
    }),
  )
  .output(zPostAppsByAppIdConvertToWorkflowResponse)

export const convertToWorkflow = {
  post: post26,
}

/**
 * Copy app
 *
 * Create a copy of an existing application
 */
export const post27 = oc
  .route({
    description: 'Create a copy of an existing application',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdCopy',
    path: '/apps/{app_id}/copy',
    successStatus: 201,
    summary: 'Copy app',
    tags: ['console'],
  })
  .input(z.object({ body: zPostAppsByAppIdCopyBody, params: zPostAppsByAppIdCopyPath }))
  .output(zPostAppsByAppIdCopyResponse)

export const copy = {
  post: post27,
}

/**
 * Export app
 *
 * Export application configuration as DSL
 */
export const get27 = oc
  .route({
    description: 'Export application configuration as DSL',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdExport',
    path: '/apps/{app_id}/export',
    summary: 'Export app',
    tags: ['console'],
  })
  .input(
    z.object({ params: zGetAppsByAppIdExportPath, query: zGetAppsByAppIdExportQuery.optional() }),
  )
  .output(zGetAppsByAppIdExportResponse)

export const export2 = {
  get: get27,
}

/**
 * Export user feedback data for Google Sheets
 */
export const get28 = oc
  .route({
    description: 'Export user feedback data for Google Sheets',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdFeedbacksExport',
    path: '/apps/{app_id}/feedbacks/export',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdFeedbacksExportPath,
      query: zGetAppsByAppIdFeedbacksExportQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdFeedbacksExportResponse)

export const export3 = {
  get: get28,
}

/**
 * Create or update message feedback (like/dislike)
 */
export const post28 = oc
  .route({
    description: 'Create or update message feedback (like/dislike)',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdFeedbacks',
    path: '/apps/{app_id}/feedbacks',
    tags: ['console'],
  })
  .input(z.object({ body: zPostAppsByAppIdFeedbacksBody, params: zPostAppsByAppIdFeedbacksPath }))
  .output(zPostAppsByAppIdFeedbacksResponse)

export const feedbacks = {
  post: post28,
  export: export3,
}

/**
 * Update application icon
 */
export const post29 = oc
  .route({
    description: 'Update application icon',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdIcon',
    path: '/apps/{app_id}/icon',
    tags: ['console'],
  })
  .input(z.object({ body: zPostAppsByAppIdIconBody, params: zPostAppsByAppIdIconPath }))
  .output(zPostAppsByAppIdIconResponse)

export const icon = {
  post: post29,
}

/**
 * Get message details by ID
 */
export const get29 = oc
  .route({
    description: 'Get message details by ID',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdMessagesByMessageId',
    path: '/apps/{app_id}/messages/{message_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdMessagesByMessageIdPath }))
  .output(zGetAppsByAppIdMessagesByMessageIdResponse)

export const byMessageId2 = {
  get: get29,
}

export const messages = {
  byMessageId: byMessageId2,
}

/**
 * Modify app model config
 *
 * Update application model configuration
 */
export const post30 = oc
  .route({
    description: 'Update application model configuration',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdModelConfig',
    path: '/apps/{app_id}/model-config',
    summary: 'Modify app model config',
    tags: ['console'],
  })
  .input(
    z.object({ body: zPostAppsByAppIdModelConfigBody, params: zPostAppsByAppIdModelConfigPath }),
  )
  .output(zPostAppsByAppIdModelConfigResponse)

export const modelConfig = {
  post: post30,
}

/**
 * Check if app name is available
 */
export const post31 = oc
  .route({
    description: 'Check if app name is available',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdName',
    path: '/apps/{app_id}/name',
    tags: ['console'],
  })
  .input(z.object({ body: zPostAppsByAppIdNameBody, params: zPostAppsByAppIdNamePath }))
  .output(zPostAppsByAppIdNameResponse)

export const name = {
  post: post31,
}

/**
 * Publish app to Creators Platform
 */
export const post32 = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdPublishToCreatorsPlatform',
    path: '/apps/{app_id}/publish-to-creators-platform',
    summary: 'Publish app to Creators Platform',
    tags: ['console'],
  })
  .input(z.object({ params: zPostAppsByAppIdPublishToCreatorsPlatformPath }))
  .output(zPostAppsByAppIdPublishToCreatorsPlatformResponse)

export const publishToCreatorsPlatform = {
  post: post32,
}

/**
 * Get MCP server configuration for an application
 */
export const get30 = oc
  .route({
    description: 'Get MCP server configuration for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdServer',
    path: '/apps/{app_id}/server',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdServerPath }))
  .output(zGetAppsByAppIdServerResponse)

/**
 * Create MCP server configuration for an application
 */
export const post33 = oc
  .route({
    description: 'Create MCP server configuration for an application',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdServer',
    path: '/apps/{app_id}/server',
    successStatus: 201,
    tags: ['console'],
  })
  .input(z.object({ body: zPostAppsByAppIdServerBody, params: zPostAppsByAppIdServerPath }))
  .output(zPostAppsByAppIdServerResponse)

/**
 * Update MCP server configuration for an application
 */
export const put2 = oc
  .route({
    description: 'Update MCP server configuration for an application',
    inputStructure: 'detailed',
    method: 'PUT',
    operationId: 'putAppsByAppIdServer',
    path: '/apps/{app_id}/server',
    tags: ['console'],
  })
  .input(z.object({ body: zPutAppsByAppIdServerBody, params: zPutAppsByAppIdServerPath }))
  .output(zPutAppsByAppIdServerResponse)

export const server = {
  get: get30,
  post: post33,
  put: put2,
}

/**
 * Reset access token for application site
 */
export const post34 = oc
  .route({
    description: 'Reset access token for application site',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdSiteAccessTokenReset',
    path: '/apps/{app_id}/site/access-token-reset',
    tags: ['console'],
  })
  .input(z.object({ params: zPostAppsByAppIdSiteAccessTokenResetPath }))
  .output(zPostAppsByAppIdSiteAccessTokenResetResponse)

export const accessTokenReset = {
  post: post34,
}

/**
 * Update application site configuration
 */
export const post35 = oc
  .route({
    description: 'Update application site configuration',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdSite',
    path: '/apps/{app_id}/site',
    tags: ['console'],
  })
  .input(z.object({ body: zPostAppsByAppIdSiteBody, params: zPostAppsByAppIdSitePath }))
  .output(zPostAppsByAppIdSiteResponse)

export const site = {
  post: post35,
  accessTokenReset,
}

/**
 * Enable or disable app site
 */
export const post36 = oc
  .route({
    description: 'Enable or disable app site',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdSiteEnable',
    path: '/apps/{app_id}/site-enable',
    tags: ['console'],
  })
  .input(z.object({ body: zPostAppsByAppIdSiteEnableBody, params: zPostAppsByAppIdSiteEnablePath }))
  .output(zPostAppsByAppIdSiteEnableResponse)

export const siteEnable = {
  post: post36,
}

/**
 * Get average response time statistics for an application
 */
export const get31 = oc
  .route({
    description: 'Get average response time statistics for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdStatisticsAverageResponseTime',
    path: '/apps/{app_id}/statistics/average-response-time',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdStatisticsAverageResponseTimePath,
      query: zGetAppsByAppIdStatisticsAverageResponseTimeQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdStatisticsAverageResponseTimeResponse)

export const averageResponseTime = {
  get: get31,
}

/**
 * Get average session interaction statistics for an application
 */
export const get32 = oc
  .route({
    description: 'Get average session interaction statistics for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdStatisticsAverageSessionInteractions',
    path: '/apps/{app_id}/statistics/average-session-interactions',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdStatisticsAverageSessionInteractionsPath,
      query: zGetAppsByAppIdStatisticsAverageSessionInteractionsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdStatisticsAverageSessionInteractionsResponse)

export const averageSessionInteractions = {
  get: get32,
}

/**
 * Get daily conversation statistics for an application
 */
export const get33 = oc
  .route({
    description: 'Get daily conversation statistics for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdStatisticsDailyConversations',
    path: '/apps/{app_id}/statistics/daily-conversations',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdStatisticsDailyConversationsPath,
      query: zGetAppsByAppIdStatisticsDailyConversationsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdStatisticsDailyConversationsResponse)

export const dailyConversations = {
  get: get33,
}

/**
 * Get daily terminal/end-user statistics for an application
 */
export const get34 = oc
  .route({
    description: 'Get daily terminal/end-user statistics for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdStatisticsDailyEndUsers',
    path: '/apps/{app_id}/statistics/daily-end-users',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdStatisticsDailyEndUsersPath,
      query: zGetAppsByAppIdStatisticsDailyEndUsersQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdStatisticsDailyEndUsersResponse)

export const dailyEndUsers = {
  get: get34,
}

/**
 * Get daily message statistics for an application
 */
export const get35 = oc
  .route({
    description: 'Get daily message statistics for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdStatisticsDailyMessages',
    path: '/apps/{app_id}/statistics/daily-messages',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdStatisticsDailyMessagesPath,
      query: zGetAppsByAppIdStatisticsDailyMessagesQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdStatisticsDailyMessagesResponse)

export const dailyMessages = {
  get: get35,
}

/**
 * Get daily token cost statistics for an application
 */
export const get36 = oc
  .route({
    description: 'Get daily token cost statistics for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdStatisticsTokenCosts',
    path: '/apps/{app_id}/statistics/token-costs',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdStatisticsTokenCostsPath,
      query: zGetAppsByAppIdStatisticsTokenCostsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdStatisticsTokenCostsResponse)

export const tokenCosts = {
  get: get36,
}

/**
 * Get tokens per second statistics for an application
 */
export const get37 = oc
  .route({
    description: 'Get tokens per second statistics for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdStatisticsTokensPerSecond',
    path: '/apps/{app_id}/statistics/tokens-per-second',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdStatisticsTokensPerSecondPath,
      query: zGetAppsByAppIdStatisticsTokensPerSecondQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdStatisticsTokensPerSecondResponse)

export const tokensPerSecond = {
  get: get37,
}

/**
 * Get user satisfaction rate statistics for an application
 */
export const get38 = oc
  .route({
    description: 'Get user satisfaction rate statistics for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdStatisticsUserSatisfactionRate',
    path: '/apps/{app_id}/statistics/user-satisfaction-rate',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdStatisticsUserSatisfactionRatePath,
      query: zGetAppsByAppIdStatisticsUserSatisfactionRateQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdStatisticsUserSatisfactionRateResponse)

export const userSatisfactionRate = {
  get: get38,
}

export const statistics = {
  averageResponseTime,
  averageSessionInteractions,
  dailyConversations,
  dailyEndUsers,
  dailyMessages,
  tokenCosts,
  tokensPerSecond,
  userSatisfactionRate,
}

/**
 * Get available TTS voices for a specific language
 */
export const get39 = oc
  .route({
    description: 'Get available TTS voices for a specific language',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdTextToAudioVoices',
    path: '/apps/{app_id}/text-to-audio/voices',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdTextToAudioVoicesPath,
      query: zGetAppsByAppIdTextToAudioVoicesQuery,
    }),
  )
  .output(zGetAppsByAppIdTextToAudioVoicesResponse)

export const voices = {
  get: get39,
}

/**
 * Convert text to speech for chat messages
 */
export const post37 = oc
  .route({
    description: 'Convert text to speech for chat messages',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdTextToAudio',
    path: '/apps/{app_id}/text-to-audio',
    tags: ['console'],
  })
  .input(
    z.object({ body: zPostAppsByAppIdTextToAudioBody, params: zPostAppsByAppIdTextToAudioPath }),
  )
  .output(zPostAppsByAppIdTextToAudioResponse)

export const textToAudio = {
  post: post37,
  voices,
}

/**
 * Get app trace
 *
 * Get app tracing configuration
 */
export const get40 = oc
  .route({
    description: 'Get app tracing configuration',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdTrace',
    path: '/apps/{app_id}/trace',
    summary: 'Get app trace',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdTracePath }))
  .output(zGetAppsByAppIdTraceResponse)

/**
 * Update app tracing configuration
 */
export const post38 = oc
  .route({
    description: 'Update app tracing configuration',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdTrace',
    path: '/apps/{app_id}/trace',
    tags: ['console'],
  })
  .input(z.object({ body: zPostAppsByAppIdTraceBody, params: zPostAppsByAppIdTracePath }))
  .output(zPostAppsByAppIdTraceResponse)

export const trace = {
  get: get40,
  post: post38,
}

/**
 * Delete an existing trace app configuration
 *
 * Delete an existing tracing configuration for an application
 */
export const delete7 = oc
  .route({
    description: 'Delete an existing tracing configuration for an application',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByAppIdTraceConfig',
    path: '/apps/{app_id}/trace-config',
    successStatus: 204,
    summary: 'Delete an existing trace app configuration',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zDeleteAppsByAppIdTraceConfigPath,
      query: zDeleteAppsByAppIdTraceConfigQuery,
    }),
  )
  .output(zDeleteAppsByAppIdTraceConfigResponse)

/**
 * Get tracing configuration for an application
 */
export const get41 = oc
  .route({
    description: 'Get tracing configuration for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdTraceConfig',
    path: '/apps/{app_id}/trace-config',
    tags: ['console'],
  })
  .input(
    z.object({ params: zGetAppsByAppIdTraceConfigPath, query: zGetAppsByAppIdTraceConfigQuery }),
  )
  .output(zGetAppsByAppIdTraceConfigResponse)

/**
 * Update an existing trace app configuration
 *
 * Update an existing tracing configuration for an application
 */
export const patch = oc
  .route({
    description: 'Update an existing tracing configuration for an application',
    inputStructure: 'detailed',
    method: 'PATCH',
    operationId: 'patchAppsByAppIdTraceConfig',
    path: '/apps/{app_id}/trace-config',
    summary: 'Update an existing trace app configuration',
    tags: ['console'],
  })
  .input(
    z.object({ body: zPatchAppsByAppIdTraceConfigBody, params: zPatchAppsByAppIdTraceConfigPath }),
  )
  .output(zPatchAppsByAppIdTraceConfigResponse)

/**
 * Create a new trace app configuration
 *
 * Create a new tracing configuration for an application
 */
export const post39 = oc
  .route({
    description: 'Create a new tracing configuration for an application',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdTraceConfig',
    path: '/apps/{app_id}/trace-config',
    successStatus: 201,
    summary: 'Create a new trace app configuration',
    tags: ['console'],
  })
  .input(
    z.object({ body: zPostAppsByAppIdTraceConfigBody, params: zPostAppsByAppIdTraceConfigPath }),
  )
  .output(zPostAppsByAppIdTraceConfigResponse)

export const traceConfig = {
  delete: delete7,
  get: get41,
  patch,
  post: post39,
}

/**
 * Update app trigger (enable/disable)
 */
export const post40 = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdTriggerEnable',
    path: '/apps/{app_id}/trigger-enable',
    summary: 'Update app trigger (enable/disable)',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdTriggerEnableBody,
      params: zPostAppsByAppIdTriggerEnablePath,
    }),
  )
  .output(zPostAppsByAppIdTriggerEnableResponse)

export const triggerEnable = {
  post: post40,
}

/**
 * Get app triggers list
 */
export const get42 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdTriggers',
    path: '/apps/{app_id}/triggers',
    summary: 'Get app triggers list',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdTriggersPath }))
  .output(zGetAppsByAppIdTriggersResponse)

export const triggers = {
  get: get42,
}

/**
 * Get workflow app logs
 *
 * Get workflow application execution logs
 */
export const get43 = oc
  .route({
    description: 'Get workflow application execution logs',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowAppLogs',
    path: '/apps/{app_id}/workflow-app-logs',
    summary: 'Get workflow app logs',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowAppLogsPath,
      query: zGetAppsByAppIdWorkflowAppLogsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdWorkflowAppLogsResponse)

export const workflowAppLogs = {
  get: get43,
}

/**
 * Get workflow archived logs
 *
 * Get workflow archived execution logs
 */
export const get44 = oc
  .route({
    description: 'Get workflow archived execution logs',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowArchivedLogs',
    path: '/apps/{app_id}/workflow-archived-logs',
    summary: 'Get workflow archived logs',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowArchivedLogsPath,
      query: zGetAppsByAppIdWorkflowArchivedLogsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdWorkflowArchivedLogsResponse)

export const workflowArchivedLogs = {
  get: get44,
}

/**
 * Get workflow runs count statistics
 *
 * Get workflow runs count statistics
 */
export const get45 = oc
  .route({
    description: 'Get workflow runs count statistics',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowRunsCount',
    path: '/apps/{app_id}/workflow-runs/count',
    summary: 'Get workflow runs count statistics',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowRunsCountPath,
      query: zGetAppsByAppIdWorkflowRunsCountQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdWorkflowRunsCountResponse)

export const count3 = {
  get: get45,
}

/**
 * Stop workflow task
 *
 * Stop running workflow task
 */
export const post41 = oc
  .route({
    description: 'Stop running workflow task',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowRunsTasksByTaskIdStop',
    path: '/apps/{app_id}/workflow-runs/tasks/{task_id}/stop',
    summary: 'Stop workflow task',
    tags: ['console'],
  })
  .input(z.object({ params: zPostAppsByAppIdWorkflowRunsTasksByTaskIdStopPath }))
  .output(zPostAppsByAppIdWorkflowRunsTasksByTaskIdStopResponse)

export const stop3 = {
  post: post41,
}

export const byTaskId3 = {
  stop: stop3,
}

export const tasks = {
  byTaskId: byTaskId3,
}

/**
 * Generate a download URL for an archived workflow run.
 */
export const get46 = oc
  .route({
    description: 'Generate a download URL for an archived workflow run.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowRunsByRunIdExport',
    path: '/apps/{app_id}/workflow-runs/{run_id}/export',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowRunsByRunIdExportPath }))
  .output(zGetAppsByAppIdWorkflowRunsByRunIdExportResponse)

export const export4 = {
  get: get46,
}

/**
 * Get workflow run node execution list
 *
 * Get workflow run node execution list
 */
export const get47 = oc
  .route({
    description: 'Get workflow run node execution list',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowRunsByRunIdNodeExecutions',
    path: '/apps/{app_id}/workflow-runs/{run_id}/node-executions',
    summary: 'Get workflow run node execution list',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsPath }))
  .output(zGetAppsByAppIdWorkflowRunsByRunIdNodeExecutionsResponse)

export const nodeExecutions = {
  get: get47,
}

/**
 * Get workflow run detail
 *
 * Get workflow run detail
 */
export const get48 = oc
  .route({
    description: 'Get workflow run detail',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowRunsByRunId',
    path: '/apps/{app_id}/workflow-runs/{run_id}',
    summary: 'Get workflow run detail',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowRunsByRunIdPath }))
  .output(zGetAppsByAppIdWorkflowRunsByRunIdResponse)

export const byRunId = {
  get: get48,
  export: export4,
  nodeExecutions,
}

/**
 * Read a text/binary preview file in a workflow Agent node sandbox
 */
export const get49 = oc
  .route({
    description: 'Read a text/binary preview file in a workflow Agent node sandbox',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesRead',
    path: '/apps/{app_id}/workflow-runs/{workflow_run_id}/agent-nodes/{node_id}/sandbox/files/read',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesReadPath,
      query: zGetAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesReadQuery,
    }),
  )
  .output(zGetAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesReadResponse)

export const read2 = {
  get: get49,
}

/**
 * Upload one workflow Agent sandbox file as a Dify ToolFile mapping
 */
export const post42 = oc
  .route({
    description: 'Upload one workflow Agent sandbox file as a Dify ToolFile mapping',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesUpload',
    path: '/apps/{app_id}/workflow-runs/{workflow_run_id}/agent-nodes/{node_id}/sandbox/files/upload',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesUploadBody,
      params: zPostAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesUploadPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesUploadResponse)

export const upload3 = {
  post: post42,
}

/**
 * List a directory in a workflow Agent node sandbox
 */
export const get50 = oc
  .route({
    description: 'List a directory in a workflow Agent node sandbox',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFiles',
    path: '/apps/{app_id}/workflow-runs/{workflow_run_id}/agent-nodes/{node_id}/sandbox/files',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesPath,
      query:
        zGetAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdWorkflowRunsByWorkflowRunIdAgentNodesByNodeIdSandboxFilesResponse)

export const files4 = {
  get: get50,
  read: read2,
  upload: upload3,
}

export const sandbox = {
  files: files4,
}

export const byNodeId4 = {
  sandbox,
}

export const agentNodes = {
  byNodeId: byNodeId4,
}

export const byWorkflowRunId = {
  agentNodes,
}

/**
 * Get workflow run list
 *
 * Get workflow run list
 */
export const get51 = oc
  .route({
    description: 'Get workflow run list',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowRuns',
    path: '/apps/{app_id}/workflow-runs',
    summary: 'Get workflow run list',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowRunsPath,
      query: zGetAppsByAppIdWorkflowRunsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdWorkflowRunsResponse)

export const workflowRuns2 = {
  get: get51,
  count: count3,
  tasks,
  byRunId,
  byWorkflowRunId,
}

/**
 * Get all users in current tenant for mentions
 *
 * Get all users in current tenant for mentions
 */
export const get52 = oc
  .route({
    description: 'Get all users in current tenant for mentions',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowCommentsMentionUsers',
    path: '/apps/{app_id}/workflow/comments/mention-users',
    summary: 'Get all users in current tenant for mentions',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowCommentsMentionUsersPath }))
  .output(zGetAppsByAppIdWorkflowCommentsMentionUsersResponse)

export const mentionUsers = {
  get: get52,
}

/**
 * Delete a comment reply
 *
 * Delete a comment reply
 */
export const delete8 = oc
  .route({
    description: 'Delete a comment reply',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyId',
    path: '/apps/{app_id}/workflow/comments/{comment_id}/replies/{reply_id}',
    successStatus: 204,
    summary: 'Delete a comment reply',
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdPath }))
  .output(zDeleteAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdResponse)

/**
 * Update a comment reply
 *
 * Update a comment reply
 */
export const put3 = oc
  .route({
    description: 'Update a comment reply',
    inputStructure: 'detailed',
    method: 'PUT',
    operationId: 'putAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyId',
    path: '/apps/{app_id}/workflow/comments/{comment_id}/replies/{reply_id}',
    summary: 'Update a comment reply',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPutAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdBody,
      params: zPutAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdPath,
    }),
  )
  .output(zPutAppsByAppIdWorkflowCommentsByCommentIdRepliesByReplyIdResponse)

export const byReplyId = {
  delete: delete8,
  put: put3,
}

/**
 * Add a reply to a workflow comment
 *
 * Add a reply to a workflow comment
 */
export const post43 = oc
  .route({
    description: 'Add a reply to a workflow comment',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowCommentsByCommentIdReplies',
    path: '/apps/{app_id}/workflow/comments/{comment_id}/replies',
    successStatus: 201,
    summary: 'Add a reply to a workflow comment',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowCommentsByCommentIdRepliesBody,
      params: zPostAppsByAppIdWorkflowCommentsByCommentIdRepliesPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowCommentsByCommentIdRepliesResponse)

export const replies = {
  post: post43,
  byReplyId,
}

/**
 * Resolve a workflow comment
 *
 * Resolve a workflow comment
 */
export const post44 = oc
  .route({
    description: 'Resolve a workflow comment',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowCommentsByCommentIdResolve',
    path: '/apps/{app_id}/workflow/comments/{comment_id}/resolve',
    summary: 'Resolve a workflow comment',
    tags: ['console'],
  })
  .input(z.object({ params: zPostAppsByAppIdWorkflowCommentsByCommentIdResolvePath }))
  .output(zPostAppsByAppIdWorkflowCommentsByCommentIdResolveResponse)

export const resolve = {
  post: post44,
}

/**
 * Delete a workflow comment
 *
 * Delete a workflow comment
 */
export const delete9 = oc
  .route({
    description: 'Delete a workflow comment',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByAppIdWorkflowCommentsByCommentId',
    path: '/apps/{app_id}/workflow/comments/{comment_id}',
    successStatus: 204,
    summary: 'Delete a workflow comment',
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteAppsByAppIdWorkflowCommentsByCommentIdPath }))
  .output(zDeleteAppsByAppIdWorkflowCommentsByCommentIdResponse)

/**
 * Get a specific workflow comment
 *
 * Get a specific workflow comment
 */
export const get53 = oc
  .route({
    description: 'Get a specific workflow comment',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowCommentsByCommentId',
    path: '/apps/{app_id}/workflow/comments/{comment_id}',
    summary: 'Get a specific workflow comment',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowCommentsByCommentIdPath }))
  .output(zGetAppsByAppIdWorkflowCommentsByCommentIdResponse)

/**
 * Update a workflow comment
 *
 * Update a workflow comment
 */
export const put4 = oc
  .route({
    description: 'Update a workflow comment',
    inputStructure: 'detailed',
    method: 'PUT',
    operationId: 'putAppsByAppIdWorkflowCommentsByCommentId',
    path: '/apps/{app_id}/workflow/comments/{comment_id}',
    summary: 'Update a workflow comment',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPutAppsByAppIdWorkflowCommentsByCommentIdBody,
      params: zPutAppsByAppIdWorkflowCommentsByCommentIdPath,
    }),
  )
  .output(zPutAppsByAppIdWorkflowCommentsByCommentIdResponse)

export const byCommentId = {
  delete: delete9,
  get: get53,
  put: put4,
  replies,
  resolve,
}

/**
 * Get all comments for a workflow
 *
 * Get all comments for a workflow
 */
export const get54 = oc
  .route({
    description: 'Get all comments for a workflow',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowComments',
    path: '/apps/{app_id}/workflow/comments',
    summary: 'Get all comments for a workflow',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowCommentsPath }))
  .output(zGetAppsByAppIdWorkflowCommentsResponse)

/**
 * Create a new workflow comment
 *
 * Create a new workflow comment
 */
export const post45 = oc
  .route({
    description: 'Create a new workflow comment',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowComments',
    path: '/apps/{app_id}/workflow/comments',
    successStatus: 201,
    summary: 'Create a new workflow comment',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowCommentsBody,
      params: zPostAppsByAppIdWorkflowCommentsPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowCommentsResponse)

export const comments = {
  get: get54,
  post: post45,
  mentionUsers,
  byCommentId,
}

/**
 * Get workflow average app interaction statistics
 */
export const get55 = oc
  .route({
    description: 'Get workflow average app interaction statistics',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowStatisticsAverageAppInteractions',
    path: '/apps/{app_id}/workflow/statistics/average-app-interactions',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowStatisticsAverageAppInteractionsPath,
      query: zGetAppsByAppIdWorkflowStatisticsAverageAppInteractionsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdWorkflowStatisticsAverageAppInteractionsResponse)

export const averageAppInteractions = {
  get: get55,
}

/**
 * Get workflow daily runs statistics
 */
export const get56 = oc
  .route({
    description: 'Get workflow daily runs statistics',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowStatisticsDailyConversations',
    path: '/apps/{app_id}/workflow/statistics/daily-conversations',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowStatisticsDailyConversationsPath,
      query: zGetAppsByAppIdWorkflowStatisticsDailyConversationsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdWorkflowStatisticsDailyConversationsResponse)

export const dailyConversations2 = {
  get: get56,
}

/**
 * Get workflow daily terminals statistics
 */
export const get57 = oc
  .route({
    description: 'Get workflow daily terminals statistics',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowStatisticsDailyTerminals',
    path: '/apps/{app_id}/workflow/statistics/daily-terminals',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowStatisticsDailyTerminalsPath,
      query: zGetAppsByAppIdWorkflowStatisticsDailyTerminalsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdWorkflowStatisticsDailyTerminalsResponse)

export const dailyTerminals = {
  get: get57,
}

/**
 * Get workflow daily token cost statistics
 */
export const get58 = oc
  .route({
    description: 'Get workflow daily token cost statistics',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowStatisticsTokenCosts',
    path: '/apps/{app_id}/workflow/statistics/token-costs',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowStatisticsTokenCostsPath,
      query: zGetAppsByAppIdWorkflowStatisticsTokenCostsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdWorkflowStatisticsTokenCostsResponse)

export const tokenCosts2 = {
  get: get58,
}

export const statistics2 = {
  averageAppInteractions,
  dailyConversations: dailyConversations2,
  dailyTerminals,
  tokenCosts: tokenCosts2,
}

export const workflow = {
  comments,
  statistics: statistics2,
}

/**
 * Get default block config
 *
 * Get default block configuration by type
 */
export const get59 = oc
  .route({
    description: 'Get default block configuration by type',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockType',
    path: '/apps/{app_id}/workflows/default-workflow-block-configs/{block_type}',
    summary: 'Get default block config',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypePath,
      query: zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeResponse)

export const byBlockType = {
  get: get59,
}

/**
 * Get default block config
 *
 * Get default block configurations for workflow
 */
export const get60 = oc
  .route({
    description: 'Get default block configurations for workflow',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDefaultWorkflowBlockConfigs',
    path: '/apps/{app_id}/workflows/default-workflow-block-configs',
    summary: 'Get default block config',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsPath }))
  .output(zGetAppsByAppIdWorkflowsDefaultWorkflowBlockConfigsResponse)

export const defaultWorkflowBlockConfigs = {
  get: get60,
  byBlockType,
}

/**
 * Get conversation variables for workflow
 */
export const get61 = oc
  .route({
    description: 'Get conversation variables for workflow',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDraftConversationVariables',
    path: '/apps/{app_id}/workflows/draft/conversation-variables',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsDraftConversationVariablesPath }))
  .output(zGetAppsByAppIdWorkflowsDraftConversationVariablesResponse)

/**
 * Update conversation variables for workflow draft
 */
export const post46 = oc
  .route({
    description: 'Update conversation variables for workflow draft',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftConversationVariables',
    path: '/apps/{app_id}/workflows/draft/conversation-variables',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftConversationVariablesBody,
      params: zPostAppsByAppIdWorkflowsDraftConversationVariablesPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftConversationVariablesResponse)

export const conversationVariables2 = {
  get: get61,
  post: post46,
}

/**
 * Get draft workflow
 *
 * Get environment variables for workflow
 */
export const get62 = oc
  .route({
    description: 'Get environment variables for workflow',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDraftEnvironmentVariables',
    path: '/apps/{app_id}/workflows/draft/environment-variables',
    summary: 'Get draft workflow',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsDraftEnvironmentVariablesPath }))
  .output(zGetAppsByAppIdWorkflowsDraftEnvironmentVariablesResponse)

/**
 * Update environment variables for workflow draft
 */
export const post47 = oc
  .route({
    description: 'Update environment variables for workflow draft',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftEnvironmentVariables',
    path: '/apps/{app_id}/workflows/draft/environment-variables',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftEnvironmentVariablesBody,
      params: zPostAppsByAppIdWorkflowsDraftEnvironmentVariablesPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftEnvironmentVariablesResponse)

export const environmentVariables = {
  get: get62,
  post: post47,
}

/**
 * Update draft workflow features
 */
export const post48 = oc
  .route({
    description: 'Update draft workflow features',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftFeatures',
    path: '/apps/{app_id}/workflows/draft/features',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftFeaturesBody,
      params: zPostAppsByAppIdWorkflowsDraftFeaturesPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftFeaturesResponse)

export const features = {
  post: post48,
}

/**
 * Test human input delivery
 *
 * Test human input delivery for workflow
 */
export const post49 = oc
  .route({
    description: 'Test human input delivery for workflow',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTest',
    path: '/apps/{app_id}/workflows/draft/human-input/nodes/{node_id}/delivery-test',
    summary: 'Test human input delivery',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTestBody,
      params: zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTestPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdDeliveryTestResponse)

export const deliveryTest = {
  post: post49,
}

/**
 * Preview human input form content and placeholders
 *
 * Get human input form preview for workflow
 */
export const post50 = oc
  .route({
    description: 'Get human input form preview for workflow',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreview',
    path: '/apps/{app_id}/workflows/draft/human-input/nodes/{node_id}/form/preview',
    summary: 'Preview human input form content and placeholders',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreviewBody,
      params: zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreviewPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormPreviewResponse)

export const preview3 = {
  post: post50,
}

/**
 * Submit human input form preview
 *
 * Submit human input form preview for workflow
 */
export const post51 = oc
  .route({
    description: 'Submit human input form preview for workflow',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRun',
    path: '/apps/{app_id}/workflows/draft/human-input/nodes/{node_id}/form/run',
    summary: 'Submit human input form preview',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRunBody,
      params: zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRunPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftHumanInputNodesByNodeIdFormRunResponse)

export const run5 = {
  post: post51,
}

export const form2 = {
  preview: preview3,
  run: run5,
}

export const byNodeId5 = {
  deliveryTest,
  form: form2,
}

export const nodes4 = {
  byNodeId: byNodeId5,
}

export const humanInput2 = {
  nodes: nodes4,
}

/**
 * Run draft workflow iteration node
 *
 * Run draft workflow iteration node
 */
export const post52 = oc
  .route({
    description: 'Run draft workflow iteration node',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRun',
    path: '/apps/{app_id}/workflows/draft/iteration/nodes/{node_id}/run',
    summary: 'Run draft workflow iteration node',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunBody,
      params: zPostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftIterationNodesByNodeIdRunResponse)

export const run6 = {
  post: post52,
}

export const byNodeId6 = {
  run: run6,
}

export const nodes5 = {
  byNodeId: byNodeId6,
}

export const iteration2 = {
  nodes: nodes5,
}

/**
 * Run draft workflow loop node
 *
 * Run draft workflow loop node
 */
export const post53 = oc
  .route({
    description: 'Run draft workflow loop node',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRun',
    path: '/apps/{app_id}/workflows/draft/loop/nodes/{node_id}/run',
    summary: 'Run draft workflow loop node',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunBody,
      params: zPostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftLoopNodesByNodeIdRunResponse)

export const run7 = {
  post: post53,
}

export const byNodeId7 = {
  run: run7,
}

export const nodes6 = {
  byNodeId: byNodeId7,
}

export const loop2 = {
  nodes: nodes6,
}

export const get63 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerCandidates',
    path: '/apps/{app_id}/workflows/draft/nodes/{node_id}/agent-composer/candidates',
    tags: ['console'],
  })
  .input(
    z.object({ params: zGetAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerCandidatesPath }),
  )
  .output(zGetAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerCandidatesResponse)

export const candidates2 = {
  get: get63,
}

export const post54 = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerImpact',
    path: '/apps/{app_id}/workflows/draft/nodes/{node_id}/agent-composer/impact',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerImpactBody,
      params: zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerImpactPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerImpactResponse)

export const impact = {
  post: post54,
}

export const post55 = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerSaveToRoster',
    path: '/apps/{app_id}/workflows/draft/nodes/{node_id}/agent-composer/save-to-roster',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerSaveToRosterBody,
      params: zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerSaveToRosterPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerSaveToRosterResponse)

export const saveToRoster = {
  post: post55,
}

export const post56 = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerValidate',
    path: '/apps/{app_id}/workflows/draft/nodes/{node_id}/agent-composer/validate',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerValidateBody,
      params: zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerValidatePath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerValidateResponse)

export const validate2 = {
  post: post56,
}

export const get64 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposer',
    path: '/apps/{app_id}/workflows/draft/nodes/{node_id}/agent-composer',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerPath }))
  .output(zGetAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerResponse)

export const put5 = oc
  .route({
    inputStructure: 'detailed',
    method: 'PUT',
    operationId: 'putAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposer',
    path: '/apps/{app_id}/workflows/draft/nodes/{node_id}/agent-composer',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPutAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerBody,
      params: zPutAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerPath,
    }),
  )
  .output(zPutAppsByAppIdWorkflowsDraftNodesByNodeIdAgentComposerResponse)

export const agentComposer2 = {
  get: get64,
  put: put5,
  candidates: candidates2,
  impact,
  saveToRoster,
  validate: validate2,
}

/**
 * Get last run result for draft workflow node
 */
export const get65 = oc
  .route({
    description: 'Get last run result for draft workflow node',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDraftNodesByNodeIdLastRun',
    path: '/apps/{app_id}/workflows/draft/nodes/{node_id}/last-run',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunPath }))
  .output(zGetAppsByAppIdWorkflowsDraftNodesByNodeIdLastRunResponse)

export const lastRun = {
  get: get65,
}

/**
 * Run draft workflow node
 *
 * Run draft workflow node
 */
export const post57 = oc
  .route({
    description: 'Run draft workflow node',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftNodesByNodeIdRun',
    path: '/apps/{app_id}/workflows/draft/nodes/{node_id}/run',
    summary: 'Run draft workflow node',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftNodesByNodeIdRunBody,
      params: zPostAppsByAppIdWorkflowsDraftNodesByNodeIdRunPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftNodesByNodeIdRunResponse)

export const run8 = {
  post: post57,
}

/**
 * Poll for trigger events and execute single node when event arrives
 *
 * Poll for trigger events and execute single node when event arrives
 */
export const post58 = oc
  .route({
    description: 'Poll for trigger events and execute single node when event arrives',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRun',
    path: '/apps/{app_id}/workflows/draft/nodes/{node_id}/trigger/run',
    summary: 'Poll for trigger events and execute single node when event arrives',
    tags: ['console'],
  })
  .input(z.object({ params: zPostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunPath }))
  .output(zPostAppsByAppIdWorkflowsDraftNodesByNodeIdTriggerRunResponse)

export const run9 = {
  post: post58,
}

export const trigger = {
  run: run9,
}

/**
 * Delete all variables for a specific node
 */
export const delete10 = oc
  .route({
    description: 'Delete all variables for a specific node',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByAppIdWorkflowsDraftNodesByNodeIdVariables',
    path: '/apps/{app_id}/workflows/draft/nodes/{node_id}/variables',
    successStatus: 204,
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesPath }))
  .output(zDeleteAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesResponse)

/**
 * Get variables for a specific node
 */
export const get66 = oc
  .route({
    description: 'Get variables for a specific node',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDraftNodesByNodeIdVariables',
    path: '/apps/{app_id}/workflows/draft/nodes/{node_id}/variables',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesPath }))
  .output(zGetAppsByAppIdWorkflowsDraftNodesByNodeIdVariablesResponse)

export const variables = {
  delete: delete10,
  get: get66,
}

export const byNodeId8 = {
  agentComposer: agentComposer2,
  lastRun,
  run: run8,
  trigger,
  variables,
}

export const nodes7 = {
  byNodeId: byNodeId8,
}

/**
 * Run draft workflow
 *
 * Run draft workflow
 */
export const post59 = oc
  .route({
    description: 'Run draft workflow',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftRun',
    path: '/apps/{app_id}/workflows/draft/run',
    summary: 'Run draft workflow',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftRunBody,
      params: zPostAppsByAppIdWorkflowsDraftRunPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftRunResponse)

export const run10 = {
  post: post59,
}

/**
 * Server-Sent Events stream of inspector deltas for a draft workflow run.
 */
export const get67 = oc
  .route({
    description: 'Server-Sent Events stream of inspector deltas for a draft workflow run.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEvents',
    path: '/apps/{app_id}/workflows/draft/runs/{run_id}/node-outputs/events',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEventsPath }))
  .output(zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsEventsResponse)

export const events = {
  get: get67,
}

/**
 * Full value for one declared output, including signed download URL for files.
 */
export const get68 = oc
  .route({
    description: 'Full value for one declared output, including signed download URL for files.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdByOutputNamePreview',
    path: '/apps/{app_id}/workflows/draft/runs/{run_id}/node-outputs/{node_id}/{output_name}/preview',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewPath,
    }),
  )
  .output(zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewResponse)

export const preview4 = {
  get: get68,
}

export const byOutputName = {
  preview: preview4,
}

/**
 * One node's declared outputs for a draft workflow run.
 */
export const get69 = oc
  .route({
    description: 'One node\'s declared outputs for a draft workflow run.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeId',
    path: '/apps/{app_id}/workflows/draft/runs/{run_id}/node-outputs/{node_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdPath }))
  .output(zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsByNodeIdResponse)

export const byNodeId9 = {
  get: get69,
  byOutputName,
}

/**
 * Snapshot of every node's declared outputs for a draft workflow run.
 */
export const get70 = oc
  .route({
    description: 'Snapshot of every node\'s declared outputs for a draft workflow run.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputs',
    path: '/apps/{app_id}/workflows/draft/runs/{run_id}/node-outputs',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsPath }))
  .output(zGetAppsByAppIdWorkflowsDraftRunsByRunIdNodeOutputsResponse)

export const nodeOutputs = {
  get: get70,
  events,
  byNodeId: byNodeId9,
}

export const byRunId2 = {
  nodeOutputs,
}

export const runs = {
  byRunId: byRunId2,
}

/**
 * Get system variables for workflow
 */
export const get71 = oc
  .route({
    description: 'Get system variables for workflow',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDraftSystemVariables',
    path: '/apps/{app_id}/workflows/draft/system-variables',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsDraftSystemVariablesPath }))
  .output(zGetAppsByAppIdWorkflowsDraftSystemVariablesResponse)

export const systemVariables = {
  get: get71,
}

/**
 * Poll for trigger events and execute full workflow when event arrives
 *
 * Poll for trigger events and execute full workflow when event arrives
 */
export const post60 = oc
  .route({
    description: 'Poll for trigger events and execute full workflow when event arrives',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftTriggerRun',
    path: '/apps/{app_id}/workflows/draft/trigger/run',
    summary: 'Poll for trigger events and execute full workflow when event arrives',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftTriggerRunBody,
      params: zPostAppsByAppIdWorkflowsDraftTriggerRunPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftTriggerRunResponse)

export const run11 = {
  post: post60,
}

/**
 * Full workflow debug when the start node is a trigger
 *
 * Full workflow debug when the start node is a trigger
 */
export const post61 = oc
  .route({
    description: 'Full workflow debug when the start node is a trigger',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraftTriggerRunAll',
    path: '/apps/{app_id}/workflows/draft/trigger/run-all',
    summary: 'Full workflow debug when the start node is a trigger',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftTriggerRunAllBody,
      params: zPostAppsByAppIdWorkflowsDraftTriggerRunAllPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftTriggerRunAllResponse)

export const runAll = {
  post: post61,
}

export const trigger2 = {
  run: run11,
  runAll,
}

/**
 * Reset a workflow variable to its default value
 */
export const put6 = oc
  .route({
    description: 'Reset a workflow variable to its default value',
    inputStructure: 'detailed',
    method: 'PUT',
    operationId: 'putAppsByAppIdWorkflowsDraftVariablesByVariableIdReset',
    path: '/apps/{app_id}/workflows/draft/variables/{variable_id}/reset',
    tags: ['console'],
  })
  .input(z.object({ params: zPutAppsByAppIdWorkflowsDraftVariablesByVariableIdResetPath }))
  .output(zPutAppsByAppIdWorkflowsDraftVariablesByVariableIdResetResponse)

export const reset = {
  put: put6,
}

/**
 * Delete a workflow variable
 */
export const delete11 = oc
  .route({
    description: 'Delete a workflow variable',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByAppIdWorkflowsDraftVariablesByVariableId',
    path: '/apps/{app_id}/workflows/draft/variables/{variable_id}',
    successStatus: 204,
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdPath }))
  .output(zDeleteAppsByAppIdWorkflowsDraftVariablesByVariableIdResponse)

/**
 * Get a specific workflow variable
 */
export const get72 = oc
  .route({
    description: 'Get a specific workflow variable',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDraftVariablesByVariableId',
    path: '/apps/{app_id}/workflows/draft/variables/{variable_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsDraftVariablesByVariableIdPath }))
  .output(zGetAppsByAppIdWorkflowsDraftVariablesByVariableIdResponse)

/**
 * Update a workflow variable
 */
export const patch2 = oc
  .route({
    description: 'Update a workflow variable',
    inputStructure: 'detailed',
    method: 'PATCH',
    operationId: 'patchAppsByAppIdWorkflowsDraftVariablesByVariableId',
    path: '/apps/{app_id}/workflows/draft/variables/{variable_id}',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPatchAppsByAppIdWorkflowsDraftVariablesByVariableIdBody,
      params: zPatchAppsByAppIdWorkflowsDraftVariablesByVariableIdPath,
    }),
  )
  .output(zPatchAppsByAppIdWorkflowsDraftVariablesByVariableIdResponse)

export const byVariableId = {
  delete: delete11,
  get: get72,
  patch: patch2,
  reset,
}

/**
 * Delete all draft workflow variables
 */
export const delete12 = oc
  .route({
    description: 'Delete all draft workflow variables',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByAppIdWorkflowsDraftVariables',
    path: '/apps/{app_id}/workflows/draft/variables',
    successStatus: 204,
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteAppsByAppIdWorkflowsDraftVariablesPath }))
  .output(zDeleteAppsByAppIdWorkflowsDraftVariablesResponse)

/**
 * Get draft workflow
 *
 * Get draft workflow variables
 */
export const get73 = oc
  .route({
    description: 'Get draft workflow variables',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDraftVariables',
    path: '/apps/{app_id}/workflows/draft/variables',
    summary: 'Get draft workflow',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowsDraftVariablesPath,
      query: zGetAppsByAppIdWorkflowsDraftVariablesQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdWorkflowsDraftVariablesResponse)

export const variables2 = {
  delete: delete12,
  get: get73,
  byVariableId,
}

/**
 * Get draft workflow
 *
 * Get draft workflow for an application
 */
export const get74 = oc
  .route({
    description: 'Get draft workflow for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsDraft',
    path: '/apps/{app_id}/workflows/draft',
    summary: 'Get draft workflow',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsDraftPath }))
  .output(zGetAppsByAppIdWorkflowsDraftResponse)

/**
 * Sync draft workflow
 *
 * Sync draft workflow configuration
 */
export const post62 = oc
  .route({
    description: 'Sync draft workflow configuration',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsDraft',
    path: '/apps/{app_id}/workflows/draft',
    summary: 'Sync draft workflow',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsDraftBody,
      params: zPostAppsByAppIdWorkflowsDraftPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsDraftResponse)

export const draft2 = {
  get: get74,
  post: post62,
  conversationVariables: conversationVariables2,
  environmentVariables,
  features,
  humanInput: humanInput2,
  iteration: iteration2,
  loop: loop2,
  nodes: nodes7,
  run: run10,
  runs,
  systemVariables,
  trigger: trigger2,
  variables: variables2,
}

/**
 * Get published workflow
 *
 * Get published workflow for an application
 */
export const get75 = oc
  .route({
    description: 'Get published workflow for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsPublish',
    path: '/apps/{app_id}/workflows/publish',
    summary: 'Get published workflow',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsPublishPath }))
  .output(zGetAppsByAppIdWorkflowsPublishResponse)

/**
 * Publish workflow
 */
export const post63 = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsPublish',
    path: '/apps/{app_id}/workflows/publish',
    summary: 'Publish workflow',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostAppsByAppIdWorkflowsPublishBody,
      params: zPostAppsByAppIdWorkflowsPublishPath,
    }),
  )
  .output(zPostAppsByAppIdWorkflowsPublishResponse)

export const publish = {
  get: get75,
  post: post63,
}

/**
 * Server-Sent Events stream of inspector deltas for a published workflow run.
 */
export const get76 = oc
  .route({
    description: 'Server-Sent Events stream of inspector deltas for a published workflow run.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEvents',
    path: '/apps/{app_id}/workflows/published/runs/{run_id}/node-outputs/events',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEventsPath }))
  .output(zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsEventsResponse)

export const events2 = {
  get: get76,
}

/**
 * Full value for one declared output of a published run.
 */
export const get77 = oc
  .route({
    description: 'Full value for one declared output of a published run.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId:
      'getAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdByOutputNamePreview',
    path: '/apps/{app_id}/workflows/published/runs/{run_id}/node-outputs/{node_id}/{output_name}/preview',
    tags: ['console'],
  })
  .input(
    z.object({
      params:
        zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewPath,
    }),
  )
  .output(
    zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdByOutputNamePreviewResponse,
  )

export const preview5 = {
  get: get77,
}

export const byOutputName2 = {
  preview: preview5,
}

/**
 * One node's declared outputs for a published workflow run.
 */
export const get78 = oc
  .route({
    description: 'One node\'s declared outputs for a published workflow run.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeId',
    path: '/apps/{app_id}/workflows/published/runs/{run_id}/node-outputs/{node_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdPath }))
  .output(zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsByNodeIdResponse)

export const byNodeId10 = {
  get: get78,
  byOutputName: byOutputName2,
}

/**
 * Snapshot of every node's declared outputs for a published workflow run.
 */
export const get79 = oc
  .route({
    description: 'Snapshot of every node\'s declared outputs for a published workflow run.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputs',
    path: '/apps/{app_id}/workflows/published/runs/{run_id}/node-outputs',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsPath }))
  .output(zGetAppsByAppIdWorkflowsPublishedRunsByRunIdNodeOutputsResponse)

export const nodeOutputs2 = {
  get: get79,
  events: events2,
  byNodeId: byNodeId10,
}

export const byRunId3 = {
  nodeOutputs: nodeOutputs2,
}

export const runs2 = {
  byRunId: byRunId3,
}

export const published = {
  runs: runs2,
}

/**
 * Get webhook trigger for a node
 */
export const get80 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflowsTriggersWebhook',
    path: '/apps/{app_id}/workflows/triggers/webhook',
    summary: 'Get webhook trigger for a node',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowsTriggersWebhookPath,
      query: zGetAppsByAppIdWorkflowsTriggersWebhookQuery,
    }),
  )
  .output(zGetAppsByAppIdWorkflowsTriggersWebhookResponse)

export const webhook = {
  get: get80,
}

export const triggers2 = {
  webhook,
}

/**
 * Restore a published workflow version into the draft workflow
 */
export const post64 = oc
  .route({
    description: 'Restore a published workflow version into the draft workflow',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByAppIdWorkflowsByWorkflowIdRestore',
    path: '/apps/{app_id}/workflows/{workflow_id}/restore',
    tags: ['console'],
  })
  .input(z.object({ params: zPostAppsByAppIdWorkflowsByWorkflowIdRestorePath }))
  .output(zPostAppsByAppIdWorkflowsByWorkflowIdRestoreResponse)

export const restore = {
  post: post64,
}

/**
 * Delete workflow
 */
export const delete13 = oc
  .route({
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByAppIdWorkflowsByWorkflowId',
    path: '/apps/{app_id}/workflows/{workflow_id}',
    successStatus: 204,
    summary: 'Delete workflow',
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteAppsByAppIdWorkflowsByWorkflowIdPath }))
  .output(zDeleteAppsByAppIdWorkflowsByWorkflowIdResponse)

/**
 * Update workflow attributes
 *
 * Update workflow by ID
 */
export const patch3 = oc
  .route({
    description: 'Update workflow by ID',
    inputStructure: 'detailed',
    method: 'PATCH',
    operationId: 'patchAppsByAppIdWorkflowsByWorkflowId',
    path: '/apps/{app_id}/workflows/{workflow_id}',
    summary: 'Update workflow attributes',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPatchAppsByAppIdWorkflowsByWorkflowIdBody,
      params: zPatchAppsByAppIdWorkflowsByWorkflowIdPath,
    }),
  )
  .output(zPatchAppsByAppIdWorkflowsByWorkflowIdResponse)

export const byWorkflowId = {
  delete: delete13,
  patch: patch3,
  restore,
}

/**
 * Get published workflows
 *
 * Get all published workflows for an application
 */
export const get81 = oc
  .route({
    description: 'Get all published workflows for an application',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppIdWorkflows',
    path: '/apps/{app_id}/workflows',
    summary: 'Get published workflows',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetAppsByAppIdWorkflowsPath,
      query: zGetAppsByAppIdWorkflowsQuery.optional(),
    }),
  )
  .output(zGetAppsByAppIdWorkflowsResponse)

export const workflows3 = {
  get: get81,
  defaultWorkflowBlockConfigs,
  draft: draft2,
  publish,
  published,
  triggers: triggers2,
  byWorkflowId,
}

/**
 * Delete app
 *
 * Delete application
 */
export const delete14 = oc
  .route({
    description: 'Delete application',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByAppId',
    path: '/apps/{app_id}',
    successStatus: 204,
    summary: 'Delete app',
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteAppsByAppIdPath }))
  .output(zDeleteAppsByAppIdResponse)

/**
 * Get app detail
 *
 * Get application details
 */
export const get82 = oc
  .route({
    description: 'Get application details',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByAppId',
    path: '/apps/{app_id}',
    summary: 'Get app detail',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByAppIdPath }))
  .output(zGetAppsByAppIdResponse)

/**
 * Update app
 *
 * Update application details
 */
export const put7 = oc
  .route({
    description: 'Update application details',
    inputStructure: 'detailed',
    method: 'PUT',
    operationId: 'putAppsByAppId',
    path: '/apps/{app_id}',
    summary: 'Update app',
    tags: ['console'],
  })
  .input(z.object({ body: zPutAppsByAppIdBody, params: zPutAppsByAppIdPath }))
  .output(zPutAppsByAppIdResponse)

export const byAppId2 = {
  delete: delete14,
  get: get82,
  put: put7,
  advancedChat,
  agentComposer,
  agentFeatures,
  agentReferencingWorkflows,
  agentSandbox,
  agent,
  annotationReply,
  annotationSetting,
  annotationSettings,
  annotations,
  apiEnable,
  audioToText,
  chatConversations,
  chatMessages,
  completionConversations,
  completionMessages,
  conversationVariables,
  convertToWorkflow,
  copy,
  export: export2,
  feedbacks,
  icon,
  messages,
  modelConfig,
  name,
  publishToCreatorsPlatform,
  server,
  site,
  siteEnable,
  statistics,
  textToAudio,
  trace,
  traceConfig,
  triggerEnable,
  triggers,
  workflowAppLogs,
  workflowArchivedLogs,
  workflowRuns: workflowRuns2,
  workflow,
  workflows: workflows3,
}

/**
 * Delete an API key for an app
 *
 * Delete an API key for an app
 */
export const delete15 = oc
  .route({
    description: 'Delete an API key for an app',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteAppsByResourceIdApiKeysByApiKeyId',
    path: '/apps/{resource_id}/api-keys/{api_key_id}',
    successStatus: 204,
    summary: 'Delete an API key for an app',
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteAppsByResourceIdApiKeysByApiKeyIdPath }))
  .output(zDeleteAppsByResourceIdApiKeysByApiKeyIdResponse)

export const byApiKeyId = {
  delete: delete15,
}

/**
 * Get all API keys for an app
 *
 * Get all API keys for an app
 */
export const get83 = oc
  .route({
    description: 'Get all API keys for an app',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByResourceIdApiKeys',
    path: '/apps/{resource_id}/api-keys',
    summary: 'Get all API keys for an app',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByResourceIdApiKeysPath }))
  .output(zGetAppsByResourceIdApiKeysResponse)

/**
 * Create a new API key for an app
 *
 * Create a new API key for an app
 */
export const post65 = oc
  .route({
    description: 'Create a new API key for an app',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAppsByResourceIdApiKeys',
    path: '/apps/{resource_id}/api-keys',
    successStatus: 201,
    summary: 'Create a new API key for an app',
    tags: ['console'],
  })
  .input(z.object({ params: zPostAppsByResourceIdApiKeysPath }))
  .output(zPostAppsByResourceIdApiKeysResponse)

export const apiKeys = {
  get: get83,
  post: post65,
  byApiKeyId,
}

export const byResourceId = {
  apiKeys,
}

/**
 * Refresh MCP server configuration and regenerate server code
 */
export const get84 = oc
  .route({
    description: 'Refresh MCP server configuration and regenerate server code',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getAppsByServerIdServerRefresh',
    path: '/apps/{server_id}/server/refresh',
    tags: ['console'],
  })
  .input(z.object({ params: zGetAppsByServerIdServerRefreshPath }))
  .output(zGetAppsByServerIdServerRefreshResponse)

export const refresh = {
  get: get84,
}

export const server2 = {
  refresh,
}

export const byServerId = {
  server: server2,
}

/**
 * Get app list
 *
 * Get list of applications with pagination and filtering
 */
export const get85 = oc
  .route({
    description: 'Get list of applications with pagination and filtering',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getApps',
    path: '/apps',
    summary: 'Get app list',
    tags: ['console'],
  })
  .input(z.object({ query: zGetAppsQuery.optional() }))
  .output(zGetAppsResponse)

/**
 * Create app
 *
 * Create a new application
 */
export const post66 = oc
  .route({
    description: 'Create a new application',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postApps',
    path: '/apps',
    successStatus: 201,
    summary: 'Create app',
    tags: ['console'],
  })
  .input(z.object({ body: zPostAppsBody }))
  .output(zPostAppsResponse)

export const apps = {
  get: get85,
  post: post66,
  imports,
  workflows,
  byAppId: byAppId2,
  byResourceId,
  byServerId,
}

export const contract = {
  apps,
}
