@promptbook/cli 0.113.0-7 → 0.113.0-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/agents-server/next.config.ts +6 -3
- package/apps/agents-server/src/app/admin/resource-monitor/page.tsx +456 -0
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerClient.tsx +14 -2
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskLogActions.tsx +150 -0
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskRow.tsx +58 -18
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskTerminalDialog.tsx +125 -0
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTasksCard.tsx +3 -1
- package/apps/agents-server/src/app/admin/task-manager/page.tsx +3 -2
- package/apps/agents-server/src/app/admin/update/AdvancedOriginRepositoryPanel.tsx +14 -9
- package/apps/agents-server/src/app/admin/update/AutomaticSelfUpdateConfigurationCard.tsx +93 -0
- package/apps/agents-server/src/app/admin/update/CurrentDeploymentCard.tsx +15 -13
- package/apps/agents-server/src/app/admin/update/CustomCommitPicker.tsx +10 -10
- package/apps/agents-server/src/app/admin/update/InstalledVersionsCard.tsx +112 -0
- package/apps/agents-server/src/app/admin/update/PendingCommitsCard.tsx +9 -8
- package/apps/agents-server/src/app/admin/update/TargetEnvironmentCard.tsx +14 -14
- package/apps/agents-server/src/app/admin/update/UpdateClient.tsx +18 -8
- package/apps/agents-server/src/app/admin/update/UpdateDatabaseMigrationsPanel.tsx +305 -0
- package/apps/agents-server/src/app/admin/update/UpdateJobCard.tsx +29 -8
- package/apps/agents-server/src/app/admin/update/UpdateOverview.ts +68 -0
- package/apps/agents-server/src/app/admin/update/updatePageCardClassName.ts +6 -0
- package/apps/agents-server/src/app/admin/update/useUpdateClientState.ts +241 -7
- package/apps/agents-server/src/app/agents/[agentName]/AgentChatWrapper.tsx +17 -3
- package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatSurface.tsx +6 -2
- package/apps/agents-server/src/app/api/admin/chat-tasks/[taskId]/terminal/route.ts +52 -0
- package/apps/agents-server/src/app/api/admin/update/route.ts +55 -8
- package/apps/agents-server/src/app/api/admin/update/versions/route.ts +34 -0
- package/apps/agents-server/src/app/api/auth/shibboleth/acs/route.ts +4 -2
- package/apps/agents-server/src/app/api/auth/shibboleth/login/route.ts +3 -1
- package/apps/agents-server/src/app/api/auth/shibboleth/metadata/route.ts +5 -2
- package/apps/agents-server/src/app/api/auth/shibboleth/status/route.ts +5 -2
- package/apps/agents-server/src/app/layout.tsx +39 -25
- package/apps/agents-server/src/components/AgentAvatar/AgentAvatar.tsx +1 -1
- package/apps/agents-server/src/components/AgentAvatar/DefaultAgentAvatarVisualProvider.tsx +1 -1
- package/apps/agents-server/src/components/Header/Header.tsx +16 -3
- package/apps/agents-server/src/components/Header/HeaderTypes.ts +6 -0
- package/apps/agents-server/src/components/Header/buildAgentMenuStructure.tsx +6 -4
- package/apps/agents-server/src/components/Header/buildHeaderSystemMenuItems.ts +13 -1
- package/apps/agents-server/src/components/Homepage/useAgentsListState.ts +1 -1
- package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +21 -5
- package/apps/agents-server/src/constants/defaultAgentAvatarVisual.ts +4 -3
- package/apps/agents-server/src/database/metadataDefaults.ts +1 -1
- package/apps/agents-server/src/database/migrate.ts +25 -1
- package/apps/agents-server/src/database/migratePrefix.ts +24 -0
- package/apps/agents-server/src/database/runDatabaseMigrations.ts +9 -1
- package/apps/agents-server/src/instrumentation-node.ts +15 -0
- package/apps/agents-server/src/languages/ServerTranslationKeys.ts +1 -0
- package/apps/agents-server/src/languages/translations/czech.yaml +1 -0
- package/apps/agents-server/src/languages/translations/english.yaml +1 -0
- package/apps/agents-server/src/{components/Homepage → utils/agentOrganization}/hiddenFolders.ts +49 -29
- package/apps/agents-server/src/utils/backup/createServerBackupZipStream.ts +7 -1382
- package/apps/agents-server/src/utils/backup/serverBackup/appendAgentBackupEntriesToZip.ts +27 -0
- package/apps/agents-server/src/utils/backup/serverBackup/appendConversationBackupEntriesToZip.ts +140 -0
- package/apps/agents-server/src/utils/backup/serverBackup/appendFileBackupEntriesToZip.ts +147 -0
- package/apps/agents-server/src/utils/backup/serverBackup/appendMessageBackupEntriesToZip.ts +65 -0
- package/apps/agents-server/src/utils/backup/serverBackup/appendMetadataBackupEntriesToZip.ts +39 -0
- package/apps/agents-server/src/utils/backup/serverBackup/appendSectionEntriesToZip.ts +92 -0
- package/apps/agents-server/src/utils/backup/serverBackup/appendUserBackupEntriesToZip.ts +80 -0
- package/apps/agents-server/src/utils/backup/serverBackup/createRedactedWalletBackupRecord.ts +34 -0
- package/apps/agents-server/src/utils/backup/serverBackup/createServerBackupManifest.ts +82 -0
- package/apps/agents-server/src/utils/backup/serverBackup/downloadBackupBinaryContent.ts +39 -0
- package/apps/agents-server/src/utils/backup/serverBackup/resolveFeedbackThreadMessages.ts +53 -0
- package/apps/agents-server/src/utils/backup/serverBackup/serverBackupAttachments.ts +151 -0
- package/apps/agents-server/src/utils/backup/serverBackup/serverBackupContext.ts +167 -0
- package/apps/agents-server/src/utils/backup/serverBackup/serverBackupFilenames.ts +161 -0
- package/apps/agents-server/src/utils/backup/serverBackup/serverBackupPreviews.ts +97 -0
- package/apps/agents-server/src/utils/backup/serverBackup/serverBackupRowUtilities.ts +158 -0
- package/apps/agents-server/src/utils/backup/serverBackup/serverBackupTypes.ts +59 -0
- package/apps/agents-server/src/utils/chat/createAttachmentAwareCitationLabelResolver.ts +147 -0
- package/apps/agents-server/src/utils/chatTasksAdmin.ts +1 -1
- package/apps/agents-server/src/utils/externalChatRunner/processExternalUserChatJob.ts +11 -5
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/GetAdminChatTasksData.ts +12 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/adminChatTaskSqlQuery.ts +264 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/adminChatTaskSqlValues.ts +35 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/adminChatTaskTimeUtilities.ts +30 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/compareAdminChatTasks.ts +135 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/createAdminChatTaskCounters.ts +29 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/filterAdminChatTasks.ts +78 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/getAdminChatTasksViaClientSql.ts +62 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/getAdminChatTasksViaSupabaseQuery.ts +29 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/loadAdminChatTaskFallbackData.ts +193 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskFallbackRows.ts +99 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskSqlRows.ts +94 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks.ts +4 -947
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/mapVpsSelfUpdateJobToAdminChatTask.ts +18 -5
- package/apps/agents-server/src/utils/getAdminChatTasksResponse.ts +57 -21
- package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +20 -5
- package/apps/agents-server/src/utils/pagePreviewBrowserSessions.ts +13 -1
- package/apps/agents-server/src/utils/resourceMonitor/formatResourceMonitorValue.ts +50 -0
- package/apps/agents-server/src/utils/resourceMonitor/readCpuResourceUsage.ts +75 -0
- package/apps/agents-server/src/utils/resourceMonitor/readDiskResourceUsage.ts +42 -0
- package/apps/agents-server/src/utils/resourceMonitor/readMemoryResourceUsage.ts +28 -0
- package/apps/agents-server/src/utils/resourceMonitor/readNetworkResourceUsage.ts +271 -0
- package/apps/agents-server/src/utils/resourceMonitor/readServerResourceMonitorSnapshot.ts +47 -0
- package/apps/agents-server/src/utils/resourceMonitor/resolveServerResourceWarningStatus.ts +72 -0
- package/apps/agents-server/src/utils/resourceMonitor/resourceMonitorConstants.ts +29 -0
- package/apps/agents-server/src/utils/resourceMonitor/resourceMonitorTypes.ts +155 -0
- package/apps/agents-server/src/utils/resourceMonitor/waitForResourceMonitorSample.ts +11 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/createShibbolethSamlClient.ts +35 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/createShibbolethServiceProviderMetadataXml.ts +25 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/extractShibbolethProfileAttributes.ts +173 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/fetchIdentityProviderMetadataXml.ts +21 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/findOrCreateShibbolethUser.ts +323 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/getShibbolethAuthenticationAttemptTableName.ts +13 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/getShibbolethRequestDetails.ts +19 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/getShibbolethUserIdentityTableName.ts +13 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/parseIdentityProviderMetadataXml.ts +110 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/recordShibbolethAuthenticationAttempt.ts +57 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/resolveShibbolethAuthenticationConfiguration.ts +78 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/resolveShibbolethPublicRequestUrl.ts +101 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/resolveShibbolethServiceProviderUrls.ts +63 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/sanitizeShibbolethRelayState.ts +17 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/shibbolethAuthenticationConstants.ts +62 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication/shibbolethAuthenticationTypes.ts +105 -0
- package/apps/agents-server/src/utils/shibbolethAuthentication.ts +25 -957
- package/apps/agents-server/src/utils/taskTerminal/resolveAdminTaskTerminalSession.ts +322 -0
- package/apps/agents-server/src/utils/taskTerminal/runWithTaskTerminalCapture.ts +134 -0
- package/apps/agents-server/src/utils/taskTerminal/taskTerminalLog.ts +360 -0
- package/apps/agents-server/src/utils/userChat/finalizeUserChatJob.ts +16 -0
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/updateUserChatTimeoutTerminalState.ts +3 -0
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutWorker.ts +4 -1
- package/apps/agents-server/src/utils/vpsConfiguration.ts +4 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/deleteVpsSelfUpdateInstalledVersion.ts +81 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/listVpsSelfUpdateCandidateCommits.ts +217 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/readPersistedVpsSelfUpdateJob.ts +310 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/readVpsSelfUpdateOverview.ts +178 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/resolveVpsSelfUpdateJobForOverview.ts +42 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/startVpsSelfUpdate.ts +201 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateAutomaticConfiguration.ts +152 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateConfiguration.ts +81 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateCron.ts +357 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateEnvironment.ts +120 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateInstalledVersions.ts +162 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateJobConstants.ts +15 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateJobHistory.ts +387 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateJobIdentity.ts +26 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateOriginRepository.ts +90 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateRepository.ts +286 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateScheduler.ts +191 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateStateFiles.ts +197 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateTypes.ts +452 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate.ts +66 -1547
- package/esm/apps/agents-server/src/database/migratePrefix.d.ts +19 -0
- package/esm/apps/agents-server/src/database/runDatabaseMigrations.d.ts +4 -0
- package/esm/book/scripts/import-markdown/increaseHeadings.d.ts +8 -0
- package/esm/index.es.js +28566 -27913
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages/MultipleAgentAutoPuller.d.ts +27 -0
- package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages/MultipleAgentGithubSynchronizer.d.ts +26 -0
- package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages/MultipleAgentRunUiPresenter.d.ts +66 -0
- package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages/RunMultipleAgentMessageTaskScheduler.d.ts +67 -0
- package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages/formatProjectPath.d.ts +6 -0
- package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages/loadLocalAgentRunnerProjectSummaries.d.ts +11 -0
- package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages/wait.d.ts +6 -0
- package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeSessionResurrection.d.ts +37 -0
- package/esm/scripts/run-codex-prompts/runners/claude-code/parseClaudeCodeOutputEvents.d.ts +47 -0
- package/esm/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +6 -4
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +30 -5
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +7 -1
- package/esm/scripts/run-codex-prompts/ui/coderRunUiRefresh.d.ts +2 -2
- package/esm/src/_packages/types.index.d.ts +2 -2
- package/esm/src/avatars/renderAvatarVisualAsciiArt.d.ts +24 -1
- package/esm/src/avatars/visuals/octopus3dAvatarVisualShared.d.ts +1 -1
- package/esm/src/book-components/BookEditor/BookEditorMonacoUploadPanel.d.ts +1 -1
- package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/bookEditorMonacoUploadTypes.d.ts +120 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/clearScheduledTimer.d.ts +6 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/enqueueFilesForUpload.d.ts +26 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadEditorSync.d.ts +23 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadItemsState.d.ts +21 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadProgressQueue.d.ts +12 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadQueue.d.ts +27 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/useCompletedUploadsAutoClear.d.ts +12 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads.d.ts +5 -58
- package/esm/src/book-components/Chat/Chat/ChatImageAttachmentModal.d.ts +25 -0
- package/esm/src/book-components/Chat/Chat/ChatInputArea.d.ts +3 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageAttachments.d.ts +27 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -1
- package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +8 -0
- package/esm/src/book-components/Chat/Chat/useChatInputAreaComposer.d.ts +12 -0
- package/esm/src/book-components/Chat/Chat/useChatInputAreaComposer.draftMessage.test.d.ts +2 -0
- package/esm/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +1 -1
- package/esm/src/book-components/Chat/utils/parseMessageButtons.d.ts +16 -2
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_BUILD_CACHE_FILENAME.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_BUILD_CACHE_VERSION.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_NEXT_BUILD_ID_FILENAME.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/AgentsServerBuildCache.d.ts +10 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/AgentsServerBuildCacheOptions.d.ts +10 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/NODE_MODULES_DIRECTORY_NAME.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/PreparedAgentsServerRuntime.d.ts +18 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerBuildSourceFingerprint.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +28 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/ensureAgentsServerBuild.d.ts +19 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/getAgentsServerBuildInputRelativePaths.d.ts +11 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerAppPath.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerAppPathMaterialized.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerBuildCacheCurrent.d.ts +7 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerBuildInputTestFile.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerBuildInputDirectoryName.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerBuildInputPath.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerRuntimeSourcePath.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isFile.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isPathInsideNodeModules.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/normalizeAgentsServerBuildInputPath.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/prepareAgentsServerRuntime.d.ts +9 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/readAgentsServerBuildCache.d.ts +8 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerAppPath.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerBuildAppPath.d.ts +9 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerBuildOutputPath.d.ts +7 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/resolveNextCliPath.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/resolveNodeModulesPath.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/runNextBuild.d.ts +12 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/shouldCopyAgentsServerRuntimePath.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/synchronizeMaterializedAgentsServerRuntime.d.ts +11 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/writeAgentsServerBuildCache.d.ts +7 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +8 -109
- package/esm/src/cli/cli-commands/agents-server/ensureAgentsServerEnvFile.d.ts +1 -1
- package/esm/src/cli/cli-commands/agents-server/ensureAgentsServerGitignoreFile.d.ts +1 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.d.ts +16 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerLogStreams.d.ts +30 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerRuntimePaths.d.ts +19 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerSupervisorState.d.ts +37 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/LocalAgentRunnerLimits.d.ts +9 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/PreparedAgentsServerLaunch.d.ts +13 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/StartAgentsServerOptions.d.ts +24 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/createInternalRouteErrorMessage.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/createLocalAgentRunOptions.d.ts +9 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/forwardChildOutput.d.ts +13 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/loadAgentsServerProjectEnvironment.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/prepareAgentsServerLaunch.d.ts +18 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/readInternalRouteErrorDetails.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/resolveAgentsServerChildHostname.d.ts +7 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/startNextServer.d.ts +20 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/startUserChatJobWorkerPump.d.ts +15 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/stopChildProcess.d.ts +8 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/waitForLocalAgentRunnerLimits.d.ts +16 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +3 -30
- package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +1 -1
- package/esm/src/collection/agent-collection/CreateAgentInput.d.ts +1 -1
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +1 -1
- package/esm/src/commitments/META/META.d.ts +2 -2
- package/esm/src/commitments/META_AVATAR/META_AVATAR.d.ts +9 -4
- package/esm/src/commitments/index.d.ts +1 -1
- package/esm/src/conversion/validation/validatePipeline/createPipelineValidationContext.d.ts +16 -0
- package/esm/src/conversion/validation/validatePipeline/validatePipelineCollectionsStructure.d.ts +7 -0
- package/esm/src/conversion/validation/validatePipeline/validatePipelineDependencyResolution.d.ts +7 -0
- package/esm/src/conversion/validation/validatePipeline/validatePipelineMetadata.d.ts +7 -0
- package/esm/src/conversion/validation/validatePipeline/validatePipelineParameters.d.ts +7 -0
- package/esm/src/conversion/validation/validatePipeline/validatePipelineTasks.d.ts +7 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/RegisteredLlmToolsMessageContext.d.ts +46 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/USED_ENV_FILENAME.d.ts +11 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolConfigurationStatusMessage.d.ts +7 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolEntryKey.d.ts +7 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolInstallationStatusMessage.d.ts +7 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolStatus.d.ts +14 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolsMessageContext.d.ts +7 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/getAvailableRegisteredLlmToolsEnvironmentVariables.d.ts +7 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/getRegisteredLlmToolRegisters.d.ts +7 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/hasRegisteredLlmToolEntry.d.ts +7 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/listRegisteredLlmToolEntries.d.ts +9 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/listRegisteredLlmToolStatuses.d.ts +7 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderAvailableRegisteredLlmTools.d.ts +7 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderNoRegisteredLlmToolsMessage.d.ts +7 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderRegisteredLlmToolsMessage.d.ts +8 -0
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderRelevantRegisteredLlmToolsEnvironmentVariables.d.ts +7 -0
- package/esm/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +2 -2
- package/esm/src/utils/color/Color.d.ts +1 -1
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/_packages/types.index.ts +2 -2
- package/src/avatars/Avatar.tsx +2 -13
- package/src/avatars/renderAvatarVisual.ts +2 -13
- package/src/avatars/renderAvatarVisualAsciiArt.ts +137 -18
- package/src/avatars/visuals/asciiOctopusAvatarVisual.ts +1 -6
- package/src/avatars/visuals/avatarVisualRegistry.ts +1 -1
- package/src/avatars/visuals/minecraft2AvatarVisual.ts +1 -2
- package/src/avatars/visuals/octopus2AvatarVisual.ts +1 -5
- package/src/avatars/visuals/octopus3AvatarVisual.ts +1 -8
- package/src/avatars/visuals/octopus3d2AvatarVisual.ts +4 -13
- package/src/avatars/visuals/octopus3d3AvatarVisual.ts +4 -13
- package/src/avatars/visuals/octopus3d4AvatarVisual.ts +4 -13
- package/src/avatars/visuals/octopus3dAvatarVisual.ts +3 -3
- package/src/avatars/visuals/octopus3dAvatarVisualShared.ts +2 -7
- package/src/book-2.0/agent-source/parseAgentSource/applyMetaCommitment.ts +2 -1
- package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +3 -5
- package/src/book-3.0/CliAgent.ts +1 -7
- package/src/book-3.0/LiteAgent.ts +5 -5
- package/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.tsx +1 -4
- package/src/book-components/BookEditor/BookEditor.tsx +2 -2
- package/src/book-components/BookEditor/BookEditorAboutPromptbookInformation.tsx +3 -2
- package/src/book-components/BookEditor/BookEditorActionbar.tsx +1 -1
- package/src/book-components/BookEditor/BookEditorMonaco.tsx +2 -2
- package/src/book-components/BookEditor/BookEditorMonacoUploadPanel.tsx +1 -1
- package/src/book-components/BookEditor/useBookEditorMonacoLanguage.ts +1 -1
- package/src/book-components/BookEditor/useBookEditorMonacoStyles.ts +1 -1
- package/src/book-components/BookEditor/useBookEditorMonacoUploads/bookEditorMonacoUploadTypes.ts +147 -0
- package/src/book-components/BookEditor/useBookEditorMonacoUploads/clearScheduledTimer.ts +10 -0
- package/src/book-components/BookEditor/useBookEditorMonacoUploads/enqueueFilesForUpload.ts +209 -0
- package/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadEditorSync.ts +164 -0
- package/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadItemsState.ts +121 -0
- package/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadProgressQueue.ts +81 -0
- package/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadQueue.ts +360 -0
- package/src/book-components/BookEditor/useBookEditorMonacoUploads/useCompletedUploadsAutoClear.ts +47 -0
- package/src/book-components/BookEditor/useBookEditorMonacoUploads.ts +10 -1067
- package/src/book-components/Chat/Chat/Chat.module.css +159 -0
- package/src/book-components/Chat/Chat/Chat.tsx +16 -1
- package/src/book-components/Chat/Chat/ChatCitationModal.tsx +2 -2
- package/src/book-components/Chat/Chat/ChatImageAttachmentModal.tsx +108 -0
- package/src/book-components/Chat/Chat/ChatInputArea.tsx +43 -27
- package/src/book-components/Chat/Chat/ChatMessageAttachments.tsx +212 -0
- package/src/book-components/Chat/Chat/ChatMessageItem.tsx +32 -18
- package/src/book-components/Chat/Chat/ChatMessageList.tsx +3 -0
- package/src/book-components/Chat/Chat/ChatProps.tsx +9 -0
- package/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.tsx +1 -5
- package/src/book-components/Chat/Chat/useChatInputAreaComposer.ts +59 -7
- package/src/book-components/Chat/Chat/useChatInputAreaDictation.ts +7 -7
- package/src/book-components/Chat/Chat/useChatToolCallModalState.ts +1 -4
- package/src/book-components/Chat/hooks/useChatRatings.ts +1 -1
- package/src/book-components/Chat/save/html/htmlSaveFormatDefinition.ts +2 -3
- package/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.ts +2 -2
- package/src/book-components/Chat/save/pdf/buildChatPdf.ts +1 -1
- package/src/book-components/Chat/utils/getToolCallChipletInfo.ts +1 -5
- package/src/book-components/Chat/utils/isVisibleChatToolCall.ts +2 -1
- package/src/book-components/Chat/utils/parseMessageButtons.ts +27 -2
- package/src/cli/cli-commands/about.ts +1 -1
- package/src/cli/cli-commands/agent/agentCliOptions.ts +2 -5
- package/src/cli/cli-commands/agent-folder/agentProjectPaths.ts +6 -12
- package/src/cli/cli-commands/agent-folder/init.ts +3 -8
- package/src/cli/cli-commands/agent-folder/initializeAgentProjectConfiguration.ts +2 -11
- package/src/cli/cli-commands/agent-folder/printAgentInitializationSummary.ts +2 -9
- package/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_BUILD_CACHE_FILENAME.ts +6 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_BUILD_CACHE_VERSION.ts +6 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_NEXT_BUILD_ID_FILENAME.ts +6 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/AgentsServerBuildCache.ts +11 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/AgentsServerBuildCacheOptions.ts +9 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/NODE_MODULES_DIRECTORY_NAME.ts +6 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/PreparedAgentsServerRuntime.ts +19 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerBuildSourceFingerprint.ts +71 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.ts +69 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/ensureAgentsServerBuild.ts +59 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/getAgentsServerBuildInputRelativePaths.ts +23 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerAppPath.ts +20 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerAppPathMaterialized.ts +17 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerBuildCacheCurrent.ts +27 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerBuildInputTestFile.ts +21 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerBuildInputDirectoryName.ts +22 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerBuildInputPath.ts +30 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerRuntimeSourcePath.ts +41 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/isFile.ts +14 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/isPathInsideNodeModules.ts +10 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/normalizeAgentsServerBuildInputPath.ts +10 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/prepareAgentsServerRuntime.ts +31 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/readAgentsServerBuildCache.ts +35 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerAppPath.ts +33 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerBuildAppPath.ts +30 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerBuildOutputPath.ts +19 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/resolveNextCliPath.ts +21 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/resolveNodeModulesPath.ts +19 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/runNextBuild.ts +184 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/shouldCopyAgentsServerRuntimePath.ts +48 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/synchronizeMaterializedAgentsServerRuntime.ts +179 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/writeAgentsServerBuildCache.ts +28 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer.ts +22 -1045
- package/src/cli/cli-commands/agents-server/ensureAgentsServerEnvFile.ts +2 -1
- package/src/cli/cli-commands/agents-server/ensureAgentsServerGitignoreFile.ts +2 -1
- package/src/cli/cli-commands/agents-server/run.ts +2 -5
- package/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.ts +67 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerLogStreams.ts +43 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerRuntimePaths.ts +44 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerSupervisorState.ts +59 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/LocalAgentRunnerLimits.ts +9 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/PreparedAgentsServerLaunch.ts +14 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/StartAgentsServerOptions.ts +26 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/createInternalRouteErrorMessage.ts +15 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/createLocalAgentRunOptions.ts +29 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/forwardChildOutput.ts +32 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/loadAgentsServerProjectEnvironment.ts +18 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/prepareAgentsServerLaunch.ts +81 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/readInternalRouteErrorDetails.ts +52 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/resolveAgentsServerChildHostname.ts +17 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/startNextServer.ts +97 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/startUserChatJobWorkerPump.ts +132 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/stopChildProcess.ts +14 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/waitForLocalAgentRunnerLimits.ts +132 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer.ts +24 -797
- package/src/cli/cli-commands/agents-server.ts +2 -6
- package/src/cli/cli-commands/coder/agentCodingFile.ts +1 -7
- package/src/cli/cli-commands/coder/generate-boilerplates.ts +2 -6
- package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +2 -7
- package/src/cli/cli-commands/coder/server.ts +4 -2
- package/src/cli/cli-commands/common/promptRunnerCliOptions.ts +3 -8
- package/src/cli/cli-commands/make.ts +1 -1
- package/src/cli/cli-commands/run/runCommandAction.ts +1 -1
- package/src/collection/agent-collection/CreateAgentInput.ts +2 -5
- package/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.ts +1 -1
- package/src/commitments/MEMORY/createMemoryToolFunctions.ts +1 -10
- package/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.ts +1 -10
- package/src/commitments/MEMORY/parseMemoryToolArgs.ts +1 -6
- package/src/commitments/META/META.ts +4 -4
- package/src/commitments/META_AVATAR/META_AVATAR.ts +16 -10
- package/src/commitments/USE_CALENDAR/createUseCalendarToolFunctions.ts +1 -4
- package/src/commitments/USE_PROJECT/createUseProjectToolFunctions.ts +2 -10
- package/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.ts +1 -11
- package/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.ts +1 -6
- package/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.ts +1 -6
- package/src/commitments/WALLET/createWalletToolFunctions.ts +2 -11
- package/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.ts +1 -6
- package/src/commitments/WALLET/parseWalletToolArgs.ts +1 -10
- package/src/commitments/index.ts +1 -0
- package/src/conversion/parsePipeline/applyPipelineHead.ts +1 -1
- package/src/conversion/parsePipeline/createUniqueSectionNameResolver.ts +1 -1
- package/src/conversion/parsePipeline/processPipelineSection.ts +1 -1
- package/src/conversion/validation/validatePipeline/createPipelineValidationContext.ts +43 -0
- package/src/conversion/validation/validatePipeline/validatePipelineCollectionsStructure.ts +72 -0
- package/src/conversion/validation/validatePipeline/validatePipelineDependencyResolution.ts +220 -0
- package/src/conversion/validation/validatePipeline/validatePipelineMetadata.ts +66 -0
- package/src/conversion/validation/validatePipeline/validatePipelineParameters.ts +136 -0
- package/src/conversion/validation/validatePipeline/validatePipelineTasks.ts +243 -0
- package/src/conversion/validation/validatePipeline.ts +7 -750
- package/src/execution/LlmExecutionTools.ts +1 -6
- package/src/execution/createPipelineExecutor/getReservedParametersForTask.ts +1 -5
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/RegisteredLlmToolsMessageContext.ts +51 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/USED_ENV_FILENAME.ts +30 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolConfigurationStatusMessage.ts +62 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolEntryKey.ts +10 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolInstallationStatusMessage.ts +75 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolStatus.ts +101 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolsMessageContext.ts +24 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/getAvailableRegisteredLlmToolsEnvironmentVariables.ts +17 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/getRegisteredLlmToolRegisters.ts +15 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/hasRegisteredLlmToolEntry.ts +19 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/listRegisteredLlmToolEntries.ts +44 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/listRegisteredLlmToolStatuses.ts +21 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderAvailableRegisteredLlmTools.ts +97 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderNoRegisteredLlmToolsMessage.ts +17 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderRegisteredLlmToolsMessage.ts +30 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderRelevantRegisteredLlmToolsEnvironmentVariables.ts +32 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage.ts +5 -568
- package/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.ts +1 -6
- package/src/llm-providers/openai/OpenAiAgentKitExecutionTools.ts +2 -2
- package/src/llm-providers/openai/OpenAiAssistantExecutionTools.ts +1 -1
- package/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.ts +2 -2
- package/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.ts +1 -1
- package/src/llm-providers/openai/OpenAiCompatibleExecutionTools.ts +2 -7
- package/src/llm-providers/openai/utils/OpenAiCompatibleChatPromptBuilder.ts +1 -1
- package/src/llm-providers/openai/utils/OpenAiCompatibleChatToolCaller.ts +2 -2
- package/src/llm-providers/openai/utils/OpenAiCompatibleUnsupportedParameterRetrier.ts +1 -5
- package/src/llm-providers/openai/utils/buildToolInvocationScript.ts +1 -6
- package/src/other/templates/getTemplatesPipelineCollection.ts +705 -791
- package/src/remote-server/startRemoteServer/registerExecutionRoutes.ts +1 -1
- package/src/remote-server/startRemoteServer/registerServerIndexRoute.ts +1 -1
- package/src/scrapers/_common/utils/makeKnowledgeSourceHandler.ts +1 -6
- package/src/speech-recognition/OpenAiSpeechRecognition.ts +1 -6
- package/src/transpilers/_common/prepareSdkTranspilerContext.ts +1 -4
- package/src/types/Prompt.ts +1 -7
- package/src/types/string_host.ts +1 -9
- package/src/types/string_pipeline_url.ts +1 -4
- package/src/utils/agents/resolveAgentAvatarImageUrl.ts +2 -2
- package/src/utils/color/Color.ts +2 -2
- package/src/utils/markdown/parseMarkdownSection.ts +1 -5
- package/src/utils/random/$randomFullnameWithColor.ts +1 -6
- package/src/version.ts +2 -2
- package/src/versions.txt +2 -1
- package/umd/apps/agents-server/src/database/migratePrefix.d.ts +19 -0
- package/umd/apps/agents-server/src/database/runDatabaseMigrations.d.ts +4 -0
- package/umd/book/scripts/import-markdown/increaseHeadings.d.ts +8 -0
- package/umd/index.umd.js +28568 -27915
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages/MultipleAgentAutoPuller.d.ts +27 -0
- package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages/MultipleAgentGithubSynchronizer.d.ts +26 -0
- package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages/MultipleAgentRunUiPresenter.d.ts +66 -0
- package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages/RunMultipleAgentMessageTaskScheduler.d.ts +67 -0
- package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages/formatProjectPath.d.ts +6 -0
- package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages/loadLocalAgentRunnerProjectSummaries.d.ts +11 -0
- package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages/wait.d.ts +6 -0
- package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeSessionResurrection.d.ts +37 -0
- package/umd/scripts/run-codex-prompts/runners/claude-code/parseClaudeCodeOutputEvents.d.ts +47 -0
- package/umd/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +6 -4
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +30 -5
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +7 -1
- package/umd/scripts/run-codex-prompts/ui/coderRunUiRefresh.d.ts +2 -2
- package/umd/src/_packages/types.index.d.ts +2 -2
- package/umd/src/avatars/renderAvatarVisualAsciiArt.d.ts +24 -1
- package/umd/src/avatars/visuals/octopus3dAvatarVisualShared.d.ts +1 -1
- package/umd/src/book-components/BookEditor/BookEditorMonacoUploadPanel.d.ts +1 -1
- package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/bookEditorMonacoUploadTypes.d.ts +120 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/clearScheduledTimer.d.ts +6 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/enqueueFilesForUpload.d.ts +26 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadEditorSync.d.ts +23 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadItemsState.d.ts +21 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadProgressQueue.d.ts +12 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadQueue.d.ts +27 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/useCompletedUploadsAutoClear.d.ts +12 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads.d.ts +5 -58
- package/umd/src/book-components/Chat/Chat/ChatImageAttachmentModal.d.ts +25 -0
- package/umd/src/book-components/Chat/Chat/ChatInputArea.d.ts +3 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageAttachments.d.ts +27 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -1
- package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +8 -0
- package/umd/src/book-components/Chat/Chat/useChatInputAreaComposer.d.ts +12 -0
- package/umd/src/book-components/Chat/Chat/useChatInputAreaComposer.draftMessage.test.d.ts +2 -0
- package/umd/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +1 -1
- package/umd/src/book-components/Chat/utils/parseMessageButtons.d.ts +16 -2
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_BUILD_CACHE_FILENAME.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_BUILD_CACHE_VERSION.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_NEXT_BUILD_ID_FILENAME.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/AgentsServerBuildCache.d.ts +10 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/AgentsServerBuildCacheOptions.d.ts +10 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/NODE_MODULES_DIRECTORY_NAME.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/PreparedAgentsServerRuntime.d.ts +18 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerBuildSourceFingerprint.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +28 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/ensureAgentsServerBuild.d.ts +19 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/getAgentsServerBuildInputRelativePaths.d.ts +11 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerAppPath.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerAppPathMaterialized.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerBuildCacheCurrent.d.ts +7 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerBuildInputTestFile.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerBuildInputDirectoryName.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerBuildInputPath.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerRuntimeSourcePath.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isFile.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isPathInsideNodeModules.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/normalizeAgentsServerBuildInputPath.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/prepareAgentsServerRuntime.d.ts +9 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/readAgentsServerBuildCache.d.ts +8 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerAppPath.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerBuildAppPath.d.ts +9 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerBuildOutputPath.d.ts +7 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/resolveNextCliPath.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/resolveNodeModulesPath.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/runNextBuild.d.ts +12 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/shouldCopyAgentsServerRuntimePath.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/synchronizeMaterializedAgentsServerRuntime.d.ts +11 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/writeAgentsServerBuildCache.d.ts +7 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +8 -109
- package/umd/src/cli/cli-commands/agents-server/ensureAgentsServerEnvFile.d.ts +1 -1
- package/umd/src/cli/cli-commands/agents-server/ensureAgentsServerGitignoreFile.d.ts +1 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.d.ts +16 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerLogStreams.d.ts +30 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerRuntimePaths.d.ts +19 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerSupervisorState.d.ts +37 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/LocalAgentRunnerLimits.d.ts +9 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/PreparedAgentsServerLaunch.d.ts +13 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/StartAgentsServerOptions.d.ts +24 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/createInternalRouteErrorMessage.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/createLocalAgentRunOptions.d.ts +9 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/forwardChildOutput.d.ts +13 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/loadAgentsServerProjectEnvironment.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/prepareAgentsServerLaunch.d.ts +18 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/readInternalRouteErrorDetails.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/resolveAgentsServerChildHostname.d.ts +7 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/startNextServer.d.ts +20 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/startUserChatJobWorkerPump.d.ts +15 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/stopChildProcess.d.ts +8 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/waitForLocalAgentRunnerLimits.d.ts +16 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +3 -30
- package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +1 -1
- package/umd/src/collection/agent-collection/CreateAgentInput.d.ts +1 -1
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +1 -1
- package/umd/src/commitments/META/META.d.ts +2 -2
- package/umd/src/commitments/META_AVATAR/META_AVATAR.d.ts +9 -4
- package/umd/src/commitments/index.d.ts +1 -1
- package/umd/src/conversion/validation/validatePipeline/createPipelineValidationContext.d.ts +16 -0
- package/umd/src/conversion/validation/validatePipeline/validatePipelineCollectionsStructure.d.ts +7 -0
- package/umd/src/conversion/validation/validatePipeline/validatePipelineDependencyResolution.d.ts +7 -0
- package/umd/src/conversion/validation/validatePipeline/validatePipelineMetadata.d.ts +7 -0
- package/umd/src/conversion/validation/validatePipeline/validatePipelineParameters.d.ts +7 -0
- package/umd/src/conversion/validation/validatePipeline/validatePipelineTasks.d.ts +7 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/RegisteredLlmToolsMessageContext.d.ts +46 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/USED_ENV_FILENAME.d.ts +11 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolConfigurationStatusMessage.d.ts +7 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolEntryKey.d.ts +7 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolInstallationStatusMessage.d.ts +7 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolStatus.d.ts +14 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolsMessageContext.d.ts +7 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/getAvailableRegisteredLlmToolsEnvironmentVariables.d.ts +7 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/getRegisteredLlmToolRegisters.d.ts +7 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/hasRegisteredLlmToolEntry.d.ts +7 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/listRegisteredLlmToolEntries.d.ts +9 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/listRegisteredLlmToolStatuses.d.ts +7 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderAvailableRegisteredLlmTools.d.ts +7 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderNoRegisteredLlmToolsMessage.d.ts +7 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderRegisteredLlmToolsMessage.d.ts +8 -0
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderRelevantRegisteredLlmToolsEnvironmentVariables.d.ts +7 -0
- package/umd/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +2 -2
- package/umd/src/utils/color/Color.d.ts +1 -1
- package/umd/src/version.d.ts +1 -1
- package/apps/agents-server/src/utils/userChat/createUserChatRunnerProgressCard.ts +0 -57
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { spaceTrim } from 'spacetrim';
|
|
2
|
+
import { LOOP_LIMIT } from '../../../config';
|
|
3
|
+
import { RESERVED_PARAMETER_NAMES } from '../../../constants';
|
|
4
|
+
import { PipelineLogicError } from '../../../errors/PipelineLogicError';
|
|
5
|
+
import { UnexpectedError } from '../../../errors/UnexpectedError';
|
|
6
|
+
import type { PipelineJson } from '../../../pipeline/PipelineJson/PipelineJson';
|
|
7
|
+
import type { TaskJson } from '../../../pipeline/PipelineJson/TaskJson';
|
|
8
|
+
import type { string_name, string_reserved_parameter_name } from '../../../types/string_name';
|
|
9
|
+
import type { PipelineValidationContext } from './createPipelineValidationContext';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Shared state for one dependency-resolution validation pass.
|
|
13
|
+
*
|
|
14
|
+
* @private type of `validatePipelineDependencyResolution`
|
|
15
|
+
*/
|
|
16
|
+
type PipelineDependencyResolutionState = {
|
|
17
|
+
resolvedParameterNames: ReadonlyArray<string_name>;
|
|
18
|
+
unresolvedTasks: ReadonlyArray<TaskJson>;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Validates that task dependencies can be resolved without cycles or missing definitions.
|
|
23
|
+
*
|
|
24
|
+
* @private function of `validatePipeline`
|
|
25
|
+
*/
|
|
26
|
+
export function validatePipelineDependencyResolution({
|
|
27
|
+
pipeline,
|
|
28
|
+
pipelineIdentification,
|
|
29
|
+
}: PipelineValidationContext): void {
|
|
30
|
+
let dependencyResolutionState = createInitialDependencyResolutionState(pipeline);
|
|
31
|
+
let loopLimit = LOOP_LIMIT;
|
|
32
|
+
|
|
33
|
+
while (hasUnresolvedTasks(dependencyResolutionState)) {
|
|
34
|
+
if (loopLimit-- < 0) {
|
|
35
|
+
throw createDependencyResolutionLoopLimitError(pipelineIdentification);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
dependencyResolutionState = resolveNextDependencyResolutionState(
|
|
39
|
+
dependencyResolutionState,
|
|
40
|
+
pipelineIdentification,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Collects the parameter names that are already resolvable before dependency traversal starts.
|
|
47
|
+
*
|
|
48
|
+
* @private internal utility of `validatePipelineDependencyResolution`
|
|
49
|
+
*/
|
|
50
|
+
function createInitialDependencyResolutionState(
|
|
51
|
+
pipeline: Pick<PipelineJson, 'parameters' | 'tasks'>,
|
|
52
|
+
): PipelineDependencyResolutionState {
|
|
53
|
+
return {
|
|
54
|
+
resolvedParameterNames: createInitiallyResolvedParameterNames(pipeline),
|
|
55
|
+
unresolvedTasks: [...pipeline.tasks],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Checks whether dependency resolution still has tasks left to process.
|
|
61
|
+
*
|
|
62
|
+
* @private internal utility of `validatePipelineDependencyResolution`
|
|
63
|
+
*/
|
|
64
|
+
function hasUnresolvedTasks({ unresolvedTasks }: PipelineDependencyResolutionState): boolean {
|
|
65
|
+
return unresolvedTasks.length > 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Resolves the next batch of currently satisfiable tasks.
|
|
70
|
+
*
|
|
71
|
+
* @private internal utility of `validatePipelineDependencyResolution`
|
|
72
|
+
*/
|
|
73
|
+
function resolveNextDependencyResolutionState(
|
|
74
|
+
dependencyResolutionState: PipelineDependencyResolutionState,
|
|
75
|
+
pipelineIdentification: string,
|
|
76
|
+
): PipelineDependencyResolutionState {
|
|
77
|
+
const currentlyResolvedTasks = getCurrentlyResolvedTasks(
|
|
78
|
+
dependencyResolutionState.unresolvedTasks,
|
|
79
|
+
dependencyResolutionState.resolvedParameterNames,
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
if (currentlyResolvedTasks.length === 0) {
|
|
83
|
+
throw createUnresolvedTasksError(
|
|
84
|
+
dependencyResolutionState.unresolvedTasks,
|
|
85
|
+
dependencyResolutionState.resolvedParameterNames,
|
|
86
|
+
pipelineIdentification,
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
resolvedParameterNames: appendResolvedTaskParameterNames(
|
|
92
|
+
dependencyResolutionState.resolvedParameterNames,
|
|
93
|
+
currentlyResolvedTasks,
|
|
94
|
+
),
|
|
95
|
+
unresolvedTasks: dependencyResolutionState.unresolvedTasks.filter(
|
|
96
|
+
(task) => !currentlyResolvedTasks.includes(task),
|
|
97
|
+
),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Collects the parameter names that are already resolvable before dependency traversal starts.
|
|
103
|
+
*
|
|
104
|
+
* @private internal utility of `validatePipelineDependencyResolution`
|
|
105
|
+
*/
|
|
106
|
+
function createInitiallyResolvedParameterNames(pipeline: Pick<PipelineJson, 'parameters'>): ReadonlyArray<string_name> {
|
|
107
|
+
let resolvedParameterNames: ReadonlyArray<string_name> = pipeline.parameters
|
|
108
|
+
.filter(({ isInput }) => isInput)
|
|
109
|
+
.map(({ name }) => name);
|
|
110
|
+
|
|
111
|
+
for (const reservedParameterName of RESERVED_PARAMETER_NAMES) {
|
|
112
|
+
resolvedParameterNames = [...resolvedParameterNames, reservedParameterName];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return resolvedParameterNames;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Adds newly resolved task outputs to the resolved parameter list.
|
|
120
|
+
*
|
|
121
|
+
* @private internal utility of `validatePipelineDependencyResolution`
|
|
122
|
+
*/
|
|
123
|
+
function appendResolvedTaskParameterNames(
|
|
124
|
+
resolvedParameterNames: ReadonlyArray<string_name>,
|
|
125
|
+
currentlyResolvedTasks: ReadonlyArray<TaskJson>,
|
|
126
|
+
): ReadonlyArray<string_name> {
|
|
127
|
+
return [
|
|
128
|
+
...resolvedParameterNames,
|
|
129
|
+
...currentlyResolvedTasks.map(({ resultingParameterName }) => resultingParameterName),
|
|
130
|
+
];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Selects tasks whose dependencies are already resolved.
|
|
135
|
+
*
|
|
136
|
+
* @private internal utility of `validatePipelineDependencyResolution`
|
|
137
|
+
*/
|
|
138
|
+
function getCurrentlyResolvedTasks(
|
|
139
|
+
unresolvedTasks: ReadonlyArray<TaskJson>,
|
|
140
|
+
resolvedParameterNames: ReadonlyArray<string_name>,
|
|
141
|
+
): ReadonlyArray<TaskJson> {
|
|
142
|
+
return unresolvedTasks.filter((task) =>
|
|
143
|
+
task.dependentParameterNames.every((name) => resolvedParameterNames.includes(name)),
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Creates the unexpected loop-limit error for dependency resolution.
|
|
149
|
+
*
|
|
150
|
+
* @private internal utility of `validatePipelineDependencyResolution`
|
|
151
|
+
*/
|
|
152
|
+
function createDependencyResolutionLoopLimitError(pipelineIdentification: string): UnexpectedError {
|
|
153
|
+
// Note: Really UnexpectedError not LimitReachedError - this should not happen and be caught below
|
|
154
|
+
return new UnexpectedError(
|
|
155
|
+
spaceTrim(
|
|
156
|
+
(block) => `
|
|
157
|
+
Loop limit reached during detection of circular dependencies in \`validatePipeline\`
|
|
158
|
+
|
|
159
|
+
${block(pipelineIdentification)}
|
|
160
|
+
`,
|
|
161
|
+
),
|
|
162
|
+
// <- TODO: [🚞]
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Creates the detailed error for unresolved or circular task dependencies.
|
|
168
|
+
*
|
|
169
|
+
* @private internal utility of `validatePipelineDependencyResolution`
|
|
170
|
+
*/
|
|
171
|
+
function createUnresolvedTasksError(
|
|
172
|
+
unresolvedTasks: ReadonlyArray<TaskJson>,
|
|
173
|
+
resolvedParameterNames: ReadonlyArray<string_name>,
|
|
174
|
+
pipelineIdentification: string,
|
|
175
|
+
): PipelineLogicError {
|
|
176
|
+
return new PipelineLogicError(
|
|
177
|
+
// TODO: [🐎] DRY
|
|
178
|
+
spaceTrim(
|
|
179
|
+
(block) => `
|
|
180
|
+
|
|
181
|
+
Can not resolve some parameters:
|
|
182
|
+
Either you are using a parameter that is not defined, or there are some circular dependencies.
|
|
183
|
+
|
|
184
|
+
${block(pipelineIdentification)}
|
|
185
|
+
|
|
186
|
+
**Can not resolve:**
|
|
187
|
+
${block(
|
|
188
|
+
unresolvedTasks
|
|
189
|
+
.map(
|
|
190
|
+
({ resultingParameterName, dependentParameterNames }) =>
|
|
191
|
+
`- Parameter \`{${resultingParameterName}}\` which depends on ${dependentParameterNames
|
|
192
|
+
.map((dependentParameterName) => `\`{${dependentParameterName}}\``)
|
|
193
|
+
.join(' and ')}`,
|
|
194
|
+
)
|
|
195
|
+
.join('\n'),
|
|
196
|
+
)}
|
|
197
|
+
|
|
198
|
+
**Resolved:**
|
|
199
|
+
${block(
|
|
200
|
+
resolvedParameterNames
|
|
201
|
+
.filter((name) => !RESERVED_PARAMETER_NAMES.includes(name as string_reserved_parameter_name))
|
|
202
|
+
.map((name) => `- Parameter \`{${name}}\``)
|
|
203
|
+
.join('\n'),
|
|
204
|
+
)}
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
**Reserved (which are available):**
|
|
208
|
+
${block(
|
|
209
|
+
resolvedParameterNames
|
|
210
|
+
.filter((name) => RESERVED_PARAMETER_NAMES.includes(name as string_reserved_parameter_name))
|
|
211
|
+
.map((name) => `- Parameter \`{${name}}\``)
|
|
212
|
+
.join('\n'),
|
|
213
|
+
)}
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
`,
|
|
217
|
+
// <- TODO: [🚞]
|
|
218
|
+
),
|
|
219
|
+
);
|
|
220
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { spaceTrim } from 'spacetrim';
|
|
2
|
+
import { PipelineLogicError } from '../../../errors/PipelineLogicError';
|
|
3
|
+
import type { PipelineJson } from '../../../pipeline/PipelineJson/PipelineJson';
|
|
4
|
+
import { isValidPromptbookVersion } from '../../../utils/validators/semanticVersion/isValidPromptbookVersion';
|
|
5
|
+
import { isValidPipelineUrl } from '../../../utils/validators/url/isValidPipelineUrl';
|
|
6
|
+
import type { PipelineValidationContext } from './createPipelineValidationContext';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Validates pipeline-level metadata fields.
|
|
10
|
+
*
|
|
11
|
+
* @private function of `validatePipeline`
|
|
12
|
+
*/
|
|
13
|
+
export function validatePipelineMetadata({ pipeline, pipelineIdentification }: PipelineValidationContext): void {
|
|
14
|
+
validatePipelineUrl(pipeline, pipelineIdentification);
|
|
15
|
+
validatePipelineBookVersion(pipeline, pipelineIdentification);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Validates the pipeline URL, when present.
|
|
20
|
+
*
|
|
21
|
+
* @private internal utility of `validatePipelineMetadata`
|
|
22
|
+
*/
|
|
23
|
+
function validatePipelineUrl(pipeline: Pick<PipelineJson, 'pipelineUrl'>, pipelineIdentification: string): void {
|
|
24
|
+
if (pipeline.pipelineUrl === undefined || isValidPipelineUrl(pipeline.pipelineUrl)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// <- Note: [🚲]
|
|
29
|
+
throw new PipelineLogicError(
|
|
30
|
+
spaceTrim(
|
|
31
|
+
(block) => `
|
|
32
|
+
Invalid promptbook URL "${pipeline.pipelineUrl}"
|
|
33
|
+
|
|
34
|
+
${block(pipelineIdentification)}
|
|
35
|
+
`,
|
|
36
|
+
),
|
|
37
|
+
// <- TODO: [🐠]
|
|
38
|
+
// <- TODO: [🚞]
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Validates the Promptbook version, when present.
|
|
44
|
+
*
|
|
45
|
+
* @private internal utility of `validatePipelineMetadata`
|
|
46
|
+
*/
|
|
47
|
+
function validatePipelineBookVersion(
|
|
48
|
+
pipeline: Pick<PipelineJson, 'bookVersion'>,
|
|
49
|
+
pipelineIdentification: string,
|
|
50
|
+
): void {
|
|
51
|
+
if (pipeline.bookVersion === undefined || isValidPromptbookVersion(pipeline.bookVersion)) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// <- Note: [🚲]
|
|
56
|
+
throw new PipelineLogicError(
|
|
57
|
+
spaceTrim(
|
|
58
|
+
(block) => `
|
|
59
|
+
Invalid Promptbook Version "${pipeline.bookVersion}"
|
|
60
|
+
|
|
61
|
+
${block(pipelineIdentification)}
|
|
62
|
+
`,
|
|
63
|
+
),
|
|
64
|
+
// <- TODO: [🚞]
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { spaceTrim } from 'spacetrim';
|
|
2
|
+
import { PipelineLogicError } from '../../../errors/PipelineLogicError';
|
|
3
|
+
import type { ParameterJson } from '../../../pipeline/PipelineJson/ParameterJson';
|
|
4
|
+
import type { PipelineJson } from '../../../pipeline/PipelineJson/PipelineJson';
|
|
5
|
+
import type { TaskJson } from '../../../pipeline/PipelineJson/TaskJson';
|
|
6
|
+
import type { PipelineValidationContext } from './createPipelineValidationContext';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Validates all pipeline parameter declarations.
|
|
10
|
+
*
|
|
11
|
+
* @private function of `validatePipeline`
|
|
12
|
+
*/
|
|
13
|
+
export function validatePipelineParameters({ pipeline, pipelineIdentification }: PipelineValidationContext): void {
|
|
14
|
+
for (const parameter of pipeline.parameters) {
|
|
15
|
+
validatePipelineParameter(parameter, pipeline, pipelineIdentification);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Validates one pipeline parameter declaration.
|
|
21
|
+
*
|
|
22
|
+
* @private internal utility of `validatePipelineParameters`
|
|
23
|
+
*/
|
|
24
|
+
function validatePipelineParameter(
|
|
25
|
+
parameter: ParameterJson,
|
|
26
|
+
pipeline: Pick<PipelineJson, 'tasks'>,
|
|
27
|
+
pipelineIdentification: string,
|
|
28
|
+
): void {
|
|
29
|
+
validateParameterDirection(parameter, pipelineIdentification);
|
|
30
|
+
validateParameterUsage(parameter, pipeline, pipelineIdentification);
|
|
31
|
+
validateParameterDefinition(parameter, pipeline, pipelineIdentification);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Validates that one parameter does not declare incompatible directions.
|
|
36
|
+
*
|
|
37
|
+
* @private internal utility of `validatePipelineParameters`
|
|
38
|
+
*/
|
|
39
|
+
function validateParameterDirection(parameter: ParameterJson, pipelineIdentification: string): void {
|
|
40
|
+
if (!parameter.isInput || !parameter.isOutput) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const parameterName = (parameter as ParameterJson).name;
|
|
45
|
+
|
|
46
|
+
throw new PipelineLogicError(
|
|
47
|
+
spaceTrim(
|
|
48
|
+
(block) => `
|
|
49
|
+
|
|
50
|
+
Parameter \`{${parameterName}}\` can not be both input and output
|
|
51
|
+
|
|
52
|
+
${block(pipelineIdentification)}
|
|
53
|
+
`,
|
|
54
|
+
),
|
|
55
|
+
// <- Note: [🆑]
|
|
56
|
+
// <- TODO: [🚞]
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Validates that one intermediate parameter is actually consumed by at least one task.
|
|
62
|
+
*
|
|
63
|
+
* @private internal utility of `validatePipelineParameters`
|
|
64
|
+
*/
|
|
65
|
+
function validateParameterUsage(
|
|
66
|
+
parameter: ParameterJson,
|
|
67
|
+
pipeline: Pick<PipelineJson, 'tasks'>,
|
|
68
|
+
pipelineIdentification: string,
|
|
69
|
+
): void {
|
|
70
|
+
if (parameter.isInput || parameter.isOutput || isParameterUsedByAnyTask(parameter, pipeline.tasks)) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
throw new PipelineLogicError(
|
|
75
|
+
spaceTrim(
|
|
76
|
+
(block) => `
|
|
77
|
+
Parameter \`{${parameter.name}}\` is created but not used
|
|
78
|
+
|
|
79
|
+
You can declare {${parameter.name}} as output parameter by adding in the header:
|
|
80
|
+
- OUTPUT PARAMETER \`{${parameter.name}}\` ${parameter.description || ''}
|
|
81
|
+
|
|
82
|
+
${block(pipelineIdentification)}
|
|
83
|
+
|
|
84
|
+
`,
|
|
85
|
+
),
|
|
86
|
+
// <- TODO: [🚞]
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Validates that one non-input parameter is produced by at least one task.
|
|
92
|
+
*
|
|
93
|
+
* @private internal utility of `validatePipelineParameters`
|
|
94
|
+
*/
|
|
95
|
+
function validateParameterDefinition(
|
|
96
|
+
parameter: ParameterJson,
|
|
97
|
+
pipeline: Pick<PipelineJson, 'tasks'>,
|
|
98
|
+
pipelineIdentification: string,
|
|
99
|
+
): void {
|
|
100
|
+
if (parameter.isInput || isParameterDefinedByAnyTask(parameter, pipeline.tasks)) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
throw new PipelineLogicError(
|
|
105
|
+
spaceTrim(
|
|
106
|
+
(block) => `
|
|
107
|
+
Parameter \`{${parameter.name}}\` is declared but not defined
|
|
108
|
+
|
|
109
|
+
You can do one of these:
|
|
110
|
+
1) Remove declaration of \`{${parameter.name}}\`
|
|
111
|
+
2) Add task that results in \`-> {${parameter.name}}\`
|
|
112
|
+
|
|
113
|
+
${block(pipelineIdentification)}
|
|
114
|
+
`,
|
|
115
|
+
),
|
|
116
|
+
// <- TODO: [🚞]
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Checks whether one parameter is consumed by at least one task dependency list.
|
|
122
|
+
*
|
|
123
|
+
* @private internal utility of `validatePipelineParameters`
|
|
124
|
+
*/
|
|
125
|
+
function isParameterUsedByAnyTask(parameter: ParameterJson, tasks: ReadonlyArray<TaskJson>): boolean {
|
|
126
|
+
return tasks.some((task) => task.dependentParameterNames.includes(parameter.name));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Checks whether one parameter is produced by at least one task.
|
|
131
|
+
*
|
|
132
|
+
* @private internal utility of `validatePipelineParameters`
|
|
133
|
+
*/
|
|
134
|
+
function isParameterDefinedByAnyTask(parameter: ParameterJson, tasks: ReadonlyArray<TaskJson>): boolean {
|
|
135
|
+
return tasks.some((task) => task.resultingParameterName === parameter.name);
|
|
136
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { spaceTrim } from 'spacetrim';
|
|
2
|
+
import { RESERVED_PARAMETER_NAMES } from '../../../constants';
|
|
3
|
+
import { PipelineLogicError } from '../../../errors/PipelineLogicError';
|
|
4
|
+
import type { PipelineJson } from '../../../pipeline/PipelineJson/PipelineJson';
|
|
5
|
+
import type { TaskJson } from '../../../pipeline/PipelineJson/TaskJson';
|
|
6
|
+
import type { string_name, string_reserved_parameter_name } from '../../../types/string_name';
|
|
7
|
+
import type { PipelineValidationContext } from './createPipelineValidationContext';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Validates all pipeline tasks and their per-task invariants.
|
|
11
|
+
*
|
|
12
|
+
* @private function of `validatePipeline`
|
|
13
|
+
*/
|
|
14
|
+
export function validatePipelineTasks({ pipeline, pipelineIdentification }: PipelineValidationContext): void {
|
|
15
|
+
// Note: All input parameters are defined - so that they can be used as result of some task
|
|
16
|
+
const definedParameters = createInitiallyDefinedParameters(pipeline);
|
|
17
|
+
|
|
18
|
+
for (const task of pipeline.tasks) {
|
|
19
|
+
validatePipelineTask(task, definedParameters, pipelineIdentification);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Collects the parameter names that are already defined before task validation starts.
|
|
25
|
+
*
|
|
26
|
+
* @private internal utility of `validatePipelineTasks`
|
|
27
|
+
*/
|
|
28
|
+
function createInitiallyDefinedParameters(pipeline: Pick<PipelineJson, 'parameters'>): Set<string> {
|
|
29
|
+
return new Set(pipeline.parameters.filter(({ isInput }) => isInput).map(({ name }) => name));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Validates one pipeline task and its invariants.
|
|
34
|
+
*
|
|
35
|
+
* @private internal utility of `validatePipelineTasks`
|
|
36
|
+
*/
|
|
37
|
+
function validatePipelineTask(task: TaskJson, definedParameters: Set<string>, pipelineIdentification: string): void {
|
|
38
|
+
validateTaskResultingParameter(task, definedParameters, pipelineIdentification);
|
|
39
|
+
validateTaskJokers(task, pipelineIdentification);
|
|
40
|
+
validateTaskExpectations(task, pipelineIdentification);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Validates one task result parameter declaration and marks it as defined.
|
|
45
|
+
*
|
|
46
|
+
* @private internal utility of `validatePipelineTasks`
|
|
47
|
+
*/
|
|
48
|
+
function validateTaskResultingParameter(
|
|
49
|
+
task: TaskJson,
|
|
50
|
+
definedParameters: Set<string>,
|
|
51
|
+
pipelineIdentification: string,
|
|
52
|
+
): void {
|
|
53
|
+
if (definedParameters.has(task.resultingParameterName)) {
|
|
54
|
+
throw new PipelineLogicError(
|
|
55
|
+
spaceTrim(
|
|
56
|
+
(block) => `
|
|
57
|
+
Parameter \`{${task.resultingParameterName}}\` is defined multiple times
|
|
58
|
+
|
|
59
|
+
${block(pipelineIdentification)}
|
|
60
|
+
`,
|
|
61
|
+
),
|
|
62
|
+
// <- TODO: [🚞]
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (RESERVED_PARAMETER_NAMES.includes(task.resultingParameterName as string_reserved_parameter_name)) {
|
|
67
|
+
throw new PipelineLogicError(
|
|
68
|
+
spaceTrim(
|
|
69
|
+
(block) => `
|
|
70
|
+
Parameter name {${task.resultingParameterName}} is reserved, please use different name
|
|
71
|
+
|
|
72
|
+
${block(pipelineIdentification)}
|
|
73
|
+
`,
|
|
74
|
+
),
|
|
75
|
+
|
|
76
|
+
// <- TODO: [🚞]
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
definedParameters.add(task.resultingParameterName);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Validates joker parameters for one task.
|
|
85
|
+
*
|
|
86
|
+
* @private internal utility of `validatePipelineTasks`
|
|
87
|
+
*/
|
|
88
|
+
function validateTaskJokers(task: TaskJson, pipelineIdentification: string): void {
|
|
89
|
+
if (!hasTaskJokers(task)) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
validateTaskSupportsJokers(task, pipelineIdentification);
|
|
94
|
+
validateTaskJokerDependencies(task, pipelineIdentification);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Checks whether one task declares any joker parameters.
|
|
99
|
+
*
|
|
100
|
+
* @private internal utility of `validatePipelineTasks`
|
|
101
|
+
*/
|
|
102
|
+
function hasTaskJokers(task: TaskJson): task is TaskJson & { jokerParameterNames: ReadonlyArray<string_name> } {
|
|
103
|
+
return !!task.jokerParameterNames && task.jokerParameterNames.length > 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Validates that a task has the required supporting features when using jokers.
|
|
108
|
+
*
|
|
109
|
+
* @private internal utility of `validatePipelineTasks`
|
|
110
|
+
*/
|
|
111
|
+
function validateTaskSupportsJokers(task: TaskJson, pipelineIdentification: string): void {
|
|
112
|
+
if (task.format || task.expectations /* <- TODO: Require at least 1 -> min <- expectation to use jokers */) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
throw new PipelineLogicError(
|
|
117
|
+
spaceTrim(
|
|
118
|
+
(block) => `
|
|
119
|
+
Joker parameters are used for {${task.resultingParameterName}} but no expectations are defined
|
|
120
|
+
|
|
121
|
+
${block(pipelineIdentification)}
|
|
122
|
+
`,
|
|
123
|
+
),
|
|
124
|
+
// <- TODO: [🚞]
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Validates that every joker parameter is also listed among task dependencies.
|
|
130
|
+
*
|
|
131
|
+
* @private internal utility of `validatePipelineTasks`
|
|
132
|
+
*/
|
|
133
|
+
function validateTaskJokerDependencies(
|
|
134
|
+
task: TaskJson & { jokerParameterNames: ReadonlyArray<string_name> },
|
|
135
|
+
pipelineIdentification: string,
|
|
136
|
+
): void {
|
|
137
|
+
for (const joker of task.jokerParameterNames) {
|
|
138
|
+
if (task.dependentParameterNames.includes(joker)) {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
throw new PipelineLogicError(
|
|
143
|
+
spaceTrim(
|
|
144
|
+
(block) => `
|
|
145
|
+
Parameter \`{${joker}}\` is used for {${
|
|
146
|
+
task.resultingParameterName
|
|
147
|
+
}} as joker but not in \`dependentParameterNames\`
|
|
148
|
+
|
|
149
|
+
${block(pipelineIdentification)}
|
|
150
|
+
`,
|
|
151
|
+
),
|
|
152
|
+
// <- TODO: [🚞]
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Validates all expectation bounds configured on one task.
|
|
159
|
+
*
|
|
160
|
+
* @private internal utility of `validatePipelineTasks`
|
|
161
|
+
*/
|
|
162
|
+
function validateTaskExpectations(task: TaskJson, pipelineIdentification: string): void {
|
|
163
|
+
if (!task.expectations) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
for (const [unit, { min, max }] of Object.entries(task.expectations)) {
|
|
168
|
+
validateTaskExpectationRange(unit, min, max, pipelineIdentification);
|
|
169
|
+
validateTaskExpectationMin(unit, min, pipelineIdentification);
|
|
170
|
+
validateTaskExpectationMax(unit, max, pipelineIdentification);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Validates the minimum and maximum expectation ordering for one unit.
|
|
176
|
+
*
|
|
177
|
+
* @private internal utility of `validatePipelineTasks`
|
|
178
|
+
*/
|
|
179
|
+
function validateTaskExpectationRange(
|
|
180
|
+
unit: string,
|
|
181
|
+
min: number | undefined,
|
|
182
|
+
max: number | undefined,
|
|
183
|
+
pipelineIdentification: string,
|
|
184
|
+
): void {
|
|
185
|
+
if (min === undefined || max === undefined || min <= max) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
throw new PipelineLogicError(
|
|
190
|
+
spaceTrim(
|
|
191
|
+
(block) => `
|
|
192
|
+
Min expectation (=${min}) of ${unit} is higher than max expectation (=${max})
|
|
193
|
+
|
|
194
|
+
${block(pipelineIdentification)}
|
|
195
|
+
`,
|
|
196
|
+
),
|
|
197
|
+
// <- TODO: [🚞]
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Validates the minimum expectation bound for one unit.
|
|
203
|
+
*
|
|
204
|
+
* @private internal utility of `validatePipelineTasks`
|
|
205
|
+
*/
|
|
206
|
+
function validateTaskExpectationMin(unit: string, min: number | undefined, pipelineIdentification: string): void {
|
|
207
|
+
if (min === undefined || min >= 0) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
throw new PipelineLogicError(
|
|
212
|
+
spaceTrim(
|
|
213
|
+
(block) => `
|
|
214
|
+
Min expectation of ${unit} must be zero or positive
|
|
215
|
+
|
|
216
|
+
${block(pipelineIdentification)}
|
|
217
|
+
`,
|
|
218
|
+
),
|
|
219
|
+
// <- TODO: [🚞]
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Validates the maximum expectation bound for one unit.
|
|
225
|
+
*
|
|
226
|
+
* @private internal utility of `validatePipelineTasks`
|
|
227
|
+
*/
|
|
228
|
+
function validateTaskExpectationMax(unit: string, max: number | undefined, pipelineIdentification: string): void {
|
|
229
|
+
if (max === undefined || max > 0) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
throw new PipelineLogicError(
|
|
234
|
+
spaceTrim(
|
|
235
|
+
(block) => `
|
|
236
|
+
Max expectation of ${unit} must be positive
|
|
237
|
+
|
|
238
|
+
${block(pipelineIdentification)}
|
|
239
|
+
`,
|
|
240
|
+
),
|
|
241
|
+
// <- TODO: [🚞]
|
|
242
|
+
);
|
|
243
|
+
}
|