@promptbook/cli 0.113.0-0 → 0.113.0-10
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/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 +69 -20
- 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/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/input/route.ts +161 -0
- package/apps/agents-server/src/app/api/page-preview/stream/route.ts +81 -0
- package/apps/agents-server/src/app/layout.tsx +39 -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/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/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 +182 -16
- 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 +21 -5
- package/apps/agents-server/src/constants/chatVisualMode.ts +1 -1
- package/apps/agents-server/src/constants/defaultAgentAvatarVisual.ts +4 -3
- package/apps/agents-server/src/constants/themeMode.ts +1 -1
- 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/migrations/2026-05-2600-default-theme.sql +2 -2
- 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 +1 -0
- package/apps/agents-server/src/languages/translations/czech.yaml +1 -0
- package/apps/agents-server/src/languages/translations/english.yaml +1 -0
- package/apps/agents-server/src/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 +4 -1
- 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 +97 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse.ts +258 -6
- 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 +512 -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 +4 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/deleteVpsSelfUpdateInstalledVersion.ts +81 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/listVpsSelfUpdateCandidateCommits.ts +217 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/readPersistedVpsSelfUpdateJob.ts +310 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/readVpsSelfUpdateOverview.ts +178 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/resolveVpsSelfUpdateJobForOverview.ts +42 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/startVpsSelfUpdate.ts +201 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateAutomaticConfiguration.ts +152 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateConfiguration.ts +81 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateCron.ts +357 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateEnvironment.ts +120 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateInstalledVersions.ts +162 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateJobConstants.ts +15 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateJobHistory.ts +387 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateJobIdentity.ts +26 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateOriginRepository.ts +90 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateRepository.ts +286 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateScheduler.ts +191 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateStateFiles.ts +197 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateTypes.ts +452 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate.ts +66 -1535
- 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 +28592 -27063
- 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/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 +54 -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 +2 -2
- 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/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 +196 -0
- package/src/book-components/Chat/Chat/Chat.tsx +16 -1
- package/src/book-components/Chat/Chat/ChatCitationModal.tsx +2 -2
- package/src/book-components/Chat/Chat/ChatImageAttachmentModal.tsx +108 -0
- package/src/book-components/Chat/Chat/ChatInputArea.tsx +43 -27
- package/src/book-components/Chat/Chat/ChatMessageAttachments.tsx +212 -0
- package/src/book-components/Chat/Chat/ChatMessageItem.tsx +32 -18
- package/src/book-components/Chat/Chat/ChatMessageList.tsx +3 -0
- package/src/book-components/Chat/Chat/ChatProps.tsx +9 -0
- package/src/book-components/Chat/Chat/CitationIframePreview.tsx +138 -11
- 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 +889 -773
- 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/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 +28594 -27065
- 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/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 +54 -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 +2 -2
- 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/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/utils/userChat/createUserChatRunnerProgressCard.ts +0 -57
- package/esm/scripts/run-codex-prompts/common/resolveAgentSystemMessage.d.ts +0 -6
- package/umd/scripts/run-codex-prompts/common/resolveAgentSystemMessage.d.ts +0 -6
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import type { AdminChatTaskView } from '../../chatTasksAdmin';
|
|
2
|
+
import type { ParsedAdminChatTaskQuery } from '../parseAdminChatTaskQuery';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Builds the shared union query that surfaces durable chat jobs and timeouts as one admin task stream.
|
|
6
|
+
*
|
|
7
|
+
* @private function of `getAdminChatTasks`
|
|
8
|
+
*/
|
|
9
|
+
export function createAdminChatTaskBaseQuery(options: {
|
|
10
|
+
userChatJobTable: string;
|
|
11
|
+
userChatTimeoutTable: string;
|
|
12
|
+
userTable: string;
|
|
13
|
+
agentTable: string;
|
|
14
|
+
}): string {
|
|
15
|
+
return `
|
|
16
|
+
SELECT
|
|
17
|
+
job."id" AS "id",
|
|
18
|
+
'CHAT_COMPLETION'::text AS "kind",
|
|
19
|
+
job."status" AS "status",
|
|
20
|
+
job."createdAt" AS "createdAt",
|
|
21
|
+
job."queuedAt" AS "queuedAt",
|
|
22
|
+
job."startedAt" AS "startedAt",
|
|
23
|
+
job."updatedAt" AS "updatedAt",
|
|
24
|
+
job."completedAt" AS "finishedAt",
|
|
25
|
+
job."cancelRequestedAt" AS "cancelRequestedAt",
|
|
26
|
+
NULL::TIMESTAMP WITH TIME ZONE AS "pausedAt",
|
|
27
|
+
job."lastHeartbeatAt" AS "lastHeartbeatAt",
|
|
28
|
+
job."leaseExpiresAt" AS "leaseExpiresAt",
|
|
29
|
+
NULL::BIGINT AS "recurrenceIntervalMs",
|
|
30
|
+
job."attemptCount" AS "attemptCount",
|
|
31
|
+
job."failureReason" AS "lastErrorSummary",
|
|
32
|
+
job."failureDetails" AS "lastErrorDetails",
|
|
33
|
+
job."userId" AS "userId",
|
|
34
|
+
"user"."username" AS "username",
|
|
35
|
+
job."agentPermanentId" AS "agentPermanentId",
|
|
36
|
+
agent."agentName" AS "agentName",
|
|
37
|
+
job."chatId" AS "chatId"
|
|
38
|
+
FROM ${options.userChatJobTable} job
|
|
39
|
+
LEFT JOIN ${options.userTable} "user" ON "user"."id" = job."userId"
|
|
40
|
+
LEFT JOIN ${options.agentTable} agent ON agent."permanentId" = job."agentPermanentId"
|
|
41
|
+
|
|
42
|
+
UNION ALL
|
|
43
|
+
|
|
44
|
+
SELECT
|
|
45
|
+
timeout."id" AS "id",
|
|
46
|
+
'CHAT_TIMEOUT'::text AS "kind",
|
|
47
|
+
timeout."status" AS "status",
|
|
48
|
+
timeout."createdAt" AS "createdAt",
|
|
49
|
+
timeout."queuedAt" AS "queuedAt",
|
|
50
|
+
timeout."startedAt" AS "startedAt",
|
|
51
|
+
timeout."updatedAt" AS "updatedAt",
|
|
52
|
+
timeout."completedAt" AS "finishedAt",
|
|
53
|
+
timeout."cancelRequestedAt" AS "cancelRequestedAt",
|
|
54
|
+
timeout."pausedAt" AS "pausedAt",
|
|
55
|
+
NULL::TIMESTAMP WITH TIME ZONE AS "lastHeartbeatAt",
|
|
56
|
+
timeout."leaseExpiresAt" AS "leaseExpiresAt",
|
|
57
|
+
timeout."recurrenceIntervalMs" AS "recurrenceIntervalMs",
|
|
58
|
+
timeout."attemptCount" AS "attemptCount",
|
|
59
|
+
timeout."failureReason" AS "lastErrorSummary",
|
|
60
|
+
NULL::TEXT AS "lastErrorDetails",
|
|
61
|
+
timeout."userId" AS "userId",
|
|
62
|
+
"user"."username" AS "username",
|
|
63
|
+
timeout."agentPermanentId" AS "agentPermanentId",
|
|
64
|
+
agent."agentName" AS "agentName",
|
|
65
|
+
timeout."chatId" AS "chatId"
|
|
66
|
+
FROM ${options.userChatTimeoutTable} timeout
|
|
67
|
+
LEFT JOIN ${options.userTable} "user" ON "user"."id" = timeout."userId"
|
|
68
|
+
LEFT JOIN ${options.agentTable} agent ON agent."permanentId" = timeout."agentPermanentId"
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Builds the paginated admin task list query together with its bound parameter values.
|
|
74
|
+
*
|
|
75
|
+
* @private function of `getAdminChatTasks`
|
|
76
|
+
*/
|
|
77
|
+
export function createAdminChatTaskListQuery(options: { baseTaskQuery: string; query: ParsedAdminChatTaskQuery }): {
|
|
78
|
+
sql: string;
|
|
79
|
+
values: Array<string | number>;
|
|
80
|
+
} {
|
|
81
|
+
const listQueryParts = createAdminChatTaskListQueryParts(options.query);
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
sql: `
|
|
85
|
+
WITH tasks AS (
|
|
86
|
+
${options.baseTaskQuery}
|
|
87
|
+
)
|
|
88
|
+
SELECT
|
|
89
|
+
task.*,
|
|
90
|
+
COUNT(*) OVER() AS "totalCount"
|
|
91
|
+
FROM tasks task
|
|
92
|
+
${listQueryParts.whereClause}
|
|
93
|
+
ORDER BY ${createAdminChatTaskOrderBySql(options.query.view, 'task')}
|
|
94
|
+
LIMIT $${listQueryParts.limitPlaceholder}
|
|
95
|
+
OFFSET $${listQueryParts.offsetPlaceholder}
|
|
96
|
+
`,
|
|
97
|
+
values: listQueryParts.values,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Builds the task-manager summary counters query.
|
|
103
|
+
*
|
|
104
|
+
* @private function of `getAdminChatTasks`
|
|
105
|
+
*/
|
|
106
|
+
export function createAdminChatTaskCountersQuery(options: { baseTaskQuery: string }): string {
|
|
107
|
+
return `
|
|
108
|
+
WITH tasks AS (
|
|
109
|
+
${options.baseTaskQuery}
|
|
110
|
+
)
|
|
111
|
+
SELECT
|
|
112
|
+
COUNT(*) FILTER (WHERE "status" = 'RUNNING') AS "runningCount",
|
|
113
|
+
COUNT(*) FILTER (WHERE "status" = 'QUEUED') AS "queuedCount",
|
|
114
|
+
COUNT(*) FILTER (
|
|
115
|
+
WHERE "status" = 'FAILED'
|
|
116
|
+
AND "finishedAt" >= CURRENT_TIMESTAMP - INTERVAL '24 hours'
|
|
117
|
+
) AS "failedLast24hCount",
|
|
118
|
+
CASE
|
|
119
|
+
WHEN MIN("queuedAt") FILTER (WHERE "status" = 'QUEUED') IS NULL THEN NULL
|
|
120
|
+
ELSE EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - MIN("queuedAt") FILTER (WHERE "status" = 'QUEUED'))) * 1000
|
|
121
|
+
END AS "oldestQueuedAgeMs"
|
|
122
|
+
FROM tasks
|
|
123
|
+
`;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Creates the `WHERE` clause and parameter list for the paginated admin task query.
|
|
128
|
+
*
|
|
129
|
+
* @private function of `getAdminChatTasks`
|
|
130
|
+
*/
|
|
131
|
+
function createAdminChatTaskListQueryParts(query: ParsedAdminChatTaskQuery): {
|
|
132
|
+
whereClause: string;
|
|
133
|
+
values: Array<string | number>;
|
|
134
|
+
limitPlaceholder: number;
|
|
135
|
+
offsetPlaceholder: number;
|
|
136
|
+
} {
|
|
137
|
+
const values: Array<string | number> = [];
|
|
138
|
+
const whereParts: Array<string> = [];
|
|
139
|
+
|
|
140
|
+
appendAdminChatTaskViewClause(query, values, whereParts, 'task');
|
|
141
|
+
appendAdminChatTaskSearchClause(query.search, values, whereParts, 'task');
|
|
142
|
+
|
|
143
|
+
values.push(query.pageSize);
|
|
144
|
+
values.push((query.page - 1) * query.pageSize);
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
whereClause: whereParts.length > 0 ? `WHERE ${whereParts.join(' AND ')}` : '',
|
|
148
|
+
values,
|
|
149
|
+
limitPlaceholder: values.length - 1,
|
|
150
|
+
offsetPlaceholder: values.length,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Appends the status/time-window filter for one dashboard view.
|
|
156
|
+
*
|
|
157
|
+
* @private function of `getAdminChatTasks`
|
|
158
|
+
*/
|
|
159
|
+
function appendAdminChatTaskViewClause(
|
|
160
|
+
query: ParsedAdminChatTaskQuery,
|
|
161
|
+
values: Array<string | number>,
|
|
162
|
+
whereParts: Array<string>,
|
|
163
|
+
alias: string,
|
|
164
|
+
): void {
|
|
165
|
+
switch (query.view) {
|
|
166
|
+
case 'running':
|
|
167
|
+
whereParts.push(`${alias}."status" = 'RUNNING'`);
|
|
168
|
+
return;
|
|
169
|
+
case 'queued':
|
|
170
|
+
whereParts.push(`${alias}."status" = 'QUEUED'`);
|
|
171
|
+
return;
|
|
172
|
+
case 'failed':
|
|
173
|
+
whereParts.push(`${alias}."status" = 'FAILED'`);
|
|
174
|
+
whereParts.push(`${alias}."finishedAt" >= CURRENT_TIMESTAMP - INTERVAL '24 hours'`);
|
|
175
|
+
return;
|
|
176
|
+
case 'all':
|
|
177
|
+
values.push(query.timeWindowHours);
|
|
178
|
+
whereParts.push(`${alias}."updatedAt" >= CURRENT_TIMESTAMP - ($${values.length} * INTERVAL '1 hour')`);
|
|
179
|
+
return;
|
|
180
|
+
case 'active':
|
|
181
|
+
default:
|
|
182
|
+
whereParts.push(`${alias}."status" IN ('QUEUED', 'RUNNING')`);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Appends the free-text search clause used by the dashboard.
|
|
188
|
+
*
|
|
189
|
+
* @private function of `getAdminChatTasks`
|
|
190
|
+
*/
|
|
191
|
+
function appendAdminChatTaskSearchClause(
|
|
192
|
+
search: string,
|
|
193
|
+
values: Array<string | number>,
|
|
194
|
+
whereParts: Array<string>,
|
|
195
|
+
alias: string,
|
|
196
|
+
): void {
|
|
197
|
+
if (!search) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
values.push(search);
|
|
202
|
+
const exactPlaceholder = values.length;
|
|
203
|
+
|
|
204
|
+
values.push(`${search}%`);
|
|
205
|
+
const prefixPlaceholder = values.length;
|
|
206
|
+
|
|
207
|
+
values.push(`%${search}%`);
|
|
208
|
+
const containsPlaceholder = values.length;
|
|
209
|
+
|
|
210
|
+
const searchParts = [
|
|
211
|
+
`${alias}."id" = $${exactPlaceholder}`,
|
|
212
|
+
`${alias}."id" LIKE $${prefixPlaceholder}`,
|
|
213
|
+
`${alias}."chatId" = $${exactPlaceholder}`,
|
|
214
|
+
`${alias}."chatId" LIKE $${prefixPlaceholder}`,
|
|
215
|
+
`${alias}."agentPermanentId" = $${exactPlaceholder}`,
|
|
216
|
+
`${alias}."agentPermanentId" LIKE $${prefixPlaceholder}`,
|
|
217
|
+
`COALESCE(${alias}."agentName", '') ILIKE $${containsPlaceholder}`,
|
|
218
|
+
`COALESCE(${alias}."username", '') ILIKE $${containsPlaceholder}`,
|
|
219
|
+
];
|
|
220
|
+
|
|
221
|
+
if (/^\d+$/.test(search)) {
|
|
222
|
+
values.push(Number.parseInt(search, 10));
|
|
223
|
+
searchParts.push(`${alias}."userId" = $${values.length}`);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
whereParts.push(`(${searchParts.join(' OR ')})`);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Resolves the stable sort order used by each dashboard view.
|
|
231
|
+
*
|
|
232
|
+
* @private function of `getAdminChatTasks`
|
|
233
|
+
*/
|
|
234
|
+
function createAdminChatTaskOrderBySql(view: AdminChatTaskView, alias: string): string {
|
|
235
|
+
switch (view) {
|
|
236
|
+
case 'running':
|
|
237
|
+
return `${alias}."startedAt" DESC NULLS LAST, ${alias}."createdAt" DESC, ${alias}."id" DESC`;
|
|
238
|
+
case 'queued':
|
|
239
|
+
return `${alias}."createdAt" DESC, ${alias}."id" DESC`;
|
|
240
|
+
case 'failed':
|
|
241
|
+
return `${alias}."finishedAt" DESC NULLS LAST, ${alias}."updatedAt" DESC, ${alias}."id" DESC`;
|
|
242
|
+
case 'all':
|
|
243
|
+
return `${alias}."updatedAt" DESC, ${alias}."createdAt" DESC, ${alias}."id" DESC`;
|
|
244
|
+
case 'active':
|
|
245
|
+
default:
|
|
246
|
+
return `
|
|
247
|
+
CASE
|
|
248
|
+
WHEN ${alias}."status" = 'RUNNING' THEN 0
|
|
249
|
+
WHEN ${alias}."status" = 'QUEUED' THEN 1
|
|
250
|
+
ELSE 2
|
|
251
|
+
END ASC,
|
|
252
|
+
CASE
|
|
253
|
+
WHEN ${alias}."status" = 'RUNNING' THEN ${alias}."startedAt"
|
|
254
|
+
ELSE NULL
|
|
255
|
+
END DESC NULLS LAST,
|
|
256
|
+
CASE
|
|
257
|
+
WHEN ${alias}."status" = 'QUEUED' THEN ${alias}."createdAt"
|
|
258
|
+
ELSE NULL
|
|
259
|
+
END DESC NULLS LAST,
|
|
260
|
+
${alias}."updatedAt" DESC,
|
|
261
|
+
${alias}."id" DESC
|
|
262
|
+
`;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts PostgreSQL count-like values into safe JavaScript numbers.
|
|
3
|
+
*
|
|
4
|
+
* @private function of `getAdminChatTasks`
|
|
5
|
+
*/
|
|
6
|
+
export function resolveSqlCount(value: string | number | undefined): number {
|
|
7
|
+
if (typeof value === 'number') {
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (typeof value === 'string') {
|
|
12
|
+
const parsed = Number.parseInt(value, 10);
|
|
13
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Converts nullable numeric SQL values into safe JavaScript numbers.
|
|
21
|
+
*
|
|
22
|
+
* @private function of `getAdminChatTasks`
|
|
23
|
+
*/
|
|
24
|
+
export function resolveNullableSqlNumber(value: string | number | null | undefined): number | null {
|
|
25
|
+
if (value === null || value === undefined) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (typeof value === 'number') {
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const parsed = Number.parseFloat(value);
|
|
34
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
35
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Milliseconds in one hour.
|
|
3
|
+
*
|
|
4
|
+
* @private constant of `getAdminChatTasks`
|
|
5
|
+
*/
|
|
6
|
+
export const HOUR_IN_MILLISECONDS = 60 * 60 * 1000;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Parses one ISO timestamp into milliseconds since epoch.
|
|
10
|
+
*
|
|
11
|
+
* @private function of `getAdminChatTasks`
|
|
12
|
+
*/
|
|
13
|
+
export function parseIsoTimestamp(timestampIso: string | null): number | null {
|
|
14
|
+
if (!timestampIso) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const timestamp = Date.parse(timestampIso);
|
|
19
|
+
return Number.isFinite(timestamp) ? timestamp : null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Returns whether one ISO timestamp is at or after the given cutoff.
|
|
24
|
+
*
|
|
25
|
+
* @private function of `getAdminChatTasks`
|
|
26
|
+
*/
|
|
27
|
+
export function isIsoTimestampAtOrAfter(timestampIso: string | null, cutoffTimestamp: number): boolean {
|
|
28
|
+
const timestamp = parseIsoTimestamp(timestampIso);
|
|
29
|
+
return timestamp !== null && timestamp >= cutoffTimestamp;
|
|
30
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { AdminChatTaskRecord, AdminChatTaskView } from '../../chatTasksAdmin';
|
|
2
|
+
import type { UserChatJobStatus } from '../../userChat/UserChatJobRecord';
|
|
3
|
+
import { parseIsoTimestamp } from './adminChatTaskTimeUtilities';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Compares two tasks using the same ordering semantics as the PostgreSQL dashboard query.
|
|
7
|
+
*
|
|
8
|
+
* @private function of `getAdminChatTasks`
|
|
9
|
+
*/
|
|
10
|
+
export function compareAdminChatTasks(
|
|
11
|
+
leftTask: AdminChatTaskRecord,
|
|
12
|
+
rightTask: AdminChatTaskRecord,
|
|
13
|
+
view: AdminChatTaskView,
|
|
14
|
+
): number {
|
|
15
|
+
switch (view) {
|
|
16
|
+
case 'running':
|
|
17
|
+
return (
|
|
18
|
+
compareNullableIsoTimestampsDescending(leftTask.startedAt, rightTask.startedAt) ||
|
|
19
|
+
compareIsoTimestampsDescending(leftTask.createdAt, rightTask.createdAt) ||
|
|
20
|
+
compareStringsDescending(leftTask.id, rightTask.id)
|
|
21
|
+
);
|
|
22
|
+
case 'queued':
|
|
23
|
+
return (
|
|
24
|
+
compareIsoTimestampsDescending(leftTask.createdAt, rightTask.createdAt) ||
|
|
25
|
+
compareStringsDescending(leftTask.id, rightTask.id)
|
|
26
|
+
);
|
|
27
|
+
case 'failed':
|
|
28
|
+
return (
|
|
29
|
+
compareNullableIsoTimestampsDescending(leftTask.finishedAt, rightTask.finishedAt) ||
|
|
30
|
+
compareIsoTimestampsDescending(leftTask.updatedAt, rightTask.updatedAt) ||
|
|
31
|
+
compareStringsDescending(leftTask.id, rightTask.id)
|
|
32
|
+
);
|
|
33
|
+
case 'all':
|
|
34
|
+
return (
|
|
35
|
+
compareIsoTimestampsDescending(leftTask.updatedAt, rightTask.updatedAt) ||
|
|
36
|
+
compareIsoTimestampsDescending(leftTask.createdAt, rightTask.createdAt) ||
|
|
37
|
+
compareStringsDescending(leftTask.id, rightTask.id)
|
|
38
|
+
);
|
|
39
|
+
case 'active':
|
|
40
|
+
default:
|
|
41
|
+
return (
|
|
42
|
+
compareNumbersAscending(
|
|
43
|
+
resolveAdminChatTaskActiveStatusRank(leftTask.status),
|
|
44
|
+
resolveAdminChatTaskActiveStatusRank(rightTask.status),
|
|
45
|
+
) ||
|
|
46
|
+
compareNullableIsoTimestampsDescending(
|
|
47
|
+
leftTask.status === 'RUNNING' ? leftTask.startedAt : null,
|
|
48
|
+
rightTask.status === 'RUNNING' ? rightTask.startedAt : null,
|
|
49
|
+
) ||
|
|
50
|
+
compareNullableIsoTimestampsDescending(
|
|
51
|
+
leftTask.status === 'QUEUED' ? leftTask.createdAt : null,
|
|
52
|
+
rightTask.status === 'QUEUED' ? rightTask.createdAt : null,
|
|
53
|
+
) ||
|
|
54
|
+
compareIsoTimestampsDescending(leftTask.updatedAt, rightTask.updatedAt) ||
|
|
55
|
+
compareStringsDescending(leftTask.id, rightTask.id)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Resolves the status sort bucket used by the `Active` dashboard view.
|
|
62
|
+
*
|
|
63
|
+
* @private function of `getAdminChatTasks`
|
|
64
|
+
*/
|
|
65
|
+
function resolveAdminChatTaskActiveStatusRank(status: UserChatJobStatus): number {
|
|
66
|
+
switch (status) {
|
|
67
|
+
case 'RUNNING':
|
|
68
|
+
return 0;
|
|
69
|
+
case 'QUEUED':
|
|
70
|
+
return 1;
|
|
71
|
+
default:
|
|
72
|
+
return 2;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Sorts timestamps descending while keeping `null` values last.
|
|
78
|
+
*
|
|
79
|
+
* @private function of `getAdminChatTasks`
|
|
80
|
+
*/
|
|
81
|
+
function compareNullableIsoTimestampsDescending(
|
|
82
|
+
leftTimestampIso: string | null,
|
|
83
|
+
rightTimestampIso: string | null,
|
|
84
|
+
): number {
|
|
85
|
+
const leftTimestamp = parseIsoTimestamp(leftTimestampIso);
|
|
86
|
+
const rightTimestamp = parseIsoTimestamp(rightTimestampIso);
|
|
87
|
+
|
|
88
|
+
if (leftTimestamp === rightTimestamp) {
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
if (leftTimestamp === null) {
|
|
92
|
+
return 1;
|
|
93
|
+
}
|
|
94
|
+
if (rightTimestamp === null) {
|
|
95
|
+
return -1;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return compareNumbersDescending(leftTimestamp, rightTimestamp);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Sorts required timestamps descending.
|
|
103
|
+
*
|
|
104
|
+
* @private function of `getAdminChatTasks`
|
|
105
|
+
*/
|
|
106
|
+
function compareIsoTimestampsDescending(leftTimestampIso: string, rightTimestampIso: string): number {
|
|
107
|
+
return compareNullableIsoTimestampsDescending(leftTimestampIso, rightTimestampIso);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Sorts numbers ascending.
|
|
112
|
+
*
|
|
113
|
+
* @private function of `getAdminChatTasks`
|
|
114
|
+
*/
|
|
115
|
+
function compareNumbersAscending(leftNumber: number, rightNumber: number): number {
|
|
116
|
+
return leftNumber - rightNumber;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Sorts numbers descending.
|
|
121
|
+
*
|
|
122
|
+
* @private function of `getAdminChatTasks`
|
|
123
|
+
*/
|
|
124
|
+
function compareNumbersDescending(leftNumber: number, rightNumber: number): number {
|
|
125
|
+
return rightNumber - leftNumber;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Sorts strings descending.
|
|
130
|
+
*
|
|
131
|
+
* @private function of `getAdminChatTasks`
|
|
132
|
+
*/
|
|
133
|
+
function compareStringsDescending(leftString: string, rightString: string): number {
|
|
134
|
+
return leftString === rightString ? 0 : leftString < rightString ? 1 : -1;
|
|
135
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AdminChatTaskCounters, AdminChatTaskRecord } from '../../chatTasksAdmin';
|
|
2
|
+
import { HOUR_IN_MILLISECONDS, isIsoTimestampAtOrAfter, parseIsoTimestamp } from './adminChatTaskTimeUtilities';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Calculates the summary counters rendered above the admin task table.
|
|
6
|
+
*
|
|
7
|
+
* @private function of `getAdminChatTasks`
|
|
8
|
+
*/
|
|
9
|
+
export function createAdminChatTaskCounters(
|
|
10
|
+
tasks: ReadonlyArray<AdminChatTaskRecord>,
|
|
11
|
+
nowTimestamp: number,
|
|
12
|
+
): AdminChatTaskCounters {
|
|
13
|
+
const queuedTimestamps = tasks
|
|
14
|
+
.filter((task) => task.status === 'QUEUED')
|
|
15
|
+
.map((task) => parseIsoTimestamp(task.queuedAt))
|
|
16
|
+
.filter((timestamp): timestamp is number => timestamp !== null);
|
|
17
|
+
const oldestQueuedTimestamp = queuedTimestamps.length > 0 ? Math.min(...queuedTimestamps) : null;
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
runningCount: tasks.filter((task) => task.status === 'RUNNING').length,
|
|
21
|
+
queuedCount: tasks.filter((task) => task.status === 'QUEUED').length,
|
|
22
|
+
failedLast24hCount: tasks.filter(
|
|
23
|
+
(task) =>
|
|
24
|
+
task.status === 'FAILED' &&
|
|
25
|
+
isIsoTimestampAtOrAfter(task.finishedAt, nowTimestamp - 24 * HOUR_IN_MILLISECONDS),
|
|
26
|
+
).length,
|
|
27
|
+
oldestQueuedAgeMs: oldestQueuedTimestamp === null ? null : Math.max(0, nowTimestamp - oldestQueuedTimestamp),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { AdminChatTaskRecord } from '../../chatTasksAdmin';
|
|
2
|
+
import type { ParsedAdminChatTaskQuery } from '../parseAdminChatTaskQuery';
|
|
3
|
+
import { HOUR_IN_MILLISECONDS, isIsoTimestampAtOrAfter } from './adminChatTaskTimeUtilities';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Keeps only the tasks that belong to the requested admin task-manager view and search.
|
|
7
|
+
*
|
|
8
|
+
* @private function of `getAdminChatTasks`
|
|
9
|
+
*/
|
|
10
|
+
export function filterAdminChatTasks(
|
|
11
|
+
tasks: ReadonlyArray<AdminChatTaskRecord>,
|
|
12
|
+
query: ParsedAdminChatTaskQuery,
|
|
13
|
+
nowTimestamp: number,
|
|
14
|
+
): Array<AdminChatTaskRecord> {
|
|
15
|
+
return tasks.filter(
|
|
16
|
+
(task) => matchesAdminChatTaskView(task, query, nowTimestamp) && matchesAdminChatTaskSearch(task, query.search),
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns whether one task belongs in the requested admin task-manager view.
|
|
22
|
+
*
|
|
23
|
+
* @private function of `getAdminChatTasks`
|
|
24
|
+
*/
|
|
25
|
+
function matchesAdminChatTaskView(
|
|
26
|
+
task: AdminChatTaskRecord,
|
|
27
|
+
query: ParsedAdminChatTaskQuery,
|
|
28
|
+
nowTimestamp: number,
|
|
29
|
+
): boolean {
|
|
30
|
+
switch (query.view) {
|
|
31
|
+
case 'running':
|
|
32
|
+
return task.status === 'RUNNING';
|
|
33
|
+
case 'queued':
|
|
34
|
+
return task.status === 'QUEUED';
|
|
35
|
+
case 'failed':
|
|
36
|
+
return (
|
|
37
|
+
task.status === 'FAILED' &&
|
|
38
|
+
isIsoTimestampAtOrAfter(task.finishedAt, nowTimestamp - 24 * HOUR_IN_MILLISECONDS)
|
|
39
|
+
);
|
|
40
|
+
case 'all':
|
|
41
|
+
return isIsoTimestampAtOrAfter(task.updatedAt, nowTimestamp - query.timeWindowHours * HOUR_IN_MILLISECONDS);
|
|
42
|
+
case 'active':
|
|
43
|
+
default:
|
|
44
|
+
return task.status === 'QUEUED' || task.status === 'RUNNING';
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Returns whether one task matches the free-text admin search input.
|
|
50
|
+
*
|
|
51
|
+
* @private function of `getAdminChatTasks`
|
|
52
|
+
*/
|
|
53
|
+
function matchesAdminChatTaskSearch(task: AdminChatTaskRecord, search: string): boolean {
|
|
54
|
+
if (!search) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (
|
|
59
|
+
task.id === search ||
|
|
60
|
+
task.id.startsWith(search) ||
|
|
61
|
+
task.chatId === search ||
|
|
62
|
+
task.chatId.startsWith(search) ||
|
|
63
|
+
task.agentPermanentId === search ||
|
|
64
|
+
task.agentPermanentId.startsWith(search)
|
|
65
|
+
) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const normalizedSearch = search.toLowerCase();
|
|
70
|
+
if ((task.agentName || '').toLowerCase().includes(normalizedSearch)) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
if ((task.username || '').toLowerCase().includes(normalizedSearch)) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return /^\d+$/.test(search) && task.userId === Number.parseInt(search, 10);
|
|
78
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { $getTableName } from '@/src/database/$getTableName';
|
|
2
|
+
import { $provideClientSql } from '@/src/database/$provideClientSql';
|
|
3
|
+
import type { ParsedAdminChatTaskQuery } from '../parseAdminChatTaskQuery';
|
|
4
|
+
import {
|
|
5
|
+
createAdminChatTaskBaseQuery,
|
|
6
|
+
createAdminChatTaskCountersQuery,
|
|
7
|
+
createAdminChatTaskListQuery,
|
|
8
|
+
} from './adminChatTaskSqlQuery';
|
|
9
|
+
import { resolveSqlCount } from './adminChatTaskSqlValues';
|
|
10
|
+
import type { GetAdminChatTasksData } from './GetAdminChatTasksData';
|
|
11
|
+
import type { AdminChatTaskCountersSqlRow, AdminChatTaskSqlRow } from './mapAdminChatTaskSqlRows';
|
|
12
|
+
import { mapAdminChatTaskCounters, mapAdminChatTaskSqlRow } from './mapAdminChatTaskSqlRows';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Loads admin task-manager data through the existing PostgreSQL raw SQL path.
|
|
16
|
+
*
|
|
17
|
+
* @private function of `getAdminChatTasks`
|
|
18
|
+
*/
|
|
19
|
+
export async function getAdminChatTasksViaClientSql(query: ParsedAdminChatTaskQuery): Promise<GetAdminChatTasksData> {
|
|
20
|
+
const sql = await $provideClientSql();
|
|
21
|
+
const userChatJobTable = quoteIdentifier(await $getTableName('UserChatJob'));
|
|
22
|
+
const userChatTimeoutTable = quoteIdentifier(await resolvePrefixedTableName('UserChatTimeout'));
|
|
23
|
+
const userTable = quoteIdentifier(await $getTableName('User'));
|
|
24
|
+
const agentTable = quoteIdentifier(await $getTableName('Agent'));
|
|
25
|
+
const baseTaskQuery = createAdminChatTaskBaseQuery({
|
|
26
|
+
userChatJobTable,
|
|
27
|
+
userChatTimeoutTable,
|
|
28
|
+
userTable,
|
|
29
|
+
agentTable,
|
|
30
|
+
});
|
|
31
|
+
const listQuery = createAdminChatTaskListQuery({ baseTaskQuery, query });
|
|
32
|
+
const listRows = await sql.raw<Array<AdminChatTaskSqlRow>>(listQuery.sql, listQuery.values);
|
|
33
|
+
const counterRows = await sql.raw<Array<AdminChatTaskCountersSqlRow>>(
|
|
34
|
+
createAdminChatTaskCountersQuery({ baseTaskQuery }),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
items: listRows.map(mapAdminChatTaskSqlRow),
|
|
39
|
+
counters: mapAdminChatTaskCounters(counterRows[0]),
|
|
40
|
+
total: resolveSqlCount(listRows[0]?.totalCount),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Quotes one trusted internal table identifier for raw SQL usage.
|
|
46
|
+
*
|
|
47
|
+
* @private function of `getAdminChatTasks`
|
|
48
|
+
*/
|
|
49
|
+
function quoteIdentifier(identifier: string): string {
|
|
50
|
+
return `"${identifier.replace(/"/g, '""')}"`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Resolves one prefixed table name using the runtime-configured Supabase prefix.
|
|
55
|
+
*
|
|
56
|
+
* @private function of `getAdminChatTasks`
|
|
57
|
+
*/
|
|
58
|
+
async function resolvePrefixedTableName(tableName: string): Promise<string> {
|
|
59
|
+
const prefixedUserTable = await $getTableName('User');
|
|
60
|
+
const tablePrefix = prefixedUserTable.slice(0, prefixedUserTable.length - 'User'.length);
|
|
61
|
+
return `${tablePrefix}${tableName}`;
|
|
62
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ParsedAdminChatTaskQuery } from '../parseAdminChatTaskQuery';
|
|
2
|
+
import { compareAdminChatTasks } from './compareAdminChatTasks';
|
|
3
|
+
import { createAdminChatTaskCounters } from './createAdminChatTaskCounters';
|
|
4
|
+
import { filterAdminChatTasks } from './filterAdminChatTasks';
|
|
5
|
+
import type { GetAdminChatTasksData } from './GetAdminChatTasksData';
|
|
6
|
+
import { loadAdminChatTaskFallbackData } from './loadAdminChatTaskFallbackData';
|
|
7
|
+
import { mapAdminChatTaskFallbackRows } from './mapAdminChatTaskFallbackRows';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Loads admin task-manager data through the shared Supabase-shaped adapters used by SQLite mode.
|
|
11
|
+
*
|
|
12
|
+
* @private function of `getAdminChatTasks`
|
|
13
|
+
*/
|
|
14
|
+
export async function getAdminChatTasksViaSupabaseQuery(
|
|
15
|
+
query: ParsedAdminChatTaskQuery,
|
|
16
|
+
): Promise<GetAdminChatTasksData> {
|
|
17
|
+
const allTasks = mapAdminChatTaskFallbackRows(await loadAdminChatTaskFallbackData());
|
|
18
|
+
const nowTimestamp = Date.now();
|
|
19
|
+
const filteredTasks = filterAdminChatTasks(allTasks, query, nowTimestamp).sort((leftTask, rightTask) =>
|
|
20
|
+
compareAdminChatTasks(leftTask, rightTask, query.view),
|
|
21
|
+
);
|
|
22
|
+
const pageOffset = (query.page - 1) * query.pageSize;
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
items: filteredTasks.slice(pageOffset, pageOffset + query.pageSize),
|
|
26
|
+
counters: createAdminChatTaskCounters(allTasks, nowTimestamp),
|
|
27
|
+
total: filteredTasks.length,
|
|
28
|
+
};
|
|
29
|
+
}
|