@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.
Files changed (329) hide show
  1. package/README.md +3 -3
  2. package/agents/default/developer.book +1 -0
  3. package/apps/agents-server/next.config.ts +22 -0
  4. package/apps/agents-server/package.json +6 -6
  5. package/apps/agents-server/scripts/build-agents-server.js +43 -7
  6. package/apps/agents-server/scripts/build-e2e.js +12 -2
  7. package/apps/agents-server/scripts/generate-reserved-paths/generate-reserved-paths.ts +30 -16
  8. package/apps/agents-server/scripts/kill-port.js +163 -0
  9. package/apps/agents-server/scripts/run-e2e-tests.js +21 -8
  10. package/apps/agents-server/scripts/run-npm.js +81 -5
  11. package/apps/agents-server/src/app/actions.ts +3 -0
  12. package/apps/agents-server/src/app/admin/email-server/page.tsx +17 -18
  13. package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskRow.tsx +2 -0
  14. package/apps/agents-server/src/app/admin/task-manager/[taskId]/TaskManagerTaskDetailClient.tsx +2 -0
  15. package/apps/agents-server/src/app/admin/task-manager/taskManagerTaskPresentation.tsx +23 -0
  16. package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +7 -0
  17. package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/[timeoutId]/route.ts +10 -153
  18. package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/route.ts +9 -4
  19. package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/route.ts +3 -0
  20. package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/stream/route.ts +2 -0
  21. package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/resolveUserChatScope.ts +8 -1
  22. package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/route.ts +15 -7
  23. package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorSaving.ts +18 -28
  24. package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatHistoryClient.tsx +19 -1
  25. package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatSidebarDefault.tsx +17 -5
  26. package/apps/agents-server/src/app/agents/[agentName]/chat/AgentGoalChatNotice.tsx +23 -0
  27. package/apps/agents-server/src/app/agents/[agentName]/chat/AgentGoalChatPlannedMessages.tsx +153 -0
  28. package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatPanel.tsx +6 -0
  29. package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatSurface.tsx +13 -0
  30. package/apps/agents-server/src/app/agents/[agentName]/chat/ExternalUserChatAdminActions.tsx +51 -3
  31. package/apps/agents-server/src/app/agents/[agentName]/chat/TeamMemberFrozenChatPrimaryAgentLink.tsx +31 -0
  32. package/apps/agents-server/src/app/agents/[agentName]/chat/useAgentChatSidebarState.ts +26 -2
  33. package/apps/agents-server/src/app/agents/[agentName]/goal/page.tsx +35 -0
  34. package/apps/agents-server/src/app/agents/[agentName]/projects/[projectName]/page.tsx +2 -2
  35. package/apps/agents-server/src/app/api/admin/dns-records/cloudflare/route.ts +26 -16
  36. package/apps/agents-server/src/app/api/emails/incoming/stalwart/route.ts +9 -2
  37. package/apps/agents-server/src/app/superadmin/servers/ServersRegistryTable.tsx +31 -39
  38. package/apps/agents-server/src/components/AgentProfile/AgentProfile.tsx +10 -3
  39. package/apps/agents-server/src/components/AgentProjects/AgentProjectIcon.tsx +137 -0
  40. package/apps/agents-server/src/components/AgentProjects/AgentProjectItem.tsx +26 -10
  41. package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsApiTokenImportStep.tsx +5 -6
  42. package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsCheckStep.tsx +6 -5
  43. package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsManualStep.tsx +10 -14
  44. package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsWizard.tsx +11 -20
  45. package/apps/agents-server/src/components/CloudflareDnsWizard/useCloudflareDnsRecordImport.ts +5 -6
  46. package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsInstructions.tsx +91 -57
  47. package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsSectionPanel.tsx +63 -0
  48. package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsSectionVariantTabs.tsx +67 -0
  49. package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsTable.tsx +40 -0
  50. package/apps/agents-server/src/components/Header/buildActiveAgentViewItems.ts +5 -4
  51. package/apps/agents-server/src/components/Header/createAgentViewLabel.tsx +4 -4
  52. package/apps/agents-server/src/components/Header/resolveActiveAgentNavigation.ts +2 -2
  53. package/apps/agents-server/src/components/Homepage/useAgentsListImportExportState.ts +22 -10
  54. package/apps/agents-server/src/components/_utils/generateMetaTxt.ts +1 -1
  55. package/apps/agents-server/src/database/migratePrefix.ts +13 -12
  56. package/apps/agents-server/src/database/migrations/2026-08-0100-agent-goal-chat-source.sql +10 -0
  57. package/apps/agents-server/src/generated/reservedPaths.ts +42 -42
  58. package/apps/agents-server/src/languages/ServerTranslationKeys.ts +9 -1
  59. package/apps/agents-server/src/languages/translations/czech.yaml +9 -1
  60. package/apps/agents-server/src/languages/translations/english.yaml +9 -1
  61. package/apps/agents-server/src/message-providers/email/stalwart/parseInboundStalwartEmail.ts +17 -2
  62. package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatConstants.ts +9 -0
  63. package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatIdentity.ts +28 -0
  64. package/apps/agents-server/src/utils/agentGoalChat/appendAgentGoalChatNote.ts +43 -0
  65. package/apps/agents-server/src/utils/agentGoalChat/canAccessAgentGoalChat.ts +14 -0
  66. package/apps/agents-server/src/utils/agentGoalChat/createAgentGoalChatNoteContent.ts +69 -0
  67. package/apps/agents-server/src/utils/agentGoalChat/ensureAgentGoalChat.ts +66 -0
  68. package/apps/agents-server/src/utils/agentGoalChat/prependAgentGoalChatSummarySeed.ts +40 -0
  69. package/apps/agents-server/src/utils/agentGoalChat/recordAgentGoalChatLifecycleNote.ts +36 -0
  70. package/apps/agents-server/src/utils/agentGoalChat/resolveAgentGoalChatOwnerUserId.ts +104 -0
  71. package/apps/agents-server/src/utils/agentGoalChat/scheduleAgentGoalChatModifiedNote.ts +82 -0
  72. package/apps/agents-server/src/utils/agentGoalChat.ts +19 -0
  73. package/apps/agents-server/src/utils/agentProjects/AgentProjectInfo.ts +10 -1
  74. package/apps/agents-server/src/utils/agentProjects/AgentProjectReferenceInfo.ts +5 -2
  75. package/apps/agents-server/src/utils/agentProjects/agentProjectFileNames.ts +21 -0
  76. package/apps/agents-server/src/utils/agentProjects/agentProjectHrefs.ts +20 -11
  77. package/apps/agents-server/src/utils/agentProjects/agentProjectsPaths.ts +15 -5
  78. package/apps/agents-server/src/utils/agentProjects/createAgentProjectInitials.ts +36 -0
  79. package/apps/agents-server/src/utils/agentProjects/createAgentProjectMarkdownReferences.ts +10 -9
  80. package/apps/agents-server/src/utils/agentProjects/createAgentProjectsDnsRecordsSection.ts +113 -0
  81. package/apps/agents-server/src/utils/agentProjects/createStaticAgentProjectServer.ts +2 -6
  82. package/apps/agents-server/src/utils/agentProjects/humanizeAgentProjectName.ts +25 -0
  83. package/apps/agents-server/src/utils/agentProjects/listAgentProjectChatReferences.ts +10 -3
  84. package/apps/agents-server/src/utils/agentProjects/parseAgentProjectIndexHtml.ts +167 -0
  85. package/apps/agents-server/src/utils/agentProjects/readAgentProjectIndexHtmlProfile.ts +24 -0
  86. package/apps/agents-server/src/utils/agentProjects/readAgentProjectReadme.ts +3 -53
  87. package/apps/agents-server/src/utils/agentProjects/readAgentProjectRootTextFile.ts +73 -0
  88. package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectFaviconRelativePath.ts +108 -0
  89. package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectInfo.ts +12 -3
  90. package/apps/agents-server/src/utils/agentProjects/{resolveAgentProjectReadmeProfile.ts → resolveAgentProjectProfile.ts} +33 -33
  91. package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectPublicUrls.ts +34 -0
  92. package/apps/agents-server/src/utils/bookLanguageDocumentation/createBookLanguageDocumentationPdfResponse.ts +19 -17
  93. package/apps/agents-server/src/utils/chatTasksAdmin.ts +9 -0
  94. package/apps/agents-server/src/utils/dnsRecords/DnsRecordInstruction.ts +20 -0
  95. package/apps/agents-server/src/utils/dnsRecords/DnsRecordsSection.ts +77 -0
  96. package/apps/agents-server/src/utils/dnsRecords/createServerDnsRecordsSections.ts +58 -0
  97. package/apps/agents-server/src/utils/dnsRecords/createServerDomainDnsRecordsSection.ts +48 -0
  98. package/apps/agents-server/src/utils/dnsRecords/dnsRecordGroups.ts +52 -0
  99. package/apps/agents-server/src/utils/dnsRecords/resolveDnsRecordBatchPlan.ts +47 -1
  100. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/adminChatTaskSqlQuery.ts +41 -36
  101. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskFallbackRows.ts +3 -0
  102. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskSqlRows.ts +2 -0
  103. package/apps/agents-server/src/utils/localChatRunner/parseLocalTeamConversations.ts +281 -0
  104. package/apps/agents-server/src/utils/localChatRunner/persistLocalTeamConversations.ts +71 -0
  105. package/apps/agents-server/src/utils/localChatRunner/prepareLocalTeamConversationWorkspace.ts +233 -0
  106. package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +37 -6
  107. package/apps/agents-server/src/utils/serverManagement/createManagedServer/insertManagedServerRegistryRow.ts +2 -2
  108. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerCoreAgents.ts +7 -6
  109. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerDefaultAgents.ts +5 -4
  110. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerMetadata.ts +3 -2
  111. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerUsers.ts +3 -2
  112. package/apps/agents-server/src/utils/serverManagement/deleteManagedServer.ts +2 -2
  113. package/apps/agents-server/src/utils/stalwart/createEmailDnsRecordsSection.ts +53 -0
  114. package/apps/agents-server/src/utils/userChat/UserChatRecord.ts +13 -0
  115. package/apps/agents-server/src/utils/userChat/UserChatSource.ts +14 -0
  116. package/apps/agents-server/src/utils/userChat/createUserChatSummary.ts +10 -2
  117. package/apps/agents-server/src/utils/userChat/finalizeUserChatJob.ts +3 -2
  118. package/apps/agents-server/src/utils/userChat/getUserChat.ts +16 -1
  119. package/apps/agents-server/src/utils/userChat/getUserChatForJobRunner.ts +31 -0
  120. package/apps/agents-server/src/utils/userChat/listUserChats.ts +113 -110
  121. package/apps/agents-server/src/utils/userChat/persistFrozenUserChat.ts +21 -6
  122. package/apps/agents-server/src/utils/userChat/runImmediateUserChatAnswer.ts +2 -6
  123. package/apps/agents-server/src/utils/userChat/runUserChatJob.ts +2 -6
  124. package/apps/agents-server/src/utils/userChat/teamMemberUserChatContext.ts +63 -0
  125. package/apps/agents-server/src/utils/userChat.ts +5 -1
  126. package/apps/agents-server/src/utils/userChatClient/cancelAgentUserTimeout.ts +2 -2
  127. package/apps/agents-server/src/utils/userChatClient/fetchAgentUserTimeouts.ts +2 -2
  128. package/apps/agents-server/src/utils/userChatClient.ts +9 -31
  129. package/apps/agents-server/src/utils/userChatTimeout/UserChatTimeoutRecord.ts +10 -2
  130. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/claimNextDueUserChatTimeout.ts +28 -25
  131. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/getAgentScopedUserChatTimeout.ts +8 -4
  132. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/listAgentUserChatTimeouts.ts +4 -1
  133. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/recoverExpiredRunningUserChatTimeouts.ts +3 -2
  134. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutWorker.ts +53 -0
  135. package/esm/index.es.js +1801 -474
  136. package/esm/index.es.js.map +1 -1
  137. package/esm/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +7 -1
  138. package/esm/scripts/run-agent-messages/messages/buildAgentTeamPromptSection.d.ts +12 -0
  139. package/esm/scripts/run-agent-messages/messages/finalizeAgentTeamConversationWorkspace.d.ts +16 -0
  140. package/esm/scripts/run-agent-messages/messages/loadAgentTeamConversationWorkspace.d.ts +6 -0
  141. package/esm/scripts/run-codex-prompts/common/createCoderRunStepTracker.d.ts +48 -0
  142. package/esm/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
  143. package/esm/scripts/run-codex-prompts/git/coderCommitScope.d.ts +31 -0
  144. package/esm/scripts/run-codex-prompts/git/coderGitSync.d.ts +15 -2
  145. package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +9 -3
  146. package/esm/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +40 -0
  147. package/esm/scripts/run-codex-prompts/prompts/buildPromptStatusDetails.d.ts +43 -0
  148. package/esm/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +6 -3
  149. package/esm/scripts/run-codex-prompts/prompts/isPromptSectionUnfinished.d.ts +8 -0
  150. package/esm/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +1 -1
  151. package/esm/scripts/run-codex-prompts/prompts/markPromptInProgress.d.ts +27 -0
  152. package/esm/scripts/run-codex-prompts/prompts/resolvePromptStatusLine.d.ts +19 -0
  153. package/esm/scripts/run-codex-prompts/prompts/writePromptStatusLine.d.ts +9 -0
  154. package/esm/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +1 -1
  155. package/esm/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
  156. package/esm/scripts/run-codex-prompts/server/updatePromptSection.d.ts +1 -1
  157. package/esm/scripts/run-codex-prompts/testing/runPromptWithTestFeedback.d.ts +6 -0
  158. package/esm/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
  159. package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
  160. package/esm/scripts/verify-prompts/$orderPromptFiles.d.ts +9 -0
  161. package/esm/scripts/verify-prompts/VerifyPromptsOrder.d.ts +26 -0
  162. package/esm/scripts/verify-prompts/verify-prompts.d.ts +3 -2
  163. package/esm/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
  164. package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
  165. package/esm/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
  166. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
  167. package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +5 -3
  168. package/esm/src/cli/cli-commands/coder/boilerplateCount.d.ts +1 -1
  169. package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
  170. package/esm/src/cli/cli-commands/coder/verify.d.ts +1 -1
  171. package/{umd/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts → esm/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
  172. package/{umd/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts → esm/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
  173. package/esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
  174. package/esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +9 -0
  175. package/esm/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
  176. package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
  177. package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts +1 -0
  178. package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
  179. package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts +1 -0
  180. package/esm/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
  181. package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +39 -0
  182. package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.d.ts +26 -0
  183. package/esm/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.d.ts +7 -0
  184. package/esm/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.test.d.ts +1 -0
  185. package/esm/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts +7 -0
  186. package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
  187. package/esm/src/utils/agents/terminalAgentAvatarVisual.d.ts +5 -2
  188. package/esm/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +6 -0
  189. package/esm/src/utils/ascii-art/createAnsiColorCode.d.ts +46 -0
  190. package/esm/src/utils/misc/debounce.d.ts +4 -2
  191. package/esm/src/utils/misc/debounce.test.d.ts +1 -0
  192. package/esm/src/version.d.ts +1 -1
  193. package/package.json +1 -1
  194. package/src/avatars/renderAvatarVisualTerminalText.ts +249 -0
  195. package/src/avatars/types/AvatarVisualDefinition.ts +60 -0
  196. package/src/avatars/visuals/asciiOctopusAvatarVisual.ts +144 -22
  197. package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +4 -4
  198. package/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.ts +1 -4
  199. package/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.ts +4 -17
  200. package/src/book-3.0/AgentTeamConversationWorkspace.ts +172 -0
  201. package/src/book-components/BookEditor/useBookEditorMonacoStyles.ts +56 -55
  202. package/src/book-components/Chat/Chat/Chat.module.css +1 -8
  203. package/src/book-components/Chat/Chat/ChatMessageMap.tsx +8 -4
  204. package/src/book-components/Chat/Chat/ChatProps.tsx +3 -2
  205. package/src/book-components/Chat/save/react/exports/chat-preview-2025-10-13 (1).jsx +95 -5
  206. package/src/book-components/Chat/utils/renderMarkdown.ts +306 -87
  207. package/src/cli/cli-commands/coder/add.ts +3 -3
  208. package/src/cli/cli-commands/coder/boilerplateCount.ts +1 -1
  209. package/src/cli/cli-commands/coder/generate-boilerplates.ts +27 -27
  210. package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +5 -4
  211. package/src/cli/cli-commands/coder/init.ts +3 -3
  212. package/src/cli/cli-commands/coder/run.ts +10 -2
  213. package/src/cli/cli-commands/coder/verify.ts +29 -5
  214. package/src/cli/cli-commands/common/coderGitSyncCliOptions.ts +6 -2
  215. package/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.ts +2 -2
  216. package/src/cli/cli-commands/common/harness/$checkHarnessInstallation.ts +4 -4
  217. package/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.ts +2 -2
  218. package/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.ts → npm/$askForNpmPackageInstallationApproval.ts} +3 -3
  219. package/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.ts +49 -0
  220. package/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.ts +25 -0
  221. package/src/cli/cli-commands/common/{harness/isHarnessVersionOutdated.ts → npm/isNpmPackageVersionOutdated.ts} +6 -4
  222. package/src/cli/cli-commands/common/projectInitialization.ts +10 -1
  223. package/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.ts +73 -0
  224. package/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.ts +94 -0
  225. package/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.ts +223 -0
  226. package/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.ts +53 -0
  227. package/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.ts +46 -0
  228. package/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.ts +32 -0
  229. package/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.ts +22 -0
  230. package/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.ts +47 -0
  231. package/src/commands/FORMAT/formatCommandParser.ts +2 -2
  232. package/src/llm-providers/openai/utils/buildToolInvocationScript.ts +21 -18
  233. package/src/other/templates/getTemplatesPipelineCollection.ts +813 -768
  234. package/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.ts +80 -27
  235. package/src/utils/agents/terminalAgentAvatarVisual.ts +31 -3
  236. package/src/utils/ascii-art/convertImageDataToAsciiArt.ts +9 -109
  237. package/src/utils/ascii-art/createAnsiColorCode.ts +132 -0
  238. package/src/utils/misc/debounce.ts +26 -5
  239. package/src/version.ts +2 -2
  240. package/src/versions.txt +2 -0
  241. package/umd/index.umd.js +1800 -473
  242. package/umd/index.umd.js.map +1 -1
  243. package/umd/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +7 -1
  244. package/umd/scripts/run-agent-messages/messages/buildAgentTeamPromptSection.d.ts +12 -0
  245. package/umd/scripts/run-agent-messages/messages/finalizeAgentTeamConversationWorkspace.d.ts +16 -0
  246. package/umd/scripts/run-agent-messages/messages/loadAgentTeamConversationWorkspace.d.ts +6 -0
  247. package/umd/scripts/run-codex-prompts/common/createCoderRunStepTracker.d.ts +48 -0
  248. package/umd/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
  249. package/umd/scripts/run-codex-prompts/git/coderCommitScope.d.ts +31 -0
  250. package/umd/scripts/run-codex-prompts/git/coderGitSync.d.ts +15 -2
  251. package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +9 -3
  252. package/umd/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +40 -0
  253. package/umd/scripts/run-codex-prompts/prompts/buildPromptStatusDetails.d.ts +43 -0
  254. package/umd/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +6 -3
  255. package/umd/scripts/run-codex-prompts/prompts/isPromptSectionUnfinished.d.ts +8 -0
  256. package/umd/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +1 -1
  257. package/umd/scripts/run-codex-prompts/prompts/markPromptInProgress.d.ts +27 -0
  258. package/umd/scripts/run-codex-prompts/prompts/resolvePromptStatusLine.d.ts +19 -0
  259. package/umd/scripts/run-codex-prompts/prompts/writePromptStatusLine.d.ts +9 -0
  260. package/umd/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +1 -1
  261. package/umd/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
  262. package/umd/scripts/run-codex-prompts/server/updatePromptSection.d.ts +1 -1
  263. package/umd/scripts/run-codex-prompts/testing/runPromptWithTestFeedback.d.ts +6 -0
  264. package/umd/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
  265. package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
  266. package/umd/scripts/verify-prompts/$orderPromptFiles.d.ts +9 -0
  267. package/umd/scripts/verify-prompts/VerifyPromptsOrder.d.ts +26 -0
  268. package/umd/scripts/verify-prompts/verify-prompts.d.ts +3 -2
  269. package/umd/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
  270. package/umd/src/avatars/renderAvatarVisualTerminalText.test.d.ts +1 -0
  271. package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
  272. package/umd/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
  273. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
  274. package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +5 -3
  275. package/umd/src/cli/cli-commands/coder/boilerplateCount.d.ts +1 -1
  276. package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
  277. package/umd/src/cli/cli-commands/coder/verify.d.ts +1 -1
  278. package/{esm/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts → umd/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
  279. package/{esm/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts → umd/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
  280. package/umd/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.test.d.ts +1 -0
  281. package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
  282. package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts +1 -0
  283. package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +9 -0
  284. package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts +1 -0
  285. package/umd/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
  286. package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
  287. package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts +1 -0
  288. package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
  289. package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts +1 -0
  290. package/umd/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
  291. package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +39 -0
  292. package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.d.ts +26 -0
  293. package/umd/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.d.ts +7 -0
  294. package/umd/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.test.d.ts +1 -0
  295. package/umd/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts +7 -0
  296. package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
  297. package/umd/src/utils/agents/terminalAgentAvatarVisual.d.ts +5 -2
  298. package/umd/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +6 -0
  299. package/umd/src/utils/ascii-art/createAnsiColorCode.d.ts +46 -0
  300. package/umd/src/utils/misc/debounce.d.ts +4 -2
  301. package/umd/src/utils/misc/debounce.test.d.ts +1 -0
  302. package/umd/src/version.d.ts +1 -1
  303. package/apps/agents-server/scripts/ignore-kill-eperm.js +0 -31
  304. package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/actions/route.ts +0 -103
  305. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsClient.tsx +0 -43
  306. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsEditDialog.tsx +0 -98
  307. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsFiltersCard.tsx +0 -75
  308. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsHeader.tsx +0 -53
  309. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsSummaryMetrics.tsx +0 -70
  310. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableCard.tsx +0 -58
  311. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableRow.tsx +0 -242
  312. package/apps/agents-server/src/app/agents/[agentName]/timeouts/loading.tsx +0 -15
  313. package/apps/agents-server/src/app/agents/[agentName]/timeouts/page.tsx +0 -28
  314. package/apps/agents-server/src/app/agents/[agentName]/timeouts/useAgentTimeoutsClientState.ts +0 -769
  315. package/apps/agents-server/src/components/AgentProjectDnsInstructions/AgentProjectDnsInstructions.tsx +0 -182
  316. package/apps/agents-server/src/utils/userChatClient/runAgentUserTimeoutBulkAction.ts +0 -24
  317. package/apps/agents-server/src/utils/userChatClient/updateAgentUserTimeout.ts +0 -25
  318. package/esm/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +0 -7
  319. package/esm/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +0 -11
  320. package/esm/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +0 -9
  321. package/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.ts +0 -34
  322. package/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.ts +0 -28
  323. package/umd/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +0 -7
  324. package/umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +0 -11
  325. package/umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +0 -9
  326. /package/esm/src/{cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → avatars/renderAvatarVisualTerminalText.test.d.ts} +0 -0
  327. /package/esm/src/cli/cli-commands/common/{harness/isHarnessVersionOutdated.test.d.ts → npm/$resolveLatestNpmPackageVersion.test.d.ts} +0 -0
  328. /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
  329. /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
- }
@@ -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
- }