@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
4
|
+
import type { DnsRecordGroup } from '../../utils/dnsRecords/DnsRecordInstruction';
|
|
5
|
+
import { resolveDnsRecordBatchPlanForGroups } from '../../utils/dnsRecords/resolveDnsRecordBatchPlan';
|
|
6
6
|
import { CloudflareDnsApiTokenImportStep } from './CloudflareDnsApiTokenImportStep';
|
|
7
7
|
import { CloudflareDnsCheckStep } from './CloudflareDnsCheckStep';
|
|
8
8
|
import { CloudflareDnsManualStep } from './CloudflareDnsManualStep';
|
|
@@ -15,14 +15,14 @@ import { CloudflareDnsZoneFileImportStep } from './CloudflareDnsZoneFileImportSt
|
|
|
15
15
|
*
|
|
16
16
|
* The record table remains the single source of truth for the values to configure. This wizard adds the two batch
|
|
17
17
|
* ways of configuring all of them at once - an API token import and a zone file import - and keeps the manual steps
|
|
18
|
-
* as a fallback.
|
|
18
|
+
* as a fallback. All record groups of the DNS manual, for example the server domain, the generated project domains,
|
|
19
|
+
* and the email records, are configured by this one wizard together.
|
|
19
20
|
*
|
|
20
21
|
* @private shared by the Agents Server DNS instruction views
|
|
21
22
|
*/
|
|
22
23
|
export function CloudflareDnsWizard({
|
|
23
24
|
domain,
|
|
24
|
-
|
|
25
|
-
records,
|
|
25
|
+
recordGroups,
|
|
26
26
|
}: {
|
|
27
27
|
/**
|
|
28
28
|
* Hostname whose DNS records are being configured.
|
|
@@ -30,16 +30,11 @@ export function CloudflareDnsWizard({
|
|
|
30
30
|
readonly domain: string;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* All record groups displayed by the parent instruction panel.
|
|
34
34
|
*/
|
|
35
|
-
readonly
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* The canonical DNS records displayed by the parent instruction panel.
|
|
39
|
-
*/
|
|
40
|
-
readonly records: ReadonlyArray<DnsRecordInstruction>;
|
|
35
|
+
readonly recordGroups: ReadonlyArray<DnsRecordGroup>;
|
|
41
36
|
}) {
|
|
42
|
-
const batchPlan =
|
|
37
|
+
const batchPlan = resolveDnsRecordBatchPlanForGroups(recordGroups);
|
|
43
38
|
const isBatchImportAvailable = batchPlan.applicableRecords.length > 0;
|
|
44
39
|
const availableSteps = CLOUDFLARE_DNS_WIZARD_STEPS.filter((step) => isBatchImportAvailable || !step.isBatchStep);
|
|
45
40
|
const [currentStep, setCurrentStep] = useState<CloudflareDnsWizardStep>(
|
|
@@ -67,11 +62,7 @@ export function CloudflareDnsWizard({
|
|
|
67
62
|
/>
|
|
68
63
|
|
|
69
64
|
{currentStep === 'import-with-api-token' ? (
|
|
70
|
-
<CloudflareDnsApiTokenImportStep
|
|
71
|
-
batchPlan={batchPlan}
|
|
72
|
-
domain={domain}
|
|
73
|
-
recordSelection={recordSelection}
|
|
74
|
-
/>
|
|
65
|
+
<CloudflareDnsApiTokenImportStep batchPlan={batchPlan} domain={domain} recordGroups={recordGroups} />
|
|
75
66
|
) : null}
|
|
76
67
|
|
|
77
68
|
{currentStep === 'import-zone-file' ? (
|
|
@@ -79,10 +70,10 @@ export function CloudflareDnsWizard({
|
|
|
79
70
|
) : null}
|
|
80
71
|
|
|
81
72
|
{currentStep === 'add-manually' ? (
|
|
82
|
-
<CloudflareDnsManualStep domain={domain}
|
|
73
|
+
<CloudflareDnsManualStep domain={domain} recordGroups={recordGroups} />
|
|
83
74
|
) : null}
|
|
84
75
|
|
|
85
|
-
{currentStep === 'check-dns' ? <CloudflareDnsCheckStep
|
|
76
|
+
{currentStep === 'check-dns' ? <CloudflareDnsCheckStep recordGroups={recordGroups} /> : null}
|
|
86
77
|
</section>
|
|
87
78
|
);
|
|
88
79
|
}
|
package/apps/agents-server/src/components/CloudflareDnsWizard/useCloudflareDnsRecordImport.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useCallback, useState } from 'react';
|
|
4
4
|
import type { CloudflareDnsBatchApplication } from '../../utils/cloudflare/CloudflareDnsBatchApplication';
|
|
5
|
-
import type {
|
|
5
|
+
import type { DnsRecordGroup } from '../../utils/dnsRecords/DnsRecordInstruction';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Endpoint which writes the records of one DNS manual into Cloudflare.
|
|
@@ -23,8 +23,7 @@ const CLOUDFLARE_DNS_IMPORT_ENDPOINT = '/api/admin/dns-records/cloudflare';
|
|
|
23
23
|
*/
|
|
24
24
|
export function useCloudflareDnsRecordImport(options: {
|
|
25
25
|
readonly domain: string;
|
|
26
|
-
readonly
|
|
27
|
-
readonly records: ReadonlyArray<DnsRecordInstruction>;
|
|
26
|
+
readonly recordGroups: ReadonlyArray<DnsRecordGroup>;
|
|
28
27
|
}): {
|
|
29
28
|
readonly isImporting: boolean;
|
|
30
29
|
readonly application: CloudflareDnsBatchApplication | null;
|
|
@@ -34,7 +33,7 @@ export function useCloudflareDnsRecordImport(options: {
|
|
|
34
33
|
const [isImporting, setIsImporting] = useState(false);
|
|
35
34
|
const [application, setApplication] = useState<CloudflareDnsBatchApplication | null>(null);
|
|
36
35
|
const [errorMessage, setErrorMessage] = useState<string | null>(null);
|
|
37
|
-
const { domain,
|
|
36
|
+
const { domain, recordGroups } = options;
|
|
38
37
|
|
|
39
38
|
const importRecords = useCallback(
|
|
40
39
|
async (apiToken: string) => {
|
|
@@ -46,7 +45,7 @@ export function useCloudflareDnsRecordImport(options: {
|
|
|
46
45
|
const response = await fetch(CLOUDFLARE_DNS_IMPORT_ENDPOINT, {
|
|
47
46
|
method: 'POST',
|
|
48
47
|
headers: { 'Content-Type': 'application/json' },
|
|
49
|
-
body: JSON.stringify({ apiToken, domain,
|
|
48
|
+
body: JSON.stringify({ apiToken, domain, recordGroups }),
|
|
50
49
|
});
|
|
51
50
|
const payload = (await response.json().catch(() => null)) as
|
|
52
51
|
| (CloudflareDnsBatchApplication & { readonly error?: string })
|
|
@@ -64,7 +63,7 @@ export function useCloudflareDnsRecordImport(options: {
|
|
|
64
63
|
setIsImporting(false);
|
|
65
64
|
}
|
|
66
65
|
},
|
|
67
|
-
[domain,
|
|
66
|
+
[domain, recordGroups],
|
|
68
67
|
);
|
|
69
68
|
|
|
70
69
|
return { isImporting, application, errorMessage, importRecords };
|
|
@@ -1,21 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState, type ReactNode } from 'react';
|
|
2
4
|
import type { DnsProviderGuide } from '../../utils/dnsProviderGuides';
|
|
3
|
-
import type {
|
|
5
|
+
import type { DnsRecordGroup } from '../../utils/dnsRecords/DnsRecordInstruction';
|
|
6
|
+
import type { DnsRecordsSection, DnsRecordsSectionVariant } from '../../utils/dnsRecords/DnsRecordsSection';
|
|
7
|
+
import {
|
|
8
|
+
hasAlternativeDnsRecordGroup,
|
|
9
|
+
isEveryDnsRecordGroupAlternative,
|
|
10
|
+
isEveryDnsRecordGroupRequired,
|
|
11
|
+
} from '../../utils/dnsRecords/dnsRecordGroups';
|
|
4
12
|
import { CloudflareDnsWizard } from '../CloudflareDnsWizard/CloudflareDnsWizard';
|
|
5
13
|
import { DnsProviderGuides } from '../DnsProviderGuides/DnsProviderGuides';
|
|
14
|
+
import { DnsRecordsSectionPanel } from './DnsRecordsSectionPanel';
|
|
6
15
|
|
|
7
16
|
/**
|
|
8
|
-
*
|
|
17
|
+
* The one DNS record configuration panel of the Agents Server administration.
|
|
18
|
+
*
|
|
19
|
+
* Every administration view uses this same component and just passes the sections which are relevant for it - the
|
|
20
|
+
* Super Admin servers page passes all sections of one server, while a subpage such as `/admin/email-server` passes
|
|
21
|
+
* only its own section. All shown sections are configured by one shared Cloudflare wizard.
|
|
9
22
|
*
|
|
10
23
|
* @private shared by the Agents Server DNS instruction views
|
|
11
24
|
*/
|
|
12
25
|
export function DnsRecordsInstructions({
|
|
13
26
|
description,
|
|
14
27
|
domain,
|
|
15
|
-
recordSelection,
|
|
16
|
-
records,
|
|
17
28
|
providerGuides,
|
|
18
|
-
|
|
29
|
+
sections,
|
|
19
30
|
title,
|
|
20
31
|
}: {
|
|
21
32
|
/**
|
|
@@ -24,94 +35,79 @@ export function DnsRecordsInstructions({
|
|
|
24
35
|
readonly description?: ReactNode;
|
|
25
36
|
|
|
26
37
|
/**
|
|
27
|
-
* Domain whose
|
|
38
|
+
* Domain whose DNS zone holds all shown records.
|
|
28
39
|
*/
|
|
29
40
|
readonly domain: string;
|
|
30
41
|
|
|
31
|
-
/**
|
|
32
|
-
* Whether every shown record or just one alternative must be configured.
|
|
33
|
-
*/
|
|
34
|
-
readonly recordSelection: DnsRecordSelection;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* DNS records to configure at the provider.
|
|
38
|
-
*/
|
|
39
|
-
readonly records: ReadonlyArray<DnsRecordInstruction>;
|
|
40
|
-
|
|
41
42
|
/**
|
|
42
43
|
* Optional provider-specific documentation links.
|
|
43
44
|
*/
|
|
44
45
|
readonly providerGuides?: ReadonlyArray<DnsProviderGuide>;
|
|
45
46
|
|
|
46
47
|
/**
|
|
47
|
-
*
|
|
48
|
+
* Parts of the DNS setup shown in this manual.
|
|
48
49
|
*/
|
|
49
|
-
readonly
|
|
50
|
+
readonly sections: ReadonlyArray<DnsRecordsSection>;
|
|
50
51
|
|
|
51
52
|
/**
|
|
52
53
|
* Context-specific panel title.
|
|
53
54
|
*/
|
|
54
55
|
readonly title?: ReactNode;
|
|
55
56
|
}) {
|
|
56
|
-
const
|
|
57
|
-
|
|
57
|
+
const [selectedVariantIdBySectionId, setSelectedVariantIdBySectionId] = useState<Record<string, string>>({});
|
|
58
|
+
const selectedVariantBySection = sections.map((section) => ({
|
|
59
|
+
section,
|
|
60
|
+
selectedVariant: resolveSelectedDnsRecordsSectionVariant(
|
|
61
|
+
section,
|
|
62
|
+
selectedVariantIdBySectionId[section.id] || null,
|
|
63
|
+
),
|
|
64
|
+
}));
|
|
65
|
+
const recordGroups: ReadonlyArray<DnsRecordGroup> = selectedVariantBySection.flatMap(({ selectedVariant }) =>
|
|
66
|
+
selectedVariant ? [selectedVariant] : [],
|
|
67
|
+
);
|
|
68
|
+
const isRecordShown = recordGroups.some((recordGroup) => recordGroup.records.length > 0);
|
|
58
69
|
|
|
59
70
|
return (
|
|
60
71
|
<div className="space-y-4 rounded-xl border border-amber-200 bg-amber-50 px-4 py-4 text-sm text-amber-900">
|
|
61
|
-
{title || description
|
|
72
|
+
{title || description ? (
|
|
62
73
|
<div className="space-y-1">
|
|
63
74
|
{title ? <p className="font-semibold">{title}</p> : null}
|
|
64
75
|
{description ? <div>{description}</div> : null}
|
|
65
|
-
{resolvedAddresses?.length ? (
|
|
66
|
-
<p className="text-xs text-amber-800">
|
|
67
|
-
Currently resolves to: <span className="font-mono">{resolvedAddresses.join(', ')}</span>
|
|
68
|
-
</p>
|
|
69
|
-
) : null}
|
|
70
76
|
</div>
|
|
71
77
|
) : null}
|
|
72
78
|
|
|
73
|
-
{
|
|
74
|
-
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<td className="px-3 py-2 font-mono text-slate-800">{record.name}</td>
|
|
89
|
-
<td className="px-3 py-2 font-mono text-slate-800">{record.value}</td>
|
|
90
|
-
<td className="px-3 py-2 text-amber-900">{record.note || 'Required.'}</td>
|
|
91
|
-
</tr>
|
|
92
|
-
))}
|
|
93
|
-
</tbody>
|
|
94
|
-
</table>
|
|
95
|
-
</div>
|
|
96
|
-
) : null}
|
|
79
|
+
{selectedVariantBySection.map(({ section, selectedVariant }) =>
|
|
80
|
+
selectedVariant ? (
|
|
81
|
+
<DnsRecordsSectionPanel
|
|
82
|
+
key={section.id}
|
|
83
|
+
onSelectVariant={(variantId) =>
|
|
84
|
+
setSelectedVariantIdBySectionId((selectedVariantIds) => ({
|
|
85
|
+
...selectedVariantIds,
|
|
86
|
+
[section.id]: variantId,
|
|
87
|
+
}))
|
|
88
|
+
}
|
|
89
|
+
section={section}
|
|
90
|
+
selectedVariant={selectedVariant}
|
|
91
|
+
/>
|
|
92
|
+
) : null,
|
|
93
|
+
)}
|
|
97
94
|
|
|
98
95
|
<div className="space-y-2">
|
|
99
|
-
<p className="font-medium">How to
|
|
96
|
+
<p className="font-medium">How to set it up</p>
|
|
100
97
|
<ol className="list-decimal space-y-1 pl-5 text-amber-900">
|
|
101
98
|
<li>Open your DNS provider for this domain.</li>
|
|
102
99
|
<li>
|
|
103
|
-
{
|
|
100
|
+
{resolveDnsRecordSelectionInstruction(recordGroups)} for{' '}
|
|
101
|
+
<span className="font-mono">{domain}</span>.
|
|
104
102
|
</li>
|
|
105
|
-
{
|
|
103
|
+
{hasAlternativeDnsRecordGroup(recordGroups) ? (
|
|
106
104
|
<li>Remove conflicting A, AAAA, or CNAME records for the same hostname.</li>
|
|
107
105
|
) : null}
|
|
108
106
|
<li>Wait for DNS propagation, then refresh this page.</li>
|
|
109
107
|
</ol>
|
|
110
108
|
</div>
|
|
111
109
|
|
|
112
|
-
{
|
|
113
|
-
<CloudflareDnsWizard domain={domain} recordSelection={recordSelection} records={records} />
|
|
114
|
-
) : null}
|
|
110
|
+
{isRecordShown ? <CloudflareDnsWizard domain={domain} recordGroups={recordGroups} /> : null}
|
|
115
111
|
|
|
116
112
|
<div className="space-y-2">
|
|
117
113
|
<p className="font-medium">Provider guides</p>
|
|
@@ -123,3 +119,41 @@ export function DnsRecordsInstructions({
|
|
|
123
119
|
</div>
|
|
124
120
|
);
|
|
125
121
|
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Resolves which variant of one section is currently shown.
|
|
125
|
+
*
|
|
126
|
+
* The first variant is the recommended one, so it stays selected until the administrator picks another one.
|
|
127
|
+
*
|
|
128
|
+
* @param section - Section whose variant is resolved.
|
|
129
|
+
* @param selectedVariantId - Variant picked by the administrator, when there is one.
|
|
130
|
+
* @returns Selected variant, or `null` for a section without any variant.
|
|
131
|
+
*
|
|
132
|
+
* @private function of <DnsRecordsInstructions/>
|
|
133
|
+
*/
|
|
134
|
+
function resolveSelectedDnsRecordsSectionVariant(
|
|
135
|
+
section: DnsRecordsSection,
|
|
136
|
+
selectedVariantId: string | null,
|
|
137
|
+
): DnsRecordsSectionVariant | null {
|
|
138
|
+
return section.variants.find((variant) => variant.id === selectedVariantId) || section.variants[0] || null;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Resolves how many of the shown records an administrator has to configure.
|
|
143
|
+
*
|
|
144
|
+
* @param recordGroups - Currently selected groups of all shown sections.
|
|
145
|
+
* @returns Instruction sentence without the domain.
|
|
146
|
+
*
|
|
147
|
+
* @private function of <DnsRecordsInstructions/>
|
|
148
|
+
*/
|
|
149
|
+
function resolveDnsRecordSelectionInstruction(recordGroups: ReadonlyArray<DnsRecordGroup>): string {
|
|
150
|
+
if (isEveryDnsRecordGroupRequired(recordGroups)) {
|
|
151
|
+
return 'Add all records shown above';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (isEveryDnsRecordGroupAlternative(recordGroups)) {
|
|
155
|
+
return 'Add one of the records above';
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return 'Add all records shown above, and only one record from each group of alternatives';
|
|
159
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { DnsRecordsSection, DnsRecordsSectionVariant } from '../../utils/dnsRecords/DnsRecordsSection';
|
|
4
|
+
import { DnsRecordsSectionVariantTabs } from './DnsRecordsSectionVariantTabs';
|
|
5
|
+
import { DnsRecordsTable } from './DnsRecordsTable';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Renders one part of the DNS setup - its explanation, its optional setup variants, and its records.
|
|
9
|
+
*
|
|
10
|
+
* @private internal part of <DnsRecordsInstructions/>
|
|
11
|
+
*/
|
|
12
|
+
export function DnsRecordsSectionPanel({
|
|
13
|
+
onSelectVariant,
|
|
14
|
+
section,
|
|
15
|
+
selectedVariant,
|
|
16
|
+
}: {
|
|
17
|
+
/**
|
|
18
|
+
* Called with the identifier of the newly selected variant of this section.
|
|
19
|
+
*/
|
|
20
|
+
readonly onSelectVariant: (variantId: string) => void;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Section to render.
|
|
24
|
+
*/
|
|
25
|
+
readonly section: DnsRecordsSection;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Variant of the section which is currently selected.
|
|
29
|
+
*/
|
|
30
|
+
readonly selectedVariant: DnsRecordsSectionVariant;
|
|
31
|
+
}) {
|
|
32
|
+
return (
|
|
33
|
+
<section aria-label={section.title} className="space-y-3 rounded-lg border border-amber-200 bg-white/70 p-4">
|
|
34
|
+
<div className="space-y-1">
|
|
35
|
+
<h3 className="font-semibold">{section.title}</h3>
|
|
36
|
+
{section.description ? <div className="text-amber-900">{section.description}</div> : null}
|
|
37
|
+
{section.statusSummary ? (
|
|
38
|
+
<p className={section.isDnsIssue ? 'text-amber-800' : 'text-emerald-700'}>
|
|
39
|
+
{section.statusSummary}
|
|
40
|
+
</p>
|
|
41
|
+
) : null}
|
|
42
|
+
{section.resolvedAddresses?.length ? (
|
|
43
|
+
<p className="text-xs text-amber-800">
|
|
44
|
+
Currently resolves to: <span className="font-mono">{section.resolvedAddresses.join(', ')}</span>
|
|
45
|
+
</p>
|
|
46
|
+
) : null}
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
{section.variants.length > 1 ? (
|
|
50
|
+
<DnsRecordsSectionVariantTabs
|
|
51
|
+
label={section.variantsLabel || 'Setup'}
|
|
52
|
+
onSelect={onSelectVariant}
|
|
53
|
+
selectedVariantId={selectedVariant.id}
|
|
54
|
+
variants={section.variants}
|
|
55
|
+
/>
|
|
56
|
+
) : null}
|
|
57
|
+
|
|
58
|
+
{selectedVariant.description ? <div className="text-amber-900">{selectedVariant.description}</div> : null}
|
|
59
|
+
|
|
60
|
+
{selectedVariant.records.length ? <DnsRecordsTable records={selectedVariant.records} /> : null}
|
|
61
|
+
</section>
|
|
62
|
+
);
|
|
63
|
+
}
|
package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsSectionVariantTabs.tsx
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { DnsRecordsSectionVariant } from '../../utils/dnsRecords/DnsRecordsSection';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Renders the accessible variant switch of one DNS record section.
|
|
7
|
+
*
|
|
8
|
+
* @private internal part of <DnsRecordsInstructions/>
|
|
9
|
+
*/
|
|
10
|
+
export function DnsRecordsSectionVariantTabs({
|
|
11
|
+
label,
|
|
12
|
+
onSelect,
|
|
13
|
+
selectedVariantId,
|
|
14
|
+
variants,
|
|
15
|
+
}: {
|
|
16
|
+
/**
|
|
17
|
+
* Label of the whole variant group.
|
|
18
|
+
*/
|
|
19
|
+
readonly label: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Called with the identifier of the newly selected variant.
|
|
23
|
+
*/
|
|
24
|
+
readonly onSelect: (variantId: string) => void;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Identifier of the currently selected variant.
|
|
28
|
+
*/
|
|
29
|
+
readonly selectedVariantId: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Alternative setups of the section.
|
|
33
|
+
*/
|
|
34
|
+
readonly variants: ReadonlyArray<DnsRecordsSectionVariant>;
|
|
35
|
+
}) {
|
|
36
|
+
return (
|
|
37
|
+
<div>
|
|
38
|
+
<p className="mb-2 text-xs font-semibold uppercase tracking-wide text-amber-700">{label}</p>
|
|
39
|
+
<div
|
|
40
|
+
className="flex flex-wrap gap-1 rounded-md border border-amber-200 bg-white p-1"
|
|
41
|
+
role="tablist"
|
|
42
|
+
aria-label={label}
|
|
43
|
+
>
|
|
44
|
+
{variants.map((variant) => {
|
|
45
|
+
const isSelected = variant.id === selectedVariantId;
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<button
|
|
49
|
+
key={variant.id}
|
|
50
|
+
type="button"
|
|
51
|
+
role="tab"
|
|
52
|
+
aria-selected={isSelected}
|
|
53
|
+
onClick={() => onSelect(variant.id)}
|
|
54
|
+
className={`flex-1 rounded px-2 py-2 text-xs font-semibold transition ${
|
|
55
|
+
isSelected
|
|
56
|
+
? 'bg-amber-700 text-white shadow-sm'
|
|
57
|
+
: 'text-amber-800 hover:bg-amber-50 hover:text-amber-950'
|
|
58
|
+
}`}
|
|
59
|
+
>
|
|
60
|
+
{variant.label}
|
|
61
|
+
</button>
|
|
62
|
+
);
|
|
63
|
+
})}
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { DnsRecordInstruction } from '../../utils/dnsRecords/DnsRecordInstruction';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Renders the canonical table of DNS records which an administrator copies to their DNS provider.
|
|
5
|
+
*
|
|
6
|
+
* @private internal part of <DnsRecordsInstructions/>
|
|
7
|
+
*/
|
|
8
|
+
export function DnsRecordsTable({
|
|
9
|
+
records,
|
|
10
|
+
}: {
|
|
11
|
+
/**
|
|
12
|
+
* DNS records of one section variant.
|
|
13
|
+
*/
|
|
14
|
+
readonly records: ReadonlyArray<DnsRecordInstruction>;
|
|
15
|
+
}) {
|
|
16
|
+
return (
|
|
17
|
+
<div className="overflow-x-auto rounded-lg border border-amber-200 bg-white">
|
|
18
|
+
<table className="min-w-full divide-y divide-amber-100 text-xs">
|
|
19
|
+
<thead className="bg-amber-100/60 text-amber-900">
|
|
20
|
+
<tr>
|
|
21
|
+
<th className="px-3 py-2 text-left font-semibold">Type</th>
|
|
22
|
+
<th className="px-3 py-2 text-left font-semibold">Name</th>
|
|
23
|
+
<th className="px-3 py-2 text-left font-semibold">Value</th>
|
|
24
|
+
<th className="px-3 py-2 text-left font-semibold">When to use</th>
|
|
25
|
+
</tr>
|
|
26
|
+
</thead>
|
|
27
|
+
<tbody className="divide-y divide-amber-100">
|
|
28
|
+
{records.map((record) => (
|
|
29
|
+
<tr key={`${record.type}-${record.name}-${record.value}`}>
|
|
30
|
+
<td className="px-3 py-2 font-mono font-semibold text-amber-900">{record.type}</td>
|
|
31
|
+
<td className="px-3 py-2 font-mono text-slate-800">{record.name}</td>
|
|
32
|
+
<td className="px-3 py-2 font-mono text-slate-800">{record.value}</td>
|
|
33
|
+
<td className="px-3 py-2 text-amber-900">{record.note || 'Required.'}</td>
|
|
34
|
+
</tr>
|
|
35
|
+
))}
|
|
36
|
+
</tbody>
|
|
37
|
+
</table>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -49,10 +49,6 @@ export function buildActiveAgentViewItems({
|
|
|
49
49
|
label: createAgentViewLabel('Chat', translate),
|
|
50
50
|
href: `${activeAgentBasePath}/chat`,
|
|
51
51
|
},
|
|
52
|
-
{
|
|
53
|
-
label: createAgentViewLabel('Timeouts', translate),
|
|
54
|
-
href: `${activeAgentBasePath}/timeouts`,
|
|
55
|
-
},
|
|
56
52
|
];
|
|
57
53
|
|
|
58
54
|
if (isProjectsViewVisible) {
|
|
@@ -67,6 +63,11 @@ export function buildActiveAgentViewItems({
|
|
|
67
63
|
label: createAgentViewLabel('Book', translate),
|
|
68
64
|
href: `${activeAgentBasePath}/book`,
|
|
69
65
|
});
|
|
66
|
+
// Note: The goal chat is readable by exactly who may read the agent source book
|
|
67
|
+
items.push({
|
|
68
|
+
label: createAgentViewLabel('Goal', translate),
|
|
69
|
+
href: `${activeAgentBasePath}/goal`,
|
|
70
|
+
});
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
if (agentMoreViewItems.length > 0) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Clock3Icon,
|
|
3
2
|
FileTextIcon,
|
|
4
3
|
FolderKanbanIcon,
|
|
5
4
|
MessageSquareIcon,
|
|
6
5
|
MoreHorizontalIcon,
|
|
7
6
|
NotebookPenIcon,
|
|
7
|
+
TargetIcon,
|
|
8
8
|
} from 'lucide-react';
|
|
9
9
|
import type { ServerTranslationKey } from '../../languages/ServerTranslationKeys';
|
|
10
10
|
|
|
@@ -13,7 +13,7 @@ import type { ServerTranslationKey } from '../../languages/ServerTranslationKeys
|
|
|
13
13
|
*
|
|
14
14
|
* @private type of Header
|
|
15
15
|
*/
|
|
16
|
-
export type AgentHierarchyView = 'Profile' | 'Chat' | 'Book' | '
|
|
16
|
+
export type AgentHierarchyView = 'Profile' | 'Chat' | 'Book' | 'Goal' | 'Projects' | 'More';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Icon displayed next to each hierarchy view label.
|
|
@@ -22,7 +22,7 @@ const AGENT_VIEW_ICON_MAP: Record<AgentHierarchyView, typeof FileTextIcon> = {
|
|
|
22
22
|
Profile: FileTextIcon,
|
|
23
23
|
Chat: MessageSquareIcon,
|
|
24
24
|
Book: NotebookPenIcon,
|
|
25
|
-
|
|
25
|
+
Goal: TargetIcon,
|
|
26
26
|
Projects: FolderKanbanIcon,
|
|
27
27
|
More: MoreHorizontalIcon,
|
|
28
28
|
};
|
|
@@ -34,7 +34,7 @@ const AGENT_VIEW_TRANSLATION_KEY_MAP: Record<AgentHierarchyView, ServerTranslati
|
|
|
34
34
|
Profile: 'common.profile',
|
|
35
35
|
Chat: 'common.chat',
|
|
36
36
|
Book: 'common.book',
|
|
37
|
-
|
|
37
|
+
Goal: 'common.goalChat',
|
|
38
38
|
Projects: 'common.projects',
|
|
39
39
|
More: 'common.more',
|
|
40
40
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import JSZip from 'jszip';
|
|
4
4
|
import { useCallback, useRef, useState, type DragEvent } from 'react';
|
|
5
|
+
import { spaceTrim } from 'spacetrim';
|
|
5
6
|
import { downloadBlob, parseFilenameFromContentDisposition } from '../../utils/download/browserFileDownload';
|
|
6
7
|
import { showAlert, showConfirm, showPrompt } from '../AsyncDialogs/asyncDialogs';
|
|
7
8
|
|
|
@@ -323,7 +324,10 @@ async function uploadAgentsImportFiles(options: {
|
|
|
323
324
|
formData.append(FILES_FORM_FIELD, file);
|
|
324
325
|
}
|
|
325
326
|
|
|
326
|
-
formData.append(
|
|
327
|
+
formData.append(
|
|
328
|
+
TARGET_FOLDER_ID_FORM_FIELD,
|
|
329
|
+
options.targetFolderId === null ? 'null' : String(options.targetFolderId),
|
|
330
|
+
);
|
|
327
331
|
formData.append(CONFLICT_RESOLUTION_FORM_FIELD, options.conflictResolution);
|
|
328
332
|
|
|
329
333
|
return fetch(AGENTS_IMPORT_ENDPOINT, {
|
|
@@ -392,11 +396,16 @@ async function promptAgentsImportConflictResolution(
|
|
|
392
396
|
): Promise<Exclude<AgentsImportConflictResolution, 'ASK'> | null> {
|
|
393
397
|
const decision = await showPrompt({
|
|
394
398
|
title: 'Duplicate agents',
|
|
395
|
-
message:
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
399
|
+
message: spaceTrim(
|
|
400
|
+
(block) => `
|
|
401
|
+
Some dropped books have the same agent name as existing agents but different book source.
|
|
402
|
+
Type \`duplicate\` to import them as additional agents, or \`skip\` to skip the conflicting books.
|
|
403
|
+
|
|
404
|
+
${block(
|
|
405
|
+
createWarningListMessage(conflicts.map((conflict) => `${conflict.agentName}: ${conflict.path}`)),
|
|
406
|
+
)}
|
|
407
|
+
`,
|
|
408
|
+
),
|
|
400
409
|
inputLabel: 'Decision',
|
|
401
410
|
defaultValue: 'skip',
|
|
402
411
|
placeholder: 'duplicate or skip',
|
|
@@ -437,10 +446,13 @@ async function confirmNonBookZipEntries(files: ReadonlyArray<File>): Promise<boo
|
|
|
437
446
|
|
|
438
447
|
return showConfirm({
|
|
439
448
|
title: 'Import agents',
|
|
440
|
-
message:
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
449
|
+
message: spaceTrim(
|
|
450
|
+
(block) => `
|
|
451
|
+
The ZIP archive contains files that are not \`.book\` files. They will be ignored.
|
|
452
|
+
|
|
453
|
+
${block(createWarningListMessage(nonBookZipEntryPaths))}
|
|
454
|
+
`,
|
|
455
|
+
),
|
|
444
456
|
confirmLabel: 'Import agents',
|
|
445
457
|
cancelLabel: 'Cancel',
|
|
446
458
|
}).catch(() => false);
|