@promptbook/cli 0.114.0-5 → 0.114.0-7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/agents/default/developer.book +1 -0
  2. package/apps/agents-server/next.config.ts +22 -0
  3. package/apps/agents-server/package.json +6 -6
  4. package/apps/agents-server/scripts/build-agents-server.js +43 -7
  5. package/apps/agents-server/scripts/build-e2e.js +12 -2
  6. package/apps/agents-server/scripts/generate-reserved-paths/generate-reserved-paths.ts +30 -16
  7. package/apps/agents-server/scripts/kill-port.js +163 -0
  8. package/apps/agents-server/scripts/run-e2e-tests.js +21 -8
  9. package/apps/agents-server/scripts/run-npm.js +81 -5
  10. package/apps/agents-server/src/app/actions.ts +3 -0
  11. package/apps/agents-server/src/app/admin/email-server/page.tsx +17 -18
  12. package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskRow.tsx +2 -0
  13. package/apps/agents-server/src/app/admin/task-manager/[taskId]/TaskManagerTaskDetailClient.tsx +2 -0
  14. package/apps/agents-server/src/app/admin/task-manager/taskManagerTaskPresentation.tsx +23 -0
  15. package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +7 -0
  16. package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/[timeoutId]/route.ts +10 -153
  17. package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/route.ts +9 -4
  18. package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/route.ts +3 -0
  19. package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/stream/route.ts +2 -0
  20. package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/resolveUserChatScope.ts +8 -1
  21. package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/route.ts +15 -7
  22. package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorSaving.ts +18 -28
  23. package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatHistoryClient.tsx +19 -1
  24. package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatSidebarDefault.tsx +17 -5
  25. package/apps/agents-server/src/app/agents/[agentName]/chat/AgentGoalChatNotice.tsx +23 -0
  26. package/apps/agents-server/src/app/agents/[agentName]/chat/AgentGoalChatPlannedMessages.tsx +153 -0
  27. package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatPanel.tsx +6 -0
  28. package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatSurface.tsx +13 -0
  29. package/apps/agents-server/src/app/agents/[agentName]/chat/ExternalUserChatAdminActions.tsx +51 -3
  30. package/apps/agents-server/src/app/agents/[agentName]/chat/TeamMemberFrozenChatPrimaryAgentLink.tsx +31 -0
  31. package/apps/agents-server/src/app/agents/[agentName]/chat/useAgentChatSidebarState.ts +26 -2
  32. package/apps/agents-server/src/app/agents/[agentName]/goal/page.tsx +35 -0
  33. package/apps/agents-server/src/app/agents/[agentName]/projects/[projectName]/page.tsx +2 -2
  34. package/apps/agents-server/src/app/api/admin/dns-records/cloudflare/route.ts +26 -16
  35. package/apps/agents-server/src/app/api/emails/incoming/stalwart/route.ts +9 -2
  36. package/apps/agents-server/src/app/superadmin/servers/ServersRegistryTable.tsx +31 -39
  37. package/apps/agents-server/src/components/AgentProfile/AgentProfile.tsx +10 -3
  38. package/apps/agents-server/src/components/AgentProjects/AgentProjectIcon.tsx +137 -0
  39. package/apps/agents-server/src/components/AgentProjects/AgentProjectItem.tsx +26 -10
  40. package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsApiTokenImportStep.tsx +5 -6
  41. package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsCheckStep.tsx +6 -5
  42. package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsManualStep.tsx +10 -14
  43. package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsWizard.tsx +11 -20
  44. package/apps/agents-server/src/components/CloudflareDnsWizard/useCloudflareDnsRecordImport.ts +5 -6
  45. package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsInstructions.tsx +91 -57
  46. package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsSectionPanel.tsx +63 -0
  47. package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsSectionVariantTabs.tsx +67 -0
  48. package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsTable.tsx +40 -0
  49. package/apps/agents-server/src/components/Header/buildActiveAgentViewItems.ts +5 -4
  50. package/apps/agents-server/src/components/Header/createAgentViewLabel.tsx +4 -4
  51. package/apps/agents-server/src/components/Header/resolveActiveAgentNavigation.ts +2 -2
  52. package/apps/agents-server/src/components/Homepage/useAgentsListImportExportState.ts +22 -10
  53. package/apps/agents-server/src/components/_utils/generateMetaTxt.ts +1 -1
  54. package/apps/agents-server/src/database/migratePrefix.ts +13 -12
  55. package/apps/agents-server/src/database/migrations/2026-08-0100-agent-goal-chat-source.sql +10 -0
  56. package/apps/agents-server/src/generated/reservedPaths.ts +42 -42
  57. package/apps/agents-server/src/languages/ServerTranslationKeys.ts +9 -1
  58. package/apps/agents-server/src/languages/translations/czech.yaml +9 -1
  59. package/apps/agents-server/src/languages/translations/english.yaml +9 -1
  60. package/apps/agents-server/src/message-providers/email/stalwart/parseInboundStalwartEmail.ts +17 -2
  61. package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatConstants.ts +9 -0
  62. package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatIdentity.ts +28 -0
  63. package/apps/agents-server/src/utils/agentGoalChat/appendAgentGoalChatNote.ts +43 -0
  64. package/apps/agents-server/src/utils/agentGoalChat/canAccessAgentGoalChat.ts +14 -0
  65. package/apps/agents-server/src/utils/agentGoalChat/createAgentGoalChatNoteContent.ts +69 -0
  66. package/apps/agents-server/src/utils/agentGoalChat/ensureAgentGoalChat.ts +66 -0
  67. package/apps/agents-server/src/utils/agentGoalChat/prependAgentGoalChatSummarySeed.ts +40 -0
  68. package/apps/agents-server/src/utils/agentGoalChat/recordAgentGoalChatLifecycleNote.ts +36 -0
  69. package/apps/agents-server/src/utils/agentGoalChat/resolveAgentGoalChatOwnerUserId.ts +104 -0
  70. package/apps/agents-server/src/utils/agentGoalChat/scheduleAgentGoalChatModifiedNote.ts +82 -0
  71. package/apps/agents-server/src/utils/agentGoalChat.ts +19 -0
  72. package/apps/agents-server/src/utils/agentProjects/AgentProjectInfo.ts +10 -1
  73. package/apps/agents-server/src/utils/agentProjects/AgentProjectReferenceInfo.ts +5 -2
  74. package/apps/agents-server/src/utils/agentProjects/agentProjectFileNames.ts +21 -0
  75. package/apps/agents-server/src/utils/agentProjects/agentProjectHrefs.ts +20 -11
  76. package/apps/agents-server/src/utils/agentProjects/agentProjectsPaths.ts +15 -5
  77. package/apps/agents-server/src/utils/agentProjects/createAgentProjectInitials.ts +36 -0
  78. package/apps/agents-server/src/utils/agentProjects/createAgentProjectMarkdownReferences.ts +11 -9
  79. package/apps/agents-server/src/utils/agentProjects/createAgentProjectsDnsRecordsSection.ts +113 -0
  80. package/apps/agents-server/src/utils/agentProjects/createStaticAgentProjectServer.ts +2 -6
  81. package/apps/agents-server/src/utils/agentProjects/humanizeAgentProjectName.ts +25 -0
  82. package/apps/agents-server/src/utils/agentProjects/listAgentProjectChatReferences.ts +10 -3
  83. package/apps/agents-server/src/utils/agentProjects/parseAgentProjectIndexHtml.ts +167 -0
  84. package/apps/agents-server/src/utils/agentProjects/readAgentProjectIndexHtmlProfile.ts +24 -0
  85. package/apps/agents-server/src/utils/agentProjects/readAgentProjectReadme.ts +3 -53
  86. package/apps/agents-server/src/utils/agentProjects/readAgentProjectRootTextFile.ts +73 -0
  87. package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectFaviconRelativePath.ts +108 -0
  88. package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectInfo.ts +12 -3
  89. package/apps/agents-server/src/utils/agentProjects/{resolveAgentProjectReadmeProfile.ts → resolveAgentProjectProfile.ts} +33 -33
  90. package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectPublicUrls.ts +34 -0
  91. package/apps/agents-server/src/utils/bookLanguageDocumentation/createBookLanguageDocumentationPdfResponse.ts +19 -17
  92. package/apps/agents-server/src/utils/chatTasksAdmin.ts +9 -0
  93. package/apps/agents-server/src/utils/dnsRecords/DnsRecordInstruction.ts +20 -0
  94. package/apps/agents-server/src/utils/dnsRecords/DnsRecordsSection.ts +77 -0
  95. package/apps/agents-server/src/utils/dnsRecords/createServerDnsRecordsSections.ts +58 -0
  96. package/apps/agents-server/src/utils/dnsRecords/createServerDomainDnsRecordsSection.ts +48 -0
  97. package/apps/agents-server/src/utils/dnsRecords/dnsRecordGroups.ts +52 -0
  98. package/apps/agents-server/src/utils/dnsRecords/resolveDnsRecordBatchPlan.ts +47 -1
  99. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/adminChatTaskSqlQuery.ts +41 -36
  100. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskFallbackRows.ts +3 -0
  101. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskSqlRows.ts +2 -0
  102. package/apps/agents-server/src/utils/localChatRunner/parseLocalTeamConversations.ts +281 -0
  103. package/apps/agents-server/src/utils/localChatRunner/persistLocalTeamConversations.ts +71 -0
  104. package/apps/agents-server/src/utils/localChatRunner/prepareLocalTeamConversationWorkspace.ts +233 -0
  105. package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +37 -6
  106. package/apps/agents-server/src/utils/serverManagement/createManagedServer/insertManagedServerRegistryRow.ts +2 -2
  107. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerCoreAgents.ts +7 -6
  108. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerDefaultAgents.ts +5 -4
  109. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerMetadata.ts +3 -2
  110. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerUsers.ts +3 -2
  111. package/apps/agents-server/src/utils/serverManagement/deleteManagedServer.ts +2 -2
  112. package/apps/agents-server/src/utils/stalwart/createEmailDnsRecordsSection.ts +53 -0
  113. package/apps/agents-server/src/utils/userChat/UserChatRecord.ts +13 -0
  114. package/apps/agents-server/src/utils/userChat/UserChatSource.ts +14 -0
  115. package/apps/agents-server/src/utils/userChat/createUserChatSummary.ts +10 -2
  116. package/apps/agents-server/src/utils/userChat/finalizeUserChatJob.ts +3 -2
  117. package/apps/agents-server/src/utils/userChat/getUserChat.ts +16 -1
  118. package/apps/agents-server/src/utils/userChat/getUserChatForJobRunner.ts +31 -0
  119. package/apps/agents-server/src/utils/userChat/listUserChats.ts +113 -110
  120. package/apps/agents-server/src/utils/userChat/persistFrozenUserChat.ts +21 -6
  121. package/apps/agents-server/src/utils/userChat/runImmediateUserChatAnswer.ts +2 -6
  122. package/apps/agents-server/src/utils/userChat/runUserChatJob.ts +2 -6
  123. package/apps/agents-server/src/utils/userChat/teamMemberUserChatContext.ts +63 -0
  124. package/apps/agents-server/src/utils/userChat.ts +5 -1
  125. package/apps/agents-server/src/utils/userChatClient/cancelAgentUserTimeout.ts +2 -2
  126. package/apps/agents-server/src/utils/userChatClient/fetchAgentUserTimeouts.ts +2 -2
  127. package/apps/agents-server/src/utils/userChatClient.ts +9 -31
  128. package/apps/agents-server/src/utils/userChatTimeout/UserChatTimeoutRecord.ts +10 -2
  129. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/claimNextDueUserChatTimeout.ts +28 -25
  130. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/getAgentScopedUserChatTimeout.ts +8 -4
  131. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/listAgentUserChatTimeouts.ts +4 -1
  132. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/recoverExpiredRunningUserChatTimeouts.ts +3 -2
  133. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutWorker.ts +53 -0
  134. package/esm/index.es.js +1534 -401
  135. package/esm/index.es.js.map +1 -1
  136. package/esm/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +7 -1
  137. package/esm/scripts/run-agent-messages/messages/buildAgentTeamPromptSection.d.ts +12 -0
  138. package/esm/scripts/run-agent-messages/messages/finalizeAgentTeamConversationWorkspace.d.ts +16 -0
  139. package/esm/scripts/run-agent-messages/messages/loadAgentTeamConversationWorkspace.d.ts +6 -0
  140. package/esm/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
  141. package/esm/scripts/run-codex-prompts/git/coderCommitScope.d.ts +31 -0
  142. package/esm/scripts/run-codex-prompts/git/coderGitSync.d.ts +15 -2
  143. package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +9 -3
  144. package/esm/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +40 -0
  145. package/esm/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
  146. package/esm/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
  147. package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
  148. package/esm/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
  149. package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
  150. package/esm/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
  151. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
  152. package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +12 -3
  153. package/esm/src/cli/cli-commands/coder/boilerplateCount.d.ts +1 -1
  154. package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
  155. package/esm/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.d.ts → npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
  156. package/{umd/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts → esm/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
  157. package/esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
  158. package/esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +9 -0
  159. package/esm/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
  160. package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
  161. package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts +1 -0
  162. package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
  163. package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts +1 -0
  164. package/esm/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
  165. package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +39 -0
  166. package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.d.ts +26 -0
  167. package/esm/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.d.ts +7 -0
  168. package/esm/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.test.d.ts +1 -0
  169. package/esm/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts +7 -0
  170. package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
  171. package/esm/src/utils/agents/terminalAgentAvatarVisual.d.ts +5 -2
  172. package/esm/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +6 -0
  173. package/esm/src/utils/ascii-art/createAnsiColorCode.d.ts +46 -0
  174. package/esm/src/utils/misc/debounce.d.ts +4 -2
  175. package/esm/src/utils/misc/debounce.test.d.ts +1 -0
  176. package/esm/src/version.d.ts +1 -1
  177. package/package.json +1 -1
  178. package/src/avatars/renderAvatarVisualTerminalText.ts +249 -0
  179. package/src/avatars/types/AvatarVisualDefinition.ts +60 -0
  180. package/src/avatars/visuals/asciiOctopusAvatarVisual.ts +144 -22
  181. package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +4 -4
  182. package/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.ts +1 -4
  183. package/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.ts +4 -17
  184. package/src/book-3.0/AgentTeamConversationWorkspace.ts +172 -0
  185. package/src/book-components/BookEditor/useBookEditorMonacoStyles.ts +56 -55
  186. package/src/book-components/Chat/Chat/Chat.module.css +1 -8
  187. package/src/book-components/Chat/Chat/ChatMessageMap.tsx +8 -4
  188. package/src/book-components/Chat/Chat/ChatProps.tsx +3 -2
  189. package/src/book-components/Chat/MarkdownContent/MarkdownContent.module.css +14 -14
  190. package/src/book-components/Chat/save/react/exports/chat-preview-2025-10-13 (1).jsx +95 -5
  191. package/src/book-components/Chat/utils/renderMarkdown.ts +535 -89
  192. package/src/cli/cli-commands/coder/add.ts +3 -3
  193. package/src/cli/cli-commands/coder/boilerplateCount.ts +1 -1
  194. package/src/cli/cli-commands/coder/generate-boilerplates.ts +27 -27
  195. package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +5 -4
  196. package/src/cli/cli-commands/coder/init.ts +3 -3
  197. package/src/cli/cli-commands/coder/run.ts +10 -2
  198. package/src/cli/cli-commands/common/coderGitSyncCliOptions.ts +6 -2
  199. package/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.ts +2 -2
  200. package/src/cli/cli-commands/common/harness/$checkHarnessInstallation.ts +4 -4
  201. package/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.ts +2 -2
  202. package/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.ts → npm/$askForNpmPackageInstallationApproval.ts} +3 -3
  203. package/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.ts +49 -0
  204. package/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.ts +25 -0
  205. package/src/cli/cli-commands/common/{harness/isHarnessVersionOutdated.ts → npm/isNpmPackageVersionOutdated.ts} +6 -4
  206. package/src/cli/cli-commands/common/projectInitialization.ts +10 -1
  207. package/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.ts +73 -0
  208. package/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.ts +94 -0
  209. package/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.ts +223 -0
  210. package/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.ts +53 -0
  211. package/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.ts +46 -0
  212. package/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.ts +32 -0
  213. package/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.ts +22 -0
  214. package/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.ts +47 -0
  215. package/src/commands/FORMAT/formatCommandParser.ts +2 -2
  216. package/src/llm-providers/openai/utils/buildToolInvocationScript.ts +21 -18
  217. package/src/other/templates/getTemplatesPipelineCollection.ts +976 -668
  218. package/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.ts +80 -27
  219. package/src/utils/agents/terminalAgentAvatarVisual.ts +31 -3
  220. package/src/utils/ascii-art/convertImageDataToAsciiArt.ts +9 -109
  221. package/src/utils/ascii-art/createAnsiColorCode.ts +132 -0
  222. package/src/utils/misc/debounce.ts +26 -5
  223. package/src/version.ts +2 -2
  224. package/src/versions.txt +2 -0
  225. package/umd/index.umd.js +1533 -400
  226. package/umd/index.umd.js.map +1 -1
  227. package/umd/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +7 -1
  228. package/umd/scripts/run-agent-messages/messages/buildAgentTeamPromptSection.d.ts +12 -0
  229. package/umd/scripts/run-agent-messages/messages/finalizeAgentTeamConversationWorkspace.d.ts +16 -0
  230. package/umd/scripts/run-agent-messages/messages/loadAgentTeamConversationWorkspace.d.ts +6 -0
  231. package/umd/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
  232. package/umd/scripts/run-codex-prompts/git/coderCommitScope.d.ts +31 -0
  233. package/umd/scripts/run-codex-prompts/git/coderGitSync.d.ts +15 -2
  234. package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +9 -3
  235. package/umd/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +40 -0
  236. package/umd/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
  237. package/umd/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
  238. package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
  239. package/umd/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
  240. package/umd/src/avatars/renderAvatarVisualTerminalText.test.d.ts +1 -0
  241. package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
  242. package/umd/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
  243. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
  244. package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +12 -3
  245. package/umd/src/cli/cli-commands/coder/boilerplateCount.d.ts +1 -1
  246. package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
  247. package/umd/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.d.ts → npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
  248. package/{esm/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts → umd/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
  249. package/umd/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.test.d.ts +1 -0
  250. package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
  251. package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts +1 -0
  252. package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +9 -0
  253. package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts +1 -0
  254. package/umd/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
  255. package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
  256. package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts +1 -0
  257. package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
  258. package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts +1 -0
  259. package/umd/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
  260. package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +39 -0
  261. package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.d.ts +26 -0
  262. package/umd/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.d.ts +7 -0
  263. package/umd/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.test.d.ts +1 -0
  264. package/umd/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts +7 -0
  265. package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
  266. package/umd/src/utils/agents/terminalAgentAvatarVisual.d.ts +5 -2
  267. package/umd/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +6 -0
  268. package/umd/src/utils/ascii-art/createAnsiColorCode.d.ts +46 -0
  269. package/umd/src/utils/misc/debounce.d.ts +4 -2
  270. package/umd/src/utils/misc/debounce.test.d.ts +1 -0
  271. package/umd/src/version.d.ts +1 -1
  272. package/apps/agents-server/scripts/ignore-kill-eperm.js +0 -31
  273. package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/actions/route.ts +0 -103
  274. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsClient.tsx +0 -43
  275. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsEditDialog.tsx +0 -98
  276. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsFiltersCard.tsx +0 -75
  277. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsHeader.tsx +0 -53
  278. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsSummaryMetrics.tsx +0 -70
  279. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableCard.tsx +0 -58
  280. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableRow.tsx +0 -242
  281. package/apps/agents-server/src/app/agents/[agentName]/timeouts/loading.tsx +0 -15
  282. package/apps/agents-server/src/app/agents/[agentName]/timeouts/page.tsx +0 -28
  283. package/apps/agents-server/src/app/agents/[agentName]/timeouts/useAgentTimeoutsClientState.ts +0 -769
  284. package/apps/agents-server/src/components/AgentProjectDnsInstructions/AgentProjectDnsInstructions.tsx +0 -182
  285. package/apps/agents-server/src/utils/userChatClient/runAgentUserTimeoutBulkAction.ts +0 -24
  286. package/apps/agents-server/src/utils/userChatClient/updateAgentUserTimeout.ts +0 -25
  287. package/esm/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +0 -11
  288. package/esm/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +0 -9
  289. package/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.ts +0 -34
  290. package/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.ts +0 -28
  291. package/umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +0 -11
  292. package/umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +0 -9
  293. /package/esm/src/{cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → avatars/renderAvatarVisualTerminalText.test.d.ts} +0 -0
  294. /package/esm/src/cli/cli-commands/common/{harness/isHarnessVersionOutdated.test.d.ts → npm/$resolveLatestNpmPackageVersion.test.d.ts} +0 -0
  295. /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
  296. /package/{umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts → esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts} +0 -0
@@ -1,8 +1,14 @@
1
1
  import { type AgentProjectsPromptSectionOptions } from './buildAgentProjectsPromptSection';
2
+ import { type AgentTeamPromptWorkspace } from './buildAgentTeamPromptSection';
2
3
  /**
3
4
  * Options adjusting the generated agent message prompt.
4
5
  */
5
- export type BuildAgentMessagePromptOptions = AgentProjectsPromptSectionOptions;
6
+ export type BuildAgentMessagePromptOptions = AgentProjectsPromptSectionOptions & {
7
+ /**
8
+ * Optional local TEAM roster prepared by the Agents Server for this user turn.
9
+ */
10
+ teamWorkspace?: AgentTeamPromptWorkspace;
11
+ };
6
12
  /**
7
13
  * Builds the prompt sent to the selected coding runner for one queued user-thread book.
8
14
  */
@@ -0,0 +1,12 @@
1
+ import { type AgentTeamConversationWorkspaceManifest } from '../../../src/book-3.0/AgentTeamConversationWorkspace';
2
+ /**
3
+ * TEAM workspace information made visible to one coding-harness prompt.
4
+ */
5
+ export type AgentTeamPromptWorkspace = {
6
+ readonly relativeWorkspacePath: string;
7
+ readonly manifest: AgentTeamConversationWorkspaceManifest;
8
+ };
9
+ /**
10
+ * Builds the optional single-run TEAM consultation instructions for a coding harness.
11
+ */
12
+ export declare function buildAgentTeamPromptSection(workspace: AgentTeamPromptWorkspace | undefined): string;
@@ -0,0 +1,16 @@
1
+ import type { AgentMessageFile } from './AgentMessageFile';
2
+ import type { AgentTeamPromptWorkspace } from './buildAgentTeamPromptSection';
3
+ /**
4
+ * TEAM transcript files retained next to the finished user message.
5
+ */
6
+ export type FinishedAgentTeamConversationWorkspace = {
7
+ readonly relativePaths: ReadonlyArray<string>;
8
+ };
9
+ /**
10
+ * Moves harness-created TEAM conversation transcripts into the finished-message history.
11
+ */
12
+ export declare function finalizeAgentTeamConversationWorkspace(options: {
13
+ readonly projectPath: string;
14
+ readonly queuedMessage: AgentMessageFile;
15
+ readonly workspace: AgentTeamPromptWorkspace | null;
16
+ }): Promise<FinishedAgentTeamConversationWorkspace | null>;
@@ -0,0 +1,6 @@
1
+ import type { AgentMessageFile } from './AgentMessageFile';
2
+ import type { AgentTeamPromptWorkspace } from './buildAgentTeamPromptSection';
3
+ /**
4
+ * Loads the optional TEAM roster snapshot for one queued message.
5
+ */
6
+ export declare function loadAgentTeamConversationWorkspace(projectPath: string, queuedMessage: AgentMessageFile): Promise<AgentTeamPromptWorkspace | null>;
@@ -1,9 +1,8 @@
1
+ import type { WorkingTreeChangesSnapshot } from '../git/workingTreeChanges';
1
2
  /**
2
3
  * Snapshot of file hashes for files that were already dirty before a coding round started.
3
4
  */
4
- export type ChangedFilesSnapshot = {
5
- readonly changedFileHashes: ReadonlyMap<string, string>;
6
- };
5
+ export type ChangedFilesSnapshot = WorkingTreeChangesSnapshot;
7
6
  /**
8
7
  * Options for normalizing line endings in files changed during one coding round.
9
8
  */
@@ -0,0 +1,31 @@
1
+ import type { WorkingTreeChangesSnapshot } from './workingTreeChanges';
2
+ /**
3
+ * Working tree state captured right before one `ptbk coder` operation starts changing the project.
4
+ *
5
+ * Note: This is the single mechanism which every `ptbk coder` command uses to commit only the files relevant
6
+ * for the operation it has just performed, instead of everything which happens to be changed in the project.
7
+ */
8
+ export type CoderCommitScope = {
9
+ /**
10
+ * Project the operation runs in.
11
+ */
12
+ readonly projectPath: string;
13
+ /**
14
+ * Files which were already changed before the operation started.
15
+ */
16
+ readonly snapshotBeforeOperation: WorkingTreeChangesSnapshot;
17
+ };
18
+ /**
19
+ * Captures the working tree state before one `ptbk coder` operation changes anything.
20
+ *
21
+ * The captured scope is passed to the commit of the very same operation, which then commits exactly the files
22
+ * this operation has created, changed, moved or deleted.
23
+ */
24
+ export declare function captureCoderCommitScope(projectPath: string): Promise<CoderCommitScope>;
25
+ /**
26
+ * Resolves the repository-relative paths which one `ptbk coder` operation has really changed.
27
+ *
28
+ * Files which were already changed before the operation started and which the operation did not touch are
29
+ * never part of the result, so they stay in the working tree instead of being swept into the commit.
30
+ */
31
+ export declare function resolveCoderCommitScopePaths(scope: CoderCommitScope): Promise<ReadonlyArray<string>>;
@@ -1,3 +1,4 @@
1
+ import type { CoderCommitScope } from './coderCommitScope';
1
2
  /**
2
3
  * Automatic git synchronization of the project changes made by one `ptbk coder` command.
3
4
  *
@@ -24,6 +25,17 @@ export type CoderGitSyncOptions = {
24
25
  * Note: This is the default for every command and helper which supports the git synchronization.
25
26
  */
26
27
  export declare const DISABLED_CODER_GIT_SYNC_OPTIONS: CoderGitSyncOptions;
28
+ /**
29
+ * Pulls the latest repository changes and captures the working tree state before a `ptbk coder` command
30
+ * changes the project.
31
+ *
32
+ * The returned scope is handed over to `$commitCoderChanges` of the very same command, which then commits
33
+ * exactly the files this command has changed.
34
+ */
35
+ export declare function $startCoderGitSync(options: {
36
+ readonly gitSync: CoderGitSyncOptions;
37
+ readonly projectPath?: string;
38
+ }): Promise<CoderCommitScope>;
27
39
  /**
28
40
  * Pulls the latest repository changes before a `ptbk coder` command changes the project.
29
41
  */
@@ -34,10 +46,11 @@ export declare function $pullCoderChanges(options: {
34
46
  /**
35
47
  * Commits - and when requested also pushes - the changes one `ptbk coder` command has just made.
36
48
  *
37
- * Note: A repository without any change is left alone instead of creating an empty commit.
49
+ * Note: Only the files this very command has changed are committed, everything else is left in the working tree.
50
+ * Note: A command which changed nothing is left alone instead of creating an empty commit.
38
51
  */
39
52
  export declare function $commitCoderChanges(options: {
40
53
  readonly gitSync: CoderGitSyncOptions;
41
54
  readonly commitMessage: string;
42
- readonly projectPath?: string;
55
+ readonly commitScope: CoderCommitScope;
43
56
  }): Promise<void>;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Commits staged changes with the provided message using the dedicated coding-agent identity when configured,
3
3
  * otherwise falls back to the default Git configuration. Remote pushing is opt-in via `options.autoPush`,
4
- * `options.includePaths` can restrict staging, `options.onlyPaths` can restrict the commit pathspec,
4
+ * `options.relevantPaths` restricts both the staging and the commit to the files of the current operation,
5
5
  * `options.excludePaths` can keep temporary artifacts out of the created commit and
6
6
  * `options.isEmptyCommitAllowed` keeps a round without any file change from failing.
7
7
  *
@@ -10,8 +10,14 @@
10
10
  */
11
11
  export declare function commitChanges(message: string, options?: {
12
12
  autoPush?: boolean;
13
- includePaths?: ReadonlyArray<string>;
14
- onlyPaths?: ReadonlyArray<string>;
13
+ /**
14
+ * Repository-relative paths which are relevant for the current operation.
15
+ *
16
+ * Only these paths are staged and only they end up in the created commit, so unrelated changes of the
17
+ * project are left in the working tree. Everything is committed when the paths are not provided at all,
18
+ * while an empty list commits nothing but the file changes already staged before.
19
+ */
20
+ relevantPaths?: ReadonlyArray<string>;
15
21
  excludePaths?: ReadonlyArray<string>;
16
22
  projectPath?: string;
17
23
  isEmptyCommitAllowed?: boolean;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Snapshot of file hashes for files that were already dirty before one operation started.
3
+ *
4
+ * Note: This is the single source of truth about which files one `ptbk coder` operation has really changed,
5
+ * used both for normalizing line endings and for committing only the relevant files.
6
+ */
7
+ export type WorkingTreeChangesSnapshot = {
8
+ /**
9
+ * Hash of every dirty file at the moment the snapshot was taken.
10
+ *
11
+ * A file which was dirty but could not be hashed (a deleted file or a non-regular file) is stored as `null`,
12
+ * so it can be told apart from a file which was not dirty at all.
13
+ */
14
+ readonly changedFileHashes: ReadonlyMap<string, string | null>;
15
+ };
16
+ /**
17
+ * Captures hashes for files that are dirty before one operation starts.
18
+ */
19
+ export declare function captureWorkingTreeChangesSnapshot(projectPath: string): Promise<WorkingTreeChangesSnapshot>;
20
+ /**
21
+ * Lists the repository-relative paths which really changed since the snapshot was taken.
22
+ *
23
+ * A file which was already dirty before and was not touched afterwards is not listed, so the result contains
24
+ * exactly the files changed by the operation which the snapshot wraps.
25
+ */
26
+ export declare function listFilesChangedSinceSnapshot(projectPath: string, snapshot: WorkingTreeChangesSnapshot): Promise<ReadonlyArray<string>>;
27
+ /**
28
+ * Lists dirty tracked files and untracked files in the working tree.
29
+ */
30
+ export declare function listWorkingTreeChangedFiles(projectPath: string): Promise<ReadonlyArray<string>>;
31
+ /**
32
+ * Reads the content hash of one repository-relative working tree file.
33
+ *
34
+ * @returns Hash of a regular file, otherwise `null` for a deleted or non-regular file.
35
+ */
36
+ export declare function readWorkingTreeFileHash(projectPath: string, relativePath: string): Promise<string | null>;
37
+ /**
38
+ * Normalizes Git output paths for internal matching.
39
+ */
40
+ export declare function normalizeGitFilePath(filePath: string): string;
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * @private internal constant of `ptbk coder server`
8
8
  */
9
- export declare const CODER_SERVER_HTML = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Ptbk Coder Server</title>\n <style>\n * { box-sizing: border-box; margin: 0; padding: 0; }\n body {\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n background: #f6f7f9;\n color: #1f2933;\n min-height: 100vh;\n }\n\n header {\n background: #22313f;\n color: white;\n padding: 12px 18px;\n display: flex;\n align-items: center;\n gap: 12px;\n position: sticky;\n top: 0;\n z-index: 10;\n box-shadow: 0 2px 10px rgba(15,23,42,0.22);\n }\n header h1 { font-size: 17px; font-weight: 700; flex-shrink: 0; letter-spacing: 0; }\n\n .status-badge {\n padding: 3px 10px;\n border-radius: 999px;\n font-size: 11px;\n font-weight: 700;\n text-transform: uppercase;\n flex-shrink: 0;\n }\n .status-RUNNING { background: #0b875b; color: white; }\n .status-PAUSING { background: #d97904; color: white; }\n .status-PAUSED { background: #b42318; color: white; }\n\n #pause-label {\n font-size: 12px;\n color: rgba(255,255,255,0.75);\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .btn {\n padding: 6px 12px;\n border: 0;\n border-radius: 4px;\n cursor: pointer;\n font-size: 13px;\n font-weight: 700;\n transition: background 0.15s, opacity 0.15s;\n flex-shrink: 0;\n }\n .btn:disabled { opacity: 0.55; cursor: default; }\n .btn-pause { background: #ffd166; color: #1f2933; }\n .btn-resume { background: #0b875b; color: white; }\n .btn-save { background: #2563eb; color: white; }\n .btn-cancel { background: #edf0f4; color: #1f2933; }\n\n .run-strip {\n background: white;\n border-bottom: 1px solid #d8dee8;\n padding: 12px 18px;\n display: grid;\n grid-template-columns: minmax(220px, 1.2fr) minmax(240px, 1fr) minmax(260px, 1.4fr);\n gap: 14px;\n align-items: center;\n }\n .run-title {\n font-size: 14px;\n font-weight: 700;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .run-subtitle,\n .run-current,\n .run-output {\n color: #64748b;\n font-size: 12px;\n line-height: 1.45;\n overflow: hidden;\n }\n .run-current,\n .run-output {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n }\n .progress-shell {\n display: grid;\n grid-template-columns: 1fr auto;\n gap: 8px;\n align-items: center;\n }\n .progress-track {\n height: 10px;\n background: #e4e9f0;\n border-radius: 999px;\n overflow: hidden;\n }\n .progress-fill {\n display: block;\n height: 100%;\n width: 0;\n background: linear-gradient(90deg, #0b875b, #2563eb);\n transition: width 0.2s;\n }\n .progress-label {\n color: #475569;\n font-size: 12px;\n font-weight: 700;\n min-width: 72px;\n text-align: right;\n }\n\n .board {\n display: flex;\n gap: 14px;\n padding: 16px;\n overflow-x: auto;\n min-height: calc(100vh - 119px);\n align-items: flex-start;\n }\n\n .column {\n background: #e9edf3;\n border-top: 4px solid #94a3b8;\n border-radius: 6px;\n padding: 10px;\n min-width: 250px;\n width: 270px;\n flex-shrink: 0;\n }\n .column-backlog { border-top-color: #64748b; }\n .column-low-priority { border-top-color: #d97904; }\n .column-todo { border-top-color: #2563eb; }\n .column-in-progress { border-top-color: #7c3aed; }\n .column-done { border-top-color: #0b875b; }\n .column-errors { border-top-color: #b42318; }\n .column-finished { border-top-color: #0891b2; }\n\n .column-header {\n font-size: 12px;\n font-weight: 800;\n text-transform: uppercase;\n color: #475569;\n margin-bottom: 10px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n }\n .column-count {\n background: rgba(255,255,255,0.72);\n border-radius: 999px;\n padding: 2px 8px;\n font-size: 11px;\n color: #475569;\n }\n .column-cards { min-height: 40px; }\n\n .card {\n background: white;\n border-radius: 6px;\n padding: 10px 12px;\n margin-bottom: 8px;\n box-shadow: 0 1px 3px rgba(15,23,42,0.12);\n cursor: pointer;\n border-left: 3px solid #94a3b8;\n }\n .card:hover { box-shadow: 0 4px 12px rgba(15,23,42,0.16); }\n .card-backlog { border-left-color: #64748b; }\n .card-low-priority { border-left-color: #d97904; }\n .card-todo { border-left-color: #2563eb; }\n .card-in-progress { border-left-color: #7c3aed; }\n .card-done { border-left-color: #0b875b; }\n .card-errors { border-left-color: #b42318; }\n .card-finished { border-left-color: #0891b2; }\n\n .card-file {\n font-size: 10px;\n color: #7b8794;\n margin-bottom: 6px;\n font-weight: 600;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .card-summary {\n font-size: 13px;\n line-height: 1.45;\n color: #1f2933;\n word-break: break-word;\n white-space: pre-wrap;\n max-height: 76px;\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: 4;\n -webkit-box-orient: vertical;\n }\n .card-tags {\n display: flex;\n flex-wrap: wrap;\n gap: 5px;\n margin-top: 8px;\n }\n .card-tag {\n border-radius: 999px;\n padding: 2px 7px;\n font-size: 10px;\n font-weight: 800;\n line-height: 1.35;\n }\n .tag-not-ready { background: #e2e8f0; color: #475569; }\n .tag-left-in-progress { background: #ffe4e6; color: #9f1239; }\n .tag-unwritten { background: #fff4cc; color: #8a5a00; }\n .tag-implementing { background: #ede9fe; color: #5b21b6; }\n .tag-verifying { background: #fae8ff; color: #86198f; }\n .tag-priority { background: #ffedd5; color: #9a3412; }\n\n .empty-column {\n color: #94a3b8;\n font-size: 12px;\n padding: 10px 4px;\n text-align: center;\n }\n\n .modal-overlay {\n position: fixed;\n inset: 0;\n background: rgba(15,23,42,0.58);\n display: flex;\n align-items: flex-start;\n justify-content: center;\n padding: 56px 16px 16px;\n z-index: 100;\n }\n .modal-overlay.hidden { display: none; }\n\n .modal {\n background: white;\n border-radius: 8px;\n width: 100%;\n max-width: 720px;\n padding: 18px;\n box-shadow: 0 14px 40px rgba(15,23,42,0.28);\n }\n .modal-header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n margin-bottom: 14px;\n gap: 12px;\n }\n .modal-meta { flex: 1; min-width: 0; }\n .modal-file {\n font-size: 11px;\n color: #7b8794;\n margin-bottom: 4px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .modal-section-label { font-size: 14px; font-weight: 700; color: #1f2933; }\n .modal-status {\n font-size: 11px;\n font-weight: 800;\n padding: 3px 8px;\n border-radius: 999px;\n text-transform: uppercase;\n flex-shrink: 0;\n }\n .status-backlog { background: #e2e8f0; color: #475569; }\n .status-low-priority { background: #ffedd5; color: #9a3412; }\n .status-todo { background: #dbeafe; color: #1d4ed8; }\n .status-in-progress { background: #ede9fe; color: #5b21b6; }\n .status-done { background: #dcfce7; color: #166534; }\n .status-errors { background: #fee2e2; color: #991b1b; }\n .status-finished { background: #cffafe; color: #155e75; }\n .modal-close {\n background: transparent;\n border: 0;\n color: #64748b;\n cursor: pointer;\n font-size: 20px;\n padding: 0 4px;\n line-height: 1;\n }\n .modal-close:hover { color: #1f2933; }\n\n textarea {\n width: 100%;\n min-height: 300px;\n font-family: \"SFMono-Regular\", Consolas, \"Courier New\", monospace;\n font-size: 13px;\n border: 2px solid #d8dee8;\n border-radius: 4px;\n padding: 10px 12px;\n resize: vertical;\n line-height: 1.6;\n color: #1f2933;\n }\n textarea:focus {\n outline: none;\n border-color: #2563eb;\n box-shadow: 0 0 0 3px rgba(37,99,235,0.12);\n }\n .modal-actions {\n display: flex;\n gap: 8px;\n margin-top: 14px;\n justify-content: flex-end;\n }\n\n .error-banner {\n background: #fee2e2;\n border-bottom: 2px solid #b42318;\n color: #991b1b;\n padding: 8px 18px;\n font-size: 13px;\n font-weight: 700;\n }\n .error-banner.hidden { display: none; }\n\n @media (max-width: 860px) {\n header { flex-wrap: wrap; }\n #pause-label { order: 4; flex-basis: 100%; }\n .run-strip { grid-template-columns: 1fr; }\n .board { min-height: calc(100vh - 212px); }\n }\n </style>\n</head>\n<body>\n <div id=\"error-banner\" class=\"error-banner hidden\"></div>\n\n <header>\n <h1>Ptbk Coder Server</h1>\n <span id=\"status-badge\" class=\"status-badge status-RUNNING\">RUNNING</span>\n <span id=\"pause-label\"></span>\n <button id=\"toggle-btn\" class=\"btn btn-pause\">Pause</button>\n </header>\n\n <section class=\"run-strip\">\n <div>\n <div class=\"run-title\" id=\"run-title\">Initializing...</div>\n <div class=\"run-subtitle\" id=\"run-subtitle\">Loading runner state</div>\n </div>\n <div class=\"progress-shell\">\n <div class=\"progress-track\"><span class=\"progress-fill\" id=\"progress-fill\"></span></div>\n <div class=\"progress-label\" id=\"progress-label\">0%</div>\n </div>\n <div>\n <div class=\"run-current\" id=\"run-current\">No active prompt</div>\n <div class=\"run-output\" id=\"run-output\"></div>\n </div>\n </section>\n\n <div class=\"board\" id=\"board\"></div>\n\n <div class=\"modal-overlay hidden\" id=\"modal-overlay\">\n <div class=\"modal\">\n <div class=\"modal-header\">\n <div class=\"modal-meta\">\n <div class=\"modal-file\" id=\"modal-file\"></div>\n <div class=\"modal-section-label\" id=\"modal-section-label\"></div>\n </div>\n <span class=\"modal-status\" id=\"modal-status-badge\"></span>\n <button class=\"modal-close\" id=\"modal-close\" title=\"Close\">&times;</button>\n </div>\n\n <textarea id=\"modal-content\" placeholder=\"Prompt content\"></textarea>\n\n <div class=\"modal-actions\">\n <button class=\"btn btn-cancel\" id=\"cancel-button\">Cancel</button>\n <button class=\"btn btn-save\" id=\"save-button\">Save</button>\n </div>\n </div>\n </div>\n\n <script>\n \"use strict\";\n\n const BOARD_COLUMNS = [\n { id: \"backlog\", title: \"Backlog\" },\n { id: \"low-priority\", title: \"Outside priority\" },\n { id: \"todo\", title: \"To do\" },\n { id: \"in-progress\", title: \"In progress\" },\n { id: \"done\", title: \"Done\" },\n { id: \"errors\", title: \"Errors\" },\n { id: \"finished\", title: \"Finished\" },\n ];\n\n let modalState = null;\n let lastPauseState = \"RUNNING\";\n\n function getColumnTitle(columnId) {\n const column = BOARD_COLUMNS.find((columnCandidate) => columnCandidate.id === columnId);\n return column ? column.title : columnId;\n }\n\n function showError(message) {\n const banner = document.getElementById(\"error-banner\");\n banner.textContent = message;\n banner.classList.remove(\"hidden\");\n clearTimeout(banner.timer);\n banner.timer = setTimeout(() => banner.classList.add(\"hidden\"), 6000);\n }\n\n function escapeHtml(value) {\n const element = document.createElement(\"div\");\n element.textContent = String(value);\n return element.innerHTML;\n }\n\n function renderBoardSkeleton() {\n const board = document.getElementById(\"board\");\n board.innerHTML = \"\";\n\n for (const column of BOARD_COLUMNS) {\n const columnElement = document.createElement(\"section\");\n columnElement.className = \"column column-\" + column.id;\n columnElement.innerHTML =\n '<div class=\"column-header\">' +\n '<span>' + escapeHtml(column.title) + '</span>' +\n '<span class=\"column-count\" id=\"count-' + column.id + '\">0</span>' +\n '</div>' +\n '<div class=\"column-cards\" id=\"cards-' + column.id + '\">' +\n '<div class=\"empty-column\">Loading</div>' +\n '</div>';\n board.appendChild(columnElement);\n }\n }\n\n async function fetchStatus() {\n try {\n const response = await fetch(\"/api/status\");\n if (!response.ok) {\n showError(\"Status API error: \" + response.status);\n return;\n }\n\n const status = await response.json();\n renderPauseState(status);\n renderRunState(status.runState);\n } catch (error) {\n showError(\"Could not reach coder server: \" + error.message);\n }\n }\n\n function renderPauseState(status) {\n lastPauseState = status.pauseState;\n\n const badge = document.getElementById(\"status-badge\");\n badge.textContent = status.pauseState;\n badge.className = \"status-badge status-\" + status.pauseState;\n\n const toggleButton = document.getElementById(\"toggle-btn\");\n const pauseLabel = document.getElementById(\"pause-label\");\n\n if (status.pauseState === \"RUNNING\") {\n toggleButton.textContent = \"Pause\";\n toggleButton.className = \"btn btn-pause\";\n pauseLabel.textContent = \"\";\n return;\n }\n\n toggleButton.textContent = \"Resume\";\n toggleButton.className = \"btn btn-resume\";\n pauseLabel.textContent =\n (status.pauseState === \"PAUSING\" ? \"Pausing before: \" : \"Paused before: \") +\n (status.pauseTargetLabel || \"next checkpoint\");\n }\n\n function renderRunState(runState) {\n if (!runState) {\n document.getElementById(\"run-title\").textContent = \"Waiting for runner state\";\n document.getElementById(\"run-subtitle\").textContent = \"\";\n return;\n }\n\n const progress = runState.progress || {};\n const percentage = Number(progress.percentage || 0);\n const runnerParts = [runState.config.agentName, runState.config.modelName, runState.config.thinkingLevel]\n .filter(Boolean);\n\n document.getElementById(\"run-title\").textContent = runState.statusMessage || runState.phase;\n document.getElementById(\"run-subtitle\").textContent = runnerParts.join(\" / \");\n document.getElementById(\"progress-fill\").style.width = Math.max(0, Math.min(100, percentage)) + \"%\";\n document.getElementById(\"progress-label\").textContent =\n percentage + \"% \" + (progress.sessionDone || 0) + \"/\" + (progress.sessionTotal || 0);\n document.getElementById(\"run-current\").textContent = runState.currentPromptLabel\n ? runState.currentPromptLabel + \" - attempt \" + runState.currentAttempt + \"/\" + runState.maxAttempts\n : \"No active prompt\";\n\n renderRunOutput(runState);\n }\n\n function renderRunOutput(runState) {\n const statusLines = (runState.agentStatusTableRows || []).map((row) =>\n row.status + \" - \" + row.agentName + (row.url ? \" - \" + row.url : \"\")\n );\n const outputLines = [\n ...(runState.agentStatusLines || []),\n ...statusLines,\n ...(runState.agentOutputLines || []),\n ...(runState.errors || []).map((errorLine) => \"Error: \" + errorLine),\n ].slice(-3);\n\n document.getElementById(\"run-output\").textContent = outputLines.join(\"\\n\");\n }\n\n async function fetchPrompts() {\n try {\n const response = await fetch(\"/api/prompts\");\n if (!response.ok) {\n showError(\"Prompts API error: \" + response.status);\n return;\n }\n\n renderBoard(await response.json());\n } catch (error) {\n showError(\"Could not load prompts: \" + error.message);\n }\n }\n\n function renderBoard(promptFiles) {\n const columns = Object.fromEntries(BOARD_COLUMNS.map((column) => [column.id, []]));\n\n for (const file of promptFiles) {\n for (const section of file.sections) {\n if (columns[section.column]) {\n columns[section.column].push({ file, section });\n }\n }\n }\n\n for (const column of BOARD_COLUMNS) {\n renderColumn(column.id, columns[column.id]);\n }\n }\n\n function renderColumn(columnId, cards) {\n const container = document.getElementById(\"cards-\" + columnId);\n const countElement = document.getElementById(\"count-\" + columnId);\n\n countElement.textContent = cards.length;\n container.innerHTML = \"\";\n\n if (cards.length === 0) {\n container.innerHTML = '<div class=\"empty-column\">Empty</div>';\n return;\n }\n\n for (const cardData of cards) {\n container.appendChild(createPromptCard(cardData.file, cardData.section));\n }\n }\n\n function createPromptCard(file, section) {\n const card = document.createElement(\"article\");\n card.className = \"card card-\" + section.column;\n card.innerHTML =\n '<div class=\"card-file\">' + escapeHtml(file.relativeFilePath || file.fileName) + \" #\" + (section.index + 1) + '</div>' +\n '<div class=\"card-summary\">' + escapeHtml(section.summary) + '</div>' +\n renderTags(section);\n card.onclick = () => openModal(file, section);\n return card;\n }\n\n function renderTags(section) {\n const tags = [...(section.tags || [])];\n if (section.priority > 0) {\n tags.push({ id: \"priority\", label: \"P\" + section.priority });\n }\n\n if (tags.length === 0) {\n return \"\";\n }\n\n return '<div class=\"card-tags\">' + tags.map((tag) =>\n '<span class=\"card-tag tag-' + escapeHtml(tag.id) + '\">' + escapeHtml(tag.label) + '</span>'\n ).join(\"\") + '</div>';\n }\n\n function openModal(file, section) {\n modalState = { filePath: file.filePath, sectionIndex: section.index };\n\n document.getElementById(\"modal-file\").textContent = file.relativeFilePath || file.fileName;\n document.getElementById(\"modal-section-label\").textContent = \"Section \" + (section.index + 1);\n\n const statusBadge = document.getElementById(\"modal-status-badge\");\n statusBadge.textContent = getColumnTitle(section.column);\n statusBadge.className = \"modal-status status-\" + section.column;\n\n document.getElementById(\"modal-content\").value = section.content;\n document.getElementById(\"modal-overlay\").classList.remove(\"hidden\");\n setTimeout(() => document.getElementById(\"modal-content\").focus(), 50);\n }\n\n function closeModal() {\n document.getElementById(\"modal-overlay\").classList.add(\"hidden\");\n modalState = null;\n }\n\n async function saveModal() {\n if (!modalState) {\n return;\n }\n\n const content = document.getElementById(\"modal-content\").value;\n const saveButton = document.getElementById(\"save-button\");\n saveButton.disabled = true;\n saveButton.textContent = \"Saving...\";\n\n try {\n const response = await fetch(\"/api/prompts/update\", {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n filePath: modalState.filePath,\n sectionIndex: modalState.sectionIndex,\n content,\n }),\n });\n\n if (!response.ok) {\n throw new Error(\"HTTP \" + response.status);\n }\n\n closeModal();\n await fetchPrompts();\n } catch (error) {\n showError(\"Save failed: \" + error.message);\n } finally {\n saveButton.disabled = false;\n saveButton.textContent = \"Save\";\n }\n }\n\n document.getElementById(\"toggle-btn\").onclick = async () => {\n try {\n const endpoint = lastPauseState === \"RUNNING\" ? \"/api/pause\" : \"/api/resume\";\n await fetch(endpoint, { method: \"POST\" });\n await fetchStatus();\n } catch (error) {\n showError(\"Toggle failed: \" + error.message);\n }\n };\n\n document.getElementById(\"modal-close\").onclick = closeModal;\n document.getElementById(\"cancel-button\").onclick = closeModal;\n document.getElementById(\"save-button\").onclick = saveModal;\n\n document.addEventListener(\"keydown\", (event) => {\n if (event.key === \"Escape\") {\n closeModal();\n return;\n }\n if ((event.ctrlKey || event.metaKey) && event.key === \"Enter\") {\n saveModal();\n }\n });\n\n document.getElementById(\"modal-overlay\").addEventListener(\"click\", (event) => {\n if (event.target === document.getElementById(\"modal-overlay\")) {\n closeModal();\n }\n });\n\n renderBoardSkeleton();\n fetchStatus();\n fetchPrompts();\n setInterval(fetchStatus, 2000);\n setInterval(fetchPrompts, 5000);\n </script>\n</body>\n</html>\n";
9
+ export declare const CODER_SERVER_HTML: string;
@@ -28,12 +28,12 @@ export type CoderRunAgentVisual = TerminalAgentAvatarVisual;
28
28
  * Builds the ANSI ASCII-art visual of the `--agent` book shown above the coder-run dashboard.
29
29
  *
30
30
  * The agent's avatar visual is resolved the same way as on the website - the `META AVATAR`
31
- * commitment wins, then the `META VISUAL` commitment, then the shared default visual - and is
32
- * rendered dynamically through the shared canvas avatar pipeline into terminal ASCII art.
33
- * The terminal variant uses a transparent horizontal canvas instead of the website's framed 1:1 surface.
31
+ * commitment wins, then the `META VISUAL` commitment, then the shared default visual.
32
+ * Character-based visuals such as `AsciiOctopus` paint the terminal grid directly, while pixel-based
33
+ * visuals are rendered through the shared canvas avatar pipeline into terminal ASCII art, using a
34
+ * transparent horizontal canvas instead of the website's framed 1:1 surface.
34
35
  *
35
- * The visual is decorative, so any failure (for example when the optional `@napi-rs/canvas`
36
- * module is not installed) returns `null` and the caller keeps the default brand banner.
36
+ * The visual is decorative, so any failure returns `null` and the caller keeps the default brand banner.
37
37
  *
38
38
  * @param agentSource Source of the `--agent` book file.
39
39
  * @returns ANSI-colored ASCII-art renderer or `null` when the visual cannot be rendered.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Builds the terminal output required to replace the previous coder-run frame with the next one.
3
+ *
4
+ * The complete update is returned as one string so callers can write it atomically. This prevents
5
+ * animated visuals from producing a separate terminal write for every changed row, which otherwise
6
+ * leaves a large rendering backlog in terminal emulators while their window is not focused.
7
+ *
8
+ * @private internal utility of coder run UI
9
+ */
10
+ export type BuildCoderRunUiTerminalFrameUpdateOptions = {
11
+ /** Frame currently displayed in the terminal, with the cursor on its last row. */
12
+ readonly previousFrameLines: readonly string[];
13
+ /** Frame that should replace the currently displayed frame. */
14
+ readonly nextFrameLines: readonly string[];
15
+ };
16
+ /**
17
+ * Builds one atomic ANSI update that changes the displayed coder-run terminal frame.
18
+ *
19
+ * A change in frame height requires a full rewrite to reserve or clear rows correctly. Frames with
20
+ * the same height only rewrite contiguous groups of changed rows, returning to the frame bottom
21
+ * between groups so each group can be assembled into the same output payload safely.
22
+ *
23
+ * @returns One terminal output payload, or `undefined` when the frame is already up to date.
24
+ *
25
+ * @private internal utility of coder run UI
26
+ */
27
+ export declare function buildCoderRunUiTerminalFrameUpdate(options: BuildCoderRunUiTerminalFrameUpdateOptions): string | undefined;
@@ -0,0 +1,80 @@
1
+ import type { AsciiArtColorDepth } from '../utils/ascii-art/convertImageDataToAsciiArt';
2
+ import type { ResolvedAvatarRenderDefinition } from './renderAvatarVisual';
3
+ import type { AvatarDefinition } from './types/AvatarDefinition';
4
+ import type { AvatarSurfaceStyle, AvatarVisualId, AvatarVisualTerminalTextGrid } from './types/AvatarVisualDefinition';
5
+ /**
6
+ * Options shared by the terminal-text avatar renderers.
7
+ *
8
+ * @private within the repository
9
+ */
10
+ export type RenderAvatarVisualTerminalTextOptions = {
11
+ /**
12
+ * Stable visual identity of the rendered agent avatar.
13
+ */
14
+ readonly avatarDefinition: AvatarDefinition;
15
+ /**
16
+ * Built-in avatar visual to render, the same one used on the website.
17
+ */
18
+ readonly visualId: AvatarVisualId;
19
+ /**
20
+ * Surface used to derive the avatar palette.
21
+ *
22
+ * @default 'framed'
23
+ */
24
+ readonly surface?: AvatarSurfaceStyle;
25
+ /**
26
+ * Output width in terminal character cells.
27
+ */
28
+ readonly columns: number;
29
+ /**
30
+ * Output height in terminal character cells.
31
+ */
32
+ readonly rows: number;
33
+ /**
34
+ * Animation timestamp for animated visuals.
35
+ */
36
+ readonly timeMs: number;
37
+ /**
38
+ * Optional stable render data reused across frames.
39
+ */
40
+ readonly resolvedAvatarRenderDefinition?: ResolvedAvatarRenderDefinition;
41
+ };
42
+ /**
43
+ * Options for `renderAvatarVisualTerminalTextLines`.
44
+ *
45
+ * @private within the repository
46
+ */
47
+ export type RenderAvatarVisualTerminalTextLinesOptions = RenderAvatarVisualTerminalTextOptions & {
48
+ /**
49
+ * Color depth of the emitted ANSI escape codes.
50
+ *
51
+ * @default 'TRUE_COLOR'
52
+ */
53
+ readonly colorDepth?: AsciiArtColorDepth;
54
+ };
55
+ /**
56
+ * Renders one frame of a character-based avatar visual straight into terminal character cells.
57
+ *
58
+ * Visuals which are themselves made of characters, for example `AsciiOctopus`, lose their identity
59
+ * when they are rasterized onto a canvas and converted back into half-block ASCII art - every glyph
60
+ * is averaged away into a colored blob. Such visuals expose `renderTerminalText`, which paints the
61
+ * terminal grid directly and is used instead of the raster pipeline.
62
+ *
63
+ * The square avatar is centered inside the requested grid the same way `renderAvatarVisualAsciiArt`
64
+ * centers the avatar canvas inside a wider terminal frame.
65
+ *
66
+ * @param options Avatar identity, visual selection, and output grid size.
67
+ * @returns Grid of `rows` rows of `columns` cells, or `null` when the visual has no terminal renderer.
68
+ *
69
+ * @private within the repository
70
+ */
71
+ export declare function renderAvatarVisualTerminalTextGrid(options: RenderAvatarVisualTerminalTextOptions): AvatarVisualTerminalTextGrid | null;
72
+ /**
73
+ * Renders one frame of a character-based avatar visual into ANSI-colored terminal lines.
74
+ *
75
+ * @param options Avatar identity, visual selection, output grid size, and ANSI color depth.
76
+ * @returns One ANSI-colored string per output row, or `null` when the visual has no terminal renderer.
77
+ *
78
+ * @private within the repository
79
+ */
80
+ export declare function renderAvatarVisualTerminalTextLines(options: RenderAvatarVisualTerminalTextLinesOptions): ReadonlyArray<string> | null;
@@ -72,6 +72,52 @@ export type AvatarVisualRenderContext = {
72
72
  * @private shared contract for the avatar rendering system
73
73
  */
74
74
  export type AvatarVisual = (context: AvatarVisualRenderContext) => void;
75
+ /**
76
+ * One painted character cell of a terminal-text avatar frame.
77
+ *
78
+ * @private shared contract for the avatar rendering system
79
+ */
80
+ export type AvatarVisualTerminalTextCell = {
81
+ /**
82
+ * Single character painted in the cell.
83
+ */
84
+ readonly character: string;
85
+ /**
86
+ * Color of the character as a CSS color string, optionally with an alpha channel.
87
+ */
88
+ readonly color: string_color;
89
+ };
90
+ /**
91
+ * One rendered terminal-text avatar frame as a grid of character cells.
92
+ *
93
+ * Rows are ordered top to bottom, cells left to right, and `null` leaves the terminal background visible.
94
+ *
95
+ * @private shared contract for the avatar rendering system
96
+ */
97
+ export type AvatarVisualTerminalTextGrid = ReadonlyArray<ReadonlyArray<AvatarVisualTerminalTextCell | null>>;
98
+ /**
99
+ * Rendering context forwarded to a terminal-text avatar visual.
100
+ *
101
+ * Unlike `AvatarVisualRenderContext` this carries no canvas, because the visual paints
102
+ * character cells of a fixed terminal grid instead of pixels.
103
+ *
104
+ * @private shared contract for the avatar rendering system
105
+ */
106
+ export type AvatarVisualTerminalTextRenderContext = {
107
+ readonly columns: number;
108
+ readonly rows: number;
109
+ readonly timeMs: number;
110
+ readonly avatarDefinition: AvatarDefinition;
111
+ readonly palette: AvatarPalette;
112
+ readonly createRandom: (salt: string) => () => number;
113
+ readonly interaction: AvatarInteractionState;
114
+ };
115
+ /**
116
+ * Signature of one terminal-text avatar visual renderer.
117
+ *
118
+ * @private shared contract for the avatar rendering system
119
+ */
120
+ export type AvatarVisualTerminalText = (context: AvatarVisualTerminalTextRenderContext) => AvatarVisualTerminalTextGrid;
75
121
  /**
76
122
  * Metadata and renderer for one built-in avatar visual.
77
123
  *
@@ -84,6 +130,14 @@ export type AvatarVisualDefinition = {
84
130
  readonly isAnimated: boolean;
85
131
  readonly supportsPointerTracking?: boolean;
86
132
  readonly render: AvatarVisual;
133
+ /**
134
+ * Optional native terminal renderer of visuals which are themselves made of characters.
135
+ *
136
+ * Character-based visuals lose their identity when they are rasterized onto a canvas and
137
+ * converted back into half-block ASCII art, so they paint the terminal character grid directly.
138
+ * Visuals without this renderer are rasterized through `renderAvatarVisualAsciiArt` instead.
139
+ */
140
+ readonly renderTerminalText?: AvatarVisualTerminalText;
87
141
  };
88
142
  /**
89
143
  * Props of the shared `<Avatar/>` component.
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Relative directory for an active TEAM conversation workspace.
3
+ *
4
+ * @private internal convention shared by the Agents Server and agent-folder runner
5
+ */
6
+ export declare const AGENT_TEAM_CONVERSATIONS_DIRECTORY_PATH: string;
7
+ /**
8
+ * Relative directory where completed TEAM conversation transcripts are retained.
9
+ *
10
+ * @private internal convention shared by the Agents Server and agent-folder runner
11
+ */
12
+ export declare const AGENT_FINISHED_TEAM_CONVERSATIONS_DIRECTORY_PATH: string;
13
+ /**
14
+ * Name of the JSON manifest that describes one TEAM conversation workspace.
15
+ *
16
+ * @private internal convention shared by the Agents Server and agent-folder runner
17
+ */
18
+ export declare const AGENT_TEAM_CONVERSATION_MANIFEST_FILE_NAME = "team.json";
19
+ /**
20
+ * Name of the read-only teammate-source directory inside one TEAM workspace.
21
+ *
22
+ * @private internal convention shared by the Agents Server and agent-folder runner
23
+ */
24
+ export declare const AGENT_TEAMMATE_SOURCES_DIRECTORY_NAME = "teammates";
25
+ /**
26
+ * One primary agent represented in a TEAM workspace manifest.
27
+ *
28
+ * @private internal convention shared by the Agents Server and agent-folder runner
29
+ */
30
+ export type AgentTeamConversationPrimaryAgent = {
31
+ readonly permanentId: string;
32
+ readonly agentName: string;
33
+ };
34
+ /**
35
+ * One local teammate made available to the coding harness for a single user turn.
36
+ *
37
+ * @private internal convention shared by the Agents Server and agent-folder runner
38
+ */
39
+ export type AgentTeamConversationTeammate = {
40
+ readonly permanentId: string;
41
+ readonly agentName: string;
42
+ readonly url: string;
43
+ readonly instructions: string;
44
+ readonly sourceFileName: string;
45
+ };
46
+ /**
47
+ * Persisted roster snapshot for the optional TEAM workspace of one queued message.
48
+ *
49
+ * @private internal convention shared by the Agents Server and agent-folder runner
50
+ */
51
+ export type AgentTeamConversationWorkspaceManifest = {
52
+ readonly version: 1;
53
+ readonly primaryAgent: AgentTeamConversationPrimaryAgent;
54
+ readonly teammates: ReadonlyArray<AgentTeamConversationTeammate>;
55
+ };
56
+ /**
57
+ * Creates the stable directory name that belongs to one queued `.book` message.
58
+ *
59
+ * @private internal convention shared by the Agents Server and agent-folder runner
60
+ */
61
+ export declare function createAgentTeamConversationWorkspaceDirectoryName(messageFileName: string): string;
62
+ /**
63
+ * Creates the relative active workspace path for one queued message.
64
+ *
65
+ * @private internal convention shared by the Agents Server and agent-folder runner
66
+ */
67
+ export declare function createAgentTeamConversationWorkspacePath(messageFileName: string): string;
68
+ /**
69
+ * Creates the relative completed-workspace path for one queued message.
70
+ *
71
+ * @private internal convention shared by the Agents Server and agent-folder runner
72
+ */
73
+ export declare function createFinishedAgentTeamConversationWorkspacePath(messageFileName: string): string;
74
+ /**
75
+ * Creates the source-snapshot file name for one teammate.
76
+ *
77
+ * @private internal convention shared by the Agents Server and agent-folder runner
78
+ */
79
+ export declare function createAgentTeamTeammateSourceFileName(teammatePermanentId: string): string;
80
+ /**
81
+ * Checks whether unknown JSON has the minimum shape required for a TEAM workspace manifest.
82
+ *
83
+ * @private internal convention shared by the Agents Server and agent-folder runner
84
+ */
85
+ export declare function isAgentTeamConversationWorkspaceManifest(value: unknown): value is AgentTeamConversationWorkspaceManifest;
@@ -591,8 +591,9 @@ export type ChatProps = {
591
591
  progress?: number;
592
592
  }>;
593
593
  /**
594
- * Content to be shown inside the chat bar in head
595
- * If not provided, the chat bar will not be rendered
594
+ * Optional content displayed in the chat header above the message list.
595
+ *
596
+ * If not provided, the header row is not rendered.
596
597
  */
597
598
  readonly children?: ReactNode;
598
599
  /**
@@ -17,6 +17,13 @@ export type MarkdownInlineReference = {
17
17
  * Raw reference text between `[[` and `]]`.
18
18
  */
19
19
  readonly reference: string;
20
+ /**
21
+ * Optional text aliases which should render as this reference when an agent mentions them in markdown.
22
+ *
23
+ * They are also accepted inside a `[[reference]]` token. This lets application code use a stable
24
+ * technical reference while recognizing a human-facing name in older messages.
25
+ */
26
+ readonly sourceTextAliases?: ReadonlyArray<string>;
20
27
  /**
21
28
  * Human-readable label rendered inside the link chip.
22
29
  */
@@ -26,10 +33,12 @@ export type MarkdownInlineReference = {
26
33
  */
27
34
  readonly href: string;
28
35
  /**
29
- * Markdown link destination prefixes that should render as this reference as well.
36
+ * Optional URL prefixes which also identify this reference in the authored markdown.
30
37
  *
31
- * This supports legacy links such as an Agents Server project file URL while keeping
32
- * `reference` as the canonical `[[project]]` token.
38
+ * A markdown link or a bare URL pointing to one of these prefixes is rendered as the same chip
39
+ * as the `[[reference]]` token. Both absolute URLs (for example `https://project.example.com`)
40
+ * and application paths (for example `/agents/agent/projects/website`) are supported; a path
41
+ * prefix matches on any host so that both relative and absolute links are recognized.
33
42
  */
34
43
  readonly sourceHrefPrefixes?: ReadonlyArray<string>;
35
44
  /**
@@ -12,7 +12,7 @@ export type BoilerplateCount = {
12
12
  * Number of prompts written into each generated file.
13
13
  *
14
14
  * Note: More than one prompt per file is an advanced option - each prompt is one separate
15
- * coding task separated by `---` and tagged with its own fresh emoji tag.
15
+ * coding task separated by `---`, with all prompts in the file sharing its fresh emoji tag.
16
16
  */
17
17
  readonly promptsPerFileCount: number;
18
18
  };
@@ -10,7 +10,7 @@ import type { BoilerplateCount } from './boilerplateCount';
10
10
  */
11
11
  export declare function $initializeCoderGenerateBoilerplatesCommand(program: Program): $side_effect;
12
12
  /**
13
- * Generates boilerplate prompt files with unique emoji tags.
13
+ * Generates boilerplate prompt files with one unique emoji tag per file.
14
14
  *
15
15
  * @private internal function of `generatePromptBoilerplate` command
16
16
  */
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Asks the user in the terminal whether the harness should be installed or updated right now.
2
+ * Asks the user in the terminal whether an npm package should be installed or updated now.
3
3
  *
4
4
  * Note: `$` is used to indicate that this function is not a pure function - it reads the answer from stdin
5
5
  *
6
6
  * @returns `true` when the user confirms, `false` when the user declines or the terminal is not interactive
7
7
  * @private internal utility of `promptbookCli`
8
8
  */
9
- export declare function $askForHarnessInstallationApproval(question: string): Promise<boolean>;
9
+ export declare function $askForNpmPackageInstallationApproval(question: string): Promise<boolean>;
@@ -1,10 +1,9 @@
1
- import type { HarnessDefinition } from './HarnessDefinition';
2
1
  /**
3
- * Reads the newest version of the harness published to npm.
2
+ * Reads the newest version of one npm package.
4
3
  *
5
4
  * Note: `$` is used to indicate that this function is not a pure function - it queries the npm registry
6
5
  *
7
6
  * @returns The newest published version or `null` when the registry could not be reached
8
7
  * @private internal utility of `promptbookCli`
9
8
  */
10
- export declare function $resolveLatestHarnessVersion(definition: HarnessDefinition): Promise<string | null>;
9
+ export declare function $resolveLatestNpmPackageVersion(npmPackageName: string): Promise<string | null>;