@promptbook/cli 0.114.0-4 → 0.114.0-6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- 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 +10 -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 +1801 -474
- 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/createCoderRunStepTracker.d.ts +48 -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/prompts/buildPromptStatusDetails.d.ts +43 -0
- package/esm/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +6 -3
- package/esm/scripts/run-codex-prompts/prompts/isPromptSectionUnfinished.d.ts +8 -0
- package/esm/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/prompts/markPromptInProgress.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/prompts/resolvePromptStatusLine.d.ts +19 -0
- package/esm/scripts/run-codex-prompts/prompts/writePromptStatusLine.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/server/updatePromptSection.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/testing/runPromptWithTestFeedback.d.ts +6 -0
- 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/scripts/verify-prompts/$orderPromptFiles.d.ts +9 -0
- package/esm/scripts/verify-prompts/VerifyPromptsOrder.d.ts +26 -0
- package/esm/scripts/verify-prompts/verify-prompts.d.ts +3 -2
- 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 +5 -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/coder/verify.d.ts +1 -1
- package/{umd/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts → esm/src/cli/cli-commands/common/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/save/react/exports/chat-preview-2025-10-13 (1).jsx +95 -5
- package/src/book-components/Chat/utils/renderMarkdown.ts +306 -87
- 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/coder/verify.ts +29 -5
- 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 +813 -768
- 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 +1800 -473
- 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/createCoderRunStepTracker.d.ts +48 -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/prompts/buildPromptStatusDetails.d.ts +43 -0
- package/umd/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +6 -3
- package/umd/scripts/run-codex-prompts/prompts/isPromptSectionUnfinished.d.ts +8 -0
- package/umd/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/prompts/markPromptInProgress.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/prompts/resolvePromptStatusLine.d.ts +19 -0
- package/umd/scripts/run-codex-prompts/prompts/writePromptStatusLine.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/server/updatePromptSection.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/testing/runPromptWithTestFeedback.d.ts +6 -0
- 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/scripts/verify-prompts/$orderPromptFiles.d.ts +9 -0
- package/umd/scripts/verify-prompts/VerifyPromptsOrder.d.ts +26 -0
- package/umd/scripts/verify-prompts/verify-prompts.d.ts +3 -2
- 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 +5 -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/coder/verify.d.ts +1 -1
- package/{esm/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts → umd/src/cli/cli-commands/common/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/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +0 -7
- 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/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +0 -7
- 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,31 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Best-effort Windows guard for child-process shutdown races during `next build`.
|
|
5
|
-
*
|
|
6
|
-
* Next.js and `jest-worker` can attempt to kill helper processes that are already
|
|
7
|
-
* exiting, which intermittently throws `EPERM` on Windows. Treat those cleanup-only
|
|
8
|
-
* failures as non-fatal so the build can finish normally.
|
|
9
|
-
*/
|
|
10
|
-
const { ChildProcess } = require('node:child_process');
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Original `ChildProcess.kill` implementation restored only when the process exits.
|
|
14
|
-
*/
|
|
15
|
-
const originalKill = ChildProcess.prototype.kill;
|
|
16
|
-
|
|
17
|
-
ChildProcess.prototype.kill = function patchedKill(signal) {
|
|
18
|
-
try {
|
|
19
|
-
return originalKill.call(this, signal);
|
|
20
|
-
} catch (error) {
|
|
21
|
-
if (
|
|
22
|
-
error instanceof Error &&
|
|
23
|
-
'code' in error &&
|
|
24
|
-
(error.code === 'EPERM' || error.code === 'ESRCH')
|
|
25
|
-
) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
throw error;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from 'next/server';
|
|
2
|
-
import { isPrivateModeEnabledFromRequest } from '@/src/utils/privateMode';
|
|
3
|
-
import {
|
|
4
|
-
cancelAllActiveAgentScopedUserChatTimeouts,
|
|
5
|
-
pauseAllActiveAgentScopedUserChatTimeouts,
|
|
6
|
-
resumeAllPausedAgentScopedUserChatTimeouts,
|
|
7
|
-
} from '@/src/utils/userChatTimeout';
|
|
8
|
-
import { resolveUserChatScope } from '../../user-chats/resolveUserChatScope';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Supported bulk actions for one agent-scoped timeout manager request.
|
|
12
|
-
*/
|
|
13
|
-
type AgentTimeoutBulkAction = 'cancel_all_active' | 'pause_all_active' | 'resume_all_paused';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Request payload accepted by timeout bulk-actions endpoint.
|
|
17
|
-
*/
|
|
18
|
-
type AgentTimeoutBulkActionPayload = {
|
|
19
|
-
action?: unknown;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Parses and validates one timeout bulk action payload.
|
|
24
|
-
*/
|
|
25
|
-
function parseTimeoutBulkActionPayload(payload: AgentTimeoutBulkActionPayload): AgentTimeoutBulkAction | null {
|
|
26
|
-
if (payload.action === 'cancel_all_active') {
|
|
27
|
-
return payload.action;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (payload.action === 'pause_all_active') {
|
|
31
|
-
return payload.action;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (payload.action === 'resume_all_paused') {
|
|
35
|
-
return payload.action;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Executes one bulk timeout action for current user+agent scope.
|
|
43
|
-
*/
|
|
44
|
-
export async function POST(request: Request, { params }: { params: Promise<{ agentName: string }> }) {
|
|
45
|
-
if (isPrivateModeEnabledFromRequest(request)) {
|
|
46
|
-
return NextResponse.json({ error: 'Private mode is enabled.' }, { status: 403 });
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const { agentName: rawAgentName } = await params;
|
|
50
|
-
const agentName = decodeURIComponent(rawAgentName);
|
|
51
|
-
const scopeResult = await resolveUserChatScope(agentName);
|
|
52
|
-
|
|
53
|
-
if (!scopeResult.ok) {
|
|
54
|
-
if (scopeResult.error === 'UNAUTHORIZED') {
|
|
55
|
-
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (scopeResult.error === 'FORBIDDEN') {
|
|
59
|
-
return NextResponse.json({ error: 'Forbidden' }, { status: 403 });
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return NextResponse.json({ error: 'Agent not found.' }, { status: 404 });
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
try {
|
|
66
|
-
const payload = (await request.json().catch(() => ({}))) as AgentTimeoutBulkActionPayload;
|
|
67
|
-
const action = parseTimeoutBulkActionPayload(payload);
|
|
68
|
-
if (!action) {
|
|
69
|
-
return NextResponse.json({ error: 'Invalid timeout bulk action.' }, { status: 400 });
|
|
70
|
-
}
|
|
71
|
-
const scope = scopeResult.scope;
|
|
72
|
-
|
|
73
|
-
const summary =
|
|
74
|
-
action === 'cancel_all_active'
|
|
75
|
-
? await cancelAllActiveAgentScopedUserChatTimeouts({
|
|
76
|
-
userId: scope.userId,
|
|
77
|
-
agentPermanentId: scope.agentPermanentId,
|
|
78
|
-
})
|
|
79
|
-
: action === 'pause_all_active'
|
|
80
|
-
? await pauseAllActiveAgentScopedUserChatTimeouts({
|
|
81
|
-
userId: scope.userId,
|
|
82
|
-
agentPermanentId: scope.agentPermanentId,
|
|
83
|
-
})
|
|
84
|
-
: await resumeAllPausedAgentScopedUserChatTimeouts({
|
|
85
|
-
userId: scope.userId,
|
|
86
|
-
agentPermanentId: scope.agentPermanentId,
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
return NextResponse.json({
|
|
90
|
-
action,
|
|
91
|
-
matchedCount: summary.matchedCount,
|
|
92
|
-
updatedCount: summary.updatedCount,
|
|
93
|
-
timeoutIds: summary.timeoutIds,
|
|
94
|
-
hasMore: summary.hasMore,
|
|
95
|
-
generatedAt: new Date().toISOString(),
|
|
96
|
-
});
|
|
97
|
-
} catch (error) {
|
|
98
|
-
return NextResponse.json(
|
|
99
|
-
{ error: error instanceof Error ? error.message : 'Failed to execute timeout bulk action.' },
|
|
100
|
-
{ status: 400 },
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useServerLanguage } from '@/src/components/ServerLanguage/ServerLanguageProvider';
|
|
4
|
-
import { AgentTimeoutsEditDialog } from './AgentTimeoutsEditDialog';
|
|
5
|
-
import { AgentTimeoutsFiltersCard } from './AgentTimeoutsFiltersCard';
|
|
6
|
-
import { AgentTimeoutsHeader } from './AgentTimeoutsHeader';
|
|
7
|
-
import { AgentTimeoutsSummaryMetrics } from './AgentTimeoutsSummaryMetrics';
|
|
8
|
-
import { AgentTimeoutsTableCard } from './AgentTimeoutsTableCard';
|
|
9
|
-
import { useAgentTimeoutsClientState } from './useAgentTimeoutsClientState';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Props for the agent timeout manager page.
|
|
13
|
-
*/
|
|
14
|
-
type AgentTimeoutsClientProps = {
|
|
15
|
-
agentName: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Displays all timeouts for one user+agent across chats and supports timeout edits.
|
|
20
|
-
*
|
|
21
|
-
* @private route component of AgentTimeoutsPage
|
|
22
|
-
*/
|
|
23
|
-
export function AgentTimeoutsClient({ agentName }: AgentTimeoutsClientProps) {
|
|
24
|
-
const { language } = useServerLanguage();
|
|
25
|
-
const state = useAgentTimeoutsClientState({ agentName });
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<div className="container mx-auto mt-20 space-y-6 px-4 py-8">
|
|
29
|
-
<AgentTimeoutsHeader state={state} />
|
|
30
|
-
<AgentTimeoutsSummaryMetrics state={state} />
|
|
31
|
-
<AgentTimeoutsFiltersCard language={language} state={state} />
|
|
32
|
-
|
|
33
|
-
{state.errorMessage ? (
|
|
34
|
-
<div className="rounded-2xl border border-red-200 bg-red-50 p-4 text-sm text-red-700">
|
|
35
|
-
{state.errorMessage}
|
|
36
|
-
</div>
|
|
37
|
-
) : null}
|
|
38
|
-
|
|
39
|
-
<AgentTimeoutsTableCard agentName={agentName} language={language} state={state} />
|
|
40
|
-
<AgentTimeoutsEditDialog state={state} />
|
|
41
|
-
</div>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Dialog } from '@/src/components/Portal/Dialog';
|
|
2
|
-
import type { useAgentTimeoutsClientState } from './useAgentTimeoutsClientState';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Props for the timeout edit dialog.
|
|
6
|
-
*
|
|
7
|
-
* @private function of AgentTimeoutsClient
|
|
8
|
-
*/
|
|
9
|
-
type AgentTimeoutsEditDialogProps = {
|
|
10
|
-
state: ReturnType<typeof useAgentTimeoutsClientState>;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Renders the advanced timeout edit dialog.
|
|
15
|
-
*
|
|
16
|
-
* @private function of AgentTimeoutsClient
|
|
17
|
-
*/
|
|
18
|
-
export function AgentTimeoutsEditDialog({ state }: AgentTimeoutsEditDialogProps) {
|
|
19
|
-
const editingTimeout = state.editingTimeout;
|
|
20
|
-
|
|
21
|
-
if (!editingTimeout) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const isSaving = state.busyTimeoutId === editingTimeout.timeoutId && state.busyAction === 'save';
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<Dialog onClose={state.requestCloseEditDialog} className="w-full max-w-2xl p-5 sm:p-6">
|
|
29
|
-
<div className="space-y-4">
|
|
30
|
-
<div>
|
|
31
|
-
<h2 className="text-lg font-semibold text-slate-900">Edit timeout</h2>
|
|
32
|
-
<p className="text-sm text-slate-500">{editingTimeout.timeoutId}</p>
|
|
33
|
-
</div>
|
|
34
|
-
|
|
35
|
-
<label className="flex flex-col gap-1 text-sm">
|
|
36
|
-
<span className="font-medium text-slate-700">Next run</span>
|
|
37
|
-
<input
|
|
38
|
-
type="datetime-local"
|
|
39
|
-
value={state.editDraft.dueAtLocalValue}
|
|
40
|
-
onChange={(event) => state.updateEditDueAtLocalValue(event.target.value)}
|
|
41
|
-
className="rounded-md border border-gray-300 px-3 py-2"
|
|
42
|
-
/>
|
|
43
|
-
</label>
|
|
44
|
-
|
|
45
|
-
<label className="flex flex-col gap-1 text-sm">
|
|
46
|
-
<span className="font-medium text-slate-700">Recurrence (minutes, leave empty for one-shot)</span>
|
|
47
|
-
<input
|
|
48
|
-
type="number"
|
|
49
|
-
min="0"
|
|
50
|
-
step="1"
|
|
51
|
-
value={state.editDraft.recurrenceMinutesValue}
|
|
52
|
-
onChange={(event) => state.updateEditRecurrenceMinutesValue(event.target.value)}
|
|
53
|
-
className="rounded-md border border-gray-300 px-3 py-2"
|
|
54
|
-
/>
|
|
55
|
-
</label>
|
|
56
|
-
|
|
57
|
-
<label className="flex flex-col gap-1 text-sm">
|
|
58
|
-
<span className="font-medium text-slate-700">Wake-up message</span>
|
|
59
|
-
<input
|
|
60
|
-
type="text"
|
|
61
|
-
value={state.editDraft.messageValue}
|
|
62
|
-
onChange={(event) => state.updateEditMessageValue(event.target.value)}
|
|
63
|
-
className="rounded-md border border-gray-300 px-3 py-2"
|
|
64
|
-
/>
|
|
65
|
-
</label>
|
|
66
|
-
|
|
67
|
-
<label className="flex flex-col gap-1 text-sm">
|
|
68
|
-
<span className="font-medium text-slate-700">Payload parameters (JSON object)</span>
|
|
69
|
-
<textarea
|
|
70
|
-
value={state.editDraft.parametersValue}
|
|
71
|
-
onChange={(event) => state.updateEditParametersValue(event.target.value)}
|
|
72
|
-
className="min-h-40 rounded-md border border-gray-300 px-3 py-2 font-mono text-xs"
|
|
73
|
-
/>
|
|
74
|
-
</label>
|
|
75
|
-
|
|
76
|
-
<div className="flex justify-end gap-2">
|
|
77
|
-
<button
|
|
78
|
-
type="button"
|
|
79
|
-
onClick={state.requestCloseEditDialog}
|
|
80
|
-
className="rounded-md border border-gray-300 px-3 py-2 text-sm font-semibold text-gray-700"
|
|
81
|
-
>
|
|
82
|
-
Close
|
|
83
|
-
</button>
|
|
84
|
-
<button
|
|
85
|
-
type="button"
|
|
86
|
-
onClick={() => {
|
|
87
|
-
void state.saveEdits();
|
|
88
|
-
}}
|
|
89
|
-
disabled={isSaving}
|
|
90
|
-
className="rounded-md border border-blue-200 bg-blue-50 px-3 py-2 text-sm font-semibold text-blue-700 disabled:opacity-60"
|
|
91
|
-
>
|
|
92
|
-
{isSaving ? 'Saving...' : 'Save'}
|
|
93
|
-
</button>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
</Dialog>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { ServerLanguageCode } from '@/src/languages/ServerLanguageRegistry';
|
|
2
|
-
import { formatServerLanguageHumanReadableDate } from '@/src/utils/localization/formatServerLanguageHumanReadableDate';
|
|
3
|
-
import type { useAgentTimeoutsClientState } from './useAgentTimeoutsClientState';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Props for the timeout filter card.
|
|
7
|
-
*
|
|
8
|
-
* @private function of AgentTimeoutsClient
|
|
9
|
-
*/
|
|
10
|
-
type AgentTimeoutsFiltersCardProps = {
|
|
11
|
-
language: ServerLanguageCode;
|
|
12
|
-
state: ReturnType<typeof useAgentTimeoutsClientState>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* One filter tab shown in the timeout-manager view switcher.
|
|
17
|
-
*
|
|
18
|
-
* @private function of AgentTimeoutsFiltersCard
|
|
19
|
-
*/
|
|
20
|
-
type TimeoutManagerFilterOption = {
|
|
21
|
-
id: ReturnType<typeof useAgentTimeoutsClientState>['filter'];
|
|
22
|
-
label: string;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Available timeout-manager filter tabs.
|
|
27
|
-
*
|
|
28
|
-
* @private function of AgentTimeoutsFiltersCard
|
|
29
|
-
*/
|
|
30
|
-
const TIMEOUT_MANAGER_FILTER_OPTIONS: ReadonlyArray<TimeoutManagerFilterOption> = [
|
|
31
|
-
{ id: 'active', label: 'Active' },
|
|
32
|
-
{ id: 'paused', label: 'Paused' },
|
|
33
|
-
{ id: 'history', label: 'History' },
|
|
34
|
-
{ id: 'all', label: 'All' },
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Formats the refresh metadata shown below the filter tabs.
|
|
39
|
-
*
|
|
40
|
-
* @private function of AgentTimeoutsFiltersCard
|
|
41
|
-
*/
|
|
42
|
-
function resolveLastRefreshedLabel(generatedAt: string | null, language: ServerLanguageCode): string {
|
|
43
|
-
return generatedAt
|
|
44
|
-
? `Last refreshed ${formatServerLanguageHumanReadableDate(generatedAt, language)}`
|
|
45
|
-
: 'Waiting for first refresh...';
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Renders the timeout-manager filter tabs and refresh metadata.
|
|
50
|
-
*
|
|
51
|
-
* @private function of AgentTimeoutsClient
|
|
52
|
-
*/
|
|
53
|
-
export function AgentTimeoutsFiltersCard({ language, state }: AgentTimeoutsFiltersCardProps) {
|
|
54
|
-
return (
|
|
55
|
-
<div className="rounded-2xl border border-gray-200 bg-white p-4 shadow-sm">
|
|
56
|
-
<div className="flex flex-wrap gap-2">
|
|
57
|
-
{TIMEOUT_MANAGER_FILTER_OPTIONS.map((filterOption) => (
|
|
58
|
-
<button
|
|
59
|
-
key={filterOption.id}
|
|
60
|
-
type="button"
|
|
61
|
-
onClick={() => state.selectFilter(filterOption.id)}
|
|
62
|
-
className={`rounded-xl border px-3 py-1.5 text-sm font-semibold ${
|
|
63
|
-
state.filter === filterOption.id
|
|
64
|
-
? 'border-blue-500 bg-blue-50 text-blue-700'
|
|
65
|
-
: 'border-gray-200 bg-white text-gray-700 hover:border-gray-300 hover:bg-gray-50'
|
|
66
|
-
}`}
|
|
67
|
-
>
|
|
68
|
-
{filterOption.label}
|
|
69
|
-
</button>
|
|
70
|
-
))}
|
|
71
|
-
</div>
|
|
72
|
-
<div className="mt-3 text-xs text-gray-500">{resolveLastRefreshedLabel(state.generatedAt, language)}</div>
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
75
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { useAgentTimeoutsClientState } from './useAgentTimeoutsClientState';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Props for the timeout-manager page header.
|
|
5
|
-
*
|
|
6
|
-
* @private function of AgentTimeoutsClient
|
|
7
|
-
*/
|
|
8
|
-
type AgentTimeoutsHeaderProps = {
|
|
9
|
-
state: ReturnType<typeof useAgentTimeoutsClientState>;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Renders the timeout-manager heading and top-level actions.
|
|
14
|
-
*
|
|
15
|
-
* @private function of AgentTimeoutsClient
|
|
16
|
-
*/
|
|
17
|
-
export function AgentTimeoutsHeader({ state }: AgentTimeoutsHeaderProps) {
|
|
18
|
-
return (
|
|
19
|
-
<div className="flex flex-col gap-3 md:flex-row md:items-end md:justify-between">
|
|
20
|
-
<div>
|
|
21
|
-
<h1 className="text-3xl font-light text-gray-900">My timeouts</h1>
|
|
22
|
-
<p className="mt-1 max-w-3xl text-sm text-gray-500">
|
|
23
|
-
Agent-scoped timeout manager across all your chats.
|
|
24
|
-
</p>
|
|
25
|
-
</div>
|
|
26
|
-
<div className="flex flex-wrap items-center gap-2">
|
|
27
|
-
{state.bulkActions.map((bulkAction) => (
|
|
28
|
-
<button
|
|
29
|
-
key={bulkAction.action}
|
|
30
|
-
type="button"
|
|
31
|
-
onClick={() => {
|
|
32
|
-
void state.runBulkAction(bulkAction.action);
|
|
33
|
-
}}
|
|
34
|
-
disabled={state.busyBulkAction !== null}
|
|
35
|
-
className={bulkAction.buttonClassName}
|
|
36
|
-
>
|
|
37
|
-
{state.busyBulkAction === bulkAction.action ? bulkAction.busyLabel : bulkAction.idleLabel}
|
|
38
|
-
</button>
|
|
39
|
-
))}
|
|
40
|
-
<button
|
|
41
|
-
type="button"
|
|
42
|
-
onClick={() => {
|
|
43
|
-
void state.refreshNow();
|
|
44
|
-
}}
|
|
45
|
-
disabled={state.isRefreshing || state.busyBulkAction !== null}
|
|
46
|
-
className="rounded-full border border-blue-200 bg-blue-50 px-3 py-1.5 text-xs font-semibold text-blue-700 disabled:cursor-not-allowed disabled:opacity-60"
|
|
47
|
-
>
|
|
48
|
-
{state.isRefreshing ? 'Refreshing...' : 'Refresh'}
|
|
49
|
-
</button>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
);
|
|
53
|
-
}
|
package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsSummaryMetrics.tsx
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { useAgentTimeoutsClientState } from './useAgentTimeoutsClientState';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Props for the timeout summary metric grid.
|
|
5
|
-
*
|
|
6
|
-
* @private function of AgentTimeoutsClient
|
|
7
|
-
*/
|
|
8
|
-
type AgentTimeoutsSummaryMetricsProps = {
|
|
9
|
-
state: ReturnType<typeof useAgentTimeoutsClientState>;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* One metric shown in the timeout-manager summary grid.
|
|
14
|
-
*
|
|
15
|
-
* @private function of AgentTimeoutsSummaryMetrics
|
|
16
|
-
*/
|
|
17
|
-
type TimeoutSummaryMetric = {
|
|
18
|
-
label: string;
|
|
19
|
-
value: string;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Builds the summary metrics shown above the timeout table.
|
|
24
|
-
*
|
|
25
|
-
* @private function of AgentTimeoutsSummaryMetrics
|
|
26
|
-
*/
|
|
27
|
-
function createTimeoutSummaryMetrics(
|
|
28
|
-
counters: ReturnType<typeof useAgentTimeoutsClientState>['counters'],
|
|
29
|
-
): Array<TimeoutSummaryMetric> {
|
|
30
|
-
return [
|
|
31
|
-
{ label: 'All', value: String(counters?.allCount ?? 0) },
|
|
32
|
-
{
|
|
33
|
-
label: 'Active',
|
|
34
|
-
value: String((counters?.queuedCount ?? 0) + (counters?.runningCount ?? 0) - (counters?.pausedCount ?? 0)),
|
|
35
|
-
},
|
|
36
|
-
{ label: 'Paused', value: String(counters?.pausedCount ?? 0) },
|
|
37
|
-
{ label: 'Failed', value: String(counters?.failedCount ?? 0) },
|
|
38
|
-
];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Renders the timeout summary metrics.
|
|
43
|
-
*
|
|
44
|
-
* @private function of AgentTimeoutsClient
|
|
45
|
-
*/
|
|
46
|
-
export function AgentTimeoutsSummaryMetrics({ state }: AgentTimeoutsSummaryMetricsProps) {
|
|
47
|
-
const metrics = createTimeoutSummaryMetrics(state.counters);
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<div className="grid gap-3 md:grid-cols-4">
|
|
51
|
-
{metrics.map((metric) => (
|
|
52
|
-
<TimeoutMetricCard key={metric.label} label={metric.label} value={metric.value} />
|
|
53
|
-
))}
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Compact metric card used by the timeout manager header.
|
|
60
|
-
*
|
|
61
|
-
* @private function of AgentTimeoutsSummaryMetrics
|
|
62
|
-
*/
|
|
63
|
-
function TimeoutMetricCard({ label, value }: TimeoutSummaryMetric) {
|
|
64
|
-
return (
|
|
65
|
-
<div className="rounded-2xl border border-gray-200 bg-white p-4 shadow-sm">
|
|
66
|
-
<div className="text-xs font-semibold uppercase tracking-wide text-gray-400">{label}</div>
|
|
67
|
-
<div className="mt-1 text-2xl font-light text-gray-900">{value}</div>
|
|
68
|
-
</div>
|
|
69
|
-
);
|
|
70
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { ServerLanguageCode } from '@/src/languages/ServerLanguageRegistry';
|
|
2
|
-
import type { useAgentTimeoutsClientState } from './useAgentTimeoutsClientState';
|
|
3
|
-
import { AgentTimeoutsTableRow } from './AgentTimeoutsTableRow';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Props for the timeout table card.
|
|
7
|
-
*
|
|
8
|
-
* @private function of AgentTimeoutsClient
|
|
9
|
-
*/
|
|
10
|
-
type AgentTimeoutsTableCardProps = {
|
|
11
|
-
agentName: string;
|
|
12
|
-
language: ServerLanguageCode;
|
|
13
|
-
state: ReturnType<typeof useAgentTimeoutsClientState>;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Renders the timeout table along with loading and empty states.
|
|
18
|
-
*
|
|
19
|
-
* @private function of AgentTimeoutsClient
|
|
20
|
-
*/
|
|
21
|
-
export function AgentTimeoutsTableCard({ agentName, language, state }: AgentTimeoutsTableCardProps) {
|
|
22
|
-
return (
|
|
23
|
-
<div className="rounded-2xl border border-gray-200 bg-white shadow-sm">
|
|
24
|
-
{state.isLoading ? (
|
|
25
|
-
<div className="p-8 text-center text-sm text-gray-500">Loading timeouts...</div>
|
|
26
|
-
) : state.filteredTimeouts.length === 0 ? (
|
|
27
|
-
<div className="p-8 text-center text-sm text-gray-500">No timeouts in this view.</div>
|
|
28
|
-
) : (
|
|
29
|
-
<div className="overflow-x-auto">
|
|
30
|
-
<table className="min-w-full divide-y divide-gray-200 text-xs">
|
|
31
|
-
<thead className="bg-gray-50 text-gray-500">
|
|
32
|
-
<tr>
|
|
33
|
-
<th className="px-4 py-3 text-left font-semibold">Timeout</th>
|
|
34
|
-
<th className="px-4 py-3 text-left font-semibold">Chat</th>
|
|
35
|
-
<th className="px-4 py-3 text-left font-semibold">Status</th>
|
|
36
|
-
<th className="px-4 py-3 text-left font-semibold">Next run</th>
|
|
37
|
-
<th className="px-4 py-3 text-left font-semibold">Recurrence</th>
|
|
38
|
-
<th className="px-4 py-3 text-left font-semibold">Payload</th>
|
|
39
|
-
<th className="px-4 py-3 text-right font-semibold">Actions</th>
|
|
40
|
-
</tr>
|
|
41
|
-
</thead>
|
|
42
|
-
<tbody className="divide-y divide-gray-200 bg-white">
|
|
43
|
-
{state.filteredTimeouts.map((timeout) => (
|
|
44
|
-
<AgentTimeoutsTableRow
|
|
45
|
-
key={timeout.timeoutId}
|
|
46
|
-
agentName={agentName}
|
|
47
|
-
language={language}
|
|
48
|
-
state={state}
|
|
49
|
-
timeout={timeout}
|
|
50
|
-
/>
|
|
51
|
-
))}
|
|
52
|
-
</tbody>
|
|
53
|
-
</table>
|
|
54
|
-
</div>
|
|
55
|
-
)}
|
|
56
|
-
</div>
|
|
57
|
-
);
|
|
58
|
-
}
|