@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
@@ -0,0 +1,172 @@
1
+ import { basename, join } from 'path';
2
+ import { AGENT_FINISHED_MESSAGES_DIRECTORY_PATH, AGENT_MESSAGES_DIRECTORY_PATH } from './agentFolderPaths';
3
+
4
+ // Note: [πŸ’ž] This file defines the shared TEAM workspace convention rather than one standalone entity.
5
+
6
+ /**
7
+ * Relative directory for an active TEAM conversation workspace.
8
+ *
9
+ * @private internal convention shared by the Agents Server and agent-folder runner
10
+ */
11
+ export const AGENT_TEAM_CONVERSATIONS_DIRECTORY_PATH = join(AGENT_MESSAGES_DIRECTORY_PATH, 'team');
12
+
13
+ /**
14
+ * Relative directory where completed TEAM conversation transcripts are retained.
15
+ *
16
+ * @private internal convention shared by the Agents Server and agent-folder runner
17
+ */
18
+ export const AGENT_FINISHED_TEAM_CONVERSATIONS_DIRECTORY_PATH = join(AGENT_FINISHED_MESSAGES_DIRECTORY_PATH, 'team');
19
+
20
+ /**
21
+ * Name of the JSON manifest that describes one TEAM conversation workspace.
22
+ *
23
+ * @private internal convention shared by the Agents Server and agent-folder runner
24
+ */
25
+ export const AGENT_TEAM_CONVERSATION_MANIFEST_FILE_NAME = 'team.json';
26
+
27
+ /**
28
+ * Name of the read-only teammate-source directory inside one TEAM workspace.
29
+ *
30
+ * @private internal convention shared by the Agents Server and agent-folder runner
31
+ */
32
+ export const AGENT_TEAMMATE_SOURCES_DIRECTORY_NAME = 'teammates';
33
+
34
+ /**
35
+ * One primary agent represented in a TEAM workspace manifest.
36
+ *
37
+ * @private internal convention shared by the Agents Server and agent-folder runner
38
+ */
39
+ export type AgentTeamConversationPrimaryAgent = {
40
+ readonly permanentId: string;
41
+ readonly agentName: string;
42
+ };
43
+
44
+ /**
45
+ * One local teammate made available to the coding harness for a single user turn.
46
+ *
47
+ * @private internal convention shared by the Agents Server and agent-folder runner
48
+ */
49
+ export type AgentTeamConversationTeammate = {
50
+ readonly permanentId: string;
51
+ readonly agentName: string;
52
+ readonly url: string;
53
+ readonly instructions: string;
54
+ readonly sourceFileName: string;
55
+ };
56
+
57
+ /**
58
+ * Persisted roster snapshot for the optional TEAM workspace of one queued message.
59
+ *
60
+ * @private internal convention shared by the Agents Server and agent-folder runner
61
+ */
62
+ export type AgentTeamConversationWorkspaceManifest = {
63
+ readonly version: 1;
64
+ readonly primaryAgent: AgentTeamConversationPrimaryAgent;
65
+ readonly teammates: ReadonlyArray<AgentTeamConversationTeammate>;
66
+ };
67
+
68
+ /**
69
+ * Creates the stable directory name that belongs to one queued `.book` message.
70
+ *
71
+ * @private internal convention shared by the Agents Server and agent-folder runner
72
+ */
73
+ export function createAgentTeamConversationWorkspaceDirectoryName(messageFileName: string): string {
74
+ const rawBaseName = basename(messageFileName).replace(/\.book$/iu, '');
75
+ const normalizedBaseName = rawBaseName.replace(/[^A-Za-z0-9._-]+/gu, '-').replace(/^[._-]+|[._-]+$/gu, '');
76
+
77
+ return normalizedBaseName || 'message';
78
+ }
79
+
80
+ /**
81
+ * Creates the relative active workspace path for one queued message.
82
+ *
83
+ * @private internal convention shared by the Agents Server and agent-folder runner
84
+ */
85
+ export function createAgentTeamConversationWorkspacePath(messageFileName: string): string {
86
+ return join(
87
+ AGENT_TEAM_CONVERSATIONS_DIRECTORY_PATH,
88
+ createAgentTeamConversationWorkspaceDirectoryName(messageFileName),
89
+ );
90
+ }
91
+
92
+ /**
93
+ * Creates the relative completed-workspace path for one queued message.
94
+ *
95
+ * @private internal convention shared by the Agents Server and agent-folder runner
96
+ */
97
+ export function createFinishedAgentTeamConversationWorkspacePath(messageFileName: string): string {
98
+ return join(
99
+ AGENT_FINISHED_TEAM_CONVERSATIONS_DIRECTORY_PATH,
100
+ createAgentTeamConversationWorkspaceDirectoryName(messageFileName),
101
+ );
102
+ }
103
+
104
+ /**
105
+ * Creates the source-snapshot file name for one teammate.
106
+ *
107
+ * @private internal convention shared by the Agents Server and agent-folder runner
108
+ */
109
+ export function createAgentTeamTeammateSourceFileName(teammatePermanentId: string): string {
110
+ const normalizedPermanentId = teammatePermanentId
111
+ .trim()
112
+ .replace(/[^A-Za-z0-9._-]+/gu, '-')
113
+ .replace(/^[._-]+|[._-]+$/gu, '');
114
+
115
+ return `${normalizedPermanentId || 'teammate'}.book`;
116
+ }
117
+
118
+ /**
119
+ * Checks whether unknown JSON has the minimum shape required for a TEAM workspace manifest.
120
+ *
121
+ * @private internal convention shared by the Agents Server and agent-folder runner
122
+ */
123
+ export function isAgentTeamConversationWorkspaceManifest(
124
+ value: unknown,
125
+ ): value is AgentTeamConversationWorkspaceManifest {
126
+ if (!value || typeof value !== 'object') {
127
+ return false;
128
+ }
129
+
130
+ const manifest = value as Partial<AgentTeamConversationWorkspaceManifest>;
131
+ if (
132
+ manifest.version !== 1 ||
133
+ !isPrimaryAgent(manifest.primaryAgent) ||
134
+ !Array.isArray(manifest.teammates) ||
135
+ !manifest.teammates.every(isTeammate)
136
+ ) {
137
+ return false;
138
+ }
139
+
140
+ return true;
141
+ }
142
+
143
+ /**
144
+ * Checks the primary-agent part of an untrusted manifest.
145
+ *
146
+ * @private internal utility of `isAgentTeamConversationWorkspaceManifest`
147
+ */
148
+ function isPrimaryAgent(value: unknown): value is AgentTeamConversationPrimaryAgent {
149
+ return Boolean(
150
+ value &&
151
+ typeof value === 'object' &&
152
+ typeof (value as AgentTeamConversationPrimaryAgent).permanentId === 'string' &&
153
+ typeof (value as AgentTeamConversationPrimaryAgent).agentName === 'string',
154
+ );
155
+ }
156
+
157
+ /**
158
+ * Checks one teammate part of an untrusted manifest.
159
+ *
160
+ * @private internal utility of `isAgentTeamConversationWorkspaceManifest`
161
+ */
162
+ function isTeammate(value: unknown): value is AgentTeamConversationTeammate {
163
+ return Boolean(
164
+ value &&
165
+ typeof value === 'object' &&
166
+ typeof (value as AgentTeamConversationTeammate).permanentId === 'string' &&
167
+ typeof (value as AgentTeamConversationTeammate).agentName === 'string' &&
168
+ typeof (value as AgentTeamConversationTeammate).url === 'string' &&
169
+ typeof (value as AgentTeamConversationTeammate).instructions === 'string' &&
170
+ typeof (value as AgentTeamConversationTeammate).sourceFileName === 'string',
171
+ );
172
+ }
@@ -1,3 +1,4 @@
1
+ import { spaceTrim } from 'spacetrim';
1
2
  import { useEffect } from 'react';
2
3
  import { PROMPTBOOK_SYNTAX_COLORS } from '../../config';
3
4
  import type { BookEditorTheme } from './BookEditorTheme';
@@ -48,66 +49,66 @@ export function useBookEditorMonacoStyles({
48
49
  document.head.appendChild(style);
49
50
  }
50
51
 
51
- style.innerHTML = `
52
+ style.innerHTML = spaceTrim(`
52
53
 
53
- @import url('https://fonts.googleapis.com/css2?family=Bitcount+Grid+Single:wght@100..900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');
54
- /* <- [🚚] */
54
+ @import url('https://fonts.googleapis.com/css2?family=Bitcount+Grid+Single:wght@100..900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');
55
+ /* <- [🚚] */
55
56
 
56
- .${instanceClass} .monaco-editor .view-lines {
57
- background-image: linear-gradient(to bottom, transparent ${scaledLineHeight - 1}px, ${lineColor} ${
57
+ .${instanceClass} .monaco-editor .view-lines {
58
+ background-image: linear-gradient(to bottom, transparent ${scaledLineHeight - 1}px, ${lineColor} ${
58
59
  scaledLineHeight - 1
59
60
  }px);
60
- background-size: calc(100% + ${scaledContentPaddingLeft}px) ${scaledLineHeight}px;
61
- background-position-x: -${scaledContentPaddingLeft}px;
62
- background-position-y: ${scaledLineHeight * BACKGROUND_POSITION_Y_MULTIPLIER}px;
63
- }
64
- .${instanceClass} .monaco-editor .overflow-guard::before {
65
- content: '';
66
- position: absolute;
67
- left: ${scaledVerticalLineLeft}px;
68
- top: 0;
69
- bottom: 0;
70
- width: 1px;
71
- background-color: ${lineColor};
72
- z-index: 10;
73
- }
61
+ background-size: calc(100% + ${scaledContentPaddingLeft}px) ${scaledLineHeight}px;
62
+ background-position-x: -${scaledContentPaddingLeft}px;
63
+ background-position-y: ${scaledLineHeight * BACKGROUND_POSITION_Y_MULTIPLIER}px;
64
+ }
65
+ .${instanceClass} .monaco-editor .overflow-guard::before {
66
+ content: '';
67
+ position: absolute;
68
+ left: ${scaledVerticalLineLeft}px;
69
+ top: 0;
70
+ bottom: 0;
71
+ width: 1px;
72
+ background-color: ${lineColor};
73
+ z-index: 10;
74
+ }
74
75
 
75
- .${instanceClass} .monaco-editor .separator-line {
76
- background: linear-gradient(
77
- to bottom,
78
- transparent ${scaledLineHeight * 0.9 - 2}px,
79
- ${separatorColor} ${scaledLineHeight * 0.9 - 2}px,
80
- ${separatorColor} ${scaledLineHeight * 0.9 + 1}px,
81
- transparent ${scaledLineHeight * 0.9 + 1}px
82
- );
83
- }
84
-
85
- .${instanceClass} .monaco-editor .transparent-text {
86
- color: transparent !important;
87
- }
88
-
89
- .${instanceClass} .monaco-editor .code-block-box {
90
- background-color: ${codeBlockBackground};
91
- border-left: 1px solid ${codeBlockBorderColor};
92
- border-right: 1px solid ${codeBlockBorderColor};
93
- padding-left: ${Math.round(8 * zoomLevel)}px;
94
- padding-right: ${Math.round(8 * zoomLevel)}px;
95
- }
96
-
97
- .${instanceClass} .monaco-editor .code-block-top {
98
- border-top: 1px solid ${codeBlockBorderColor};
99
- border-top-left-radius: ${Math.round(10 * zoomLevel)}px;
100
- border-top-right-radius: ${Math.round(10 * zoomLevel)}px;
101
- overflow: hidden;
102
- }
103
-
104
- .${instanceClass} .monaco-editor .code-block-bottom {
105
- border-bottom: 1px solid ${codeBlockBorderColor};
106
- border-bottom-left-radius: ${Math.round(10 * zoomLevel)}px;
107
- border-bottom-right-radius: ${Math.round(10 * zoomLevel)}px;
108
- overflow: hidden;
109
- }
110
- `;
76
+ .${instanceClass} .monaco-editor .separator-line {
77
+ background: linear-gradient(
78
+ to bottom,
79
+ transparent ${scaledLineHeight * 0.9 - 2}px,
80
+ ${separatorColor} ${scaledLineHeight * 0.9 - 2}px,
81
+ ${separatorColor} ${scaledLineHeight * 0.9 + 1}px,
82
+ transparent ${scaledLineHeight * 0.9 + 1}px
83
+ );
84
+ }
85
+
86
+ .${instanceClass} .monaco-editor .transparent-text {
87
+ color: transparent !important;
88
+ }
89
+
90
+ .${instanceClass} .monaco-editor .code-block-box {
91
+ background-color: ${codeBlockBackground};
92
+ border-left: 1px solid ${codeBlockBorderColor};
93
+ border-right: 1px solid ${codeBlockBorderColor};
94
+ padding-left: ${Math.round(8 * zoomLevel)}px;
95
+ padding-right: ${Math.round(8 * zoomLevel)}px;
96
+ }
97
+
98
+ .${instanceClass} .monaco-editor .code-block-top {
99
+ border-top: 1px solid ${codeBlockBorderColor};
100
+ border-top-left-radius: ${Math.round(10 * zoomLevel)}px;
101
+ border-top-right-radius: ${Math.round(10 * zoomLevel)}px;
102
+ overflow: hidden;
103
+ }
104
+
105
+ .${instanceClass} .monaco-editor .code-block-bottom {
106
+ border-bottom: 1px solid ${codeBlockBorderColor};
107
+ border-bottom-left-radius: ${Math.round(10 * zoomLevel)}px;
108
+ border-bottom-right-radius: ${Math.round(10 * zoomLevel)}px;
109
+ overflow: hidden;
110
+ }
111
+ `);
111
112
 
112
113
  return () => {
113
114
  if (process.env.NODE_ENV === 'production') {
@@ -426,17 +426,10 @@
426
426
  }
427
427
 
428
428
  .chatMainFlow .chatChildren {
429
- grid-area: πŸ’¬;
429
+ grid-area: 🟦;
430
430
  width: 100%;
431
- height: 100%;
432
431
  min-width: 0;
433
- min-height: 0;
434
432
  z-index: 300;
435
- pointer-events: none;
436
- }
437
-
438
- .chatMainFlow .chatChildren > * {
439
- pointer-events: auto;
440
433
  }
441
434
 
442
435
  /* Chat messages area */
@@ -1,4 +1,6 @@
1
1
  'use client';
2
+ import { spaceTrim } from 'spacetrim';
3
+
2
4
 
3
5
  import type { Feature, GeoJsonObject, GeoJsonProperties, Geometry } from 'geojson';
4
6
  import type { LatLng, Layer, Map as LeafletMap, Path, PathOptions } from 'leaflet';
@@ -253,10 +255,12 @@ function createPointOfInterestMarker(leaflet: LeafletNamespace, feature: ChatGeo
253
255
 
254
256
  const icon = leaflet.divIcon({
255
257
  className: styles.poiMarkerIcon,
256
- html: `
257
- <span class="${styles.poiMarkerPulse}" aria-hidden="true"></span>
258
- ${initialHtml}
259
- `.trim(),
258
+ html: spaceTrim(
259
+ (block) => `
260
+ <span class="${styles.poiMarkerPulse}" aria-hidden="true"></span>
261
+ ${block(initialHtml)}
262
+ `,
263
+ ).trim(),
260
264
  iconSize: [POI_MARKER_CONFIG.size, POI_MARKER_CONFIG.size],
261
265
  iconAnchor: POI_MARKER_CONFIG.anchor,
262
266
  });
@@ -681,8 +681,9 @@ export type ChatProps = {
681
681
  readonly tasksProgress?: Array<{ id: string; name: string; progress?: number }>; // Simplified task progress type
682
682
 
683
683
  /**
684
- * Content to be shown inside the chat bar in head
685
- * If not provided, the chat bar will not be rendered
684
+ * Optional content displayed in the chat header above the message list.
685
+ *
686
+ * If not provided, the header row is not rendered.
686
687
  */
687
688
  readonly children?: ReactNode;
688
689
 
@@ -1,3 +1,4 @@
1
+ import { spaceTrim } from 'spacetrim';
1
2
  import { Chat } from '@promptbook/components';
2
3
 
3
4
  export function ChatPreviewChatComponent() {
@@ -43,7 +44,47 @@ export function ChatPreviewChatComponent() {
43
44
  createdAt: '2025-10-12T23:13:15.925Z',
44
45
  sender: 'ASSISTANT_1',
45
46
  content:
46
- "**Absolutely!** Here’s a quick overview:\n\n- **Bold**\n- _Italic_\n- __Underline__\n- ~~Strikethrough~~\n- `Inline code`\n- Code block:\n\n```js\nconsole.log('Hello, world!');\n```\n> Blockquote\n> With\n> Multiple lines\n\n\n- Some text with [Link](https://example.com)\n- ![image](https://img.youtube.com/vi/nD1v9dMvnLY/maxresdefault.jpg)\n- Lists:\n - Item 1\n - Nested item\n- Numbered list:\n 1. First\n 1. Nested\n- Table:\n\n| Syntax | Description |\n|--------|-------------|\n| Header | Title |\n| Cell | Data |\n\n- Emoji: πŸ˜„ πŸŽ‰\n- Mention: @user\n- Hashtag: #demo\n- Math: $E=mc^2$\n- Horizontal rule:\n\n---",
47
+ spaceTrim(`
48
+ **Absolutely!** Here’s a quick overview:
49
+
50
+ - **Bold**
51
+ - _Italic_
52
+ - __Underline__
53
+ - ~~Strikethrough~~
54
+ - \`Inline code\`
55
+ - Code block:
56
+
57
+ \`\`\`js
58
+ console.log('Hello, world!');
59
+ \`\`\`
60
+ > Blockquote
61
+ > With
62
+ > Multiple lines
63
+
64
+
65
+ - Some text with [Link](https://example.com)
66
+ - ![image](https://img.youtube.com/vi/nD1v9dMvnLY/maxresdefault.jpg)
67
+ - Lists:
68
+ - Item 1
69
+ - Nested item
70
+ - Numbered list:
71
+ 1. First
72
+ 1. Nested
73
+ - Table:
74
+
75
+ | Syntax | Description |
76
+ |--------|-------------|
77
+ | Header | Title |
78
+ | Cell | Data |
79
+
80
+ - Emoji: πŸ˜„ πŸŽ‰
81
+ - Mention: @user
82
+ - Hashtag: #demo
83
+ - Math: $E=mc^2$
84
+ - Horizontal rule:
85
+
86
+ ---
87
+ `),
47
88
  isComplete: true,
48
89
  },
49
90
  {
@@ -51,7 +92,22 @@ export function ChatPreviewChatComponent() {
51
92
  createdAt: '2025-10-12T23:13:15.925Z',
52
93
  sender: 'USER',
53
94
  content:
54
- "Wow, that's a lot! Can you combine some of them?\n\n**Bold _italic_ and `inline code`**\n\nOr maybe:\n> _Blockquote with a [link](https://example.com)_\n\nAnd a table:\n\n| Name | Value |\n|------|-------|\n| Pi | $\\pi$ |\n\n---",
95
+ spaceTrim(`
96
+ Wow, that's a lot! Can you combine some of them?
97
+
98
+ **Bold _italic_ and \`inline code\`**
99
+
100
+ Or maybe:
101
+ > _Blockquote with a [link](https://example.com)_
102
+
103
+ And a table:
104
+
105
+ | Name | Value |
106
+ |------|-------|
107
+ | Pi | $\\pi$ |
108
+
109
+ ---
110
+ `),
55
111
  isComplete: true,
56
112
  },
57
113
  {
@@ -59,7 +115,19 @@ export function ChatPreviewChatComponent() {
59
115
  createdAt: '2025-10-12T23:13:15.925Z',
60
116
  sender: 'ASSISTANT_1',
61
117
  content:
62
- 'Of course! Here’s a creative mix:\n\n- ~~Strikethrough~~ and __underline__\n- 1. Numbered with *italic* and emoji πŸš€\n- - Nested `inline code`\n\n> Blockquote with math: $a^2 + b^2 = c^2$\n\n---\n\nLet me know if you want to see more! #rich #features',
118
+ spaceTrim(`
119
+ Of course! Here’s a creative mix:
120
+
121
+ - ~~Strikethrough~~ and __underline__
122
+ - 1. Numbered with *italic* and emoji πŸš€
123
+ - - Nested \`inline code\`
124
+
125
+ > Blockquote with math: $a^2 + b^2 = c^2$
126
+
127
+ ---
128
+
129
+ Let me know if you want to see more! #rich #features
130
+ `),
63
131
  isComplete: true,
64
132
  },
65
133
  {
@@ -67,7 +135,15 @@ export function ChatPreviewChatComponent() {
67
135
  createdAt: '2025-10-12T23:13:15.925Z',
68
136
  sender: 'ASSISTANT_1',
69
137
  content:
70
- 'And here are some more emojis:\n\nπŸ˜„πŸŽ‰πŸš€πŸ’‘πŸ“ŠπŸ“πŸ”₯πŸŒŸβœ…βŒ\nβ€πŸ§‘πŸ’™πŸ’šπŸ’›πŸ§‘β€οΈπŸ€ŽπŸ–€πŸ’œ\nπŸ±β€πŸ‘€πŸ±β€πŸ’»πŸ±πŸš€πŸ±β€πŸπŸ’«πŸŽžπŸŽ«πŸŽ πŸŽ\nπŸ˜€πŸ˜€πŸ˜πŸ˜‚πŸ€£πŸ˜ƒπŸ˜„πŸ˜†πŸ˜…πŸ€©\nβžΏπŸ›‚πŸ›ƒπŸ›„πŸ›…β™ΏπŸ“ΆπŸš»πŸšΉπŸšΎ',
138
+ spaceTrim(`
139
+ And here are some more emojis:
140
+
141
+ πŸ˜„πŸŽ‰πŸš€πŸ’‘πŸ“ŠπŸ“πŸ”₯πŸŒŸβœ…βŒ
142
+ β€πŸ§‘πŸ’™πŸ’šπŸ’›πŸ§‘β€οΈπŸ€ŽπŸ–€πŸ’œ
143
+ πŸ±β€πŸ‘€πŸ±β€πŸ’»πŸ±πŸš€πŸ±β€πŸπŸ’«πŸŽžπŸŽ«πŸŽ πŸŽ
144
+ πŸ˜€πŸ˜€πŸ˜πŸ˜‚πŸ€£πŸ˜ƒπŸ˜„πŸ˜†πŸ˜…πŸ€©
145
+ βžΏπŸ›‚πŸ›ƒπŸ›„πŸ›…β™ΏπŸ“ΆπŸš»πŸšΉπŸšΎ
146
+ `),
71
147
  isComplete: true,
72
148
  },
73
149
  {
@@ -75,7 +151,21 @@ export function ChatPreviewChatComponent() {
75
151
  createdAt: '2025-10-12T23:13:15.925Z',
76
152
  sender: 'ASSISTANT_1',
77
153
  content:
78
- '## And lists:\n\n- Item 1\n- Item 2\n - Nested Item 2a\n - Nested Item 2b\n- Item 3\n\n1. First item\n2. Second item\n 1. Nested second item a\n 2. Nested second item b\n3. Third item',
154
+ spaceTrim(`
155
+ ## And lists:
156
+
157
+ - Item 1
158
+ - Item 2
159
+ - Nested Item 2a
160
+ - Nested Item 2b
161
+ - Item 3
162
+
163
+ 1. First item
164
+ 2. Second item
165
+ 1. Nested second item a
166
+ 2. Nested second item b
167
+ 3. Third item
168
+ `),
79
169
  isComplete: true,
80
170
  },
81
171
  ]}