@promptbook/cli 0.114.0-5 → 0.114.0-7
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/agents/default/developer.book +1 -0
- package/apps/agents-server/next.config.ts +22 -0
- package/apps/agents-server/package.json +6 -6
- package/apps/agents-server/scripts/build-agents-server.js +43 -7
- package/apps/agents-server/scripts/build-e2e.js +12 -2
- package/apps/agents-server/scripts/generate-reserved-paths/generate-reserved-paths.ts +30 -16
- package/apps/agents-server/scripts/kill-port.js +163 -0
- package/apps/agents-server/scripts/run-e2e-tests.js +21 -8
- package/apps/agents-server/scripts/run-npm.js +81 -5
- package/apps/agents-server/src/app/actions.ts +3 -0
- package/apps/agents-server/src/app/admin/email-server/page.tsx +17 -18
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskRow.tsx +2 -0
- package/apps/agents-server/src/app/admin/task-manager/[taskId]/TaskManagerTaskDetailClient.tsx +2 -0
- package/apps/agents-server/src/app/admin/task-manager/taskManagerTaskPresentation.tsx +23 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +7 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/[timeoutId]/route.ts +10 -153
- package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/route.ts +9 -4
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/route.ts +3 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/stream/route.ts +2 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/resolveUserChatScope.ts +8 -1
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/route.ts +15 -7
- package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorSaving.ts +18 -28
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatHistoryClient.tsx +19 -1
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatSidebarDefault.tsx +17 -5
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentGoalChatNotice.tsx +23 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentGoalChatPlannedMessages.tsx +153 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatPanel.tsx +6 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatSurface.tsx +13 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/ExternalUserChatAdminActions.tsx +51 -3
- package/apps/agents-server/src/app/agents/[agentName]/chat/TeamMemberFrozenChatPrimaryAgentLink.tsx +31 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/useAgentChatSidebarState.ts +26 -2
- package/apps/agents-server/src/app/agents/[agentName]/goal/page.tsx +35 -0
- package/apps/agents-server/src/app/agents/[agentName]/projects/[projectName]/page.tsx +2 -2
- package/apps/agents-server/src/app/api/admin/dns-records/cloudflare/route.ts +26 -16
- package/apps/agents-server/src/app/api/emails/incoming/stalwart/route.ts +9 -2
- package/apps/agents-server/src/app/superadmin/servers/ServersRegistryTable.tsx +31 -39
- package/apps/agents-server/src/components/AgentProfile/AgentProfile.tsx +10 -3
- package/apps/agents-server/src/components/AgentProjects/AgentProjectIcon.tsx +137 -0
- package/apps/agents-server/src/components/AgentProjects/AgentProjectItem.tsx +26 -10
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsApiTokenImportStep.tsx +5 -6
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsCheckStep.tsx +6 -5
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsManualStep.tsx +10 -14
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsWizard.tsx +11 -20
- package/apps/agents-server/src/components/CloudflareDnsWizard/useCloudflareDnsRecordImport.ts +5 -6
- package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsInstructions.tsx +91 -57
- package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsSectionPanel.tsx +63 -0
- package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsSectionVariantTabs.tsx +67 -0
- package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsTable.tsx +40 -0
- package/apps/agents-server/src/components/Header/buildActiveAgentViewItems.ts +5 -4
- package/apps/agents-server/src/components/Header/createAgentViewLabel.tsx +4 -4
- package/apps/agents-server/src/components/Header/resolveActiveAgentNavigation.ts +2 -2
- package/apps/agents-server/src/components/Homepage/useAgentsListImportExportState.ts +22 -10
- package/apps/agents-server/src/components/_utils/generateMetaTxt.ts +1 -1
- package/apps/agents-server/src/database/migratePrefix.ts +13 -12
- package/apps/agents-server/src/database/migrations/2026-08-0100-agent-goal-chat-source.sql +10 -0
- package/apps/agents-server/src/generated/reservedPaths.ts +42 -42
- package/apps/agents-server/src/languages/ServerTranslationKeys.ts +9 -1
- package/apps/agents-server/src/languages/translations/czech.yaml +9 -1
- package/apps/agents-server/src/languages/translations/english.yaml +9 -1
- package/apps/agents-server/src/message-providers/email/stalwart/parseInboundStalwartEmail.ts +17 -2
- package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatConstants.ts +9 -0
- package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatIdentity.ts +28 -0
- package/apps/agents-server/src/utils/agentGoalChat/appendAgentGoalChatNote.ts +43 -0
- package/apps/agents-server/src/utils/agentGoalChat/canAccessAgentGoalChat.ts +14 -0
- package/apps/agents-server/src/utils/agentGoalChat/createAgentGoalChatNoteContent.ts +69 -0
- package/apps/agents-server/src/utils/agentGoalChat/ensureAgentGoalChat.ts +66 -0
- package/apps/agents-server/src/utils/agentGoalChat/prependAgentGoalChatSummarySeed.ts +40 -0
- package/apps/agents-server/src/utils/agentGoalChat/recordAgentGoalChatLifecycleNote.ts +36 -0
- package/apps/agents-server/src/utils/agentGoalChat/resolveAgentGoalChatOwnerUserId.ts +104 -0
- package/apps/agents-server/src/utils/agentGoalChat/scheduleAgentGoalChatModifiedNote.ts +82 -0
- package/apps/agents-server/src/utils/agentGoalChat.ts +19 -0
- package/apps/agents-server/src/utils/agentProjects/AgentProjectInfo.ts +10 -1
- package/apps/agents-server/src/utils/agentProjects/AgentProjectReferenceInfo.ts +5 -2
- package/apps/agents-server/src/utils/agentProjects/agentProjectFileNames.ts +21 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectHrefs.ts +20 -11
- package/apps/agents-server/src/utils/agentProjects/agentProjectsPaths.ts +15 -5
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectInitials.ts +36 -0
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectMarkdownReferences.ts +11 -9
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectsDnsRecordsSection.ts +113 -0
- package/apps/agents-server/src/utils/agentProjects/createStaticAgentProjectServer.ts +2 -6
- package/apps/agents-server/src/utils/agentProjects/humanizeAgentProjectName.ts +25 -0
- package/apps/agents-server/src/utils/agentProjects/listAgentProjectChatReferences.ts +10 -3
- package/apps/agents-server/src/utils/agentProjects/parseAgentProjectIndexHtml.ts +167 -0
- package/apps/agents-server/src/utils/agentProjects/readAgentProjectIndexHtmlProfile.ts +24 -0
- package/apps/agents-server/src/utils/agentProjects/readAgentProjectReadme.ts +3 -53
- package/apps/agents-server/src/utils/agentProjects/readAgentProjectRootTextFile.ts +73 -0
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectFaviconRelativePath.ts +108 -0
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectInfo.ts +12 -3
- package/apps/agents-server/src/utils/agentProjects/{resolveAgentProjectReadmeProfile.ts → resolveAgentProjectProfile.ts} +33 -33
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectPublicUrls.ts +34 -0
- package/apps/agents-server/src/utils/bookLanguageDocumentation/createBookLanguageDocumentationPdfResponse.ts +19 -17
- package/apps/agents-server/src/utils/chatTasksAdmin.ts +9 -0
- package/apps/agents-server/src/utils/dnsRecords/DnsRecordInstruction.ts +20 -0
- package/apps/agents-server/src/utils/dnsRecords/DnsRecordsSection.ts +77 -0
- package/apps/agents-server/src/utils/dnsRecords/createServerDnsRecordsSections.ts +58 -0
- package/apps/agents-server/src/utils/dnsRecords/createServerDomainDnsRecordsSection.ts +48 -0
- package/apps/agents-server/src/utils/dnsRecords/dnsRecordGroups.ts +52 -0
- package/apps/agents-server/src/utils/dnsRecords/resolveDnsRecordBatchPlan.ts +47 -1
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/adminChatTaskSqlQuery.ts +41 -36
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskFallbackRows.ts +3 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskSqlRows.ts +2 -0
- package/apps/agents-server/src/utils/localChatRunner/parseLocalTeamConversations.ts +281 -0
- package/apps/agents-server/src/utils/localChatRunner/persistLocalTeamConversations.ts +71 -0
- package/apps/agents-server/src/utils/localChatRunner/prepareLocalTeamConversationWorkspace.ts +233 -0
- package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +37 -6
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/insertManagedServerRegistryRow.ts +2 -2
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerCoreAgents.ts +7 -6
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerDefaultAgents.ts +5 -4
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerMetadata.ts +3 -2
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerUsers.ts +3 -2
- package/apps/agents-server/src/utils/serverManagement/deleteManagedServer.ts +2 -2
- package/apps/agents-server/src/utils/stalwart/createEmailDnsRecordsSection.ts +53 -0
- package/apps/agents-server/src/utils/userChat/UserChatRecord.ts +13 -0
- package/apps/agents-server/src/utils/userChat/UserChatSource.ts +14 -0
- package/apps/agents-server/src/utils/userChat/createUserChatSummary.ts +10 -2
- package/apps/agents-server/src/utils/userChat/finalizeUserChatJob.ts +3 -2
- package/apps/agents-server/src/utils/userChat/getUserChat.ts +16 -1
- package/apps/agents-server/src/utils/userChat/getUserChatForJobRunner.ts +31 -0
- package/apps/agents-server/src/utils/userChat/listUserChats.ts +113 -110
- package/apps/agents-server/src/utils/userChat/persistFrozenUserChat.ts +21 -6
- package/apps/agents-server/src/utils/userChat/runImmediateUserChatAnswer.ts +2 -6
- package/apps/agents-server/src/utils/userChat/runUserChatJob.ts +2 -6
- package/apps/agents-server/src/utils/userChat/teamMemberUserChatContext.ts +63 -0
- package/apps/agents-server/src/utils/userChat.ts +5 -1
- package/apps/agents-server/src/utils/userChatClient/cancelAgentUserTimeout.ts +2 -2
- package/apps/agents-server/src/utils/userChatClient/fetchAgentUserTimeouts.ts +2 -2
- package/apps/agents-server/src/utils/userChatClient.ts +9 -31
- package/apps/agents-server/src/utils/userChatTimeout/UserChatTimeoutRecord.ts +10 -2
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/claimNextDueUserChatTimeout.ts +28 -25
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/getAgentScopedUserChatTimeout.ts +8 -4
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/listAgentUserChatTimeouts.ts +4 -1
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/recoverExpiredRunningUserChatTimeouts.ts +3 -2
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutWorker.ts +53 -0
- package/esm/index.es.js +1534 -401
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +7 -1
- package/esm/scripts/run-agent-messages/messages/buildAgentTeamPromptSection.d.ts +12 -0
- package/esm/scripts/run-agent-messages/messages/finalizeAgentTeamConversationWorkspace.d.ts +16 -0
- package/esm/scripts/run-agent-messages/messages/loadAgentTeamConversationWorkspace.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
- package/esm/scripts/run-codex-prompts/git/coderCommitScope.d.ts +31 -0
- package/esm/scripts/run-codex-prompts/git/coderGitSync.d.ts +15 -2
- package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +9 -3
- package/esm/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +40 -0
- package/esm/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
- package/esm/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
- package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
- package/esm/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +12 -3
- package/esm/src/cli/cli-commands/coder/boilerplateCount.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.d.ts → npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
- package/{umd/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts → esm/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
- package/esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +39 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.d.ts +26 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts +7 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
- package/esm/src/utils/agents/terminalAgentAvatarVisual.d.ts +5 -2
- package/esm/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +6 -0
- package/esm/src/utils/ascii-art/createAnsiColorCode.d.ts +46 -0
- package/esm/src/utils/misc/debounce.d.ts +4 -2
- package/esm/src/utils/misc/debounce.test.d.ts +1 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/avatars/renderAvatarVisualTerminalText.ts +249 -0
- package/src/avatars/types/AvatarVisualDefinition.ts +60 -0
- package/src/avatars/visuals/asciiOctopusAvatarVisual.ts +144 -22
- package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +4 -4
- package/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.ts +1 -4
- package/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.ts +4 -17
- package/src/book-3.0/AgentTeamConversationWorkspace.ts +172 -0
- package/src/book-components/BookEditor/useBookEditorMonacoStyles.ts +56 -55
- package/src/book-components/Chat/Chat/Chat.module.css +1 -8
- package/src/book-components/Chat/Chat/ChatMessageMap.tsx +8 -4
- package/src/book-components/Chat/Chat/ChatProps.tsx +3 -2
- package/src/book-components/Chat/MarkdownContent/MarkdownContent.module.css +14 -14
- package/src/book-components/Chat/save/react/exports/chat-preview-2025-10-13 (1).jsx +95 -5
- package/src/book-components/Chat/utils/renderMarkdown.ts +535 -89
- package/src/cli/cli-commands/coder/add.ts +3 -3
- package/src/cli/cli-commands/coder/boilerplateCount.ts +1 -1
- package/src/cli/cli-commands/coder/generate-boilerplates.ts +27 -27
- package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +5 -4
- package/src/cli/cli-commands/coder/init.ts +3 -3
- package/src/cli/cli-commands/coder/run.ts +10 -2
- package/src/cli/cli-commands/common/coderGitSyncCliOptions.ts +6 -2
- package/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.ts +2 -2
- package/src/cli/cli-commands/common/harness/$checkHarnessInstallation.ts +4 -4
- package/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.ts +2 -2
- package/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.ts → npm/$askForNpmPackageInstallationApproval.ts} +3 -3
- package/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.ts +49 -0
- package/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.ts +25 -0
- package/src/cli/cli-commands/common/{harness/isHarnessVersionOutdated.ts → npm/isNpmPackageVersionOutdated.ts} +6 -4
- package/src/cli/cli-commands/common/projectInitialization.ts +10 -1
- package/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.ts +73 -0
- package/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.ts +94 -0
- package/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.ts +223 -0
- package/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.ts +53 -0
- package/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.ts +46 -0
- package/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.ts +32 -0
- package/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.ts +22 -0
- package/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.ts +47 -0
- package/src/commands/FORMAT/formatCommandParser.ts +2 -2
- package/src/llm-providers/openai/utils/buildToolInvocationScript.ts +21 -18
- package/src/other/templates/getTemplatesPipelineCollection.ts +976 -668
- package/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.ts +80 -27
- package/src/utils/agents/terminalAgentAvatarVisual.ts +31 -3
- package/src/utils/ascii-art/convertImageDataToAsciiArt.ts +9 -109
- package/src/utils/ascii-art/createAnsiColorCode.ts +132 -0
- package/src/utils/misc/debounce.ts +26 -5
- package/src/version.ts +2 -2
- package/src/versions.txt +2 -0
- package/umd/index.umd.js +1533 -400
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +7 -1
- package/umd/scripts/run-agent-messages/messages/buildAgentTeamPromptSection.d.ts +12 -0
- package/umd/scripts/run-agent-messages/messages/finalizeAgentTeamConversationWorkspace.d.ts +16 -0
- package/umd/scripts/run-agent-messages/messages/loadAgentTeamConversationWorkspace.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
- package/umd/scripts/run-codex-prompts/git/coderCommitScope.d.ts +31 -0
- package/umd/scripts/run-codex-prompts/git/coderGitSync.d.ts +15 -2
- package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +9 -3
- package/umd/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +40 -0
- package/umd/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
- package/umd/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
- package/umd/src/avatars/renderAvatarVisualTerminalText.test.d.ts +1 -0
- package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
- package/umd/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +12 -3
- package/umd/src/cli/cli-commands/coder/boilerplateCount.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
- package/umd/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.d.ts → npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
- package/{esm/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts → umd/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
- package/umd/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +39 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.d.ts +26 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts +7 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
- package/umd/src/utils/agents/terminalAgentAvatarVisual.d.ts +5 -2
- package/umd/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +6 -0
- package/umd/src/utils/ascii-art/createAnsiColorCode.d.ts +46 -0
- package/umd/src/utils/misc/debounce.d.ts +4 -2
- package/umd/src/utils/misc/debounce.test.d.ts +1 -0
- package/umd/src/version.d.ts +1 -1
- package/apps/agents-server/scripts/ignore-kill-eperm.js +0 -31
- package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/actions/route.ts +0 -103
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsClient.tsx +0 -43
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsEditDialog.tsx +0 -98
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsFiltersCard.tsx +0 -75
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsHeader.tsx +0 -53
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsSummaryMetrics.tsx +0 -70
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableCard.tsx +0 -58
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableRow.tsx +0 -242
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/loading.tsx +0 -15
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/page.tsx +0 -28
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/useAgentTimeoutsClientState.ts +0 -769
- package/apps/agents-server/src/components/AgentProjectDnsInstructions/AgentProjectDnsInstructions.tsx +0 -182
- package/apps/agents-server/src/utils/userChatClient/runAgentUserTimeoutBulkAction.ts +0 -24
- package/apps/agents-server/src/utils/userChatClient/updateAgentUserTimeout.ts +0 -25
- package/esm/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +0 -11
- package/esm/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +0 -9
- package/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.ts +0 -34
- package/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.ts +0 -28
- package/umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +0 -11
- package/umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +0 -9
- /package/esm/src/{cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → avatars/renderAvatarVisualTerminalText.test.d.ts} +0 -0
- /package/esm/src/cli/cli-commands/common/{harness/isHarnessVersionOutdated.test.d.ts → npm/$resolveLatestNpmPackageVersion.test.d.ts} +0 -0
- /package/{umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts} +0 -0
- /package/{umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts → esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts} +0 -0
|
@@ -72,6 +72,15 @@ export type AdminChatTaskRecord = {
|
|
|
72
72
|
workerId: string | null;
|
|
73
73
|
queueName: string | null;
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* True when the task runs in the agent's own goal chat instead of a chat started by a user.
|
|
77
|
+
*
|
|
78
|
+
* Goal-chat tasks keep their normal kind (they really are chat completions / chat timeouts) and
|
|
79
|
+
* are only flagged, so they stay in the regular task streams while remaining distinguishable
|
|
80
|
+
* from user-invoked work.
|
|
81
|
+
*/
|
|
82
|
+
isAgentGoalTask?: boolean;
|
|
83
|
+
|
|
75
84
|
/**
|
|
76
85
|
* Registered server this task belongs to, when the source task is bound to one server or the
|
|
77
86
|
* VPS-wide superadmin aggregation adds the owning server.
|
|
@@ -31,3 +31,23 @@ export type DnsRecordInstruction = {
|
|
|
31
31
|
*/
|
|
32
32
|
readonly note: string | null;
|
|
33
33
|
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* DNS records which belong together and share one all-or-one configuration rule.
|
|
37
|
+
*
|
|
38
|
+
* One DNS manual can show more groups at once, for example the server domain records, the generated project domain
|
|
39
|
+
* records, and the email records of one Agents Server.
|
|
40
|
+
*
|
|
41
|
+
* @private shared by the Agents Server DNS instruction views
|
|
42
|
+
*/
|
|
43
|
+
export type DnsRecordGroup = {
|
|
44
|
+
/**
|
|
45
|
+
* Whether every record of the group or just one of its alternatives must be configured.
|
|
46
|
+
*/
|
|
47
|
+
readonly recordSelection: DnsRecordSelection;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* DNS records of the group.
|
|
51
|
+
*/
|
|
52
|
+
readonly records: ReadonlyArray<DnsRecordInstruction>;
|
|
53
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { DnsRecordGroup } from './DnsRecordInstruction';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* One alternative setup of a DNS record section.
|
|
6
|
+
*
|
|
7
|
+
* A section with a single variant has nothing to choose from, a section with more variants lets the administrator
|
|
8
|
+
* pick exactly one of them, for example the wildcard or the single-project setup of generated project domains.
|
|
9
|
+
*
|
|
10
|
+
* @private shared by the Agents Server DNS instruction views
|
|
11
|
+
*/
|
|
12
|
+
export type DnsRecordsSectionVariant = DnsRecordGroup & {
|
|
13
|
+
/**
|
|
14
|
+
* Stable identifier of the variant, unique within its section.
|
|
15
|
+
*/
|
|
16
|
+
readonly id: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Label of the variant button.
|
|
20
|
+
*/
|
|
21
|
+
readonly label: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Explanation of what the selected variant covers.
|
|
25
|
+
*/
|
|
26
|
+
readonly description?: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* One part of the DNS setup of an Agents Server, for example its domain, its projects, or its email.
|
|
31
|
+
*
|
|
32
|
+
* Every page shows the same sections in the same shared component, just filtered down to the sections which are
|
|
33
|
+
* relevant for that page.
|
|
34
|
+
*
|
|
35
|
+
* @private shared by the Agents Server DNS instruction views
|
|
36
|
+
*/
|
|
37
|
+
export type DnsRecordsSection = {
|
|
38
|
+
/**
|
|
39
|
+
* Stable identifier of the section, unique within one DNS manual.
|
|
40
|
+
*/
|
|
41
|
+
readonly id: string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Human-readable name of the configured part, for example `Email`.
|
|
45
|
+
*/
|
|
46
|
+
readonly title: string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Explanation of what the section configures.
|
|
50
|
+
*/
|
|
51
|
+
readonly description?: ReactNode;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Label shown above the variant buttons.
|
|
55
|
+
*/
|
|
56
|
+
readonly variantsLabel?: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Alternative setups of the section, at least one of them.
|
|
60
|
+
*/
|
|
61
|
+
readonly variants: ReadonlyArray<DnsRecordsSectionVariant>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Current DNS verification state of the section, when it is known.
|
|
65
|
+
*/
|
|
66
|
+
readonly statusSummary?: string | null;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Addresses currently returned by public DNS, when verification is available.
|
|
70
|
+
*/
|
|
71
|
+
readonly resolvedAddresses?: ReadonlyArray<string>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Whether the section currently needs attention.
|
|
75
|
+
*/
|
|
76
|
+
readonly isDnsIssue?: boolean;
|
|
77
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ManagedServerDnsDiagnostic } from '../../app/superadmin/servers/ServersRegistryDnsTypes';
|
|
2
|
+
import { createAgentProjectsDnsRecordsSection } from '../agentProjects/createAgentProjectsDnsRecordsSection';
|
|
3
|
+
import { createEmailDnsRecordsSection } from '../stalwart/createEmailDnsRecordsSection';
|
|
4
|
+
import type { DnsRecordsSection } from './DnsRecordsSection';
|
|
5
|
+
import { createServerDomainDnsRecordsSection } from './createServerDomainDnsRecordsSection';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Creates every DNS section which one Agents Server needs to be fully configured.
|
|
9
|
+
*
|
|
10
|
+
* This is the single source of truth of the complete DNS setup of one server, so that `/superadmin/servers` can show
|
|
11
|
+
* the server domain, the generated project domains, and the email records in one manual and one Cloudflare wizard.
|
|
12
|
+
*
|
|
13
|
+
* @param options - Server domain, its DNS diagnostic, and the generated project domain state.
|
|
14
|
+
* @returns All DNS sections of one server.
|
|
15
|
+
*
|
|
16
|
+
* @private shared by the Agents Server DNS instruction views
|
|
17
|
+
*/
|
|
18
|
+
export function createServerDnsRecordsSections(options: {
|
|
19
|
+
/**
|
|
20
|
+
* Public domain of the Agents Server.
|
|
21
|
+
*/
|
|
22
|
+
readonly serverDomain: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* DNS verification details of the server domain, when the deployment provides them.
|
|
26
|
+
*/
|
|
27
|
+
readonly dnsDiagnostic: ManagedServerDnsDiagnostic | null | undefined;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Whether at least one generated project domain currently fails DNS verification.
|
|
31
|
+
*/
|
|
32
|
+
readonly isProjectDnsIssue?: boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Example generated project domain, when one is already assigned.
|
|
36
|
+
*/
|
|
37
|
+
readonly projectDomain?: string | null;
|
|
38
|
+
}): ReadonlyArray<DnsRecordsSection> {
|
|
39
|
+
const publicIpAddress = options.dnsDiagnostic?.publicIpAddress ?? null;
|
|
40
|
+
const serverDomainSection = createServerDomainDnsRecordsSection({
|
|
41
|
+
serverDomain: options.serverDomain,
|
|
42
|
+
dnsDiagnostic: options.dnsDiagnostic,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return [
|
|
46
|
+
...(serverDomainSection ? [serverDomainSection] : []),
|
|
47
|
+
createAgentProjectsDnsRecordsSection({
|
|
48
|
+
isDnsIssue: options.isProjectDnsIssue,
|
|
49
|
+
projectDomain: options.projectDomain,
|
|
50
|
+
publicIpAddress,
|
|
51
|
+
serverDomain: options.serverDomain,
|
|
52
|
+
}),
|
|
53
|
+
createEmailDnsRecordsSection({
|
|
54
|
+
domain: options.serverDomain,
|
|
55
|
+
publicIpAddress,
|
|
56
|
+
}),
|
|
57
|
+
];
|
|
58
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isManagedServerDnsDiagnosticIssue,
|
|
3
|
+
type ManagedServerDnsDiagnostic,
|
|
4
|
+
} from '../../app/superadmin/servers/ServersRegistryDnsTypes';
|
|
5
|
+
import type { DnsRecordsSection } from './DnsRecordsSection';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Creates the DNS section which makes the Agents Server itself reachable on its own domain.
|
|
9
|
+
*
|
|
10
|
+
* @param options - Server domain and its DNS diagnostic.
|
|
11
|
+
* @returns Server domain section, or `null` when the deployment does not verify server domains.
|
|
12
|
+
*
|
|
13
|
+
* @private shared by the Agents Server DNS instruction views
|
|
14
|
+
*/
|
|
15
|
+
export function createServerDomainDnsRecordsSection(options: {
|
|
16
|
+
/**
|
|
17
|
+
* Public domain of the Agents Server.
|
|
18
|
+
*/
|
|
19
|
+
readonly serverDomain: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* DNS verification details of the server domain, when the deployment provides them.
|
|
23
|
+
*/
|
|
24
|
+
readonly dnsDiagnostic: ManagedServerDnsDiagnostic | null | undefined;
|
|
25
|
+
}): DnsRecordsSection | null {
|
|
26
|
+
const { dnsDiagnostic, serverDomain } = options;
|
|
27
|
+
|
|
28
|
+
if (!dnsDiagnostic || dnsDiagnostic.expectedRecords.length === 0) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
id: 'server-domain',
|
|
34
|
+
title: `Server domain ${serverDomain}`,
|
|
35
|
+
description: `Makes the Agents Server reachable on ${serverDomain} and lets it issue its HTTPS certificate.`,
|
|
36
|
+
variants: [
|
|
37
|
+
{
|
|
38
|
+
id: 'server-domain',
|
|
39
|
+
label: 'Server domain',
|
|
40
|
+
recordSelection: 'one',
|
|
41
|
+
records: dnsDiagnostic.expectedRecords,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
statusSummary: dnsDiagnostic.summary,
|
|
45
|
+
resolvedAddresses: dnsDiagnostic.resolvedAddresses,
|
|
46
|
+
isDnsIssue: isManagedServerDnsDiagnosticIssue(dnsDiagnostic),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { DnsRecordGroup } from './DnsRecordInstruction';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Determines whether every record of every shown group has to be configured.
|
|
5
|
+
*
|
|
6
|
+
* @param recordGroups - Groups shown in one DNS manual.
|
|
7
|
+
* @returns `true` when no group offers alternatives.
|
|
8
|
+
*
|
|
9
|
+
* @private shared by the Agents Server DNS instruction views
|
|
10
|
+
*/
|
|
11
|
+
export function isEveryDnsRecordGroupRequired(recordGroups: ReadonlyArray<DnsRecordGroup>): boolean {
|
|
12
|
+
return recordGroups.every((recordGroup) => recordGroup.recordSelection === 'all');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Determines whether every shown group offers alternatives out of which only one may be configured.
|
|
17
|
+
*
|
|
18
|
+
* @param recordGroups - Groups shown in one DNS manual.
|
|
19
|
+
* @returns `true` when no group requires all of its records.
|
|
20
|
+
*
|
|
21
|
+
* @private shared by the Agents Server DNS instruction views
|
|
22
|
+
*/
|
|
23
|
+
export function isEveryDnsRecordGroupAlternative(recordGroups: ReadonlyArray<DnsRecordGroup>): boolean {
|
|
24
|
+
return recordGroups.every((recordGroup) => recordGroup.recordSelection === 'one');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Determines whether at least one shown group offers alternatives.
|
|
29
|
+
*
|
|
30
|
+
* Such a group can conflict with already configured records on the same hostname, so the manual has to mention
|
|
31
|
+
* removing them.
|
|
32
|
+
*
|
|
33
|
+
* @param recordGroups - Groups shown in one DNS manual.
|
|
34
|
+
* @returns `true` when at least one group offers alternatives.
|
|
35
|
+
*
|
|
36
|
+
* @private shared by the Agents Server DNS instruction views
|
|
37
|
+
*/
|
|
38
|
+
export function hasAlternativeDnsRecordGroup(recordGroups: ReadonlyArray<DnsRecordGroup>): boolean {
|
|
39
|
+
return recordGroups.some((recordGroup) => recordGroup.recordSelection === 'one');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Counts all records shown in the given groups.
|
|
44
|
+
*
|
|
45
|
+
* @param recordGroups - Groups shown in one DNS manual.
|
|
46
|
+
* @returns Number of shown records.
|
|
47
|
+
*
|
|
48
|
+
* @private shared by the Agents Server DNS instruction views
|
|
49
|
+
*/
|
|
50
|
+
export function countDnsRecordGroupRecords(recordGroups: ReadonlyArray<DnsRecordGroup>): number {
|
|
51
|
+
return recordGroups.reduce((recordCount, recordGroup) => recordCount + recordGroup.records.length, 0);
|
|
52
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DnsRecordInstruction, DnsRecordSelection } from './DnsRecordInstruction';
|
|
1
|
+
import type { DnsRecordGroup, DnsRecordInstruction, DnsRecordSelection } from './DnsRecordInstruction';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Placeholder values like `<VPS_PUBLIC_IP>` have to be filled in by a human before the record can be created.
|
|
@@ -79,3 +79,49 @@ export function resolveDnsRecordBatchPlan(options: {
|
|
|
79
79
|
|
|
80
80
|
return { applicableRecords, excludedRecords };
|
|
81
81
|
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Resolves one batch plan for all groups shown in one DNS manual.
|
|
85
|
+
*
|
|
86
|
+
* Every group keeps its own all-or-one rule, so a manual which shows the server domain, the generated project
|
|
87
|
+
* domains, and the email records at once still writes exactly the records which each of these parts needs.
|
|
88
|
+
*
|
|
89
|
+
* @param recordGroups - Groups shown in one DNS manual.
|
|
90
|
+
* @returns One batch plan covering all groups without duplicated records.
|
|
91
|
+
*/
|
|
92
|
+
export function resolveDnsRecordBatchPlanForGroups(recordGroups: ReadonlyArray<DnsRecordGroup>): DnsRecordBatchPlan {
|
|
93
|
+
const applicableRecords: Array<DnsRecordInstruction> = [];
|
|
94
|
+
const excludedRecords: Array<ExcludedDnsRecordInstruction> = [];
|
|
95
|
+
const alreadyPlannedRecordKeys = new Set<string>();
|
|
96
|
+
|
|
97
|
+
for (const recordGroup of recordGroups) {
|
|
98
|
+
const groupBatchPlan = resolveDnsRecordBatchPlan(recordGroup);
|
|
99
|
+
|
|
100
|
+
for (const record of groupBatchPlan.applicableRecords) {
|
|
101
|
+
const recordKey = createDnsRecordKey(record);
|
|
102
|
+
|
|
103
|
+
if (alreadyPlannedRecordKeys.has(recordKey)) {
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
alreadyPlannedRecordKeys.add(recordKey);
|
|
108
|
+
applicableRecords.push(record);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
excludedRecords.push(...groupBatchPlan.excludedRecords);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return { applicableRecords, excludedRecords };
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Creates the identity of one DNS record used to keep the batch free of duplicates.
|
|
119
|
+
*
|
|
120
|
+
* @param record - DNS record shown in the DNS manual.
|
|
121
|
+
* @returns Case-insensitive record key.
|
|
122
|
+
*
|
|
123
|
+
* @private function of `resolveDnsRecordBatchPlanForGroups`
|
|
124
|
+
*/
|
|
125
|
+
function createDnsRecordKey(record: DnsRecordInstruction): string {
|
|
126
|
+
return [record.type.toUpperCase(), record.name.toLowerCase(), record.value].join('\t');
|
|
127
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spaceTrim } from 'spacetrim';
|
|
1
2
|
import type { AdminChatTaskSortField, AdminChatTaskSortOrder, AdminChatTaskView } from '../../chatTasksAdmin';
|
|
2
3
|
import type { ParsedAdminChatTaskQuery } from '../parseAdminChatTaskQuery';
|
|
3
4
|
|
|
@@ -12,7 +13,7 @@ export function createAdminChatTaskBaseQuery(options: {
|
|
|
12
13
|
userTable: string;
|
|
13
14
|
agentTable: string;
|
|
14
15
|
}): string {
|
|
15
|
-
return `
|
|
16
|
+
return spaceTrim(`
|
|
16
17
|
SELECT
|
|
17
18
|
job."id" AS "id",
|
|
18
19
|
'CHAT_COMPLETION'::text AS "kind",
|
|
@@ -70,7 +71,7 @@ export function createAdminChatTaskBaseQuery(options: {
|
|
|
70
71
|
FROM ${options.userChatTimeoutTable} timeout
|
|
71
72
|
LEFT JOIN ${options.userTable} "user" ON "user"."id" = timeout."userId"
|
|
72
73
|
LEFT JOIN ${options.agentTable} agent ON agent."permanentId" = timeout."agentPermanentId"
|
|
73
|
-
|
|
74
|
+
`);
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
/**
|
|
@@ -85,19 +86,21 @@ export function createAdminChatTaskListQuery(options: { baseTaskQuery: string; q
|
|
|
85
86
|
const listQueryParts = createAdminChatTaskListQueryParts(options.query);
|
|
86
87
|
|
|
87
88
|
return {
|
|
88
|
-
sql:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
89
|
+
sql: spaceTrim(
|
|
90
|
+
(block) => `
|
|
91
|
+
WITH tasks AS (
|
|
92
|
+
${block(options.baseTaskQuery)}
|
|
93
|
+
)
|
|
94
|
+
SELECT
|
|
95
|
+
task.*,
|
|
96
|
+
COUNT(*) OVER() AS "totalCount"
|
|
97
|
+
FROM tasks task
|
|
98
|
+
${block(listQueryParts.whereClause)}
|
|
99
|
+
ORDER BY ${block(createAdminChatTaskOrderBySql(options.query, 'task'))}
|
|
100
|
+
LIMIT $${listQueryParts.limitPlaceholder}
|
|
101
|
+
OFFSET $${listQueryParts.offsetPlaceholder}
|
|
102
|
+
`,
|
|
103
|
+
),
|
|
101
104
|
values: listQueryParts.values,
|
|
102
105
|
};
|
|
103
106
|
}
|
|
@@ -108,23 +111,25 @@ export function createAdminChatTaskListQuery(options: { baseTaskQuery: string; q
|
|
|
108
111
|
* @private function of `getAdminChatTasks`
|
|
109
112
|
*/
|
|
110
113
|
export function createAdminChatTaskCountersQuery(options: { baseTaskQuery: string }): string {
|
|
111
|
-
return
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
114
|
+
return spaceTrim(
|
|
115
|
+
(block) => `
|
|
116
|
+
WITH tasks AS (
|
|
117
|
+
${block(options.baseTaskQuery)}
|
|
118
|
+
)
|
|
119
|
+
SELECT
|
|
120
|
+
COUNT(*) FILTER (WHERE "status" = 'RUNNING') AS "runningCount",
|
|
121
|
+
COUNT(*) FILTER (WHERE "status" = 'QUEUED') AS "queuedCount",
|
|
122
|
+
COUNT(*) FILTER (
|
|
123
|
+
WHERE "status" = 'FAILED'
|
|
124
|
+
AND "finishedAt" >= CURRENT_TIMESTAMP - INTERVAL '24 hours'
|
|
125
|
+
) AS "failedLast24hCount",
|
|
126
|
+
CASE
|
|
127
|
+
WHEN MIN("queuedAt") FILTER (WHERE "status" = 'QUEUED') IS NULL THEN NULL
|
|
128
|
+
ELSE EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - MIN("queuedAt") FILTER (WHERE "status" = 'QUEUED'))) * 1000
|
|
129
|
+
END AS "oldestQueuedAgeMs"
|
|
130
|
+
FROM tasks
|
|
131
|
+
`,
|
|
132
|
+
);
|
|
128
133
|
}
|
|
129
134
|
|
|
130
135
|
/**
|
|
@@ -265,7 +270,7 @@ function createAdminChatTaskDefaultOrderBySql(view: AdminChatTaskView, alias: st
|
|
|
265
270
|
return `${createAdminChatTaskTimelineExpressionSql(alias)} DESC NULLS LAST, ${alias}."updatedAt" DESC, ${alias}."createdAt" DESC, ${alias}."id" DESC`;
|
|
266
271
|
case 'active':
|
|
267
272
|
default:
|
|
268
|
-
return `
|
|
273
|
+
return spaceTrim(`
|
|
269
274
|
CASE
|
|
270
275
|
WHEN ${alias}."status" = 'RUNNING' THEN 0
|
|
271
276
|
WHEN ${alias}."status" = 'QUEUED' THEN 1
|
|
@@ -281,7 +286,7 @@ function createAdminChatTaskDefaultOrderBySql(view: AdminChatTaskView, alias: st
|
|
|
281
286
|
END DESC NULLS LAST,
|
|
282
287
|
${alias}."updatedAt" DESC,
|
|
283
288
|
${alias}."id" DESC
|
|
284
|
-
|
|
289
|
+
`);
|
|
285
290
|
}
|
|
286
291
|
}
|
|
287
292
|
|
|
@@ -328,13 +333,13 @@ function createAdminChatTaskCustomOrderBySql(
|
|
|
328
333
|
* @private function of `getAdminChatTasks`
|
|
329
334
|
*/
|
|
330
335
|
function createAdminChatTaskTimelineExpressionSql(alias: string): string {
|
|
331
|
-
return `
|
|
336
|
+
return spaceTrim(`
|
|
332
337
|
CASE
|
|
333
338
|
WHEN ${alias}."status" = 'RUNNING' THEN COALESCE(${alias}."startedAt", ${alias}."createdAt")
|
|
334
339
|
WHEN ${alias}."status" = 'QUEUED' THEN ${alias}."createdAt"
|
|
335
340
|
ELSE COALESCE(${alias}."finishedAt", ${alias}."updatedAt", ${alias}."createdAt")
|
|
336
341
|
END
|
|
337
|
-
|
|
342
|
+
`);
|
|
338
343
|
}
|
|
339
344
|
|
|
340
345
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isAgentGoalChatId } from '../../agentGoalChat/agentGoalChatIdentity';
|
|
1
2
|
import type { AdminChatTaskRecord } from '../../chatTasksAdmin';
|
|
2
3
|
import { getUserChatJobRunReportFromParameters } from '../../userChat/userChatJobRunReport';
|
|
3
4
|
import { resolveNullableSqlNumber } from './adminChatTaskSqlValues';
|
|
@@ -57,6 +58,7 @@ function mapAdminChatTaskJobRow(
|
|
|
57
58
|
chatId: row.chatId,
|
|
58
59
|
workerId: null,
|
|
59
60
|
queueName: 'user-chat-jobs',
|
|
61
|
+
isAgentGoalTask: isAgentGoalChatId(row.chatId),
|
|
60
62
|
runReport: getUserChatJobRunReportFromParameters(row.parameters),
|
|
61
63
|
};
|
|
62
64
|
}
|
|
@@ -97,5 +99,6 @@ function mapAdminChatTaskTimeoutRow(
|
|
|
97
99
|
chatId: row.chatId,
|
|
98
100
|
workerId: null,
|
|
99
101
|
queueName: 'user-chat-timeouts',
|
|
102
|
+
isAgentGoalTask: isAgentGoalChatId(row.chatId),
|
|
100
103
|
};
|
|
101
104
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isAgentGoalChatId } from '../../agentGoalChat/agentGoalChatIdentity';
|
|
1
2
|
import type { AdminChatTaskCounters, AdminChatTaskRecord } from '../../chatTasksAdmin';
|
|
2
3
|
import type { UserChatJobStatus } from '../../userChat/UserChatJobRecord';
|
|
3
4
|
import { getUserChatJobRunReportFromParameters } from '../../userChat/userChatJobRunReport';
|
|
@@ -79,6 +80,7 @@ export function mapAdminChatTaskSqlRow(row: AdminChatTaskSqlRow): AdminChatTaskR
|
|
|
79
80
|
chatId: row.chatId,
|
|
80
81
|
workerId: null,
|
|
81
82
|
queueName: row.queueName,
|
|
83
|
+
isAgentGoalTask: isAgentGoalChatId(row.chatId),
|
|
82
84
|
runReport: getUserChatJobRunReportFromParameters(row.parameters),
|
|
83
85
|
};
|
|
84
86
|
}
|