@promptbook/cli 0.113.0-1 → 0.113.0-11
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/README.md +1 -17
- package/agents/default/developer.book +3 -0
- package/apps/agents-server/next.config.ts +6 -3
- package/apps/agents-server/src/app/admin/{code-runners/CodeRunnersClient.tsx → harness-auth/HarnessAuthClient.tsx} +98 -65
- package/apps/agents-server/src/app/admin/{code-runners → harness-auth}/page.tsx +4 -4
- package/apps/agents-server/src/app/admin/resource-monitor/page.tsx +456 -0
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerClient.tsx +17 -5
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskLogActions.tsx +150 -0
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskRow.tsx +62 -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 +8 -6
- package/apps/agents-server/src/app/admin/task-manager/page.tsx +3 -2
- package/apps/agents-server/src/app/admin/update/AdvancedOriginRepositoryPanel.tsx +81 -0
- package/apps/agents-server/src/app/admin/update/AutomaticSelfUpdateConfigurationCard.tsx +90 -0
- package/apps/agents-server/src/app/admin/update/CurrentDeploymentCard.tsx +162 -0
- 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 +87 -0
- package/apps/agents-server/src/app/admin/update/TargetEnvironmentCard.tsx +331 -0
- package/apps/agents-server/src/app/admin/update/UpdateClient.tsx +35 -878
- package/apps/agents-server/src/app/admin/update/UpdateDatabaseMigrationsPanel.tsx +305 -0
- package/apps/agents-server/src/app/admin/update/UpdateJobCard.tsx +350 -0
- package/apps/agents-server/src/app/admin/update/UpdateOverview.ts +142 -0
- package/apps/agents-server/src/app/admin/update/buildDeploymentTimeBehindLabel.ts +29 -0
- package/apps/agents-server/src/app/admin/update/formatHumanReadableTimestamp.ts +18 -0
- package/apps/agents-server/src/app/admin/update/getUpdateJobFailureMessage.ts +13 -0
- package/apps/agents-server/src/app/admin/update/getUpdateJobSuccessMessage.ts +13 -0
- package/apps/agents-server/src/app/admin/update/updatePageCardClassName.ts +6 -0
- package/apps/agents-server/src/app/admin/update/useUpdateClientState.ts +675 -0
- package/apps/agents-server/src/app/agents/[agentName]/AgentChatWrapper.tsx +17 -3
- package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +13 -1
- package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatSurface.tsx +6 -2
- package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/AgentCodePageClient.tsx +14 -559
- package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/AgentCodePageHeader.tsx +84 -0
- package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/AgentCodePageSection.tsx +52 -0
- package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/GeneratedCodePreview.tsx +138 -0
- package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/GeneratedHarnessSection.tsx +98 -0
- package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/SourceBookSection.tsx +66 -0
- package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/TranspiledCodeErrorBanner.tsx +30 -0
- package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/TranspiledCodeExportWarningBanner.tsx +62 -0
- package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/Transpiler.ts +9 -0
- package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/useAgentCodeExportState.ts +478 -0
- package/apps/agents-server/src/app/api/admin/chat-tasks/[taskId]/terminal/route.ts +52 -0
- package/apps/agents-server/src/app/api/admin/{code-runners → harness-auth}/authentication/route.ts +17 -17
- package/apps/agents-server/src/app/api/admin/{code-runners → harness-auth}/route.ts +13 -13
- 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/api/page-preview/check/route.ts +20 -5
- package/apps/agents-server/src/app/api/page-preview/input/route.ts +161 -0
- package/apps/agents-server/src/app/api/page-preview/screenshot/route.ts +21 -13
- package/apps/agents-server/src/app/api/page-preview/stream/route.ts +81 -0
- package/apps/agents-server/src/app/layout.tsx +55 -25
- package/apps/agents-server/src/app/system/utilities/mocked-chats/cloneMockedChatPreset.ts +17 -0
- package/apps/agents-server/src/app/system/utilities/mocked-chats/confirmDeleteMockedChat.ts +16 -0
- package/apps/agents-server/src/app/system/utilities/mocked-chats/createDraftWithUpdatedMessage.ts +81 -0
- package/apps/agents-server/src/app/system/utilities/mocked-chats/createDraftWithUpdatedParticipant.ts +146 -0
- package/apps/agents-server/src/app/system/utilities/mocked-chats/createDraftWithUpdatedSettings.ts +19 -0
- package/apps/agents-server/src/app/system/utilities/mocked-chats/createDuplicatedDraft.ts +66 -0
- package/apps/agents-server/src/app/system/utilities/mocked-chats/findMockedChatById.ts +51 -0
- package/apps/agents-server/src/app/system/utilities/mocked-chats/persistMockedChats.ts +51 -0
- package/apps/agents-server/src/app/system/utilities/mocked-chats/useMockedChatsEditorState.ts +16 -426
- package/apps/agents-server/src/components/AdminTerminal/AdminTerminalCard.tsx +32 -24
- 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/CronJobConfiguration/CronJobConfiguration.tsx +834 -0
- package/apps/agents-server/src/components/Footer/Footer.tsx +38 -15
- package/apps/agents-server/src/components/Header/Header.tsx +16 -3
- package/apps/agents-server/src/components/Header/HeaderDesktopTopMenuNavigation.tsx +22 -2
- package/apps/agents-server/src/components/Header/HeaderHomepageLink.tsx +1 -1
- package/apps/agents-server/src/components/Header/HeaderMobileDrawer.tsx +22 -2
- package/apps/agents-server/src/components/Header/HeaderTypes.ts +12 -1
- package/apps/agents-server/src/components/Header/buildAgentMenuStructure.tsx +6 -4
- package/apps/agents-server/src/components/Header/buildDocumentationDropdownItems.tsx +198 -3
- package/apps/agents-server/src/components/Header/buildHeaderMenuItems.ts +6 -0
- package/apps/agents-server/src/components/Header/buildHeaderSystemMenuItems.ts +185 -18
- package/apps/agents-server/src/components/Homepage/buildFreeGraphBoxLayout.ts +446 -0
- package/apps/agents-server/src/components/Homepage/buildGraphLayoutNodes.ts +415 -157
- package/apps/agents-server/src/components/Homepage/useAgentsGraphCanvasState.ts +2 -1
- package/apps/agents-server/src/components/Homepage/useAgentsListState.ts +1 -1
- package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +25 -6
- package/apps/agents-server/src/constants/defaultAgentAvatarVisual.ts +4 -3
- package/apps/agents-server/src/constants/harnessAuthRoutes.ts +20 -0
- 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/database/sqlite/$provideLocalSqliteSupabase.ts +3 -1541
- package/apps/agents-server/src/database/sqlite/localSqliteSupabase/LocalSqliteQueryBuilder.ts +623 -0
- package/apps/agents-server/src/database/sqlite/localSqliteSupabase/LocalSqliteSupabaseClient.ts +64 -0
- package/apps/agents-server/src/database/sqlite/localSqliteSupabase/ensureTable.ts +93 -0
- package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteFilters.ts +202 -0
- package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteMutationPayload.ts +131 -0
- package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteRowOperations.ts +102 -0
- package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteSql.ts +59 -0
- package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteTableSchema.ts +329 -0
- package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteTypes.ts +84 -0
- package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteValueCodec.ts +63 -0
- package/apps/agents-server/src/database/sqlite/localSqliteSupabase/normalizeSqliteError.ts +22 -0
- package/apps/agents-server/src/instrumentation-node.ts +15 -0
- package/apps/agents-server/src/languages/ServerTranslationKeys.ts +2 -1
- package/apps/agents-server/src/languages/translations/czech.yaml +3 -2
- package/apps/agents-server/src/languages/translations/english.yaml +2 -1
- package/apps/agents-server/src/search/createDefaultServerSearchProviders/loadLocalOrganizationSearchDataset.ts +12 -1
- package/apps/agents-server/src/tools/send_email.ts +1 -2
- package/apps/agents-server/src/{components/Homepage → utils/agentOrganization}/hiddenFolders.ts +49 -29
- package/apps/agents-server/src/utils/agentOrganization/loadAgentOrganizationState.ts +13 -1
- 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 +3 -2
- package/apps/agents-server/src/utils/createLocalAgentSourceImporter.ts +159 -0
- package/apps/agents-server/src/utils/createMissingImportedAgentFallback.ts +60 -0
- package/apps/agents-server/src/utils/createPagePreviewBrowserStream.ts +179 -0
- package/apps/agents-server/src/utils/customDomainRouting.ts +157 -12
- package/apps/agents-server/src/utils/externalChatRunner/processExternalUserChatJob.ts +12 -6
- 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 +103 -41
- package/apps/agents-server/src/utils/{codeRunnerAuthentication.ts → harnessAuthentication.ts} +72 -56
- package/apps/agents-server/src/utils/{codeRunnerConfiguration.ts → harnessConfiguration.ts} +18 -12
- package/apps/agents-server/src/utils/importAgentWithFallback.ts +1 -58
- package/apps/agents-server/src/utils/localAgentRouteReferences.ts +167 -0
- package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +21 -6
- package/apps/agents-server/src/utils/managementApi/managementApiAgents.ts +17 -3
- package/apps/agents-server/src/utils/messages/sendMessage.ts +5 -3
- package/apps/agents-server/src/utils/pagePreviewBrowserSessions.ts +246 -0
- package/apps/agents-server/src/utils/resolveAgentStateFromSource.ts +7 -1
- package/apps/agents-server/src/utils/resolveInheritedAgentSource.ts +54 -5
- package/apps/agents-server/src/utils/resolveServerAgentContext.ts +12 -1
- package/apps/agents-server/src/utils/resolveStoredAgentState.ts +2 -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/speech-to-text/SpeechToTextFailoverRecognition/SpeechToTextFailoverRecognitionProviderRuntime.ts +0 -1
- package/apps/agents-server/src/utils/speech-to-text/SpeechToTextFailoverRecognition.ts +34 -2
- package/apps/agents-server/src/utils/taskTerminal/resolveAdminTaskTerminalSession.ts +535 -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/userChat/userChatMessageLifecycle.ts +39 -9
- 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 +7 -3
- 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/readAgentsServerFooterVersion.ts +335 -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 +490 -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/apps/agents-server/tests/e2e/support/ChatHistoryNavigationSupport.ts +5 -0
- 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 +30174 -28539
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/find-refactor-candidates/find-refactor-candidates.d.ts +7 -0
- package/esm/scripts/find-refactor-candidates/selectMostImportantRefactorCandidates.d.ts +12 -0
- 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/common/buildCoderRunProgressSnapshot.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/common/cliProgressDisplay.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/common/resolveCoderAgent.d.ts +20 -0
- package/esm/scripts/run-codex-prompts/common/sleepWithCountdown.d.ts +1 -0
- package/esm/scripts/run-codex-prompts/common/waitUntilWorldTimeDeadline.d.ts +17 -0
- 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 +8 -1
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +41 -0
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +10 -0
- 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 +98 -0
- 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/CitationIframePreview.d.ts +1 -1
- package/esm/src/book-components/Chat/Chat/CitationIframePreview.test.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/insertDictationChunk.d.ts +1 -1
- package/esm/src/book-components/Chat/Chat/insertDictationChunk.test.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/learnDictationDictionary.test.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/refineFinalDictationChunk.test.d.ts +1 -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/createPositiveIntegerOptionParser.d.ts +10 -0
- 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/agent-message-runtime/agentMessageRuntimePaths.d.ts +24 -0
- package/esm/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +2 -2
- package/esm/src/utils/agents/terminalAgentAvatarVisual.d.ts +94 -0
- package/esm/src/utils/agents/terminalAgentAvatarVisual.test.d.ts +1 -0
- package/esm/src/utils/ascii-art/$detectTerminalAnsiColorDepth.d.ts +15 -0
- package/esm/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +80 -0
- 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/avatarAnimationScheduler.ts +2 -1
- package/src/avatars/renderAvatarVisual.ts +2 -13
- package/src/avatars/renderAvatarVisualAsciiArt.ts +257 -0
- 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 +10 -15
- package/src/avatars/visuals/octopus3d4AvatarVisual.ts +18 -31
- 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 +199 -12
- 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/CitationIframePreview.tsx +108 -156
- package/src/book-components/Chat/Chat/createProgressCardChecklistMarkdown.ts +1 -8
- package/src/book-components/Chat/Chat/insertDictationChunk.ts +3 -3
- package/src/book-components/Chat/Chat/learnDictationDictionary.ts +1 -1
- 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 +140 -33
- 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 -1043
- 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/boilerplateTemplates.ts +14 -21
- package/src/cli/cli-commands/coder/find-refactor-candidates.ts +9 -2
- package/src/cli/cli-commands/coder/generate-boilerplates.ts +2 -6
- package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +2 -10
- package/src/cli/cli-commands/coder/run.ts +3 -27
- package/src/cli/cli-commands/coder/server.ts +4 -2
- package/src/cli/cli-commands/common/createPositiveIntegerOptionParser.ts +31 -0
- 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/cli/promptbookCli.ts +28 -3
- 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/TEAM/TEAM.ts +5 -5
- 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 +840 -755
- 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/agent-message-runtime/agentMessageRuntimePaths.ts +66 -0
- package/src/utils/agents/resolveAgentAvatarImageUrl.ts +2 -2
- package/src/utils/agents/terminalAgentAvatarVisual.ts +261 -0
- package/src/utils/ascii-art/$detectTerminalAnsiColorDepth.ts +45 -0
- package/src/utils/ascii-art/convertImageDataToAsciiArt.ts +396 -0
- 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 +7 -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 +30176 -28541
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/find-refactor-candidates/find-refactor-candidates.d.ts +7 -0
- package/umd/scripts/find-refactor-candidates/selectMostImportantRefactorCandidates.d.ts +12 -0
- 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/common/buildCoderRunProgressSnapshot.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/common/cliProgressDisplay.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/common/resolveCoderAgent.d.ts +20 -0
- package/umd/scripts/run-codex-prompts/common/sleepWithCountdown.d.ts +1 -0
- package/umd/scripts/run-codex-prompts/common/waitUntilWorldTimeDeadline.d.ts +17 -0
- 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 +8 -1
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +41 -0
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +10 -0
- 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 +98 -0
- 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/CitationIframePreview.d.ts +1 -1
- package/umd/src/book-components/Chat/Chat/CitationIframePreview.test.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/insertDictationChunk.d.ts +1 -1
- package/umd/src/book-components/Chat/Chat/insertDictationChunk.test.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/learnDictationDictionary.test.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/refineFinalDictationChunk.test.d.ts +1 -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/createPositiveIntegerOptionParser.d.ts +10 -0
- 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/agent-message-runtime/agentMessageRuntimePaths.d.ts +24 -0
- package/umd/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +2 -2
- package/umd/src/utils/agents/terminalAgentAvatarVisual.d.ts +94 -0
- package/umd/src/utils/agents/terminalAgentAvatarVisual.test.d.ts +1 -0
- package/umd/src/utils/ascii-art/$detectTerminalAnsiColorDepth.d.ts +15 -0
- package/umd/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +80 -0
- package/umd/src/utils/color/Color.d.ts +1 -1
- package/umd/src/version.d.ts +1 -1
- package/apps/agents-server/src/app/api/page-preview/interact/route.ts +0 -179
- package/apps/agents-server/src/app/api/page-preview/live/route.ts +0 -67
- package/apps/agents-server/src/utils/pagePreview/livePagePreviewSessions.ts +0 -365
- package/apps/agents-server/src/utils/pagePreview/resolvePagePreviewRequestUrl.ts +0 -74
- package/apps/agents-server/src/utils/userChat/createUserChatRunnerProgressCard.ts +0 -57
- package/esm/scripts/run-codex-prompts/common/resolveAgentSystemMessage.d.ts +0 -6
- package/esm/src/book-components/Chat/utils/livePagePreviewConstants.d.ts +0 -12
- package/src/book-components/Chat/utils/livePagePreviewConstants.ts +0 -17
- package/umd/scripts/run-codex-prompts/common/resolveAgentSystemMessage.d.ts +0 -6
- package/umd/src/book-components/Chat/utils/livePagePreviewConstants.d.ts +0 -12
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'async_hooks';
|
|
2
|
+
import { format } from 'util';
|
|
3
|
+
import { appendTaskTerminalLogLine } from './taskTerminalLog';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Console methods mirrored into task terminal logs.
|
|
7
|
+
*/
|
|
8
|
+
const CAPTURED_CONSOLE_LEVELS = ['debug', 'log', 'info', 'warn', 'error'] as const;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* One console level mirrored into task terminal logs.
|
|
12
|
+
*/
|
|
13
|
+
type CapturedConsoleLevel = (typeof CAPTURED_CONSOLE_LEVELS)[number];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* ANSI color prefix applied per console level so the xterm view resembles a real CLI.
|
|
17
|
+
*/
|
|
18
|
+
const CAPTURED_CONSOLE_LEVEL_ANSI_COLOR_MAP: Record<CapturedConsoleLevel, string> = {
|
|
19
|
+
debug: '\x1b[2m',
|
|
20
|
+
log: '',
|
|
21
|
+
info: '\x1b[36m',
|
|
22
|
+
warn: '\x1b[33m',
|
|
23
|
+
error: '\x1b[31m',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* ANSI style reset appended after each captured console line.
|
|
28
|
+
*/
|
|
29
|
+
const ANSI_STYLE_RESET = '\x1b[0m';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Async context carried while one task is being processed.
|
|
33
|
+
*/
|
|
34
|
+
type TaskTerminalCaptureContext = {
|
|
35
|
+
readonly taskId: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Shared mutable capture state reused across requests in the server process.
|
|
40
|
+
*/
|
|
41
|
+
type TaskTerminalCaptureState = {
|
|
42
|
+
readonly asyncLocalStorage: AsyncLocalStorage<TaskTerminalCaptureContext>;
|
|
43
|
+
isConsolePatched: boolean;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Runs one task-processing callback while mirroring its console output into the task terminal log.
|
|
48
|
+
*
|
|
49
|
+
* All `console.*` calls made anywhere in the async call tree of `callback` are still written to
|
|
50
|
+
* the real server console and are additionally appended to the in-memory terminal log of the
|
|
51
|
+
* given task, so the admin task manager can show a task-scoped CLI view in real time.
|
|
52
|
+
*
|
|
53
|
+
* @param taskId - Task identifier used by the admin task manager.
|
|
54
|
+
* @param callback - Task-processing work to run inside the capture context.
|
|
55
|
+
* @returns Result of the callback.
|
|
56
|
+
*/
|
|
57
|
+
export async function runWithTaskTerminalCapture<TResult>(
|
|
58
|
+
taskId: string,
|
|
59
|
+
callback: () => Promise<TResult> | TResult,
|
|
60
|
+
): Promise<TResult> {
|
|
61
|
+
const state = getTaskTerminalCaptureState();
|
|
62
|
+
ensureTaskCaptureConsolePatched(state);
|
|
63
|
+
|
|
64
|
+
return await state.asyncLocalStorage.run({ taskId }, async () => await callback());
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Returns the mutable singleton state for task console capturing.
|
|
69
|
+
*
|
|
70
|
+
* @returns Shared capture state.
|
|
71
|
+
*/
|
|
72
|
+
function getTaskTerminalCaptureState(): TaskTerminalCaptureState {
|
|
73
|
+
const globalState = globalThis as typeof globalThis & {
|
|
74
|
+
__promptbookTaskTerminalCaptureState?: TaskTerminalCaptureState;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
if (!globalState.__promptbookTaskTerminalCaptureState) {
|
|
78
|
+
globalState.__promptbookTaskTerminalCaptureState = {
|
|
79
|
+
asyncLocalStorage: new AsyncLocalStorage<TaskTerminalCaptureContext>(),
|
|
80
|
+
isConsolePatched: false,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return globalState.__promptbookTaskTerminalCaptureState;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Patches the global console once so calls inside a capture context are mirrored per task.
|
|
89
|
+
*
|
|
90
|
+
* The original console behavior is always preserved; mirroring failures are swallowed so a
|
|
91
|
+
* terminal-log problem can never break task processing itself.
|
|
92
|
+
*
|
|
93
|
+
* @param state - Shared capture state.
|
|
94
|
+
*/
|
|
95
|
+
function ensureTaskCaptureConsolePatched(state: TaskTerminalCaptureState): void {
|
|
96
|
+
if (state.isConsolePatched) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
state.isConsolePatched = true;
|
|
101
|
+
|
|
102
|
+
for (const level of CAPTURED_CONSOLE_LEVELS) {
|
|
103
|
+
const originalConsoleMethod = console[level].bind(console);
|
|
104
|
+
|
|
105
|
+
console[level] = (...consoleArguments: Array<unknown>) => {
|
|
106
|
+
originalConsoleMethod(...consoleArguments);
|
|
107
|
+
|
|
108
|
+
const captureContext = state.asyncLocalStorage.getStore();
|
|
109
|
+
if (!captureContext) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
appendTaskTerminalLogLine(captureContext.taskId, formatCapturedConsoleLine(level, consoleArguments));
|
|
115
|
+
} catch {
|
|
116
|
+
// Note: Never let terminal-log mirroring break the actual task processing
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Formats one captured console call as an ANSI-colored terminal line body.
|
|
124
|
+
*
|
|
125
|
+
* @param level - Captured console level.
|
|
126
|
+
* @param consoleArguments - Raw console call arguments.
|
|
127
|
+
* @returns Line content without timestamp and trailing newline.
|
|
128
|
+
*/
|
|
129
|
+
function formatCapturedConsoleLine(level: CapturedConsoleLevel, consoleArguments: Array<unknown>): string {
|
|
130
|
+
const levelColor = CAPTURED_CONSOLE_LEVEL_ANSI_COLOR_MAP[level];
|
|
131
|
+
const formattedMessage = format(...consoleArguments);
|
|
132
|
+
|
|
133
|
+
return `${levelColor}${formattedMessage}${ANSI_STYLE_RESET}`;
|
|
134
|
+
}
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Maximum buffered terminal output kept in memory for one task.
|
|
5
|
+
*/
|
|
6
|
+
const MAX_TASK_TERMINAL_OUTPUT_LENGTH = 200_000;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* How long a finished task terminal stays readable for post-mortem inspection.
|
|
10
|
+
*/
|
|
11
|
+
const TASK_TERMINAL_RETENTION_MILLISECONDS = 30 * 60 * 1000;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Maximum number of task terminals tracked at once before the oldest ones are evicted.
|
|
15
|
+
*/
|
|
16
|
+
const MAX_TRACKED_TASK_TERMINAL_COUNT = 200;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* ANSI dim style used for terminal line timestamps.
|
|
20
|
+
*/
|
|
21
|
+
const ANSI_STYLE_DIM = '\x1b[2m';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* ANSI style reset used after styled terminal fragments.
|
|
25
|
+
*/
|
|
26
|
+
const ANSI_STYLE_RESET = '\x1b[0m';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Serializable snapshot of one task-scoped terminal log.
|
|
30
|
+
*
|
|
31
|
+
* The shape intentionally matches the shared `AdminTerminalSession` browser contract
|
|
32
|
+
* so the existing admin terminal SSE helper and xterm renderer can be reused.
|
|
33
|
+
*/
|
|
34
|
+
export type TaskTerminalLogSnapshot = {
|
|
35
|
+
/**
|
|
36
|
+
* Task identifier the terminal output belongs to.
|
|
37
|
+
*/
|
|
38
|
+
readonly id: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Whether the task is still expected to produce more output.
|
|
42
|
+
*/
|
|
43
|
+
readonly isRunning: boolean;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Buffered task terminal output.
|
|
47
|
+
*/
|
|
48
|
+
readonly output: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* ISO timestamp of the first captured output.
|
|
52
|
+
*/
|
|
53
|
+
readonly startedAt: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* ISO timestamp when the task terminal was marked finished, when available.
|
|
57
|
+
*/
|
|
58
|
+
readonly finishedAt: string | null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Synthetic exit code once the task finished (`0` on success, `1` otherwise).
|
|
62
|
+
*/
|
|
63
|
+
readonly exitCode: number | null;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Always `null` — task terminals are not backed by one dedicated OS process.
|
|
67
|
+
*/
|
|
68
|
+
readonly signal: null;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Output event emitted while one task terminal is collecting output.
|
|
73
|
+
*/
|
|
74
|
+
export type TaskTerminalLogOutputEvent = {
|
|
75
|
+
readonly type: 'output';
|
|
76
|
+
readonly chunk: string;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Exit event emitted when one task terminal is marked finished.
|
|
81
|
+
*/
|
|
82
|
+
export type TaskTerminalLogExitEvent = {
|
|
83
|
+
readonly type: 'exit';
|
|
84
|
+
readonly snapshot: TaskTerminalLogSnapshot;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Browser stream callbacks used by one subscribed task terminal client.
|
|
89
|
+
*/
|
|
90
|
+
export type TaskTerminalLogSubscriber = {
|
|
91
|
+
/**
|
|
92
|
+
* Called whenever new task terminal output arrives.
|
|
93
|
+
*/
|
|
94
|
+
readonly onOutput: (event: TaskTerminalLogOutputEvent) => void;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Called once the task terminal is marked finished.
|
|
98
|
+
*/
|
|
99
|
+
readonly onExit: (event: TaskTerminalLogExitEvent) => void;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Internal mutable per-task terminal state stored in-process.
|
|
104
|
+
*/
|
|
105
|
+
type TaskTerminalLogEntry = {
|
|
106
|
+
readonly taskId: string;
|
|
107
|
+
readonly events: EventEmitter<{
|
|
108
|
+
output: [TaskTerminalLogOutputEvent];
|
|
109
|
+
exit: [TaskTerminalLogExitEvent];
|
|
110
|
+
}>;
|
|
111
|
+
readonly startedAt: Date;
|
|
112
|
+
cleanupTimeout: NodeJS.Timeout | null;
|
|
113
|
+
output: string;
|
|
114
|
+
isFinished: boolean;
|
|
115
|
+
finishedAt: Date | null;
|
|
116
|
+
exitCode: number | null;
|
|
117
|
+
updatedAtMs: number;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Shared in-memory task terminal state reused across requests in the server process.
|
|
122
|
+
*/
|
|
123
|
+
type TaskTerminalLogState = {
|
|
124
|
+
readonly entriesByTaskId: Map<string, TaskTerminalLogEntry>;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Appends one output chunk to the terminal log of the given task.
|
|
129
|
+
*
|
|
130
|
+
* The task terminal log is created lazily on the first appended chunk. A previously
|
|
131
|
+
* finished terminal is reopened so retried tasks keep collecting output into the
|
|
132
|
+
* same buffer.
|
|
133
|
+
*
|
|
134
|
+
* @param taskId - Task identifier used by the admin task manager.
|
|
135
|
+
* @param chunk - Raw terminal text to append.
|
|
136
|
+
*/
|
|
137
|
+
export function appendTaskTerminalLogOutput(taskId: string, chunk: string): void {
|
|
138
|
+
if (!chunk) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const entry = ensureTaskTerminalLogEntry(taskId);
|
|
143
|
+
|
|
144
|
+
if (entry.isFinished) {
|
|
145
|
+
reopenTaskTerminalLogEntry(entry);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
entry.output = (entry.output + chunk).slice(-MAX_TASK_TERMINAL_OUTPUT_LENGTH);
|
|
149
|
+
entry.updatedAtMs = Date.now();
|
|
150
|
+
entry.events.emit('output', {
|
|
151
|
+
type: 'output',
|
|
152
|
+
chunk,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Appends one timestamped line to the terminal log of the given task.
|
|
158
|
+
*
|
|
159
|
+
* @param taskId - Task identifier used by the admin task manager.
|
|
160
|
+
* @param message - Line content, optionally containing ANSI styling.
|
|
161
|
+
*/
|
|
162
|
+
export function appendTaskTerminalLogLine(taskId: string, message: string): void {
|
|
163
|
+
appendTaskTerminalLogOutput(
|
|
164
|
+
taskId,
|
|
165
|
+
`${ANSI_STYLE_DIM}${new Date().toISOString()}${ANSI_STYLE_RESET} ${message}\n`,
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Marks one task terminal as finished and notifies live subscribers.
|
|
171
|
+
*
|
|
172
|
+
* Does nothing when no output was ever captured for the task in this process.
|
|
173
|
+
*
|
|
174
|
+
* @param taskId - Task identifier used by the admin task manager.
|
|
175
|
+
* @param options - Finish metadata.
|
|
176
|
+
*/
|
|
177
|
+
export function markTaskTerminalLogFinished(taskId: string, options: { readonly isSuccessful: boolean }): void {
|
|
178
|
+
const entry = getTaskTerminalLogState().entriesByTaskId.get(taskId);
|
|
179
|
+
if (!entry || entry.isFinished) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
entry.isFinished = true;
|
|
184
|
+
entry.finishedAt = new Date();
|
|
185
|
+
entry.exitCode = options.isSuccessful ? 0 : 1;
|
|
186
|
+
entry.updatedAtMs = Date.now();
|
|
187
|
+
|
|
188
|
+
entry.events.emit('exit', {
|
|
189
|
+
type: 'exit',
|
|
190
|
+
snapshot: createTaskTerminalLogSnapshot(entry),
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
scheduleTaskTerminalLogCleanup(entry);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Reads the buffered terminal log snapshot for one task.
|
|
198
|
+
*
|
|
199
|
+
* @param taskId - Task identifier used by the admin task manager.
|
|
200
|
+
* @returns Snapshot or `null` when nothing was captured for the task in this process.
|
|
201
|
+
*/
|
|
202
|
+
export function getTaskTerminalLogSnapshot(taskId: string): TaskTerminalLogSnapshot | null {
|
|
203
|
+
const entry = getTaskTerminalLogState().entriesByTaskId.get(taskId);
|
|
204
|
+
return entry ? createTaskTerminalLogSnapshot(entry) : null;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Subscribes one browser connection to live task terminal events.
|
|
209
|
+
*
|
|
210
|
+
* The entry is created eagerly so subscribers attached before the first output
|
|
211
|
+
* chunk still receive everything the task produces later.
|
|
212
|
+
*
|
|
213
|
+
* @param taskId - Task identifier used by the admin task manager.
|
|
214
|
+
* @param subscriber - Stream callbacks.
|
|
215
|
+
* @returns Cleanup callback.
|
|
216
|
+
*/
|
|
217
|
+
export function subscribeToTaskTerminalLog(taskId: string, subscriber: TaskTerminalLogSubscriber): () => void {
|
|
218
|
+
const entry = ensureTaskTerminalLogEntry(taskId);
|
|
219
|
+
|
|
220
|
+
entry.events.on('output', subscriber.onOutput);
|
|
221
|
+
entry.events.on('exit', subscriber.onExit);
|
|
222
|
+
|
|
223
|
+
return () => {
|
|
224
|
+
entry.events.off('output', subscriber.onOutput);
|
|
225
|
+
entry.events.off('exit', subscriber.onExit);
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Returns the mutable singleton state for task terminal logs.
|
|
231
|
+
*
|
|
232
|
+
* @returns Shared in-memory task terminal state.
|
|
233
|
+
*/
|
|
234
|
+
function getTaskTerminalLogState(): TaskTerminalLogState {
|
|
235
|
+
const globalState = globalThis as typeof globalThis & {
|
|
236
|
+
__promptbookTaskTerminalLogState?: TaskTerminalLogState;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
if (!globalState.__promptbookTaskTerminalLogState) {
|
|
240
|
+
globalState.__promptbookTaskTerminalLogState = {
|
|
241
|
+
entriesByTaskId: new Map(),
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return globalState.__promptbookTaskTerminalLogState;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Reads or creates the mutable terminal entry for one task.
|
|
250
|
+
*
|
|
251
|
+
* @param taskId - Task identifier used by the admin task manager.
|
|
252
|
+
* @returns Mutable terminal entry.
|
|
253
|
+
*/
|
|
254
|
+
function ensureTaskTerminalLogEntry(taskId: string): TaskTerminalLogEntry {
|
|
255
|
+
const state = getTaskTerminalLogState();
|
|
256
|
+
const existingEntry = state.entriesByTaskId.get(taskId);
|
|
257
|
+
if (existingEntry) {
|
|
258
|
+
return existingEntry;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
evictStaleTaskTerminalLogEntries(state);
|
|
262
|
+
|
|
263
|
+
const entry: TaskTerminalLogEntry = {
|
|
264
|
+
taskId,
|
|
265
|
+
events: new EventEmitter(),
|
|
266
|
+
startedAt: new Date(),
|
|
267
|
+
cleanupTimeout: null,
|
|
268
|
+
output: '',
|
|
269
|
+
isFinished: false,
|
|
270
|
+
finishedAt: null,
|
|
271
|
+
exitCode: null,
|
|
272
|
+
updatedAtMs: Date.now(),
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
state.entriesByTaskId.set(taskId, entry);
|
|
276
|
+
return entry;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Reopens one finished terminal entry so a retried task keeps appending output.
|
|
281
|
+
*
|
|
282
|
+
* @param entry - Mutable terminal entry.
|
|
283
|
+
*/
|
|
284
|
+
function reopenTaskTerminalLogEntry(entry: TaskTerminalLogEntry): void {
|
|
285
|
+
entry.isFinished = false;
|
|
286
|
+
entry.finishedAt = null;
|
|
287
|
+
entry.exitCode = null;
|
|
288
|
+
|
|
289
|
+
if (entry.cleanupTimeout) {
|
|
290
|
+
clearTimeout(entry.cleanupTimeout);
|
|
291
|
+
entry.cleanupTimeout = null;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Schedules retention cleanup for one finished terminal entry.
|
|
297
|
+
*
|
|
298
|
+
* @param entry - Finished terminal entry.
|
|
299
|
+
*/
|
|
300
|
+
function scheduleTaskTerminalLogCleanup(entry: TaskTerminalLogEntry): void {
|
|
301
|
+
if (entry.cleanupTimeout) {
|
|
302
|
+
clearTimeout(entry.cleanupTimeout);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
entry.cleanupTimeout = setTimeout(() => {
|
|
306
|
+
const state = getTaskTerminalLogState();
|
|
307
|
+
if (state.entriesByTaskId.get(entry.taskId) === entry) {
|
|
308
|
+
state.entriesByTaskId.delete(entry.taskId);
|
|
309
|
+
}
|
|
310
|
+
}, TASK_TERMINAL_RETENTION_MILLISECONDS);
|
|
311
|
+
entry.cleanupTimeout.unref?.();
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Evicts the least recently updated entries when the registry grows past its cap.
|
|
316
|
+
*
|
|
317
|
+
* Finished entries are evicted first so terminals of still-running tasks survive bursts.
|
|
318
|
+
*
|
|
319
|
+
* @param state - Shared in-memory task terminal state.
|
|
320
|
+
*/
|
|
321
|
+
function evictStaleTaskTerminalLogEntries(state: TaskTerminalLogState): void {
|
|
322
|
+
if (state.entriesByTaskId.size < MAX_TRACKED_TASK_TERMINAL_COUNT) {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const entriesOldestFirst = [...state.entriesByTaskId.values()].sort(
|
|
327
|
+
(leftEntry, rightEntry) =>
|
|
328
|
+
Number(rightEntry.isFinished) - Number(leftEntry.isFinished) ||
|
|
329
|
+
leftEntry.updatedAtMs - rightEntry.updatedAtMs,
|
|
330
|
+
);
|
|
331
|
+
|
|
332
|
+
for (const entry of entriesOldestFirst) {
|
|
333
|
+
if (state.entriesByTaskId.size < MAX_TRACKED_TASK_TERMINAL_COUNT) {
|
|
334
|
+
break;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if (entry.cleanupTimeout) {
|
|
338
|
+
clearTimeout(entry.cleanupTimeout);
|
|
339
|
+
}
|
|
340
|
+
state.entriesByTaskId.delete(entry.taskId);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Converts one mutable terminal entry into a browser-safe snapshot.
|
|
346
|
+
*
|
|
347
|
+
* @param entry - Mutable terminal entry.
|
|
348
|
+
* @returns Serializable terminal snapshot.
|
|
349
|
+
*/
|
|
350
|
+
function createTaskTerminalLogSnapshot(entry: TaskTerminalLogEntry): TaskTerminalLogSnapshot {
|
|
351
|
+
return {
|
|
352
|
+
id: entry.taskId,
|
|
353
|
+
isRunning: !entry.isFinished,
|
|
354
|
+
output: entry.output,
|
|
355
|
+
startedAt: entry.startedAt.toISOString(),
|
|
356
|
+
finishedAt: entry.finishedAt ? entry.finishedAt.toISOString() : null,
|
|
357
|
+
exitCode: entry.exitCode,
|
|
358
|
+
signal: null,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { $getTableName } from '@/src/database/$getTableName';
|
|
2
2
|
import { $provideClientSql } from '@/src/database/$provideClientSql';
|
|
3
3
|
import { isAgentsServerSqliteMode } from '@/src/database/agentsServerDatabaseMode';
|
|
4
|
+
import { markTaskTerminalLogFinished } from '../taskTerminal/taskTerminalLog';
|
|
4
5
|
import type { UserChatJobRow } from './UserChatJobRow';
|
|
5
6
|
import type { UserChatJobRecord, UserChatJobStatus } from './UserChatJobRecord';
|
|
6
7
|
import { mapUserChatJobRow } from './mapUserChatJobRow';
|
|
@@ -20,6 +21,21 @@ export async function finalizeUserChatJob(options: {
|
|
|
20
21
|
provider?: string | null;
|
|
21
22
|
failureReason?: string | null;
|
|
22
23
|
failureDetails?: string | null;
|
|
24
|
+
}): Promise<UserChatJobRecord | null> {
|
|
25
|
+
const finalizedJob = await persistFinalUserChatJobStatus(options);
|
|
26
|
+
markTaskTerminalLogFinished(options.jobId, { isSuccessful: options.status === 'COMPLETED' });
|
|
27
|
+
return finalizedJob;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Persists one final job status through the mode-specific database path.
|
|
32
|
+
*/
|
|
33
|
+
async function persistFinalUserChatJobStatus(options: {
|
|
34
|
+
jobId: string;
|
|
35
|
+
status: FinalUserChatJobStatus;
|
|
36
|
+
provider?: string | null;
|
|
37
|
+
failureReason?: string | null;
|
|
38
|
+
failureDetails?: string | null;
|
|
23
39
|
}): Promise<UserChatJobRecord | null> {
|
|
24
40
|
if (isAgentsServerSqliteMode()) {
|
|
25
41
|
return finalizeUserChatJobViaSupabaseQuery(options);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ChatMessage } from '../../../../../src/_packages/types.index';
|
|
2
|
+
import { appendChatAttachmentContextWithContent } from '../../../../../src/utils/chat/chatAttachments/appendChatAttachmentContextWithContent';
|
|
3
|
+
|
|
2
4
|
/**
|
|
3
5
|
* Lifecycle states rendered on canonical server-owned chat messages.
|
|
4
6
|
*/
|
|
@@ -99,11 +101,11 @@ export function resolvePromptThreadBeforeUserMessage(
|
|
|
99
101
|
/**
|
|
100
102
|
* Creates the complete chat thread mirrored to a runner before it writes the next answer.
|
|
101
103
|
*/
|
|
102
|
-
export function createUserChatRunnerThreadMessages(options: {
|
|
104
|
+
export async function createUserChatRunnerThreadMessages(options: {
|
|
103
105
|
messages: ReadonlyArray<ChatMessage>;
|
|
104
106
|
userMessageId: string;
|
|
105
107
|
resolveInitialAgentMessage: () => string | null | undefined;
|
|
106
|
-
}): Array<UserChatRunnerThreadMessage
|
|
108
|
+
}): Promise<Array<UserChatRunnerThreadMessage>> {
|
|
107
109
|
const userMessage = options.messages.find((message) => message.id === options.userMessageId);
|
|
108
110
|
if (!userMessage) {
|
|
109
111
|
return [];
|
|
@@ -111,19 +113,16 @@ export function createUserChatRunnerThreadMessages(options: {
|
|
|
111
113
|
|
|
112
114
|
const previousThreadMessages = resolvePromptThreadBeforeUserMessage(options.messages, options.userMessageId);
|
|
113
115
|
|
|
114
|
-
|
|
116
|
+
const threadMessages = [
|
|
115
117
|
...createInitialUserChatRunnerThreadMessages({
|
|
116
118
|
isFirstUserTurn: previousThreadMessages.length === 0,
|
|
117
119
|
resolveInitialAgentMessage: options.resolveInitialAgentMessage,
|
|
118
120
|
}),
|
|
119
121
|
...previousThreadMessages,
|
|
120
122
|
userMessage,
|
|
121
|
-
]
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
sender: message.sender,
|
|
125
|
-
content: message.content,
|
|
126
|
-
}));
|
|
123
|
+
].filter(isUserChatRunnerThreadMessage);
|
|
124
|
+
|
|
125
|
+
return await Promise.all(threadMessages.map(createUserChatRunnerThreadMessage));
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
/**
|
|
@@ -176,3 +175,34 @@ function isUserChatRunnerThreadMessage(message: ChatMessage): message is ChatMes
|
|
|
176
175
|
const isRunnerSender = message.sender === 'USER' || message.sender === 'AGENT';
|
|
177
176
|
return message.isComplete !== false && isRunnerSender;
|
|
178
177
|
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Creates one runner-visible message with attachment context inlined into user-authored content.
|
|
181
|
+
*
|
|
182
|
+
* @private helper of `createUserChatRunnerThreadMessages`
|
|
183
|
+
*/
|
|
184
|
+
async function createUserChatRunnerThreadMessage(
|
|
185
|
+
message: ChatMessage & UserChatRunnerThreadMessage,
|
|
186
|
+
): Promise<UserChatRunnerThreadMessage> {
|
|
187
|
+
return {
|
|
188
|
+
sender: message.sender,
|
|
189
|
+
content: await createUserChatRunnerThreadMessageContent(message),
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Adds attachment URLs and best-effort text previews to user messages mirrored into runner `.book` files.
|
|
195
|
+
*
|
|
196
|
+
* @private helper of `createUserChatRunnerThreadMessage`
|
|
197
|
+
*/
|
|
198
|
+
async function createUserChatRunnerThreadMessageContent(
|
|
199
|
+
message: ChatMessage & UserChatRunnerThreadMessage,
|
|
200
|
+
): Promise<string> {
|
|
201
|
+
if (message.sender !== 'USER' || !message.attachments || message.attachments.length === 0) {
|
|
202
|
+
return message.content;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return await appendChatAttachmentContextWithContent(message.content, message.attachments, {
|
|
206
|
+
allowLocalhost: true,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { mapUserChatTimeoutRow } from './mapUserChatTimeoutRow';
|
|
2
2
|
import { isMissingUserChatTimeoutRelationError } from './isMissingUserChatTimeoutRelationError';
|
|
3
3
|
import { provideUserChatTimeoutTable } from './provideUserChatTimeoutTable';
|
|
4
|
+
import { markTaskTerminalLogFinished } from '../../taskTerminal/taskTerminalLog';
|
|
4
5
|
import type { UserChatTimeoutRecord, UserChatTimeoutRow } from '../UserChatTimeoutRecord';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -36,5 +37,7 @@ export async function updateUserChatTimeoutTerminalState(
|
|
|
36
37
|
throw new Error(`Failed to update user chat timeout "${timeoutId}": ${error.message}`);
|
|
37
38
|
}
|
|
38
39
|
|
|
40
|
+
markTaskTerminalLogFinished(timeoutId, { isSuccessful: status === 'COMPLETED' });
|
|
41
|
+
|
|
39
42
|
return data ? mapUserChatTimeoutRow(data as UserChatTimeoutRow) : null;
|
|
40
43
|
}
|
|
@@ -10,6 +10,7 @@ import { getUserChat } from '../userChat/getUserChat';
|
|
|
10
10
|
import { getUserChatJobByClientMessageId } from '../userChat/getUserChatJobByClientMessageId';
|
|
11
11
|
import { mutateUserChat } from '../userChat/mutateUserChat';
|
|
12
12
|
import { triggerUserChatJobWorker } from '../userChat/triggerUserChatJobWorker';
|
|
13
|
+
import { runWithTaskTerminalCapture } from '../taskTerminal/runWithTaskTerminalCapture';
|
|
13
14
|
import type { UserChatTimeoutParameters, UserChatTimeoutRecord } from './UserChatTimeoutRecord';
|
|
14
15
|
import { createTimeoutWakeUpMessage } from './createTimeoutWakeUpMessage';
|
|
15
16
|
import {
|
|
@@ -214,7 +215,9 @@ export async function runUserChatTimeoutWorkerTick(): Promise<void> {
|
|
|
214
215
|
break;
|
|
215
216
|
}
|
|
216
217
|
|
|
217
|
-
await
|
|
218
|
+
await runWithTaskTerminalCapture(claimedTimeout.timeoutId, () =>
|
|
219
|
+
processClaimedUserChatTimeout(claimedTimeout),
|
|
220
|
+
);
|
|
218
221
|
}
|
|
219
222
|
} catch (error) {
|
|
220
223
|
console.error('[user-chat-timeout]', 'worker_tick_failed', serializeError(error as Error));
|
|
@@ -42,6 +42,10 @@ export const VPS_ENVIRONMENT_VARIABLE_KEYS = [
|
|
|
42
42
|
'PTBK_AGENTS_SERVER_SQLITE_PATH',
|
|
43
43
|
'SUPABASE_TABLE_PREFIX',
|
|
44
44
|
'SUPABASE_AUTO_MIGRATE',
|
|
45
|
+
'PROMPTBOOK_REPOSITORY_REF',
|
|
46
|
+
'PTBK_AUTO_SELF_UPDATE_ENABLED',
|
|
47
|
+
'PTBK_AUTO_SELF_UPDATE_CRON',
|
|
48
|
+
'AGENTS_SERVER_GC_KEEP_VERSIONS',
|
|
45
49
|
'COPILOT_GITHUB_TOKEN',
|
|
46
50
|
'GH_TOKEN',
|
|
47
51
|
'ANTHROPIC_API_KEY',
|
|
@@ -280,12 +284,12 @@ export async function applyVpsRuntimeConfiguration(
|
|
|
280
284
|
}
|
|
281
285
|
|
|
282
286
|
/**
|
|
283
|
-
* Installs/configures the selected local
|
|
287
|
+
* Installs/configures the selected local harness through the shared VPS installer script.
|
|
284
288
|
*
|
|
285
289
|
* @returns Command output or a skipped reason when not running on a Linux VPS.
|
|
286
290
|
*/
|
|
287
|
-
export async function
|
|
288
|
-
return runVpsInstallerCommand('apply-runner', 'VPS
|
|
291
|
+
export async function applyVpsHarnessConfiguration(): Promise<VpsCommandResult> {
|
|
292
|
+
return runVpsInstallerCommand('apply-runner', 'VPS harness configuration can only be applied on Linux.');
|
|
289
293
|
}
|
|
290
294
|
|
|
291
295
|
/**
|