@promptbook/cli 0.113.0-8 → 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/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 +692 -774
- 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 +1 -0
- 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,35 @@
|
|
|
1
|
+
import { readFile } from 'fs/promises';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { AGENTS_SERVER_BUILD_CACHE_FILENAME } from './AGENTS_SERVER_BUILD_CACHE_FILENAME';
|
|
4
|
+
import { AGENTS_SERVER_BUILD_CACHE_VERSION } from './AGENTS_SERVER_BUILD_CACHE_VERSION';
|
|
5
|
+
import type { AgentsServerBuildCache } from './AgentsServerBuildCache';
|
|
6
|
+
import type { AgentsServerBuildCacheOptions } from './AgentsServerBuildCacheOptions';
|
|
7
|
+
import { resolveAgentsServerBuildOutputPath } from './resolveAgentsServerBuildOutputPath';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Reads and validates cached build metadata.
|
|
11
|
+
*
|
|
12
|
+
* @private internal utility of `buildAgentsServer`
|
|
13
|
+
*/
|
|
14
|
+
export async function readAgentsServerBuildCache(
|
|
15
|
+
options: AgentsServerBuildCacheOptions,
|
|
16
|
+
): Promise<AgentsServerBuildCache | undefined> {
|
|
17
|
+
try {
|
|
18
|
+
const serializedBuildCache = await readFile(
|
|
19
|
+
join(resolveAgentsServerBuildOutputPath(options), AGENTS_SERVER_BUILD_CACHE_FILENAME),
|
|
20
|
+
'utf-8',
|
|
21
|
+
);
|
|
22
|
+
const buildCache = JSON.parse(serializedBuildCache) as Partial<AgentsServerBuildCache>;
|
|
23
|
+
|
|
24
|
+
if (
|
|
25
|
+
buildCache.version !== AGENTS_SERVER_BUILD_CACHE_VERSION ||
|
|
26
|
+
typeof buildCache.sourceFingerprint !== 'string'
|
|
27
|
+
) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return buildCache as AgentsServerBuildCache;
|
|
32
|
+
} catch {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
import { spaceTrim } from 'spacetrim';
|
|
3
|
+
import { NotAllowed } from '../../../../errors/NotAllowed';
|
|
4
|
+
import { isAgentsServerAppPath } from './isAgentsServerAppPath';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Finds the Agents Server app in a source checkout or generated CLI package.
|
|
8
|
+
*
|
|
9
|
+
* @private internal utility of `buildAgentsServer`
|
|
10
|
+
*/
|
|
11
|
+
export async function resolveAgentsServerAppPath(): Promise<string> {
|
|
12
|
+
const candidates = [
|
|
13
|
+
join(process.cwd(), 'apps', 'agents-server'),
|
|
14
|
+
join(__dirname, '..', '..', '..', '..', '..', 'apps', 'agents-server'),
|
|
15
|
+
join(__dirname, '..', '..', '..', 'apps', 'agents-server'),
|
|
16
|
+
join(__dirname, '..', '..', 'apps', 'agents-server'),
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
for (const candidate of candidates) {
|
|
20
|
+
if (await isAgentsServerAppPath(candidate)) {
|
|
21
|
+
return candidate;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
throw new NotAllowed(
|
|
26
|
+
spaceTrim(`
|
|
27
|
+
Cannot find the bundled Agents Server app.
|
|
28
|
+
|
|
29
|
+
Checked:
|
|
30
|
+
${candidates.map((candidate) => `- \`${candidate}\``).join('\n')}
|
|
31
|
+
`),
|
|
32
|
+
);
|
|
33
|
+
}
|
package/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerBuildAppPath.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { join, resolve } from 'path';
|
|
2
|
+
import { resolvePromptbookTemporaryPath } from '../../../../utils/filesystem/promptbookTemporaryPath';
|
|
3
|
+
import { isPathInsideNodeModules } from './isPathInsideNodeModules';
|
|
4
|
+
import { synchronizeMaterializedAgentsServerRuntime } from './synchronizeMaterializedAgentsServerRuntime';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Uses the source checkout app directly, but copies npm-packaged app sources out of `node_modules`.
|
|
8
|
+
*
|
|
9
|
+
* @private internal utility of `buildAgentsServer`
|
|
10
|
+
*/
|
|
11
|
+
export async function resolveAgentsServerBuildAppPath(options: {
|
|
12
|
+
readonly nodeModulesPath: string;
|
|
13
|
+
readonly sourceAppPath: string;
|
|
14
|
+
}): Promise<string> {
|
|
15
|
+
if (!isPathInsideNodeModules(options.sourceAppPath)) {
|
|
16
|
+
return options.sourceAppPath;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const sourceRuntimeRootPath = resolve(options.sourceAppPath, '..', '..');
|
|
20
|
+
const materializedRuntimeRootPath = resolvePromptbookTemporaryPath(process.cwd(), 'agents-server', 'runtime');
|
|
21
|
+
|
|
22
|
+
await synchronizeMaterializedAgentsServerRuntime({
|
|
23
|
+
materializedRuntimeRootPath,
|
|
24
|
+
nodeModulesPath: options.nodeModulesPath,
|
|
25
|
+
sourceAppPath: options.sourceAppPath,
|
|
26
|
+
sourceRuntimeRootPath,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
return join(materializedRuntimeRootPath, 'apps', 'agents-server');
|
|
30
|
+
}
|
package/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerBuildOutputPath.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import type { AgentsServerBuildCacheOptions } from './AgentsServerBuildCacheOptions';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Next output directory used by the local Agents Server runtime unless Next overrides it.
|
|
6
|
+
*/
|
|
7
|
+
const DEFAULT_AGENTS_SERVER_NEXT_DIST_DIRECTORY_NAME = '.next';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Resolves the Next output directory used by a particular build environment.
|
|
11
|
+
*
|
|
12
|
+
* @private internal utility of `buildAgentsServer`
|
|
13
|
+
*/
|
|
14
|
+
export function resolveAgentsServerBuildOutputPath(options: AgentsServerBuildCacheOptions): string {
|
|
15
|
+
return resolve(
|
|
16
|
+
options.appPath,
|
|
17
|
+
options.environment?.NEXT_DIST_DIR || DEFAULT_AGENTS_SERVER_NEXT_DIST_DIRECTORY_NAME,
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { spaceTrim } from 'spacetrim';
|
|
2
|
+
import { NotAllowed } from '../../../../errors/NotAllowed';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Resolves the Next CLI module installed alongside the Promptbook CLI.
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of `buildAgentsServer`
|
|
8
|
+
*/
|
|
9
|
+
export function resolveNextCliPath(): string {
|
|
10
|
+
try {
|
|
11
|
+
return require.resolve('next/dist/bin/next');
|
|
12
|
+
} catch {
|
|
13
|
+
throw new NotAllowed(
|
|
14
|
+
spaceTrim(`
|
|
15
|
+
Cannot start Agents Server because the \`next\` package is unavailable.
|
|
16
|
+
|
|
17
|
+
Reinstall \`ptbk\` so the CLI package contains the Agents Server runtime dependencies.
|
|
18
|
+
`),
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import { NODE_MODULES_DIRECTORY_NAME } from './NODE_MODULES_DIRECTORY_NAME';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Resolves the dependency root that contains the installed Next CLI.
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of `buildAgentsServer`
|
|
8
|
+
*/
|
|
9
|
+
export function resolveNodeModulesPath(nextCliPath: string): string {
|
|
10
|
+
const normalizedNextCliPath = nextCliPath.replace(/\\/gu, '/');
|
|
11
|
+
const marker = `/${NODE_MODULES_DIRECTORY_NAME}/next/`;
|
|
12
|
+
const markerIndex = normalizedNextCliPath.lastIndexOf(marker);
|
|
13
|
+
|
|
14
|
+
if (markerIndex === -1) {
|
|
15
|
+
return resolve(nextCliPath, '..', '..', '..');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return normalizedNextCliPath.slice(0, markerIndex + marker.length - '/next/'.length);
|
|
19
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { spawn } from 'child_process';
|
|
2
|
+
import { spaceTrim } from 'spacetrim';
|
|
3
|
+
import { NotAllowed } from '../../../../errors/NotAllowed';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Node.js heap size limit (in MiB) injected into `NODE_OPTIONS` for the Next.js production build.
|
|
7
|
+
*
|
|
8
|
+
* Next.js webpack peaks at ~1.9 GiB on a fresh install; the Node.js default cap is ~1.7 GiB,
|
|
9
|
+
* which causes an OOM crash on first-run VPS installations where swap is the primary resource.
|
|
10
|
+
* Raising the limit lets the build complete on the first attempt.
|
|
11
|
+
*/
|
|
12
|
+
const AGENTS_SERVER_BUILD_MAX_OLD_SPACE_MIB = 4096;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Maximum attempts for a Next.js build that was killed by the operating system.
|
|
16
|
+
*/
|
|
17
|
+
const AGENTS_SERVER_BUILD_MAX_ATTEMPTS = 2;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Signals that indicate the Next.js build may have been terminated by resource pressure.
|
|
21
|
+
*/
|
|
22
|
+
const RETRYABLE_NEXT_BUILD_SIGNALS = new Set<NodeJS.Signals | null>(['SIGKILL', null]);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Exit status reported by one spawned Next.js build child process.
|
|
26
|
+
*/
|
|
27
|
+
type NextBuildExitStatus = {
|
|
28
|
+
readonly code: number | null;
|
|
29
|
+
readonly signal: NodeJS.Signals | null;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Runs the finite Next production build used by local Agents Server commands.
|
|
34
|
+
*
|
|
35
|
+
* @private internal utility of `buildAgentsServer`
|
|
36
|
+
*/
|
|
37
|
+
export async function runNextBuild(options: {
|
|
38
|
+
readonly appPath: string;
|
|
39
|
+
readonly environment: NodeJS.ProcessEnv;
|
|
40
|
+
readonly nextCliPath: string;
|
|
41
|
+
readonly onBuildOutput?: (chunk: string) => void;
|
|
42
|
+
}): Promise<void> {
|
|
43
|
+
for (let attempt = 1; attempt <= AGENTS_SERVER_BUILD_MAX_ATTEMPTS; attempt++) {
|
|
44
|
+
const exitStatus = await runNextBuildAttempt(options);
|
|
45
|
+
|
|
46
|
+
if (exitStatus.code === 0) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (attempt < AGENTS_SERVER_BUILD_MAX_ATTEMPTS && isNextBuildTerminationRetryable(exitStatus)) {
|
|
51
|
+
forwardBuildOutput(createNextBuildRetryMessage(exitStatus, attempt + 1), options.onBuildOutput);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
throw createNextBuildExitError(exitStatus, attempt);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Runs one Next.js production build attempt and returns its exit status.
|
|
61
|
+
*/
|
|
62
|
+
async function runNextBuildAttempt(options: {
|
|
63
|
+
readonly appPath: string;
|
|
64
|
+
readonly environment: NodeJS.ProcessEnv;
|
|
65
|
+
readonly nextCliPath: string;
|
|
66
|
+
readonly onBuildOutput?: (chunk: string) => void;
|
|
67
|
+
}): Promise<NextBuildExitStatus> {
|
|
68
|
+
return await new Promise<NextBuildExitStatus>((resolveBuild, rejectBuild) => {
|
|
69
|
+
const buildProcess = spawn(process.execPath, [options.nextCliPath, 'build'], {
|
|
70
|
+
cwd: options.appPath,
|
|
71
|
+
env: createNextBuildProcessEnvironment(options.environment),
|
|
72
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
buildProcess.stdout?.on('data', (chunk) => {
|
|
76
|
+
forwardBuildOutput(chunk.toString(), options.onBuildOutput);
|
|
77
|
+
});
|
|
78
|
+
buildProcess.stderr?.on('data', (chunk) => {
|
|
79
|
+
forwardBuildOutput(chunk.toString(), options.onBuildOutput);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
buildProcess.once('error', (error) => {
|
|
83
|
+
rejectBuild(createNextBuildSpawnError(error));
|
|
84
|
+
});
|
|
85
|
+
buildProcess.once('close', (code, signal) => {
|
|
86
|
+
resolveBuild({ code, signal });
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Creates the environment passed to the spawned Next.js build process.
|
|
93
|
+
*/
|
|
94
|
+
function createNextBuildProcessEnvironment(environment: NodeJS.ProcessEnv): NodeJS.ProcessEnv {
|
|
95
|
+
return {
|
|
96
|
+
...environment,
|
|
97
|
+
NODE_OPTIONS: mergeNodeOptionsWithHeapSize(environment.NODE_OPTIONS, AGENTS_SERVER_BUILD_MAX_OLD_SPACE_MIB),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Returns true when one failed build attempt is worth retrying.
|
|
103
|
+
*/
|
|
104
|
+
function isNextBuildTerminationRetryable(exitStatus: NextBuildExitStatus): boolean {
|
|
105
|
+
return exitStatus.code === null && RETRYABLE_NEXT_BUILD_SIGNALS.has(exitStatus.signal);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Creates one visible retry message for a killed Next.js build attempt.
|
|
110
|
+
*/
|
|
111
|
+
function createNextBuildRetryMessage(exitStatus: NextBuildExitStatus, nextAttempt: number): string {
|
|
112
|
+
return `\nAgents Server Next build was terminated by ${describeNextBuildExitStatus(
|
|
113
|
+
exitStatus,
|
|
114
|
+
)}. Retrying attempt ${nextAttempt}/${AGENTS_SERVER_BUILD_MAX_ATTEMPTS}.\n`;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Creates a branded error for a failed Next.js build child process.
|
|
119
|
+
*/
|
|
120
|
+
function createNextBuildExitError(exitStatus: NextBuildExitStatus, attemptCount: number): NotAllowed {
|
|
121
|
+
const lowMemoryHint = isNextBuildTerminationRetryable(exitStatus)
|
|
122
|
+
? '\n\nThe build process was terminated by the operating system. On standalone VPS self-updates this usually means the host ran out of memory while Next.js was compiling or prerendering the app.'
|
|
123
|
+
: '';
|
|
124
|
+
|
|
125
|
+
return new NotAllowed(
|
|
126
|
+
spaceTrim(`
|
|
127
|
+
Agents Server Next production build failed.
|
|
128
|
+
|
|
129
|
+
- Exit code: \`${String(exitStatus.code)}\`
|
|
130
|
+
- Signal: \`${String(exitStatus.signal)}\`
|
|
131
|
+
- Attempts: \`${String(attemptCount)}\`
|
|
132
|
+
${lowMemoryHint}
|
|
133
|
+
`),
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Creates a branded error for failures to start the Next.js build child process.
|
|
139
|
+
*/
|
|
140
|
+
function createNextBuildSpawnError(error: Error): NotAllowed {
|
|
141
|
+
return new NotAllowed(
|
|
142
|
+
spaceTrim(`
|
|
143
|
+
Cannot start the Agents Server Next production build.
|
|
144
|
+
|
|
145
|
+
${error.message}
|
|
146
|
+
`),
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Formats one Next.js build exit status for foreground logs.
|
|
152
|
+
*/
|
|
153
|
+
function describeNextBuildExitStatus(exitStatus: NextBuildExitStatus): string {
|
|
154
|
+
if (exitStatus.signal) {
|
|
155
|
+
return `signal \`${exitStatus.signal}\``;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return `exit code \`${String(exitStatus.code)}\``;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Prepends `--max-old-space-size=<mib>` to `NODE_OPTIONS` unless the caller already set one.
|
|
163
|
+
*/
|
|
164
|
+
function mergeNodeOptionsWithHeapSize(existingNodeOptions: string | undefined, maxOldSpaceMib: number): string {
|
|
165
|
+
if (existingNodeOptions !== undefined && /--max-old-space-size[= ]/u.test(existingNodeOptions)) {
|
|
166
|
+
return existingNodeOptions;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const heapFlag = `--max-old-space-size=${maxOldSpaceMib}`;
|
|
170
|
+
|
|
171
|
+
return existingNodeOptions ? `${heapFlag} ${existingNodeOptions}` : heapFlag;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Sends one Next build output chunk through the caller handler or to the foreground terminal.
|
|
176
|
+
*/
|
|
177
|
+
function forwardBuildOutput(chunk: string, onBuildOutput: ((chunk: string) => void) | undefined): void {
|
|
178
|
+
if (onBuildOutput) {
|
|
179
|
+
onBuildOutput(chunk);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
process.stdout.write(chunk);
|
|
184
|
+
}
|
package/src/cli/cli-commands/agents-server/buildAgentsServer/shouldCopyAgentsServerRuntimePath.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { basename, relative } from 'path';
|
|
2
|
+
import { isAgentsServerBuildInputTestFile } from './isAgentsServerBuildInputTestFile';
|
|
3
|
+
import { isExcludedAgentsServerBuildInputDirectoryName } from './isExcludedAgentsServerBuildInputDirectoryName';
|
|
4
|
+
import { isExcludedAgentsServerRuntimeSourcePath } from './isExcludedAgentsServerRuntimeSourcePath';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Excludes build artifacts, dependency folders, private env files, and test sources.
|
|
8
|
+
*
|
|
9
|
+
* @private internal utility of `buildAgentsServer`
|
|
10
|
+
*/
|
|
11
|
+
export function shouldCopyAgentsServerRuntimePath(sourcePath: string, sourceRootPath: string): boolean {
|
|
12
|
+
const sourceRelativePath = relative(sourceRootPath, sourcePath).replace(/\\/gu, '/');
|
|
13
|
+
const sourceRuntimeRelativePath = normalizeRuntimeSourceRelativePath(sourcePath, sourceRootPath);
|
|
14
|
+
const sourcePathSegments = sourceRelativePath.split('/').filter(Boolean);
|
|
15
|
+
const sourceBasename = basename(sourcePath);
|
|
16
|
+
|
|
17
|
+
if (sourcePathSegments.some(isExcludedAgentsServerBuildInputDirectoryName)) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (sourcePathSegments.includes('playground')) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (isExcludedAgentsServerRuntimeSourcePath(sourceRuntimeRelativePath)) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (sourceBasename.startsWith('.env')) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return !isAgentsServerBuildInputTestFile(sourceBasename);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Normalizes a copied runtime path to the shape used inside the packaged runtime root.
|
|
38
|
+
*/
|
|
39
|
+
function normalizeRuntimeSourceRelativePath(sourcePath: string, sourceRootPath: string): string {
|
|
40
|
+
const sourceRelativePath = relative(sourceRootPath, sourcePath).replace(/\\/gu, '/');
|
|
41
|
+
const sourceRootBasename = basename(sourceRootPath);
|
|
42
|
+
|
|
43
|
+
if (!sourceRelativePath) {
|
|
44
|
+
return sourceRootBasename;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return `${sourceRootBasename}/${sourceRelativePath}`;
|
|
48
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { cp, lstat, mkdir, readFile, rm, stat, symlink, writeFile } from 'fs/promises';
|
|
2
|
+
import { dirname, join } from 'path';
|
|
3
|
+
import { spaceTrim } from 'spacetrim';
|
|
4
|
+
import { NotAllowed } from '../../../../errors/NotAllowed';
|
|
5
|
+
import { AGENTS_SERVER_BUILD_CACHE_VERSION } from './AGENTS_SERVER_BUILD_CACHE_VERSION';
|
|
6
|
+
import { createAgentsServerBuildSourceFingerprint } from './createAgentsServerBuildSourceFingerprint';
|
|
7
|
+
import { getAgentsServerBuildInputRelativePaths } from './getAgentsServerBuildInputRelativePaths';
|
|
8
|
+
import { isAgentsServerAppPath } from './isAgentsServerAppPath';
|
|
9
|
+
import { NODE_MODULES_DIRECTORY_NAME } from './NODE_MODULES_DIRECTORY_NAME';
|
|
10
|
+
import { shouldCopyAgentsServerRuntimePath } from './shouldCopyAgentsServerRuntimePath';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Runtime copy metadata filename stored in the project-local materialized app root.
|
|
14
|
+
*/
|
|
15
|
+
const AGENTS_SERVER_MATERIALIZED_RUNTIME_CACHE_FILENAME = '.ptbk-agents-server-runtime-cache.json';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Metadata persisted after copying the npm-packaged Agents Server runtime into the launch project.
|
|
19
|
+
*/
|
|
20
|
+
type AgentsServerMaterializedRuntimeCache = {
|
|
21
|
+
readonly version: typeof AGENTS_SERVER_BUILD_CACHE_VERSION;
|
|
22
|
+
readonly sourceFingerprint: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Copies the bundled runtime into the launch project when the original app lives under `node_modules`.
|
|
27
|
+
*
|
|
28
|
+
* @private internal utility of `buildAgentsServer`
|
|
29
|
+
*/
|
|
30
|
+
export async function synchronizeMaterializedAgentsServerRuntime(options: {
|
|
31
|
+
readonly materializedRuntimeRootPath: string;
|
|
32
|
+
readonly nodeModulesPath: string;
|
|
33
|
+
readonly sourceAppPath: string;
|
|
34
|
+
readonly sourceRuntimeRootPath: string;
|
|
35
|
+
}): Promise<void> {
|
|
36
|
+
const sourceFingerprint = await createAgentsServerBuildSourceFingerprint(options.sourceAppPath);
|
|
37
|
+
const runtimeCache = await readAgentsServerMaterializedRuntimeCache(options.materializedRuntimeRootPath);
|
|
38
|
+
const isRuntimeCurrent =
|
|
39
|
+
runtimeCache?.version === AGENTS_SERVER_BUILD_CACHE_VERSION &&
|
|
40
|
+
runtimeCache.sourceFingerprint === sourceFingerprint &&
|
|
41
|
+
(await isAgentsServerAppPath(join(options.materializedRuntimeRootPath, 'apps', 'agents-server')));
|
|
42
|
+
|
|
43
|
+
if (!isRuntimeCurrent) {
|
|
44
|
+
await rm(options.materializedRuntimeRootPath, { recursive: true, force: true });
|
|
45
|
+
await mkdir(options.materializedRuntimeRootPath, { recursive: true });
|
|
46
|
+
|
|
47
|
+
for (const relativeInputPath of getAgentsServerBuildInputRelativePaths()) {
|
|
48
|
+
await copyAgentsServerRuntimePath({
|
|
49
|
+
destinationPath: join(options.materializedRuntimeRootPath, relativeInputPath),
|
|
50
|
+
sourcePath: join(options.sourceRuntimeRootPath, relativeInputPath),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
await assertMaterializedAgentsServerAppExists(options.materializedRuntimeRootPath);
|
|
55
|
+
await writeAgentsServerMaterializedRuntimeCache(options.materializedRuntimeRootPath, sourceFingerprint);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
await ensureMaterializedRuntimeNodeModulesLink({
|
|
59
|
+
materializedRuntimeRootPath: options.materializedRuntimeRootPath,
|
|
60
|
+
nodeModulesPath: options.nodeModulesPath,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Verifies that the materialized runtime contains a usable Next app before caching it.
|
|
66
|
+
*/
|
|
67
|
+
async function assertMaterializedAgentsServerAppExists(materializedRuntimeRootPath: string): Promise<void> {
|
|
68
|
+
const materializedAppPath = join(materializedRuntimeRootPath, 'apps', 'agents-server');
|
|
69
|
+
|
|
70
|
+
if (await isAgentsServerAppPath(materializedAppPath)) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
throw new NotAllowed(
|
|
75
|
+
spaceTrim(`
|
|
76
|
+
Cannot prepare the bundled Agents Server runtime.
|
|
77
|
+
|
|
78
|
+
The materialized app path is missing required files:
|
|
79
|
+
\`${materializedAppPath}\`
|
|
80
|
+
`),
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Copies one source path into the materialized runtime, skipping generated or private files.
|
|
86
|
+
*/
|
|
87
|
+
async function copyAgentsServerRuntimePath(options: {
|
|
88
|
+
readonly destinationPath: string;
|
|
89
|
+
readonly sourcePath: string;
|
|
90
|
+
}): Promise<void> {
|
|
91
|
+
let sourceStats;
|
|
92
|
+
|
|
93
|
+
try {
|
|
94
|
+
sourceStats = await stat(options.sourcePath);
|
|
95
|
+
} catch {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
await mkdir(dirname(options.destinationPath), { recursive: true });
|
|
100
|
+
|
|
101
|
+
if (sourceStats.isDirectory()) {
|
|
102
|
+
await cp(options.sourcePath, options.destinationPath, {
|
|
103
|
+
recursive: true,
|
|
104
|
+
filter: (sourcePath) => shouldCopyAgentsServerRuntimePath(sourcePath, options.sourcePath),
|
|
105
|
+
});
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (sourceStats.isFile() && shouldCopyAgentsServerRuntimePath(options.sourcePath, dirname(options.sourcePath))) {
|
|
110
|
+
await cp(options.sourcePath, options.destinationPath);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Links the materialized runtime back to the package dependency tree used by the installed CLI.
|
|
116
|
+
*/
|
|
117
|
+
async function ensureMaterializedRuntimeNodeModulesLink(options: {
|
|
118
|
+
readonly materializedRuntimeRootPath: string;
|
|
119
|
+
readonly nodeModulesPath: string;
|
|
120
|
+
}): Promise<void> {
|
|
121
|
+
const nodeModulesLinkPath = join(options.materializedRuntimeRootPath, NODE_MODULES_DIRECTORY_NAME);
|
|
122
|
+
|
|
123
|
+
try {
|
|
124
|
+
const existingLinkStats = await lstat(nodeModulesLinkPath);
|
|
125
|
+
await rm(nodeModulesLinkPath, {
|
|
126
|
+
force: true,
|
|
127
|
+
recursive: existingLinkStats.isDirectory() && !existingLinkStats.isSymbolicLink(),
|
|
128
|
+
});
|
|
129
|
+
} catch {
|
|
130
|
+
// The link does not exist yet.
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
await symlink(options.nodeModulesPath, nodeModulesLinkPath, process.platform === 'win32' ? 'junction' : 'dir');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Reads and validates materialized runtime metadata.
|
|
138
|
+
*/
|
|
139
|
+
async function readAgentsServerMaterializedRuntimeCache(
|
|
140
|
+
materializedRuntimeRootPath: string,
|
|
141
|
+
): Promise<AgentsServerMaterializedRuntimeCache | undefined> {
|
|
142
|
+
try {
|
|
143
|
+
const serializedRuntimeCache = await readFile(
|
|
144
|
+
join(materializedRuntimeRootPath, AGENTS_SERVER_MATERIALIZED_RUNTIME_CACHE_FILENAME),
|
|
145
|
+
'utf-8',
|
|
146
|
+
);
|
|
147
|
+
const runtimeCache = JSON.parse(serializedRuntimeCache) as Partial<AgentsServerMaterializedRuntimeCache>;
|
|
148
|
+
|
|
149
|
+
if (
|
|
150
|
+
runtimeCache.version !== AGENTS_SERVER_BUILD_CACHE_VERSION ||
|
|
151
|
+
typeof runtimeCache.sourceFingerprint !== 'string'
|
|
152
|
+
) {
|
|
153
|
+
return undefined;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return runtimeCache as AgentsServerMaterializedRuntimeCache;
|
|
157
|
+
} catch {
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Persists the source fingerprint used for the materialized runtime copy.
|
|
164
|
+
*/
|
|
165
|
+
async function writeAgentsServerMaterializedRuntimeCache(
|
|
166
|
+
materializedRuntimeRootPath: string,
|
|
167
|
+
sourceFingerprint: string,
|
|
168
|
+
): Promise<void> {
|
|
169
|
+
const runtimeCache: AgentsServerMaterializedRuntimeCache = {
|
|
170
|
+
version: AGENTS_SERVER_BUILD_CACHE_VERSION,
|
|
171
|
+
sourceFingerprint,
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
await writeFile(
|
|
175
|
+
join(materializedRuntimeRootPath, AGENTS_SERVER_MATERIALIZED_RUNTIME_CACHE_FILENAME),
|
|
176
|
+
`${JSON.stringify(runtimeCache, null, 4)}\n`,
|
|
177
|
+
'utf-8',
|
|
178
|
+
);
|
|
179
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { mkdir, writeFile } from 'fs/promises';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { AGENTS_SERVER_BUILD_CACHE_FILENAME } from './AGENTS_SERVER_BUILD_CACHE_FILENAME';
|
|
4
|
+
import { AGENTS_SERVER_BUILD_CACHE_VERSION } from './AGENTS_SERVER_BUILD_CACHE_VERSION';
|
|
5
|
+
import type { AgentsServerBuildCache } from './AgentsServerBuildCache';
|
|
6
|
+
import type { AgentsServerBuildCacheOptions } from './AgentsServerBuildCacheOptions';
|
|
7
|
+
import { createAgentsServerBuildSourceFingerprint } from './createAgentsServerBuildSourceFingerprint';
|
|
8
|
+
import { resolveAgentsServerBuildOutputPath } from './resolveAgentsServerBuildOutputPath';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Persists the source fingerprint for the just-created production build.
|
|
12
|
+
*
|
|
13
|
+
* @private internal utility of `buildAgentsServer`
|
|
14
|
+
*/
|
|
15
|
+
export async function writeAgentsServerBuildCache(options: AgentsServerBuildCacheOptions): Promise<void> {
|
|
16
|
+
const buildOutputPath = resolveAgentsServerBuildOutputPath(options);
|
|
17
|
+
const buildCache: AgentsServerBuildCache = {
|
|
18
|
+
version: AGENTS_SERVER_BUILD_CACHE_VERSION,
|
|
19
|
+
sourceFingerprint: await createAgentsServerBuildSourceFingerprint(options.appPath),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
await mkdir(buildOutputPath, { recursive: true });
|
|
23
|
+
await writeFile(
|
|
24
|
+
join(buildOutputPath, AGENTS_SERVER_BUILD_CACHE_FILENAME),
|
|
25
|
+
`${JSON.stringify(buildCache, null, 4)}\n`,
|
|
26
|
+
'utf-8',
|
|
27
|
+
);
|
|
28
|
+
}
|