@promptbook/cli 0.114.0-3 → 0.114.0-31

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 (1049) hide show
  1. package/README.md +10 -18
  2. package/agents/default/developer.book +1 -0
  3. package/apps/agents-server/README.md +1 -1
  4. package/apps/agents-server/{USE_TIMEOUT_CHIP_QA.md → TIMEOUT_CHIP_QA.md} +1 -1
  5. package/apps/agents-server/next.config.ts +28 -0
  6. package/apps/agents-server/package.json +6 -6
  7. package/apps/agents-server/scripts/build-agents-server.js +43 -7
  8. package/apps/agents-server/scripts/build-e2e.js +12 -2
  9. package/apps/agents-server/scripts/generate-reserved-paths/generate-reserved-paths.ts +30 -16
  10. package/apps/agents-server/scripts/kill-port.js +163 -0
  11. package/apps/agents-server/scripts/run-e2e-tests.js +21 -8
  12. package/apps/agents-server/scripts/run-npm.js +81 -5
  13. package/apps/agents-server/src/app/admin/_components/AdminFilterFields.tsx +84 -0
  14. package/apps/agents-server/src/app/admin/_components/AdminMetricCard.tsx +36 -0
  15. package/apps/agents-server/src/app/admin/_components/AdminTaskManagerTabs.tsx +97 -0
  16. package/apps/agents-server/src/app/admin/about/page.tsx +1 -1
  17. package/apps/agents-server/src/app/admin/email-server/page.tsx +17 -18
  18. package/apps/agents-server/src/app/admin/messages/MessageParticipants.tsx +84 -0
  19. package/apps/agents-server/src/app/admin/messages/MessageStatus.tsx +96 -0
  20. package/apps/agents-server/src/app/admin/messages/MessagesClient.tsx +29 -33
  21. package/apps/agents-server/src/app/admin/messages/messageAdminPresentation.ts +289 -0
  22. package/apps/agents-server/src/app/admin/messages/send-email/SendEmailClient.tsx +193 -63
  23. package/apps/agents-server/src/app/admin/messages/send-email/actions.ts +25 -28
  24. package/apps/agents-server/src/app/admin/messages/send-email/emailTesting.ts +153 -0
  25. package/apps/agents-server/src/app/admin/messages/send-email/emailTestingAccess.ts +30 -0
  26. package/apps/agents-server/src/app/admin/messages/send-email/page.tsx +18 -5
  27. package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerClient.tsx +103 -0
  28. package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerEditDialog.tsx +232 -0
  29. package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerFiltersCard.tsx +195 -0
  30. package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerRow.tsx +189 -0
  31. package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerSummaryMetrics.tsx +60 -0
  32. package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerTableCard.tsx +147 -0
  33. package/apps/agents-server/src/app/admin/planned-messages/page.tsx +17 -0
  34. package/apps/agents-server/src/app/admin/planned-messages/plannedMessageEditForm.ts +186 -0
  35. package/apps/agents-server/src/app/admin/planned-messages/plannedMessageManagerDialogs.ts +46 -0
  36. package/apps/agents-server/src/app/admin/planned-messages/plannedMessageManagerPresentation.tsx +188 -0
  37. package/apps/agents-server/src/app/admin/planned-messages/resolvePlannedMessageSortValue.ts +115 -0
  38. package/apps/agents-server/src/app/admin/planned-messages/usePlannedMessageManagerData.ts +116 -0
  39. package/apps/agents-server/src/app/admin/planned-messages/usePlannedMessageManagerState.ts +289 -0
  40. package/apps/agents-server/src/app/admin/task-manager/TaskManagerClient.tsx +7 -2
  41. package/apps/agents-server/src/app/admin/task-manager/TaskManagerFiltersCard.tsx +7 -73
  42. package/apps/agents-server/src/app/admin/task-manager/TaskManagerSummaryMetrics.tsx +5 -30
  43. package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskRow.tsx +2 -0
  44. package/apps/agents-server/src/app/admin/task-manager/[taskId]/TaskManagerTaskDetailClient.tsx +3 -1
  45. package/apps/agents-server/src/app/admin/task-manager/taskManagerTaskPresentation.tsx +23 -0
  46. package/apps/agents-server/src/app/agents/[agentName]/AgentChatWrapper.tsx +8 -9
  47. package/apps/agents-server/src/app/agents/[agentName]/AgentProfileChat.tsx +5 -9
  48. package/apps/agents-server/src/app/agents/[agentName]/api/book/reference-diagnostics/route.ts +30 -7
  49. package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +9 -0
  50. package/apps/agents-server/src/app/agents/[agentName]/api/book/test.http +3 -3
  51. package/apps/agents-server/src/app/agents/[agentName]/api/chat/resolveAgentChatRouteContext.ts +8 -16
  52. package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/[timeoutId]/route.ts +10 -153
  53. package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/route.ts +9 -4
  54. package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/route.ts +3 -0
  55. package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/stream/route.ts +2 -0
  56. package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/resolveUserChatScope.ts +8 -1
  57. package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/route.ts +15 -7
  58. package/apps/agents-server/src/app/agents/[agentName]/api/voice/route.ts +4 -9
  59. package/apps/agents-server/src/app/agents/[agentName]/book/BookEditorMissingReferences.tsx +106 -12
  60. package/apps/agents-server/src/app/agents/[agentName]/book/BookEditorWrapper.tsx +3 -0
  61. package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorDiagnostics.ts +12 -0
  62. package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorSaving.ts +18 -28
  63. package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorWrapper.tsx +2 -0
  64. package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatHistoryClient.tsx +19 -1
  65. package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatSidebarDefault.tsx +17 -5
  66. package/apps/agents-server/src/app/agents/[agentName]/chat/AgentGoalChatNotice.tsx +23 -0
  67. package/apps/agents-server/src/app/agents/[agentName]/chat/AgentGoalChatPlannedMessages.tsx +226 -0
  68. package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatPanel.tsx +6 -0
  69. package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatSurface.tsx +32 -12
  70. package/apps/agents-server/src/app/agents/[agentName]/chat/ExternalUserChatAdminActions.tsx +51 -3
  71. package/apps/agents-server/src/app/agents/[agentName]/chat/TeamMemberFrozenChatPrimaryAgentLink.tsx +31 -0
  72. package/apps/agents-server/src/app/agents/[agentName]/chat/page.tsx +2 -20
  73. package/apps/agents-server/src/app/agents/[agentName]/chat/useAgentChatSidebarState.ts +26 -2
  74. package/apps/agents-server/src/app/agents/[agentName]/goal/page.tsx +35 -0
  75. package/apps/agents-server/src/app/agents/[agentName]/page.tsx +2 -1
  76. package/apps/agents-server/src/app/agents/[agentName]/projectReferenceActions.ts +61 -0
  77. package/apps/agents-server/src/app/agents/[agentName]/projectRuntimeActions.ts +97 -0
  78. package/apps/agents-server/src/app/agents/[agentName]/projects/[projectName]/actions.ts +5 -50
  79. package/apps/agents-server/src/app/agents/[agentName]/projects/[projectName]/page.tsx +2 -2
  80. package/apps/agents-server/src/app/api/admin/default-agents/reinstate/route.ts +5 -1
  81. package/apps/agents-server/src/app/api/admin/dns-records/cloudflare/route.ts +26 -16
  82. package/apps/agents-server/src/app/api/admin/planned-messages/[timeoutId]/route.ts +80 -0
  83. package/apps/agents-server/src/app/api/admin/planned-messages/route.ts +19 -0
  84. package/apps/agents-server/src/app/api/emails/incoming/stalwart/route.ts +9 -2
  85. package/apps/agents-server/src/app/api/internal/agent-goal-chat-planned-messages/route.ts +201 -0
  86. package/apps/agents-server/src/app/api/scrape/route.ts +1 -1
  87. package/apps/agents-server/src/app/layout.tsx +25 -0
  88. package/apps/agents-server/src/app/page.tsx +1 -1
  89. package/apps/agents-server/src/app/superadmin/servers/ServersRegistryTable.tsx +31 -39
  90. package/apps/agents-server/src/app/system/user-wallet/UserWalletDraft.ts +2 -2
  91. package/apps/agents-server/src/components/AgentNaming/legacyAgentTextTranslations.cs.yaml +7 -0
  92. package/apps/agents-server/src/components/AgentProfile/AgentCapabilityChips.tsx +1 -24
  93. package/apps/agents-server/src/components/AgentProfile/AgentProfile.tsx +10 -3
  94. package/apps/agents-server/src/components/AgentProjects/AgentProjectIcon.tsx +137 -0
  95. package/apps/agents-server/src/components/AgentProjects/AgentProjectItem.tsx +26 -10
  96. package/apps/agents-server/src/components/AgentProjects/resolveLatestCompletedAgentMessageKey.ts +32 -0
  97. package/apps/agents-server/src/components/AgentProjects/useAgentProjectMarkdownReferences.ts +306 -0
  98. package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsApiTokenImportStep.tsx +5 -6
  99. package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsCheckStep.tsx +6 -5
  100. package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsManualStep.tsx +10 -14
  101. package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsWizard.tsx +11 -20
  102. package/apps/agents-server/src/components/CloudflareDnsWizard/useCloudflareDnsRecordImport.ts +5 -6
  103. package/apps/agents-server/src/components/DefaultAgents/ReinstateBundledAgentsButton.tsx +7 -0
  104. package/apps/agents-server/src/components/DefaultAgents/coreAgentsAdminRoute.ts +6 -0
  105. package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsInstructions.tsx +91 -57
  106. package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsSectionPanel.tsx +63 -0
  107. package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsSectionVariantTabs.tsx +67 -0
  108. package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsTable.tsx +40 -0
  109. package/apps/agents-server/src/components/Header/Header.tsx +8 -0
  110. package/apps/agents-server/src/components/Header/HeaderTypes.ts +5 -0
  111. package/apps/agents-server/src/components/Header/buildActiveAgentViewItems.ts +5 -4
  112. package/apps/agents-server/src/components/Header/buildHeaderSystemMenuItems.ts +125 -30
  113. package/apps/agents-server/src/components/Header/createAgentViewLabel.tsx +4 -4
  114. package/apps/agents-server/src/components/Header/resolveActiveAgentNavigation.ts +2 -2
  115. package/apps/agents-server/src/components/Header/resolveHeaderSystemActivities.ts +86 -0
  116. package/apps/agents-server/src/components/Homepage/AgentCard.tsx +0 -3
  117. package/apps/agents-server/src/components/Homepage/DefaultAgentsStatusNotice.tsx +1 -7
  118. package/apps/agents-server/src/components/Homepage/useAgentsListImportExportState.ts +22 -10
  119. package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +8 -0
  120. package/apps/agents-server/src/components/NewAgentDialog/NewAgentWizardState.ts +0 -12
  121. package/apps/agents-server/src/components/NewAgentDialog/NewAgentWizardUseSetupStep.tsx +0 -58
  122. package/apps/agents-server/src/components/NewAgentDialog/newAgentWizardPresets.ts +0 -56
  123. package/apps/agents-server/src/components/WalletRecordDialog/useWalletRecordDialogState.ts +1 -1
  124. package/apps/agents-server/src/components/_utils/generateMetaTxt.ts +1 -1
  125. package/apps/agents-server/src/constants/federatedAgentImport.ts +7 -0
  126. package/apps/agents-server/src/database/migratePrefix.ts +13 -12
  127. package/apps/agents-server/src/database/migrations/2026-08-0100-agent-goal-chat-source.sql +10 -0
  128. package/apps/agents-server/src/database/migrations/2026-08-1800-user-chat-timeout-schedule.sql +11 -0
  129. package/apps/agents-server/src/generated/reservedPaths.ts +42 -42
  130. package/apps/agents-server/src/instrumentation-node.ts +18 -0
  131. package/apps/agents-server/src/languages/ServerTranslationKeys.ts +16 -11
  132. package/apps/agents-server/src/languages/translations/czech.yaml +16 -11
  133. package/apps/agents-server/src/languages/translations/english.yaml +16 -11
  134. package/apps/agents-server/src/message-providers/email/smtp/SmtpMessageProvider.ts +1 -1
  135. package/apps/agents-server/src/message-providers/email/stalwart/StalwartMessageProvider.ts +59 -19
  136. package/apps/agents-server/src/message-providers/email/stalwart/parseInboundStalwartEmail.ts +17 -2
  137. package/apps/agents-server/src/middleware/createMiddlewareRequestContext/loadRegisteredServers.ts +8 -0
  138. package/apps/agents-server/src/tools/$provideOpenAiAgentKitExecutionToolsForServer.ts +0 -191
  139. package/apps/agents-server/src/tools/$provideOpenAiAssistantExecutionToolsForServer.ts +0 -3
  140. package/apps/agents-server/src/tools/$provideServer.ts +2 -1
  141. package/apps/agents-server/src/tools/agentGoalChatTimeoutToolFunctions.ts +249 -0
  142. package/apps/agents-server/src/tools/agentGoalChatTimeoutTools.ts +147 -0
  143. package/apps/agents-server/src/tools/createServerChatRuntimeTools.ts +20 -0
  144. package/apps/agents-server/src/tools/getAllToolFunctionsForServer.ts +2 -0
  145. package/apps/agents-server/src/tools/mapRegisteredServerContexts.ts +1 -1
  146. package/apps/agents-server/src/tools/run_browser.ts +1 -1
  147. package/apps/agents-server/src/tools/send_email.ts +3 -3
  148. package/apps/agents-server/src/utils/adminEntityLookups/loadAgentNamesByPermanentId.ts +45 -0
  149. package/apps/agents-server/src/utils/adminEntityLookups/loadUsernamesByUserId.ts +36 -0
  150. package/apps/agents-server/src/utils/adminEntityLookups.ts +2 -0
  151. package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatConstants.ts +14 -0
  152. package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatIdentity.ts +28 -0
  153. package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatPlannedMessageActions.ts +583 -0
  154. package/apps/agents-server/src/utils/agentGoalChat/appendAgentGoalChatNote.ts +43 -0
  155. package/apps/agents-server/src/utils/agentGoalChat/canAccessAgentGoalChat.ts +14 -0
  156. package/apps/agents-server/src/utils/agentGoalChat/createAgentGoalChatNoteContent.ts +129 -0
  157. package/apps/agents-server/src/utils/agentGoalChat/enqueueAgentGoalChatTurn.ts +167 -0
  158. package/apps/agents-server/src/utils/agentGoalChat/ensureAgentGoalChat.ts +66 -0
  159. package/apps/agents-server/src/utils/agentGoalChat/prependAgentGoalChatSummarySeed.ts +40 -0
  160. package/apps/agents-server/src/utils/agentGoalChat/recordAgentGoalChatLifecycleNote.ts +53 -0
  161. package/apps/agents-server/src/utils/agentGoalChat/resolveAgentGoalChatOwnerUserId.ts +104 -0
  162. package/apps/agents-server/src/utils/agentGoalChat/resolveEffectiveAgentGoal.ts +29 -0
  163. package/apps/agents-server/src/utils/agentGoalChat/scheduleAgentGoalChatModifiedNote.ts +85 -0
  164. package/apps/agents-server/src/utils/agentGoalChat.ts +25 -0
  165. package/apps/agents-server/src/utils/agentProjects/AgentProjectInfo.ts +10 -1
  166. package/apps/agents-server/src/utils/agentProjects/AgentProjectReferenceInfo.ts +5 -2
  167. package/apps/agents-server/src/utils/agentProjects/AgentProjectRuntimeActionResult.ts +14 -0
  168. package/apps/agents-server/src/utils/agentProjects/agentProjectFileNames.ts +21 -0
  169. package/apps/agents-server/src/utils/agentProjects/agentProjectHrefs.ts +20 -11
  170. package/apps/agents-server/src/utils/agentProjects/agentProjectIdentity.ts +46 -0
  171. package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeAutostartScheduler.ts +162 -0
  172. package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeDesiredState.ts +252 -0
  173. package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeDisplay.ts +6 -3
  174. package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeDomains.ts +2 -44
  175. package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimePaths.ts +25 -0
  176. package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimePm2.ts +60 -13
  177. package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeRegistry.ts +77 -24
  178. package/apps/agents-server/src/utils/agentProjects/agentProjectStateMutationQueue.ts +58 -0
  179. package/apps/agents-server/src/utils/agentProjects/agentProjectsPaths.ts +15 -5
  180. package/apps/agents-server/src/utils/agentProjects/createAgentProjectInitials.ts +36 -0
  181. package/apps/agents-server/src/utils/agentProjects/createAgentProjectMarkdownReferences.ts +124 -19
  182. package/apps/agents-server/src/utils/agentProjects/createAgentProjectsDnsRecordsSection.ts +113 -0
  183. package/apps/agents-server/src/utils/agentProjects/createStaticAgentProjectServer.ts +2 -6
  184. package/apps/agents-server/src/utils/agentProjects/humanizeAgentProjectName.ts +25 -0
  185. package/apps/agents-server/src/utils/agentProjects/listAgentProjectChatReferences.ts +10 -3
  186. package/apps/agents-server/src/utils/agentProjects/listAgentProjectNames.ts +35 -0
  187. package/apps/agents-server/src/utils/agentProjects/listAgentProjects.ts +6 -23
  188. package/apps/agents-server/src/utils/agentProjects/listAllAgentProjectSummaries.ts +2 -1
  189. package/apps/agents-server/src/utils/agentProjects/listAllLocalAgentProjectIdentities.ts +48 -0
  190. package/apps/agents-server/src/utils/agentProjects/parseAgentProjectIndexHtml.ts +167 -0
  191. package/apps/agents-server/src/utils/agentProjects/readAgentProjectIndexHtmlProfile.ts +24 -0
  192. package/apps/agents-server/src/utils/agentProjects/readAgentProjectReadme.ts +3 -53
  193. package/apps/agents-server/src/utils/agentProjects/readAgentProjectRootTextFile.ts +73 -0
  194. package/apps/agents-server/src/utils/agentProjects/resolveAgentChatProjectReferences.ts +25 -0
  195. package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectFaviconRelativePath.ts +108 -0
  196. package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectInfo.ts +12 -3
  197. package/apps/agents-server/src/utils/agentProjects/{resolveAgentProjectReadmeProfile.ts → resolveAgentProjectProfile.ts} +33 -33
  198. package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectPublicUrls.ts +34 -0
  199. package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectRuntimeEnvironmentFlag.ts +23 -0
  200. package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectRuntimeStatus.ts +73 -0
  201. package/apps/agents-server/src/utils/agentProjects/startDefaultAgentProjectRuntimes.ts +110 -0
  202. package/apps/agents-server/src/utils/agentReferenceResolver/MissingCoreAgentRecovery.ts +19 -0
  203. package/apps/agents-server/src/utils/agentReferenceResolver/bookScopedAgentReferences.ts +7 -0
  204. package/apps/agents-server/src/utils/agentReferenceResolver/createAgentInheritanceDiagnostics.ts +457 -0
  205. package/apps/agents-server/src/utils/agentReferenceResolver/createUnresolvedAgentReferenceDiagnostics.ts +27 -0
  206. package/apps/agents-server/src/utils/agentReferenceResolver/resolveCoreAgentAwareMissingReferences.ts +156 -0
  207. package/apps/agents-server/src/utils/bookLanguageDocumentation/createBookLanguageDocumentationPdfResponse.ts +19 -17
  208. package/apps/agents-server/src/utils/chatMessageChips/createAnsweredMessageChipToolCalls.ts +49 -0
  209. package/apps/agents-server/src/utils/chatMessageChips/createPlannedMessageChipToolCalls.ts +44 -0
  210. package/apps/agents-server/src/utils/chatMessageChips/createTouchedExternalSourceChipToolCalls.ts +39 -0
  211. package/apps/agents-server/src/utils/chatMessageChips/createTouchedProjectChipResult.ts +45 -0
  212. package/apps/agents-server/src/utils/chatMessageChips/createTouchedProjectChipToolCalls.ts +109 -0
  213. package/apps/agents-server/src/utils/chatTasksAdmin.ts +9 -0
  214. package/apps/agents-server/src/utils/createAgentWithDefaultVisibility.ts +8 -0
  215. package/apps/agents-server/src/utils/createWellKnownAgentUrl.ts +17 -0
  216. package/apps/agents-server/src/utils/cronExpression/CronExpression.ts +63 -0
  217. package/apps/agents-server/src/utils/cronExpression/normalizeCronExpression.ts +34 -0
  218. package/apps/agents-server/src/utils/cronExpression/normalizeCronExpressionWhitespace.ts +11 -0
  219. package/apps/agents-server/src/utils/cronExpression/parseCronExpression.ts +41 -0
  220. package/apps/agents-server/src/utils/cronExpression/parseCronExpressionField.ts +140 -0
  221. package/apps/agents-server/src/utils/cronExpression/resolveNextCronRun.ts +100 -0
  222. package/apps/agents-server/src/utils/cronExpression/throwInvalidCronExpressionField.ts +20 -0
  223. package/apps/agents-server/src/utils/cronExpression.ts +10 -0
  224. package/apps/agents-server/src/utils/currentServerRegistryContext.ts +2 -1
  225. package/apps/agents-server/src/utils/customDomainRouting.ts +143 -10
  226. package/apps/agents-server/src/utils/dnsRecords/DnsRecordInstruction.ts +20 -0
  227. package/apps/agents-server/src/utils/dnsRecords/DnsRecordsSection.ts +77 -0
  228. package/apps/agents-server/src/utils/dnsRecords/createServerDnsRecordsSections.ts +58 -0
  229. package/apps/agents-server/src/utils/dnsRecords/createServerDomainDnsRecordsSection.ts +48 -0
  230. package/apps/agents-server/src/utils/dnsRecords/dnsRecordGroups.ts +52 -0
  231. package/apps/agents-server/src/utils/dnsRecords/resolveDnsRecordBatchPlan.ts +47 -1
  232. package/apps/agents-server/src/utils/email/agentEmailAddress.ts +14 -0
  233. package/apps/agents-server/src/utils/email/sendEmailThroughStalwart.ts +2 -1
  234. package/apps/agents-server/src/utils/explicitFromCommitment.ts +130 -0
  235. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/adminChatTaskSqlQuery.ts +41 -36
  236. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/loadAdminChatTaskFallbackData.ts +3 -77
  237. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskFallbackRows.ts +3 -0
  238. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskSqlRows.ts +2 -0
  239. package/apps/agents-server/src/utils/getFederatedServers.ts +5 -15
  240. package/apps/agents-server/src/utils/getWellKnownAgentUrl.ts +2 -3
  241. package/apps/agents-server/src/utils/handleChatCompletion/createHandleChatCompletionPromptContext.ts +3 -2
  242. package/apps/agents-server/src/utils/handleChatCompletion/resolveHandleChatCompletionRuntime.ts +4 -12
  243. package/apps/agents-server/src/utils/localChatRunner/applyLocalAgentPlannedMessageCommands.ts +261 -0
  244. package/apps/agents-server/src/utils/localChatRunner/parseLocalTeamConversations.ts +281 -0
  245. package/apps/agents-server/src/utils/localChatRunner/persistLocalTeamConversations.ts +71 -0
  246. package/apps/agents-server/src/utils/localChatRunner/prepareLocalAgentPlannedMessagesSidecar.ts +74 -0
  247. package/apps/agents-server/src/utils/localChatRunner/prepareLocalTeamConversationWorkspace.ts +233 -0
  248. package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +154 -27
  249. package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentBooks.ts +5 -12
  250. package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentRuntime.ts +2 -2
  251. package/apps/agents-server/src/utils/managementApi/managementApiSchemas.ts +2 -2
  252. package/apps/agents-server/src/utils/messages/parseUseEmailSmtpCredential.ts +1 -1
  253. package/apps/agents-server/src/utils/parseFederatedServers.ts +14 -0
  254. package/apps/agents-server/src/utils/plannedMessageManager/cancelManagedPlannedMessage.ts +35 -0
  255. package/apps/agents-server/src/utils/plannedMessageManager/collectPlannedMessageAgentOptions.ts +56 -0
  256. package/apps/agents-server/src/utils/plannedMessageManager/createPlannedMessageManagerCounters.ts +104 -0
  257. package/apps/agents-server/src/utils/plannedMessageManager/filterPlannedMessages.ts +191 -0
  258. package/apps/agents-server/src/utils/plannedMessageManager/getPlannedMessageManagerResponse.ts +55 -0
  259. package/apps/agents-server/src/utils/plannedMessageManager/isPlannedMessageStillPlanned.ts +18 -0
  260. package/apps/agents-server/src/utils/plannedMessageManager/loadPlannedMessageManagerRecord.ts +32 -0
  261. package/apps/agents-server/src/utils/plannedMessageManager/mapPlannedMessageManagerRecord.ts +73 -0
  262. package/apps/agents-server/src/utils/plannedMessageManager/parsePlannedMessageManagerUpdateRequest.ts +76 -0
  263. package/apps/agents-server/src/utils/plannedMessageManager/resolvePlannedMessageEndReason.ts +59 -0
  264. package/apps/agents-server/src/utils/plannedMessageManager/resolvePlannedMessageLifecycle.ts +99 -0
  265. package/apps/agents-server/src/utils/plannedMessageManager/resolvePlannedMessageRecurrenceKind.ts +40 -0
  266. package/apps/agents-server/src/utils/plannedMessageManager/updateManagedPlannedMessage.ts +121 -0
  267. package/apps/agents-server/src/utils/plannedMessagesAdmin.ts +200 -0
  268. package/apps/agents-server/src/utils/resolveInheritedAgentSource.ts +114 -95
  269. package/apps/agents-server/src/utils/resolveUseEmailSmtpCredential.ts +1 -1
  270. package/apps/agents-server/src/utils/serverManagement/createManagedServer/insertManagedServerRegistryRow.ts +2 -2
  271. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerCoreAgents.ts +7 -6
  272. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerDefaultAgents.ts +5 -4
  273. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerMetadata.ts +3 -2
  274. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerUsers.ts +3 -2
  275. package/apps/agents-server/src/utils/serverManagement/deleteManagedServer.ts +2 -2
  276. package/apps/agents-server/src/utils/serverManagement/getManagedServerById.ts +1 -1
  277. package/apps/agents-server/src/utils/serverManagement/listManagedServers.ts +1 -1
  278. package/apps/agents-server/src/utils/serverRegistry.ts +0 -24
  279. package/apps/agents-server/src/utils/serverRegistryNode.ts +27 -0
  280. package/apps/agents-server/src/utils/stalwart/createEmailDnsRecordsSection.ts +53 -0
  281. package/apps/agents-server/src/utils/useEmailSmtpWalletConstants.ts +5 -5
  282. package/apps/agents-server/src/utils/userChat/UserChatRecord.ts +13 -0
  283. package/apps/agents-server/src/utils/userChat/UserChatSource.ts +14 -0
  284. package/apps/agents-server/src/utils/userChat/appendQueuedUserChatTurn.ts +9 -2
  285. package/apps/agents-server/src/utils/userChat/createImmediateUserChatAnswerModelRequirements.ts +1 -0
  286. package/apps/agents-server/src/utils/userChat/createRunUserChatJobExecutionContext.ts +7 -17
  287. package/apps/agents-server/src/utils/userChat/createUserChatSummary.ts +10 -2
  288. package/apps/agents-server/src/utils/userChat/finalizeUserChatJob.ts +3 -2
  289. package/apps/agents-server/src/utils/userChat/getUserChat.ts +16 -1
  290. package/apps/agents-server/src/utils/userChat/getUserChatForJobRunner.ts +31 -0
  291. package/apps/agents-server/src/utils/userChat/listUserChats.ts +113 -110
  292. package/apps/agents-server/src/utils/userChat/persistFrozenUserChat.ts +21 -6
  293. package/apps/agents-server/src/utils/userChat/persistUserChatJobTerminalState.ts +5 -0
  294. package/apps/agents-server/src/utils/userChat/resolveUserChatWorkerInternalToken.ts +5 -4
  295. package/apps/agents-server/src/utils/userChat/runImmediateUserChatAnswer.ts +2 -6
  296. package/apps/agents-server/src/utils/userChat/runUserChatJob.ts +2 -6
  297. package/apps/agents-server/src/utils/userChat/teamMemberUserChatContext.ts +63 -0
  298. package/apps/agents-server/src/utils/userChat/userChatJobRunReport.ts +30 -0
  299. package/apps/agents-server/src/utils/userChat/userChatMessageLifecycle.ts +6 -1
  300. package/apps/agents-server/src/utils/userChat.ts +5 -1
  301. package/apps/agents-server/src/utils/userChatClient/cancelAgentUserTimeout.ts +2 -2
  302. package/apps/agents-server/src/utils/userChatClient/fetchAgentUserTimeouts.ts +2 -2
  303. package/apps/agents-server/src/utils/userChatClient.ts +13 -31
  304. package/apps/agents-server/src/utils/userChatTimeout/UserChatTimeoutRecord.ts +47 -3
  305. package/apps/agents-server/src/utils/userChatTimeout/agentScopedTimeoutBulkActions.ts +11 -17
  306. package/apps/agents-server/src/utils/userChatTimeout/createTimeoutWakeUpMessage.ts +38 -6
  307. package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/PlannedMessageSchedule.ts +52 -0
  308. package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/hasPlannedMessageRecurrence.ts +13 -0
  309. package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/isPlannedMessageScheduleFinished.ts +30 -0
  310. package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/normalizePlannedMessageScheduleValues.ts +62 -0
  311. package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/parsePlannedMessageSchedule.ts +202 -0
  312. package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/resolvePlannedMessageDueAt.ts +121 -0
  313. package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule.ts +12 -0
  314. package/apps/agents-server/src/utils/userChatTimeout/setAgentScopedUserChatTimeoutPausedState.ts +66 -0
  315. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/claimNextDueUserChatTimeout.ts +28 -25
  316. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/createUserChatTimeout.ts +76 -5
  317. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/getAgentScopedUserChatTimeout.ts +8 -4
  318. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/listAgentUserChatTimeouts.ts +4 -1
  319. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/listAllUserChatTimeouts.ts +37 -0
  320. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/mapUserChatTimeoutRow.ts +9 -0
  321. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/recoverExpiredRunningUserChatTimeouts.ts +3 -2
  322. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/repeatFiredUserChatTimeout.ts +84 -0
  323. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/updateAgentScopedUserChatTimeout.ts +39 -6
  324. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore.ts +2 -0
  325. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutWorker.ts +220 -57
  326. package/apps/agents-server/src/utils/userChatTimeout.ts +16 -0
  327. package/apps/agents-server/src/utils/userWallet/UserWalletRecord.ts +1 -1
  328. package/apps/agents-server/src/utils/userWallet/resolveUseEmailSmtpCredentialFromWallet.ts +1 -1
  329. package/apps/agents-server/src/utils/vpsSelfUpdate/deleteVpsSelfUpdateInstalledVersion.ts +2 -1
  330. package/apps/agents-server/src/utils/vpsSelfUpdate/isVpsSelfUpdateJobRunning.ts +16 -0
  331. package/apps/agents-server/src/utils/vpsSelfUpdate/startVpsSelfUpdate.ts +2 -1
  332. package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateCron.ts +23 -316
  333. package/apps/agents-server/src/utils/vpsSelfUpdate.ts +1 -0
  334. package/apps/agents-server/tests/e2e/support/AgentManagementApi.ts +3 -3
  335. package/esm/apps/agents-server/src/constants/federatedAgentImport.d.ts +6 -0
  336. package/esm/index.es.js +9596 -8286
  337. package/esm/index.es.js.map +1 -1
  338. package/esm/scripts/run-agent-messages/git/commitAgentProjectChanges.d.ts +15 -0
  339. package/esm/scripts/run-agent-messages/git/commitAnsweredMessageProjectChanges.d.ts +24 -0
  340. package/esm/scripts/run-agent-messages/git/ensureAgentProjectGitRepository.d.ts +20 -0
  341. package/esm/scripts/run-agent-messages/git/readAgentProjectCommitChange.d.ts +11 -0
  342. package/esm/scripts/run-agent-messages/git/runAgentProjectGitCommand.d.ts +29 -0
  343. package/esm/scripts/run-agent-messages/messages/buildAgentGoalChatPromptSection.d.ts +26 -0
  344. package/esm/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +12 -1
  345. package/esm/scripts/run-agent-messages/messages/buildAgentProjectsPromptSection.d.ts +2 -14
  346. package/esm/scripts/run-agent-messages/messages/buildAgentTeamPromptSection.d.ts +12 -0
  347. package/esm/scripts/run-agent-messages/messages/finalizeAgentTeamConversationWorkspace.d.ts +16 -0
  348. package/esm/scripts/run-agent-messages/messages/listAgentProjectDirectoryNames.d.ts +7 -0
  349. package/esm/scripts/run-agent-messages/messages/loadAgentPlannedMessagesSidecar.d.ts +10 -0
  350. package/esm/scripts/run-agent-messages/messages/loadAgentTeamConversationWorkspace.d.ts +6 -0
  351. package/esm/scripts/run-agent-messages/messages/resolveAnsweredMessageTouches.d.ts +29 -0
  352. package/esm/scripts/run-codex-prompts/common/CoderRunControlFeedback.d.ts +54 -0
  353. package/esm/scripts/run-codex-prompts/common/applyCoderRunControlKey.d.ts +14 -0
  354. package/esm/scripts/run-codex-prompts/common/buildCoderRunControlKeyBadge.d.ts +7 -0
  355. package/esm/scripts/run-codex-prompts/common/createCoderRunStepTracker.d.ts +48 -0
  356. package/esm/scripts/run-codex-prompts/common/formatCoderRunControlFeedback.d.ts +13 -0
  357. package/esm/scripts/run-codex-prompts/common/listenForCoderRunControls.d.ts +17 -0
  358. package/esm/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
  359. package/esm/scripts/run-codex-prompts/common/runGoScript/$spawnLoggedBashScript.d.ts +25 -0
  360. package/esm/scripts/run-codex-prompts/common/runGoScript/$terminateLoggedBashProcessTree.d.ts +11 -0
  361. package/esm/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +4 -0
  362. package/esm/scripts/run-codex-prompts/common/waitForPause.d.ts +0 -8
  363. package/esm/scripts/run-codex-prompts/common/waitForSkippableWorldTimeDeadline.d.ts +15 -0
  364. package/esm/scripts/run-codex-prompts/git/coderCommitScope.d.ts +31 -0
  365. package/esm/scripts/run-codex-prompts/git/coderGitSync.d.ts +15 -2
  366. package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +9 -3
  367. package/esm/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +40 -0
  368. package/esm/scripts/run-codex-prompts/ping/pingCoderHarnessPeriodically.d.ts +22 -0
  369. package/esm/scripts/run-codex-prompts/prompts/buildPromptLabel.d.ts +6 -0
  370. package/esm/scripts/run-codex-prompts/prompts/buildPromptStatusDetails.d.ts +51 -0
  371. package/esm/scripts/run-codex-prompts/prompts/findFirstNonEmptyLineIndex.d.ts +6 -0
  372. package/esm/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +6 -3
  373. package/esm/scripts/run-codex-prompts/prompts/isPromptSectionUnfinished.d.ts +8 -0
  374. package/esm/scripts/run-codex-prompts/prompts/listPromptsByStatus.d.ts +7 -0
  375. package/esm/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +15 -4
  376. package/esm/scripts/run-codex-prompts/prompts/markPromptFailed.d.ts +35 -1
  377. package/esm/scripts/run-codex-prompts/prompts/markPromptInProgress.d.ts +27 -0
  378. package/esm/scripts/run-codex-prompts/prompts/promptRunnerAttribution.d.ts +30 -0
  379. package/esm/scripts/run-codex-prompts/prompts/resolveInterruptedPrompt.d.ts +9 -0
  380. package/esm/scripts/run-codex-prompts/prompts/resolvePromptStatusLine.d.ts +19 -0
  381. package/esm/scripts/run-codex-prompts/prompts/writePromptStatusLine.d.ts +10 -0
  382. package/esm/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +15 -0
  383. package/esm/scripts/run-codex-prompts/runners/claude-code/parseClaudeCodeOutputEvents.d.ts +3 -0
  384. package/esm/scripts/run-codex-prompts/runners/claude-code/parseClaudeCodeSubscriptionUsage.d.ts +11 -0
  385. package/esm/scripts/run-codex-prompts/runners/common/estimateUsageFromTextLength.d.ts +33 -0
  386. package/esm/scripts/run-codex-prompts/runners/common/modelPricing.d.ts +41 -0
  387. package/esm/scripts/run-codex-prompts/runners/gemini/gemini-pricing.d.ts +5 -18
  388. package/esm/scripts/run-codex-prompts/runners/openai-codex/OpenAiCodexRunner.d.ts +8 -0
  389. package/esm/scripts/run-codex-prompts/runners/openai-codex/buildCodexUsageFromOutput.d.ts +4 -1
  390. package/esm/scripts/run-codex-prompts/runners/openai-codex/getCodexSubscriptionUsage.d.ts +19 -0
  391. package/esm/scripts/run-codex-prompts/runners/qwen-code/QwenCodeRunner.d.ts +23 -0
  392. package/esm/scripts/run-codex-prompts/runners/qwen-code/buildQwenCodeScript.d.ts +8 -0
  393. package/esm/scripts/run-codex-prompts/runners/qwen-code/parseQwenCodeUsageFromOutput.d.ts +9 -0
  394. package/esm/scripts/run-codex-prompts/runners/qwen-code/qwen-code-pricing.d.ts +30 -0
  395. package/esm/scripts/run-codex-prompts/runners/types/HarnessSubscriptionUsage.d.ts +43 -0
  396. package/esm/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +1 -1
  397. package/esm/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
  398. package/esm/scripts/run-codex-prompts/server/updatePromptSection.d.ts +1 -1
  399. package/esm/scripts/run-codex-prompts/testing/runPromptWithTestFeedback.d.ts +6 -0
  400. package/esm/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +21 -1
  401. package/esm/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
  402. package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +8 -1
  403. package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
  404. package/esm/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +11 -0
  405. package/esm/scripts/run-codex-prompts/ui/buildSubscriptionUsageSessionRows.d.ts +11 -0
  406. package/esm/scripts/run-codex-prompts/ui/refreshCoderRunUiSubscriptionUsage.d.ts +14 -0
  407. package/esm/scripts/utils/emojiTags/validSinglePictogramEmojis.d.ts +17 -0
  408. package/esm/scripts/verify-prompts/$orderPromptFiles.d.ts +9 -0
  409. package/esm/scripts/verify-prompts/VerifyPromptsOrder.d.ts +26 -0
  410. package/esm/scripts/verify-prompts/verify-prompts.d.ts +3 -2
  411. package/esm/src/_packages/components.index.d.ts +4 -0
  412. package/esm/src/_packages/types.index.d.ts +4 -0
  413. package/esm/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
  414. package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
  415. package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -3
  416. package/esm/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +5 -0
  417. package/esm/src/book-2.0/agent-source/ParsedUnknownCommitment.d.ts +26 -0
  418. package/esm/src/book-2.0/agent-source/getBookCommitmentLineType.d.ts +19 -0
  419. package/esm/src/book-3.0/AgentMessageRunReport.d.ts +46 -0
  420. package/esm/src/book-3.0/AgentPlannedMessagesSidecar.d.ts +127 -0
  421. package/esm/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
  422. package/esm/src/book-3.0/cliAgentEnv.d.ts +3 -3
  423. package/esm/src/book-3.0/createAgentMessageSidecarBaseName.d.ts +13 -0
  424. package/esm/src/book-3.0/describeAgentPlannedMessageSchedule.d.ts +31 -0
  425. package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +1 -9
  426. package/esm/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.d.ts +28 -0
  427. package/esm/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.d.ts +28 -0
  428. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
  429. package/esm/src/book-components/Chat/Chat/renderAgentProjectDiff.d.ts +13 -0
  430. package/esm/src/book-components/Chat/Chat/renderAgentProjectToolCallDetails.d.ts +16 -0
  431. package/esm/src/book-components/Chat/utils/agentProjectToolCall.d.ts +85 -0
  432. package/esm/src/book-components/Chat/utils/externalSourceToolCall.d.ts +38 -0
  433. package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +68 -3
  434. package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +30 -0
  435. package/esm/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.d.ts +9 -0
  436. package/esm/src/cli/cli-commands/coder/GitChangesMode.d.ts +28 -0
  437. package/esm/src/cli/cli-commands/coder/boilerplateCount.d.ts +52 -0
  438. package/esm/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +14 -1
  439. package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +4 -3
  440. package/esm/src/cli/cli-commands/coder/verify.d.ts +1 -1
  441. package/esm/src/cli/cli-commands/coder/waitOptions.d.ts +12 -0
  442. package/esm/src/cli/cli-commands/common/$askForConfirmation.d.ts +9 -0
  443. package/esm/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +1 -1
  444. package/esm/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +3 -3
  445. package/esm/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +3 -3
  446. package/esm/src/cli/cli-commands/common/harness/$resolveHarnessCommandPath.d.ts +14 -0
  447. package/esm/src/cli/cli-commands/common/harness/$resolveHarnessInstallationOrigin.d.ts +10 -0
  448. package/esm/src/cli/cli-commands/common/harness/$runHarnessInstallationCommand.d.ts +43 -0
  449. package/esm/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +36 -0
  450. package/esm/src/cli/cli-commands/common/harness/HarnessInstallationOrigin.d.ts +36 -0
  451. package/esm/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +8 -2
  452. package/esm/src/cli/cli-commands/common/harness/HarnessUpdatePlan.d.ts +23 -0
  453. package/esm/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.d.ts +4 -1
  454. package/esm/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.d.ts +8 -0
  455. package/esm/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.d.ts +31 -0
  456. package/esm/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.d.ts +12 -0
  457. package/esm/src/cli/cli-commands/common/harnessUpdateCliOptions.d.ts +29 -0
  458. package/esm/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.d.ts → npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
  459. package/esm/src/cli/cli-commands/common/{harness/$resolveLatestHarnessVersion.d.ts → npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
  460. package/esm/src/cli/cli-commands/common/npm/$resolveNpmGlobalPrefixPath.d.ts +9 -0
  461. package/esm/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.d.ts +12 -0
  462. package/esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
  463. package/esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +12 -0
  464. package/esm/src/cli/cli-commands/common/projectInitialization.d.ts +6 -0
  465. package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +17 -4
  466. package/esm/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
  467. package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
  468. package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
  469. package/esm/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
  470. package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +66 -0
  471. package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.d.ts +26 -0
  472. package/esm/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.d.ts +7 -0
  473. package/esm/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts +7 -0
  474. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +15 -0
  475. package/esm/src/commitments/{COMPONENT/COMPONENT.d.ts → META_FULLNAME/META_FULLNAME.d.ts} +8 -5
  476. package/esm/src/commitments/META_ID/META_ID.d.ts +32 -0
  477. package/esm/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +14 -7
  478. package/esm/src/commitments/index.d.ts +4 -12
  479. package/esm/src/executables/platforms/locateAppOnWindows.d.ts +1 -1
  480. package/esm/src/llm-providers/agent/Agent.d.ts +1 -1
  481. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +1 -1
  482. package/esm/src/{commitments/USE_BROWSER → scrapers/_common/utils}/fetchUrlContent.d.ts +2 -3
  483. package/esm/src/utils/agent-message-runtime/AgentMessageProjectChange.d.ts +76 -0
  484. package/esm/src/utils/agent-message-runtime/AgentMessageTouchedExternalSource.d.ts +45 -0
  485. package/esm/src/utils/agent-message-runtime/parseAgentMessageRuntimeLogEvents.d.ts +62 -0
  486. package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
  487. package/esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.d.ts +18 -0
  488. package/esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.d.ts +19 -0
  489. package/esm/src/utils/agents/terminalAgentAvatarVisual.d.ts +5 -2
  490. package/esm/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +6 -0
  491. package/esm/src/utils/ascii-art/createAnsiColorCode.d.ts +46 -0
  492. package/esm/src/utils/misc/debounce.d.ts +4 -2
  493. package/esm/src/utils/misc/debounce.test.d.ts +1 -0
  494. package/esm/src/utils/misc/emojis.d.ts +3 -2
  495. package/esm/src/utils/random/$generateBookBoilerplate.test.d.ts +1 -0
  496. package/esm/src/version.d.ts +1 -1
  497. package/package.json +2 -2
  498. package/src/_packages/components.index.ts +4 -0
  499. package/src/_packages/components.readme.md +1 -1
  500. package/src/_packages/types.index.ts +4 -0
  501. package/src/avatars/renderAvatarVisualTerminalText.ts +249 -0
  502. package/src/avatars/types/AvatarVisualDefinition.ts +60 -0
  503. package/src/avatars/visuals/asciiOctopusAvatarVisual.ts +144 -22
  504. package/src/book-2.0/agent-source/AgentBasicInformation.ts +3 -9
  505. package/src/book-2.0/agent-source/AgentSourceParseResult.ts +6 -0
  506. package/src/book-2.0/agent-source/ParsedUnknownCommitment.ts +29 -0
  507. package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/augmentAgentModelRequirementsFromSource.ts +38 -1
  508. package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/filterCommitmentsForAgentModelRequirements.ts +0 -23
  509. package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.ts +0 -2
  510. package/src/book-2.0/agent-source/getBookCommitmentLineType.ts +36 -0
  511. package/src/book-2.0/agent-source/parseAgentSource/applyMetaCommitment.ts +16 -31
  512. package/src/book-2.0/agent-source/parseAgentSource/createCapabilitiesFromCommitment.ts +0 -35
  513. package/src/book-2.0/agent-source/parseAgentSourceWithCommitments.ts +128 -61
  514. package/src/book-2.0/agent-source/string_book.ts +1 -1
  515. package/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.ts +0 -25
  516. package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +7 -14
  517. package/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.ts +13 -33
  518. package/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.ts +12 -32
  519. package/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.ts +1 -4
  520. package/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.ts +4 -17
  521. package/src/book-3.0/AgentMessageRunReport.ts +135 -0
  522. package/src/book-3.0/AgentPlannedMessagesSidecar.ts +284 -0
  523. package/src/book-3.0/AgentTeamConversationWorkspace.ts +170 -0
  524. package/src/book-3.0/cliAgentEnv.ts +3 -2
  525. package/src/book-3.0/createAgentMessageSidecarBaseName.ts +20 -0
  526. package/src/book-3.0/describeAgentPlannedMessageSchedule.ts +94 -0
  527. package/src/book-components/BookEditor/BookEditorMonaco.tsx +8 -1
  528. package/src/book-components/BookEditor/BookEditorMonacoTokenization.ts +3 -1
  529. package/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.ts +3 -11
  530. package/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.ts +71 -0
  531. package/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.ts +50 -0
  532. package/src/book-components/BookEditor/useBookEditorMonacoLanguage.ts +1 -1
  533. package/src/book-components/BookEditor/useBookEditorMonacoStyles.ts +56 -55
  534. package/src/book-components/Chat/Chat/Chat.module.css +172 -27
  535. package/src/book-components/Chat/Chat/ChatMessageMap.tsx +7 -4
  536. package/src/book-components/Chat/Chat/ChatProps.tsx +3 -2
  537. package/src/book-components/Chat/Chat/renderAgentProjectDiff.tsx +85 -0
  538. package/src/book-components/Chat/Chat/renderAgentProjectToolCallDetails.tsx +206 -0
  539. package/src/book-components/Chat/Chat/renderToolCallDetails.tsx +9 -12
  540. package/src/book-components/Chat/MarkdownContent/MarkdownContent.module.css +85 -17
  541. package/src/book-components/Chat/MarkdownContent/MarkdownContent.tsx +115 -2
  542. package/src/book-components/Chat/save/react/exports/chat-preview-2025-10-13 (1).jsx +95 -5
  543. package/src/book-components/Chat/utils/agentProjectToolCall.ts +151 -0
  544. package/src/book-components/Chat/utils/externalSourceToolCall.ts +65 -0
  545. package/src/book-components/Chat/utils/getToolCallChipletInfo.ts +64 -0
  546. package/src/book-components/Chat/utils/renderMarkdown.ts +658 -96
  547. package/src/book-components/Chat/utils/timeoutToolCallPresentation.ts +34 -3
  548. package/src/cli/cli-commands/agents-server/startAgentsServer/createLocalAgentRunOptions.ts +1 -1
  549. package/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.ts +51 -0
  550. package/src/cli/cli-commands/coder/GitChangesMode.ts +35 -0
  551. package/src/cli/cli-commands/coder/add.ts +3 -3
  552. package/src/cli/cli-commands/coder/boilerplateCount.ts +139 -0
  553. package/src/cli/cli-commands/coder/boilerplateTemplates.ts +3 -15
  554. package/src/cli/cli-commands/coder/ensureCoderGitignoreFile.ts +37 -3
  555. package/src/cli/cli-commands/coder/generate-boilerplates.ts +55 -47
  556. package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +7 -4
  557. package/src/cli/cli-commands/coder/init.ts +17 -7
  558. package/src/cli/cli-commands/coder/ping.ts +48 -10
  559. package/src/cli/cli-commands/coder/run.ts +26 -4
  560. package/src/cli/cli-commands/coder/server.ts +15 -3
  561. package/src/cli/cli-commands/coder/verify.ts +29 -5
  562. package/src/cli/cli-commands/coder/waitOptions.ts +33 -0
  563. package/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.ts → $askForConfirmation.ts} +6 -6
  564. package/src/cli/cli-commands/common/coderGitSyncCliOptions.ts +6 -2
  565. package/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.ts +66 -10
  566. package/src/cli/cli-commands/common/harness/$checkHarnessInstallation.ts +32 -9
  567. package/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.ts +6 -3
  568. package/src/cli/cli-commands/common/harness/$resolveHarnessCommandPath.ts +46 -0
  569. package/src/cli/cli-commands/common/harness/$resolveHarnessInstallationOrigin.ts +36 -0
  570. package/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.ts +2 -2
  571. package/src/cli/cli-commands/common/harness/$runHarnessInstallationCommand.ts +100 -0
  572. package/src/cli/cli-commands/common/harness/HarnessDefinition.ts +65 -0
  573. package/src/cli/cli-commands/common/harness/HarnessInstallationOrigin.ts +44 -0
  574. package/src/cli/cli-commands/common/harness/HarnessInstallationStatus.ts +9 -2
  575. package/src/cli/cli-commands/common/harness/HarnessUpdatePlan.ts +27 -0
  576. package/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.ts +6 -2
  577. package/src/cli/cli-commands/common/harness/formatHarnessInstallationWarning.ts +28 -6
  578. package/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.ts +41 -0
  579. package/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.ts +111 -0
  580. package/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.ts +47 -0
  581. package/src/cli/cli-commands/common/harnessUpdateCliOptions.ts +46 -0
  582. package/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.ts +15 -0
  583. package/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.ts +49 -0
  584. package/src/cli/cli-commands/common/npm/$resolveNpmGlobalPrefixPath.ts +51 -0
  585. package/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.ts +28 -0
  586. package/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.ts +25 -0
  587. package/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.ts +165 -0
  588. package/src/cli/cli-commands/common/projectInitialization.ts +35 -3
  589. package/src/cli/cli-commands/common/promptRunnerCliOptions.ts +38 -12
  590. package/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.ts +69 -0
  591. package/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.ts +117 -0
  592. package/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.ts +259 -0
  593. package/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.ts +55 -0
  594. package/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.ts +76 -0
  595. package/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.ts +32 -0
  596. package/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.ts +13 -0
  597. package/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.ts +45 -0
  598. package/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.ts +47 -3
  599. package/src/commands/FORMAT/formatCommandParser.ts +4 -2
  600. package/src/commitments/ACTION/ACTION.ts +3 -3
  601. package/src/commitments/FROM/FROM.ts +13 -0
  602. package/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.ts +1 -1
  603. package/src/commitments/META_FULLNAME/META_FULLNAME.ts +70 -0
  604. package/src/commitments/META_ID/META_ID.ts +78 -0
  605. package/src/commitments/WRITING_RULES/WRITING_RULES.ts +16 -8
  606. package/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.ts +1 -49
  607. package/src/commitments/index.ts +8 -25
  608. package/src/executables/platforms/locateAppOnWindows.ts +12 -9
  609. package/src/llm-providers/agent/Agent.ts +1 -1
  610. package/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.ts +2 -2
  611. package/src/llm-providers/openai/utils/buildToolInvocationScript.ts +21 -18
  612. package/src/other/templates/getTemplatesPipelineCollection.ts +971 -679
  613. package/src/{commitments/USE_BROWSER → scrapers/_common/utils}/fetchUrlContent.ts +8 -9
  614. package/src/utils/agent-message-runtime/AgentMessageProjectChange.ts +183 -0
  615. package/src/utils/agent-message-runtime/AgentMessageTouchedExternalSource.ts +80 -0
  616. package/src/utils/agent-message-runtime/parseAgentMessageRuntimeLogEvents.ts +108 -0
  617. package/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.ts +78 -75
  618. package/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.ts +341 -0
  619. package/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.ts +147 -0
  620. package/src/utils/agents/terminalAgentAvatarVisual.ts +31 -3
  621. package/src/utils/ascii-art/convertImageDataToAsciiArt.ts +9 -109
  622. package/src/utils/ascii-art/createAnsiColorCode.ts +132 -0
  623. package/src/utils/misc/debounce.ts +26 -5
  624. package/src/utils/misc/emojis.ts +3 -3
  625. package/src/utils/random/$generateBookBoilerplate.ts +1 -1
  626. package/src/version.ts +2 -2
  627. package/src/versions.txt +26 -0
  628. package/umd/apps/agents-server/src/constants/federatedAgentImport.d.ts +6 -0
  629. package/umd/index.umd.js +9600 -8290
  630. package/umd/index.umd.js.map +1 -1
  631. package/umd/scripts/run-agent-messages/git/commitAgentProjectChanges.d.ts +15 -0
  632. package/umd/scripts/run-agent-messages/git/commitAnsweredMessageProjectChanges.d.ts +24 -0
  633. package/umd/scripts/run-agent-messages/git/ensureAgentProjectGitRepository.d.ts +20 -0
  634. package/umd/scripts/run-agent-messages/git/readAgentProjectCommitChange.d.ts +11 -0
  635. package/umd/scripts/run-agent-messages/git/runAgentProjectGitCommand.d.ts +29 -0
  636. package/umd/scripts/run-agent-messages/messages/buildAgentGoalChatPromptSection.d.ts +26 -0
  637. package/umd/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +12 -1
  638. package/umd/scripts/run-agent-messages/messages/buildAgentProjectsPromptSection.d.ts +2 -14
  639. package/umd/scripts/run-agent-messages/messages/buildAgentTeamPromptSection.d.ts +12 -0
  640. package/umd/scripts/run-agent-messages/messages/finalizeAgentTeamConversationWorkspace.d.ts +16 -0
  641. package/umd/scripts/run-agent-messages/messages/listAgentProjectDirectoryNames.d.ts +7 -0
  642. package/umd/scripts/run-agent-messages/messages/loadAgentPlannedMessagesSidecar.d.ts +10 -0
  643. package/umd/scripts/run-agent-messages/messages/loadAgentTeamConversationWorkspace.d.ts +6 -0
  644. package/umd/scripts/run-agent-messages/messages/resolveAnsweredMessageTouches.d.ts +29 -0
  645. package/umd/scripts/run-codex-prompts/common/CoderRunControlFeedback.d.ts +54 -0
  646. package/umd/scripts/run-codex-prompts/common/applyCoderRunControlKey.d.ts +14 -0
  647. package/umd/scripts/run-codex-prompts/common/buildCoderRunControlKeyBadge.d.ts +7 -0
  648. package/umd/scripts/run-codex-prompts/common/createCoderRunStepTracker.d.ts +48 -0
  649. package/umd/scripts/run-codex-prompts/common/formatCoderRunControlFeedback.d.ts +13 -0
  650. package/umd/scripts/run-codex-prompts/common/listenForCoderRunControls.d.ts +17 -0
  651. package/umd/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
  652. package/umd/scripts/run-codex-prompts/common/runGoScript/$spawnLoggedBashScript.d.ts +25 -0
  653. package/umd/scripts/run-codex-prompts/common/runGoScript/$terminateLoggedBashProcessTree.d.ts +11 -0
  654. package/umd/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +4 -0
  655. package/umd/scripts/run-codex-prompts/common/waitForPause.d.ts +0 -8
  656. package/umd/scripts/run-codex-prompts/common/waitForSkippableWorldTimeDeadline.d.ts +15 -0
  657. package/umd/scripts/run-codex-prompts/git/coderCommitScope.d.ts +31 -0
  658. package/umd/scripts/run-codex-prompts/git/coderGitSync.d.ts +15 -2
  659. package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +9 -3
  660. package/umd/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +40 -0
  661. package/umd/scripts/run-codex-prompts/ping/pingCoderHarnessPeriodically.d.ts +22 -0
  662. package/umd/scripts/run-codex-prompts/prompts/buildPromptLabel.d.ts +6 -0
  663. package/umd/scripts/run-codex-prompts/prompts/buildPromptStatusDetails.d.ts +51 -0
  664. package/umd/scripts/run-codex-prompts/prompts/findFirstNonEmptyLineIndex.d.ts +6 -0
  665. package/umd/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +6 -3
  666. package/umd/scripts/run-codex-prompts/prompts/isPromptSectionUnfinished.d.ts +8 -0
  667. package/umd/scripts/run-codex-prompts/prompts/listPromptsByStatus.d.ts +7 -0
  668. package/umd/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +15 -4
  669. package/umd/scripts/run-codex-prompts/prompts/markPromptFailed.d.ts +35 -1
  670. package/umd/scripts/run-codex-prompts/prompts/markPromptInProgress.d.ts +27 -0
  671. package/umd/scripts/run-codex-prompts/prompts/promptRunnerAttribution.d.ts +30 -0
  672. package/umd/scripts/run-codex-prompts/prompts/resolveInterruptedPrompt.d.ts +9 -0
  673. package/umd/scripts/run-codex-prompts/prompts/resolvePromptStatusLine.d.ts +19 -0
  674. package/umd/scripts/run-codex-prompts/prompts/writePromptStatusLine.d.ts +10 -0
  675. package/umd/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +15 -0
  676. package/umd/scripts/run-codex-prompts/runners/claude-code/parseClaudeCodeOutputEvents.d.ts +3 -0
  677. package/umd/scripts/run-codex-prompts/runners/claude-code/parseClaudeCodeSubscriptionUsage.d.ts +11 -0
  678. package/umd/scripts/run-codex-prompts/runners/common/estimateUsageFromTextLength.d.ts +33 -0
  679. package/umd/scripts/run-codex-prompts/runners/common/modelPricing.d.ts +41 -0
  680. package/umd/scripts/run-codex-prompts/runners/gemini/gemini-pricing.d.ts +5 -18
  681. package/umd/scripts/run-codex-prompts/runners/openai-codex/OpenAiCodexRunner.d.ts +8 -0
  682. package/umd/scripts/run-codex-prompts/runners/openai-codex/buildCodexUsageFromOutput.d.ts +4 -1
  683. package/umd/scripts/run-codex-prompts/runners/openai-codex/getCodexSubscriptionUsage.d.ts +19 -0
  684. package/umd/scripts/run-codex-prompts/runners/qwen-code/QwenCodeRunner.d.ts +23 -0
  685. package/umd/scripts/run-codex-prompts/runners/qwen-code/buildQwenCodeScript.d.ts +8 -0
  686. package/umd/scripts/run-codex-prompts/runners/qwen-code/parseQwenCodeUsageFromOutput.d.ts +9 -0
  687. package/umd/scripts/run-codex-prompts/runners/qwen-code/qwen-code-pricing.d.ts +30 -0
  688. package/umd/scripts/run-codex-prompts/runners/types/HarnessSubscriptionUsage.d.ts +43 -0
  689. package/umd/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +1 -1
  690. package/umd/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
  691. package/umd/scripts/run-codex-prompts/server/updatePromptSection.d.ts +1 -1
  692. package/umd/scripts/run-codex-prompts/testing/runPromptWithTestFeedback.d.ts +6 -0
  693. package/umd/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +21 -1
  694. package/umd/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
  695. package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +8 -1
  696. package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
  697. package/umd/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +11 -0
  698. package/umd/scripts/run-codex-prompts/ui/buildSubscriptionUsageSessionRows.d.ts +11 -0
  699. package/umd/scripts/run-codex-prompts/ui/refreshCoderRunUiSubscriptionUsage.d.ts +14 -0
  700. package/umd/scripts/utils/emojiTags/validSinglePictogramEmojis.d.ts +17 -0
  701. package/umd/scripts/verify-prompts/$orderPromptFiles.d.ts +9 -0
  702. package/umd/scripts/verify-prompts/VerifyPromptsOrder.d.ts +26 -0
  703. package/umd/scripts/verify-prompts/verify-prompts.d.ts +3 -2
  704. package/umd/src/_packages/components.index.d.ts +4 -0
  705. package/umd/src/_packages/types.index.d.ts +4 -0
  706. package/umd/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
  707. package/umd/src/avatars/renderAvatarVisualTerminalText.test.d.ts +1 -0
  708. package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
  709. package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -3
  710. package/umd/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +5 -0
  711. package/umd/src/book-2.0/agent-source/ParsedUnknownCommitment.d.ts +26 -0
  712. package/umd/src/book-2.0/agent-source/createAgentModelRequirements.commitmentAggregation.test.d.ts +1 -0
  713. package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.unknown.test.d.ts +1 -0
  714. package/umd/src/book-2.0/agent-source/getBookCommitmentLineType.d.ts +19 -0
  715. package/umd/src/book-2.0/agent-source/parseAgentSourceWithCommitments.unknown.test.d.ts +1 -0
  716. package/umd/src/book-3.0/AgentMessageRunReport.d.ts +46 -0
  717. package/umd/src/book-3.0/AgentPlannedMessagesSidecar.d.ts +127 -0
  718. package/umd/src/book-3.0/AgentPlannedMessagesSidecar.test.d.ts +1 -0
  719. package/umd/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
  720. package/umd/src/book-3.0/cliAgentEnv.d.ts +3 -3
  721. package/umd/src/book-3.0/createAgentMessageSidecarBaseName.d.ts +13 -0
  722. package/umd/src/book-3.0/describeAgentPlannedMessageSchedule.d.ts +31 -0
  723. package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +1 -9
  724. package/umd/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.d.ts +28 -0
  725. package/umd/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.test.d.ts +1 -0
  726. package/umd/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.d.ts +28 -0
  727. package/umd/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.test.d.ts +1 -0
  728. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
  729. package/umd/src/book-components/Chat/Chat/renderAgentProjectDiff.d.ts +13 -0
  730. package/umd/src/book-components/Chat/Chat/renderAgentProjectToolCallDetails.d.ts +16 -0
  731. package/umd/src/book-components/Chat/utils/agentProjectToolCall.d.ts +85 -0
  732. package/umd/src/book-components/Chat/utils/agentProjectToolCall.test.d.ts +1 -0
  733. package/umd/src/book-components/Chat/utils/externalSourceToolCall.d.ts +38 -0
  734. package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +68 -3
  735. package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +30 -0
  736. package/umd/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.d.ts +9 -0
  737. package/umd/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.test.d.ts +1 -0
  738. package/umd/src/cli/cli-commands/coder/GitChangesMode.d.ts +28 -0
  739. package/umd/src/cli/cli-commands/coder/boilerplateCount.d.ts +52 -0
  740. package/umd/src/cli/cli-commands/coder/boilerplateCount.test.d.ts +1 -0
  741. package/umd/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +14 -1
  742. package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +4 -3
  743. package/umd/src/cli/cli-commands/coder/generate-boilerplates.test.d.ts +1 -0
  744. package/umd/src/cli/cli-commands/coder/server.test.d.ts +1 -0
  745. package/umd/src/cli/cli-commands/coder/verify.d.ts +1 -1
  746. package/umd/src/cli/cli-commands/coder/waitOptions.d.ts +12 -0
  747. package/umd/src/cli/cli-commands/common/$askForConfirmation.d.ts +9 -0
  748. package/umd/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +1 -1
  749. package/umd/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +3 -3
  750. package/umd/src/cli/cli-commands/common/harness/$checkHarnessInstallation.test.d.ts +1 -0
  751. package/umd/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +3 -3
  752. package/umd/src/cli/cli-commands/common/harness/$resolveHarnessCommandPath.d.ts +14 -0
  753. package/umd/src/cli/cli-commands/common/harness/$resolveHarnessInstallationOrigin.d.ts +10 -0
  754. package/umd/src/cli/cli-commands/common/harness/$runHarnessInstallationCommand.d.ts +43 -0
  755. package/umd/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +36 -0
  756. package/umd/src/cli/cli-commands/common/harness/HarnessInstallationOrigin.d.ts +36 -0
  757. package/umd/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +8 -2
  758. package/umd/src/cli/cli-commands/common/harness/HarnessUpdatePlan.d.ts +23 -0
  759. package/umd/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.d.ts +4 -1
  760. package/umd/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.d.ts +8 -0
  761. package/umd/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.test.d.ts +1 -0
  762. package/umd/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.d.ts +31 -0
  763. package/umd/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.test.d.ts +1 -0
  764. package/umd/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.d.ts +12 -0
  765. package/umd/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.test.d.ts +1 -0
  766. package/umd/src/cli/cli-commands/common/harnessUpdateCliOptions.d.ts +29 -0
  767. package/umd/src/cli/cli-commands/common/harnessUpdateCliOptions.test.d.ts +1 -0
  768. package/umd/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.d.ts → npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
  769. package/umd/src/cli/cli-commands/common/{harness/$resolveLatestHarnessVersion.d.ts → npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
  770. package/umd/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.test.d.ts +1 -0
  771. package/umd/src/cli/cli-commands/common/npm/$resolveNpmGlobalPrefixPath.d.ts +9 -0
  772. package/umd/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.d.ts +12 -0
  773. package/umd/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.test.d.ts +1 -0
  774. package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
  775. package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts +1 -0
  776. package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +12 -0
  777. package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts +1 -0
  778. package/umd/src/cli/cli-commands/common/projectInitialization.d.ts +6 -0
  779. package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +17 -4
  780. package/umd/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
  781. package/umd/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.test.d.ts +1 -0
  782. package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
  783. package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts +1 -0
  784. package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
  785. package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts +1 -0
  786. package/umd/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
  787. package/umd/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.test.d.ts +1 -0
  788. package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +66 -0
  789. package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.d.ts +26 -0
  790. package/umd/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.d.ts +7 -0
  791. package/umd/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts +7 -0
  792. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +15 -0
  793. package/umd/src/commitments/{COMPONENT/COMPONENT.d.ts → META_FULLNAME/META_FULLNAME.d.ts} +8 -5
  794. package/umd/src/commitments/META_ID/META_ID.d.ts +32 -0
  795. package/umd/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +14 -7
  796. package/umd/src/commitments/index.d.ts +4 -12
  797. package/umd/src/executables/platforms/locateAppOnWindows.d.ts +1 -1
  798. package/umd/src/executables/platforms/locateAppOnWindows.test.d.ts +1 -0
  799. package/umd/src/llm-providers/agent/Agent.d.ts +1 -1
  800. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +1 -1
  801. package/umd/src/{commitments/USE_BROWSER → scrapers/_common/utils}/fetchUrlContent.d.ts +2 -3
  802. package/umd/src/utils/agent-message-runtime/AgentMessageProjectChange.d.ts +76 -0
  803. package/umd/src/utils/agent-message-runtime/AgentMessageTouchedExternalSource.d.ts +45 -0
  804. package/umd/src/utils/agent-message-runtime/parseAgentMessageRuntimeLogEvents.d.ts +62 -0
  805. package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
  806. package/umd/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.d.ts +18 -0
  807. package/umd/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.test.d.ts +1 -0
  808. package/umd/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.d.ts +19 -0
  809. package/umd/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.test.d.ts +1 -0
  810. package/umd/src/utils/agents/terminalAgentAvatarVisual.d.ts +5 -2
  811. package/umd/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +6 -0
  812. package/umd/src/utils/ascii-art/createAnsiColorCode.d.ts +46 -0
  813. package/umd/src/utils/misc/debounce.d.ts +4 -2
  814. package/umd/src/utils/misc/debounce.test.d.ts +1 -0
  815. package/umd/src/utils/misc/emojis.d.ts +3 -2
  816. package/umd/src/utils/random/$generateBookBoilerplate.test.d.ts +1 -0
  817. package/umd/src/version.d.ts +1 -1
  818. package/apps/agents-server/scripts/ignore-kill-eperm.js +0 -31
  819. package/apps/agents-server/src/app/admin/task-manager/TaskManagerScopeTabs.tsx +0 -74
  820. package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/actions/route.ts +0 -103
  821. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsClient.tsx +0 -43
  822. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsEditDialog.tsx +0 -98
  823. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsFiltersCard.tsx +0 -75
  824. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsHeader.tsx +0 -53
  825. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsSummaryMetrics.tsx +0 -70
  826. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableCard.tsx +0 -58
  827. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableRow.tsx +0 -242
  828. package/apps/agents-server/src/app/agents/[agentName]/timeouts/loading.tsx +0 -15
  829. package/apps/agents-server/src/app/agents/[agentName]/timeouts/page.tsx +0 -28
  830. package/apps/agents-server/src/app/agents/[agentName]/timeouts/useAgentTimeoutsClientState.ts +0 -769
  831. package/apps/agents-server/src/components/AgentProjectDnsInstructions/AgentProjectDnsInstructions.tsx +0 -182
  832. package/apps/agents-server/src/tools/configureTimeoutToolRuntimeAdapterForServer.ts +0 -381
  833. package/apps/agents-server/src/utils/emails/extractUseEmailConfigurationFromAgentSource.ts +0 -42
  834. package/apps/agents-server/src/utils/userChatClient/runAgentUserTimeoutBulkAction.ts +0 -24
  835. package/apps/agents-server/src/utils/userChatClient/updateAgentUserTimeout.ts +0 -25
  836. package/esm/apps/agents-server/src/database/sqlite/$provideAgentsServerSqliteDatabase.d.ts +0 -69
  837. package/esm/apps/agents-server/src/database/sqlite/localSqliteSupabase/ensureTable.d.ts +0 -7
  838. package/esm/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteSql.d.ts +0 -30
  839. package/esm/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteTableSchema.d.ts +0 -76
  840. package/esm/apps/agents-server/src/database/sqlite/resolveAgentsServerSqliteDatabasePath.d.ts +0 -4
  841. package/esm/apps/agents-server/src/database/sqlite/resolveServerSqliteDatabasePath.d.ts +0 -28
  842. package/esm/apps/agents-server/src/database/sqlite/standaloneServerRegistryStore.d.ts +0 -110
  843. package/esm/scripts/find-fresh-emoji-tags/utils/emojis.d.ts +0 -16
  844. package/esm/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +0 -7
  845. package/esm/scripts/run-codex-prompts/ui/buildCoderRunOctopusVisual.d.ts +0 -13
  846. package/esm/src/cli/cli-commands/common/harness/$installHarness.d.ts +0 -13
  847. package/esm/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +0 -11
  848. package/esm/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +0 -9
  849. package/esm/src/commitments/MEMORY/MEMORY.d.ts +0 -48
  850. package/esm/src/commitments/MEMORY/MemoryToolNames.d.ts +0 -11
  851. package/esm/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +0 -149
  852. package/esm/src/commitments/MEMORY/createMemorySystemMessage.d.ts +0 -6
  853. package/esm/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +0 -8
  854. package/esm/src/commitments/MEMORY/createMemoryTools.d.ts +0 -14
  855. package/esm/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +0 -6
  856. package/esm/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
  857. package/esm/src/commitments/MEMORY/getMemoryToolTitles.d.ts +0 -7
  858. package/esm/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +0 -61
  859. package/esm/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +0 -8
  860. package/esm/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +0 -13
  861. package/esm/src/commitments/META/META.d.ts +0 -65
  862. package/esm/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +0 -32
  863. package/esm/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -58
  864. package/esm/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.d.ts +0 -13
  865. package/esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +0 -10
  866. package/esm/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.d.ts +0 -47
  867. package/esm/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -38
  868. package/esm/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +0 -21
  869. package/esm/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +0 -11
  870. package/esm/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +0 -13
  871. package/esm/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -46
  872. package/esm/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -38
  873. package/esm/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +0 -9
  874. package/esm/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +0 -12
  875. package/esm/src/commitments/USE_TIME/USE_TIME.d.ts +0 -43
  876. package/esm/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +0 -11
  877. package/esm/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +0 -212
  878. package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -38
  879. package/esm/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +0 -6
  880. package/esm/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +0 -8
  881. package/esm/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +0 -7
  882. package/esm/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
  883. package/esm/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +0 -78
  884. package/esm/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +0 -8
  885. package/esm/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +0 -13
  886. package/esm/src/commitments/WALLET/WALLET.d.ts +0 -21
  887. package/esm/src/commitments/WALLET/WalletToolNames.d.ts +0 -12
  888. package/esm/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +0 -163
  889. package/esm/src/commitments/WALLET/createWalletSystemMessage.d.ts +0 -6
  890. package/esm/src/commitments/WALLET/createWalletToolFunctions.d.ts +0 -8
  891. package/esm/src/commitments/WALLET/createWalletTools.d.ts +0 -7
  892. package/esm/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +0 -6
  893. package/esm/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +0 -16
  894. package/esm/src/commitments/WALLET/getWalletToolTitles.d.ts +0 -7
  895. package/esm/src/commitments/WALLET/parseWalletToolArgs.d.ts +0 -51
  896. package/esm/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +0 -8
  897. package/esm/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +0 -13
  898. package/esm/src/commitments/_common/createSerpSearchToolFunction.d.ts +0 -12
  899. package/src/cli/cli-commands/common/harness/$installHarness.ts +0 -56
  900. package/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.ts +0 -34
  901. package/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.ts +0 -28
  902. package/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.ts +0 -39
  903. package/src/commitments/COMPONENT/COMPONENT.ts +0 -70
  904. package/src/commitments/MEMORY/MEMORY.ts +0 -94
  905. package/src/commitments/MEMORY/MemoryToolNames.ts +0 -13
  906. package/src/commitments/MEMORY/MemoryToolRuntimeAdapter.ts +0 -180
  907. package/src/commitments/MEMORY/createMemorySystemMessage.ts +0 -27
  908. package/src/commitments/MEMORY/createMemoryToolFunctions.ts +0 -134
  909. package/src/commitments/MEMORY/createMemoryTools.ts +0 -115
  910. package/src/commitments/MEMORY/getMemoryCommitmentDocumentation.ts +0 -47
  911. package/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.ts +0 -104
  912. package/src/commitments/MEMORY/getMemoryToolTitles.ts +0 -16
  913. package/src/commitments/MEMORY/parseMemoryToolArgs.ts +0 -126
  914. package/src/commitments/MEMORY/resolveMemoryRuntimeContext.ts +0 -23
  915. package/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.ts +0 -26
  916. package/src/commitments/META/META.ts +0 -168
  917. package/src/commitments/USE/TODO.txt +0 -1
  918. package/src/commitments/USE/aggregateUseCommitmentSystemMessages.ts +0 -219
  919. package/src/commitments/USE_BROWSER/TODO.txt +0 -1
  920. package/src/commitments/USE_BROWSER/USE_BROWSER.ts +0 -257
  921. package/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.ts +0 -45
  922. package/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.ts +0 -83
  923. package/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.ts +0 -146
  924. package/src/commitments/USE_EMAIL/USE_EMAIL.ts +0 -201
  925. package/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.ts +0 -75
  926. package/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.ts +0 -44
  927. package/src/commitments/USE_EMAIL/sendEmailViaBrowser.ts +0 -47
  928. package/src/commitments/USE_SEARCH_ENGINE/TODO.txt +0 -1
  929. package/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.ts +0 -171
  930. package/src/commitments/USE_SPAWN/USE_SPAWN.ts +0 -150
  931. package/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.ts +0 -42
  932. package/src/commitments/USE_SPAWN/spawnAgentViaBrowser.ts +0 -50
  933. package/src/commitments/USE_TIME/USE_TIME.ts +0 -177
  934. package/src/commitments/USE_TIMEOUT/TimeoutToolNames.ts +0 -13
  935. package/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.ts +0 -255
  936. package/src/commitments/USE_TIMEOUT/USE_TIMEOUT.ts +0 -117
  937. package/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.ts +0 -22
  938. package/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.ts +0 -361
  939. package/src/commitments/USE_TIMEOUT/createTimeoutTools.ts +0 -127
  940. package/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.ts +0 -67
  941. package/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.ts +0 -460
  942. package/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.ts +0 -36
  943. package/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.ts +0 -26
  944. package/src/commitments/WALLET/WALLET.ts +0 -71
  945. package/src/commitments/WALLET/WalletToolNames.ts +0 -14
  946. package/src/commitments/WALLET/WalletToolRuntimeAdapter.ts +0 -180
  947. package/src/commitments/WALLET/createWalletSystemMessage.ts +0 -22
  948. package/src/commitments/WALLET/createWalletToolFunctions.ts +0 -145
  949. package/src/commitments/WALLET/createWalletTools.ts +0 -129
  950. package/src/commitments/WALLET/getWalletCommitmentDocumentation.ts +0 -14
  951. package/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.ts +0 -64
  952. package/src/commitments/WALLET/getWalletToolTitles.ts +0 -17
  953. package/src/commitments/WALLET/parseWalletToolArgs.ts +0 -231
  954. package/src/commitments/WALLET/resolveWalletRuntimeContext.ts +0 -23
  955. package/src/commitments/WALLET/setWalletToolRuntimeAdapter.ts +0 -26
  956. package/src/commitments/_common/createSerpSearchToolFunction.ts +0 -46
  957. package/umd/apps/agents-server/src/database/sqlite/$provideAgentsServerSqliteDatabase.d.ts +0 -69
  958. package/umd/apps/agents-server/src/database/sqlite/localSqliteSupabase/ensureTable.d.ts +0 -7
  959. package/umd/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteSql.d.ts +0 -30
  960. package/umd/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteTableSchema.d.ts +0 -76
  961. package/umd/apps/agents-server/src/database/sqlite/resolveAgentsServerSqliteDatabasePath.d.ts +0 -4
  962. package/umd/apps/agents-server/src/database/sqlite/resolveServerSqliteDatabasePath.d.ts +0 -28
  963. package/umd/apps/agents-server/src/database/sqlite/standaloneServerRegistryStore.d.ts +0 -110
  964. package/umd/scripts/find-fresh-emoji-tags/utils/emojis.d.ts +0 -16
  965. package/umd/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +0 -7
  966. package/umd/scripts/run-codex-prompts/ui/buildCoderRunOctopusVisual.d.ts +0 -13
  967. package/umd/src/cli/cli-commands/common/harness/$installHarness.d.ts +0 -13
  968. package/umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +0 -11
  969. package/umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +0 -9
  970. package/umd/src/commitments/MEMORY/MEMORY.d.ts +0 -48
  971. package/umd/src/commitments/MEMORY/MemoryToolNames.d.ts +0 -11
  972. package/umd/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +0 -149
  973. package/umd/src/commitments/MEMORY/createMemorySystemMessage.d.ts +0 -6
  974. package/umd/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +0 -8
  975. package/umd/src/commitments/MEMORY/createMemoryTools.d.ts +0 -14
  976. package/umd/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +0 -6
  977. package/umd/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
  978. package/umd/src/commitments/MEMORY/getMemoryToolTitles.d.ts +0 -7
  979. package/umd/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +0 -61
  980. package/umd/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +0 -8
  981. package/umd/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +0 -13
  982. package/umd/src/commitments/META/META.d.ts +0 -65
  983. package/umd/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +0 -32
  984. package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -58
  985. package/umd/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.d.ts +0 -13
  986. package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +0 -10
  987. package/umd/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.d.ts +0 -47
  988. package/umd/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -38
  989. package/umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +0 -21
  990. package/umd/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +0 -11
  991. package/umd/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +0 -13
  992. package/umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -46
  993. package/umd/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -38
  994. package/umd/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +0 -9
  995. package/umd/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +0 -12
  996. package/umd/src/commitments/USE_TIME/USE_TIME.d.ts +0 -43
  997. package/umd/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +0 -11
  998. package/umd/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +0 -212
  999. package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -38
  1000. package/umd/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +0 -6
  1001. package/umd/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +0 -8
  1002. package/umd/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +0 -7
  1003. package/umd/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
  1004. package/umd/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +0 -78
  1005. package/umd/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +0 -8
  1006. package/umd/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +0 -13
  1007. package/umd/src/commitments/WALLET/WALLET.d.ts +0 -21
  1008. package/umd/src/commitments/WALLET/WalletToolNames.d.ts +0 -12
  1009. package/umd/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +0 -163
  1010. package/umd/src/commitments/WALLET/createWalletSystemMessage.d.ts +0 -6
  1011. package/umd/src/commitments/WALLET/createWalletToolFunctions.d.ts +0 -8
  1012. package/umd/src/commitments/WALLET/createWalletTools.d.ts +0 -7
  1013. package/umd/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +0 -6
  1014. package/umd/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +0 -16
  1015. package/umd/src/commitments/WALLET/getWalletToolTitles.d.ts +0 -7
  1016. package/umd/src/commitments/WALLET/parseWalletToolArgs.d.ts +0 -51
  1017. package/umd/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +0 -8
  1018. package/umd/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +0 -13
  1019. package/umd/src/commitments/_common/createSerpSearchToolFunction.d.ts +0 -12
  1020. /package/esm/src/{book-2.0/agent-source/createAgentModelRequirements.useCommitmentAggregation.test.d.ts → avatars/renderAvatarVisualTerminalText.test.d.ts} +0 -0
  1021. /package/esm/src/{cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → book-2.0/agent-source/createAgentModelRequirements.commitmentAggregation.test.d.ts} +0 -0
  1022. /package/esm/src/{cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts → book-2.0/agent-source/createAgentModelRequirementsWithCommitments.unknown.test.d.ts} +0 -0
  1023. /package/esm/src/{commitments/MEMORY/MEMORY.test.d.ts → book-2.0/agent-source/parseAgentSourceWithCommitments.unknown.test.d.ts} +0 -0
  1024. /package/esm/src/{commitments/USE_BROWSER/USE_BROWSER.test.d.ts → book-3.0/AgentPlannedMessagesSidecar.test.d.ts} +0 -0
  1025. /package/esm/src/{commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts → book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.test.d.ts} +0 -0
  1026. /package/esm/src/{commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.test.d.ts → book-components/BookEditor/createUnknownCommitmentDiagnostics.test.d.ts} +0 -0
  1027. /package/esm/src/{commitments/USE_EMAIL/USE_EMAIL.test.d.ts → book-components/Chat/utils/agentProjectToolCall.test.d.ts} +0 -0
  1028. /package/esm/src/{commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts → cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.test.d.ts} +0 -0
  1029. /package/esm/src/{commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts → cli/cli-commands/coder/boilerplateCount.test.d.ts} +0 -0
  1030. /package/esm/src/{commitments/USE_SPAWN/USE_SPAWN.test.d.ts → cli/cli-commands/coder/generate-boilerplates.test.d.ts} +0 -0
  1031. /package/esm/src/{commitments/USE_TIME/USE_TIME.test.d.ts → cli/cli-commands/coder/server.test.d.ts} +0 -0
  1032. /package/esm/src/{commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts → cli/cli-commands/common/harness/$checkHarnessInstallation.test.d.ts} +0 -0
  1033. /package/esm/src/{commitments/WALLET/WALLET.test.d.ts → cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.test.d.ts} +0 -0
  1034. /package/{umd/src/book-2.0/agent-source/createAgentModelRequirements.useCommitmentAggregation.test.d.ts → esm/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.test.d.ts} +0 -0
  1035. /package/{umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → esm/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.test.d.ts} +0 -0
  1036. /package/{umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts → esm/src/cli/cli-commands/common/harnessUpdateCliOptions.test.d.ts} +0 -0
  1037. /package/{umd/src/commitments/MEMORY/MEMORY.test.d.ts → esm/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.test.d.ts} +0 -0
  1038. /package/{umd/src/commitments/USE_BROWSER/USE_BROWSER.test.d.ts → esm/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.test.d.ts} +0 -0
  1039. /package/{umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts → esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts} +0 -0
  1040. /package/{umd/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.test.d.ts → esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts} +0 -0
  1041. /package/{umd/src/commitments/USE_EMAIL/USE_EMAIL.test.d.ts → esm/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.test.d.ts} +0 -0
  1042. /package/{umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts → esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts} +0 -0
  1043. /package/{umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts → esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts} +0 -0
  1044. /package/{umd/src/commitments/USE_SPAWN/USE_SPAWN.test.d.ts → esm/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.test.d.ts} +0 -0
  1045. /package/esm/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.d.ts +0 -0
  1046. /package/{umd/src/commitments/USE_TIME/USE_TIME.test.d.ts → esm/src/executables/platforms/locateAppOnWindows.test.d.ts} +0 -0
  1047. /package/{umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts → esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.test.d.ts} +0 -0
  1048. /package/{umd/src/commitments/WALLET/WALLET.test.d.ts → esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.test.d.ts} +0 -0
  1049. /package/umd/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.d.ts +0 -0
@@ -43,6 +43,7 @@ const MARKDOWN_SANITIZER_ALLOWED_TAGS = [
43
43
  'b',
44
44
  'blockquote',
45
45
  'br',
46
+ 'button',
46
47
  'code',
47
48
  'del',
48
49
  'details',
@@ -156,6 +157,28 @@ const MARKDOWN_SANITIZER_ALLOWED_PROTOCOLS = new Set(['http', 'https', 'mailto',
156
157
  */
157
158
  const INLINE_REFERENCE_MENU_OPTION_MARKER_ATTRIBUTE = 'data-promptbook-inline-reference-menu-option';
158
159
 
160
+ /**
161
+ * Attribute marking a client action generated for an inline-reference menu.
162
+ *
163
+ * @private utility shared with `MarkdownContent`
164
+ */
165
+ export const MARKDOWN_INLINE_REFERENCE_MENU_ACTION_ATTRIBUTE = 'data-promptbook-inline-reference-menu-action';
166
+
167
+ /**
168
+ * Attribute identifying the inline reference which owns a client menu action.
169
+ *
170
+ * @private utility shared with `MarkdownContent`
171
+ */
172
+ export const MARKDOWN_INLINE_REFERENCE_MENU_ACTION_REFERENCE_ATTRIBUTE =
173
+ 'data-promptbook-inline-reference-menu-action-reference';
174
+
175
+ /**
176
+ * Attribute marking a favicon rendered inside an inline-reference chip.
177
+ *
178
+ * @private utility shared with `MarkdownContent`
179
+ */
180
+ export const MARKDOWN_INLINE_REFERENCE_ICON_ATTRIBUTE = 'data-promptbook-inline-reference-icon';
181
+
159
182
  /**
160
183
  * Internal `data-*` attributes that Promptbook injects into rendered markdown and must survive sanitization.
161
184
  *
@@ -165,6 +188,9 @@ const MARKDOWN_SANITIZER_ALLOWED_DATA_ATTRIBUTES = new Set([
165
188
  'data-citation-footnote',
166
189
  'data-chat-progress-marker',
167
190
  INLINE_REFERENCE_MENU_OPTION_MARKER_ATTRIBUTE,
191
+ MARKDOWN_INLINE_REFERENCE_MENU_ACTION_ATTRIBUTE,
192
+ MARKDOWN_INLINE_REFERENCE_MENU_ACTION_REFERENCE_ATTRIBUTE,
193
+ MARKDOWN_INLINE_REFERENCE_ICON_ATTRIBUTE,
168
194
  ]);
169
195
 
170
196
  /**
@@ -267,14 +293,63 @@ const DETAILS_PLACEHOLDER_WRAPPED_REGEX = new RegExp(`<p>\\s*(${DETAILS_PLACEHOL
267
293
  const INLINE_REFERENCE_REGEX = /\[\[([^\]\r\n]+?)\]\]/g;
268
294
 
269
295
  /**
270
- * Pattern matching ordinary markdown links that can be promoted to inline reference chips.
296
+ * Prefix for INLINE REFERENCE PLACEHOLDER.
297
+ *
298
+ * @private utility of `renderMarkdown`
299
+ */
300
+ const INLINE_REFERENCE_PLACEHOLDER_PREFIX = '@@PROMPTBOOK_INLINE_REFERENCE_PLACEHOLDER__';
301
+
302
+ /**
303
+ * Pattern matching INLINE REFERENCE PLACEHOLDER.
304
+ *
305
+ * @private utility of `renderMarkdown`
306
+ */
307
+ const INLINE_REFERENCE_PLACEHOLDER_REGEX = new RegExp(`${INLINE_REFERENCE_PLACEHOLDER_PREFIX}(\\d+)__`, 'g');
308
+
309
+ /**
310
+ * Prefix for markdown text-segment placeholders used while resolving plain-text inline-reference aliases.
311
+ *
312
+ * @private utility of `renderMarkdown`
313
+ */
314
+ const MARKDOWN_REFERENCE_TEXT_MASK_PLACEHOLDER_PREFIX = '@@PROMPTBOOK_MARKDOWN_REFERENCE_TEXT_MASK_PLACEHOLDER__';
315
+
316
+ /**
317
+ * Pattern matching markdown text-segment placeholders.
318
+ *
319
+ * @private utility of `renderMarkdown`
320
+ */
321
+ const MARKDOWN_REFERENCE_TEXT_MASK_PLACEHOLDER_REGEX = new RegExp(
322
+ `${MARKDOWN_REFERENCE_TEXT_MASK_PLACEHOLDER_PREFIX}(\\d+)__`,
323
+ 'g',
324
+ );
325
+
326
+ /**
327
+ * Pattern matching markdown links and images together with their raw target.
328
+ *
329
+ * @private utility of `renderMarkdown`
330
+ */
331
+ const MARKDOWN_LINK_REGEX = /(!?)\[([^\]\r\n]*)\]\(\s*(<[^>\r\n]*>|[^()\s]+)(?:\s+(?:"[^"]*"|'[^']*'))?\s*\)/g;
332
+
333
+ /**
334
+ * Pattern matching bare `http(s)` URLs written directly into markdown text.
335
+ *
336
+ * @private utility of `renderMarkdown`
337
+ */
338
+ const BARE_URL_REGEX = /(^|\s)(https?:\/\/[^\s<>()[\]"']+)/g;
339
+
340
+ /**
341
+ * Sentence punctuation which trails a bare URL instead of belonging to it.
271
342
  *
272
- * Images are intentionally captured separately and left unchanged by the replacement helper.
343
+ * @private utility of `renderMarkdown`
344
+ */
345
+ const BARE_URL_TRAILING_PUNCTUATION_REGEX = /[.,;:!?]+$/;
346
+
347
+ /**
348
+ * Pattern splitting one URL into its scheme, host and remaining part.
273
349
  *
274
350
  * @private utility of `renderMarkdown`
275
351
  */
276
- const MARKDOWN_INLINE_REFERENCE_LINK_REGEX =
277
- /(!?)\[([^\]\r\n]*)\]\(\s*(<[^>\r\n]+>|[^)\s]+)(?:\s+(?:"[^"\r\n]*"|'[^'\r\n]*'|\([^)]*\)))?\s*\)/g;
352
+ const ABSOLUTE_URL_REGEX = /^[a-z][a-z0-9+.-]*:\/\/([^/?#]*)(.*)$/i;
278
353
 
279
354
  /**
280
355
  * Markdown patterns that are strong enough to identify content as markdown.
@@ -333,6 +408,14 @@ export type MarkdownInlineReference = {
333
408
  */
334
409
  readonly reference: string;
335
410
 
411
+ /**
412
+ * Optional text aliases which should render as this reference when an agent mentions them in markdown.
413
+ *
414
+ * They are also accepted inside a `[[reference]]` token. This lets application code use a stable
415
+ * technical reference while recognizing a human-facing name in older messages.
416
+ */
417
+ readonly sourceTextAliases?: ReadonlyArray<string>;
418
+
336
419
  /**
337
420
  * Human-readable label rendered inside the link chip.
338
421
  */
@@ -344,10 +427,12 @@ export type MarkdownInlineReference = {
344
427
  readonly href: string;
345
428
 
346
429
  /**
347
- * Markdown link destination prefixes that should render as this reference as well.
430
+ * Optional URL prefixes which also identify this reference in the authored markdown.
348
431
  *
349
- * This supports legacy links such as an Agents Server project file URL while keeping
350
- * `reference` as the canonical `[[project]]` token.
432
+ * A markdown link or a bare URL pointing to one of these prefixes is rendered as the same chip
433
+ * as the `[[reference]]` token. Both absolute URLs (for example `https://project.example.com`)
434
+ * and application paths (for example `/agents/agent/projects/website`) are supported; a path
435
+ * prefix matches on any host so that both relative and absolute links are recognized.
351
436
  */
352
437
  readonly sourceHrefPrefixes?: ReadonlyArray<string>;
353
438
 
@@ -356,12 +441,34 @@ export type MarkdownInlineReference = {
356
441
  */
357
442
  readonly title?: string;
358
443
 
444
+ /**
445
+ * Optional favicon and text fallback rendered before the reference label.
446
+ */
447
+ readonly icon?: MarkdownInlineReferenceIcon;
448
+
359
449
  /**
360
450
  * Optional expandable menu shown when the reference chip is clicked.
361
451
  */
362
452
  readonly menu?: MarkdownInlineReferenceMenu;
363
453
  };
364
454
 
455
+ /**
456
+ * Visual identity rendered inside one markdown inline-reference chip.
457
+ *
458
+ * @public exported from `@promptbook/components`
459
+ */
460
+ export type MarkdownInlineReferenceIcon = {
461
+ /**
462
+ * Optional image URL. The fallback remains visible when the image is unavailable.
463
+ */
464
+ readonly src?: string | null;
465
+
466
+ /**
467
+ * Short text rendered when the image is missing or broken.
468
+ */
469
+ readonly fallbackText: string;
470
+ };
471
+
365
472
  /**
366
473
  * Status displayed alongside an expandable markdown inline reference.
367
474
  *
@@ -399,6 +506,28 @@ export type MarkdownInlineReferenceMenuOption = {
399
506
  * Optional hover text for the option.
400
507
  */
401
508
  readonly title?: string;
509
+
510
+ /**
511
+ * Optional client action rendered as a button instead of a link.
512
+ */
513
+ readonly action?: MarkdownInlineReferenceMenuAction;
514
+ };
515
+
516
+ /**
517
+ * Client-side action exposed by an expandable markdown inline-reference menu.
518
+ *
519
+ * @public exported from `@promptbook/components`
520
+ */
521
+ export type MarkdownInlineReferenceMenuAction = {
522
+ /**
523
+ * Stable identifier unique within the owning reference menu.
524
+ */
525
+ readonly id: string;
526
+
527
+ /**
528
+ * Callback invoked when the menu button is selected.
529
+ */
530
+ readonly onSelect: () => void | Promise<void>;
402
531
  };
403
532
 
404
533
  /**
@@ -426,6 +555,14 @@ type MaskedCodeSegmentsResult = {
426
555
  restore: (value: string_markdown) => string_markdown;
427
556
  };
428
557
 
558
+ /**
559
+ * Result of temporarily masked markdown links, images and bare URLs.
560
+ */
561
+ type MaskedMarkdownLinkAndUrlSegmentsResult = {
562
+ masked: string_markdown;
563
+ restore: (value: string_markdown) => string_markdown;
564
+ };
565
+
429
566
  /**
430
567
  * Result of masked details blocks.
431
568
  */
@@ -696,12 +833,11 @@ const CHAT_MARKDOWN_CONVERTER = createChatMarkdownConverter();
696
833
  * outer `<details>` and optional `<summary>` markup untouched.
697
834
  *
698
835
  * @param detailsBlock - Raw `<details>...</details>` HTML captured from markdown.
699
- * @param options - Markdown rendering options to reuse for the details body.
700
836
  * @returns `<details>` HTML whose body has been converted from markdown to HTML.
701
837
  *
702
838
  * @private utility of `renderMarkdown`
703
839
  */
704
- function renderDetailsBlock(detailsBlock: string, options?: RenderMarkdownOptions): string_html {
840
+ function renderDetailsBlock(detailsBlock: string): string_html {
705
841
  const openTagMatch = detailsBlock.match(/^<details\b[^>]*>/i);
706
842
  const closeTagMatch = detailsBlock.match(/<\/details\s*>$/i);
707
843
 
@@ -715,7 +851,7 @@ function renderDetailsBlock(detailsBlock: string, options?: RenderMarkdownOption
715
851
  const summaryMatch = innerContent.match(/^(\s*<summary\b[^>]*>[\s\S]*?<\/summary\s*>)([\s\S]*)$/i);
716
852
  const summaryHtml = summaryMatch?.[1] ?? '';
717
853
  const bodyMarkdown = (summaryMatch?.[2] ?? innerContent) as string_markdown;
718
- const renderedBody = renderMarkdown(bodyMarkdown, options);
854
+ const renderedBody = renderMarkdown(bodyMarkdown);
719
855
 
720
856
  return `${openTag}${summaryHtml}${renderedBody}${closeTag}` as string_html;
721
857
  }
@@ -754,23 +890,60 @@ function maskMarkdownCodeSegments(markdown: string_markdown): MaskedCodeSegments
754
890
  };
755
891
  }
756
892
 
893
+ /**
894
+ * Masks markdown links, images and bare URLs while plain-text reference aliases are resolved.
895
+ *
896
+ * A matching display name inside an unrelated link label must keep that original link instead of
897
+ * producing a nested chip inside its anchor.
898
+ *
899
+ * @param markdown - Markdown without code segments.
900
+ * @returns Masked markdown and a restore helper.
901
+ *
902
+ * @private utility of `renderMarkdown`
903
+ */
904
+ function maskMarkdownLinksAndBareUrls(markdown: string_markdown): MaskedMarkdownLinkAndUrlSegmentsResult {
905
+ const segments: string[] = [];
906
+ const addPlaceholder = (segment: string): string => {
907
+ const placeholder = `${MARKDOWN_REFERENCE_TEXT_MASK_PLACEHOLDER_PREFIX}${segments.length}__`;
908
+ segments.push(segment);
909
+ return placeholder;
910
+ };
911
+
912
+ MARKDOWN_LINK_REGEX.lastIndex = 0;
913
+ let masked = markdown.replace(MARKDOWN_LINK_REGEX, (match) => addPlaceholder(match)) as string_markdown;
914
+
915
+ BARE_URL_REGEX.lastIndex = 0;
916
+ masked = masked.replace(BARE_URL_REGEX, (_match, leadingWhitespace: string, rawUrl: string) => {
917
+ return `${leadingWhitespace}${addPlaceholder(rawUrl)}`;
918
+ }) as string_markdown;
919
+
920
+ return {
921
+ masked,
922
+ restore(value: string_markdown): string_markdown {
923
+ return value.replace(
924
+ MARKDOWN_REFERENCE_TEXT_MASK_PLACEHOLDER_REGEX,
925
+ (_match, index) => segments[Number(index)] ?? '',
926
+ );
927
+ },
928
+ };
929
+ }
930
+
757
931
  /**
758
932
  * Masks `<details>...</details>` blocks in the markdown source so that Showdown never
759
933
  * processes their content.
760
934
  *
761
935
  * @param markdown - Markdown text that may contain raw HTML `<details>` blocks.
762
- * @param options - Markdown rendering options to reuse for the details body.
763
936
  * @returns Masked markdown and a restore helper that returns `string_html`.
764
937
  *
765
938
  * @private utility of `renderMarkdown`
766
939
  */
767
- function maskDetailsBlocks(markdown: string_markdown, options?: RenderMarkdownOptions): MaskedDetailsBlocksResult {
940
+ function maskDetailsBlocks(markdown: string_markdown): MaskedDetailsBlocksResult {
768
941
  const blocks: string_html[] = [];
769
942
 
770
943
  DETAILS_BLOCK_REGEX.lastIndex = 0;
771
944
  const masked = markdown.replace(DETAILS_BLOCK_REGEX, (match) => {
772
945
  const placeholder = `${DETAILS_PLACEHOLDER_PREFIX}${blocks.length}__`;
773
- blocks.push(renderDetailsBlock(match, options));
946
+ blocks.push(renderDetailsBlock(match));
774
947
  return placeholder;
775
948
  }) as string_markdown;
776
949
 
@@ -859,6 +1032,18 @@ function normalizeMarkdownInlineReferenceKey(value: string): string {
859
1032
  return value.trim().toLowerCase();
860
1033
  }
861
1034
 
1035
+ /**
1036
+ * Lists all token keys which can identify one inline reference.
1037
+ *
1038
+ * @param reference - Inline reference with its stable key and optional display-name aliases.
1039
+ * @returns Keys recognized inside `[[...]]` tokens.
1040
+ *
1041
+ * @private utility of `renderMarkdown`
1042
+ */
1043
+ function listMarkdownInlineReferenceKeys(reference: MarkdownInlineReference): ReadonlyArray<string> {
1044
+ return [reference.reference, ...(reference.sourceTextAliases || [])];
1045
+ }
1046
+
862
1047
  /**
863
1048
  * Builds a lookup of inline markdown references keyed by the authored `[[reference]]` text.
864
1049
  *
@@ -873,102 +1058,322 @@ function createMarkdownInlineReferenceByKey(
873
1058
  const referenceByKey = new Map<string, MarkdownInlineReference>();
874
1059
 
875
1060
  for (const reference of references) {
876
- const normalizedReference = normalizeMarkdownInlineReferenceKey(reference.reference);
877
- if (!normalizedReference || referenceByKey.has(normalizedReference)) {
878
- continue;
879
- }
1061
+ for (const referenceKey of listMarkdownInlineReferenceKeys(reference)) {
1062
+ const normalizedReference = normalizeMarkdownInlineReferenceKey(referenceKey);
1063
+ if (!normalizedReference || referenceByKey.has(normalizedReference)) {
1064
+ continue;
1065
+ }
880
1066
 
881
- referenceByKey.set(normalizedReference, reference);
1067
+ referenceByKey.set(normalizedReference, reference);
1068
+ }
882
1069
  }
883
1070
 
884
1071
  return referenceByKey;
885
1072
  }
886
1073
 
887
1074
  /**
888
- * Returns whether a href starts with a configured source href prefix.
1075
+ * One display-name alias and the inline reference it renders.
1076
+ *
1077
+ * @private utility of `renderMarkdown`
1078
+ */
1079
+ type MarkdownInlineReferenceTextMatcher = {
1080
+ /**
1081
+ * Reference rendered for the alias.
1082
+ */
1083
+ readonly reference: MarkdownInlineReference;
1084
+
1085
+ /**
1086
+ * Human-readable source text recognized in markdown.
1087
+ */
1088
+ readonly sourceTextAlias: string;
1089
+ };
1090
+
1091
+ /**
1092
+ * Escapes text before embedding it into a regular expression.
1093
+ *
1094
+ * @param value - Literal text to match.
1095
+ * @returns Regular-expression-safe text.
1096
+ *
1097
+ * @private utility of `renderMarkdown`
1098
+ */
1099
+ function escapeRegularExpression(value: string): string {
1100
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1101
+ }
1102
+
1103
+ /**
1104
+ * Creates non-ambiguous display-name matchers for inline references.
1105
+ *
1106
+ * Longer aliases are matched first so a project named `Prague Map` wins over a project named `Map`.
1107
+ * An alias shared by more than one reference is deliberately ignored instead of linking to an arbitrary project.
889
1108
  *
890
- * @param href - Markdown link destination.
891
- * @param sourceHrefPrefix - Configured source href prefix.
892
- * @returns Whether the href belongs to the source prefix.
1109
+ * @param references - References available to this markdown render.
1110
+ * @returns Plain-text matchers ordered from longest to shortest alias.
893
1111
  *
894
1112
  * @private utility of `renderMarkdown`
895
1113
  */
896
- function doesHrefStartWithSourceHrefPrefix(href: string, sourceHrefPrefix: string): boolean {
897
- if (href === sourceHrefPrefix) {
898
- return true;
1114
+ function createMarkdownInlineReferenceTextMatchers(
1115
+ references: ReadonlyArray<MarkdownInlineReference>,
1116
+ ): ReadonlyArray<MarkdownInlineReferenceTextMatcher> {
1117
+ const matcherByNormalizedAlias = new Map<string, MarkdownInlineReferenceTextMatcher | null>();
1118
+
1119
+ for (const reference of references) {
1120
+ for (const sourceTextAliasCandidate of reference.sourceTextAliases || []) {
1121
+ const sourceTextAlias = sourceTextAliasCandidate.trim();
1122
+ const normalizedAlias = normalizeMarkdownInlineReferenceKey(sourceTextAlias);
1123
+ if (!normalizedAlias) {
1124
+ continue;
1125
+ }
1126
+
1127
+ const existingMatcher = matcherByNormalizedAlias.get(normalizedAlias);
1128
+ if (existingMatcher === undefined) {
1129
+ matcherByNormalizedAlias.set(normalizedAlias, { reference, sourceTextAlias });
1130
+ } else if (existingMatcher !== null && existingMatcher.reference !== reference) {
1131
+ matcherByNormalizedAlias.set(normalizedAlias, null);
1132
+ }
1133
+ }
899
1134
  }
900
1135
 
901
- const normalizedSourceHrefPrefix = sourceHrefPrefix.endsWith('/') ? sourceHrefPrefix : `${sourceHrefPrefix}/`;
1136
+ return Array.from(matcherByNormalizedAlias.values())
1137
+ .filter((matcher): matcher is MarkdownInlineReferenceTextMatcher => matcher !== null)
1138
+ .sort(
1139
+ (firstMatcher, secondMatcher) =>
1140
+ secondMatcher.sourceTextAlias.length - firstMatcher.sourceTextAlias.length ||
1141
+ firstMatcher.sourceTextAlias.localeCompare(secondMatcher.sourceTextAlias),
1142
+ );
1143
+ }
1144
+
1145
+ /**
1146
+ * Creates a regular expression matching one plain-text alias with optional bold markdown around it.
1147
+ *
1148
+ * @param sourceTextAlias - Literal display name to match.
1149
+ * @param isMarkdownFormattingMatched - Whether matching `**alias**` and `__alias__` form.
1150
+ * @returns Unicode-aware whole-text regular expression.
1151
+ *
1152
+ * @private utility of `renderMarkdown`
1153
+ */
1154
+ function createMarkdownInlineReferenceTextAliasRegex(
1155
+ sourceTextAlias: string,
1156
+ isMarkdownFormattingMatched: boolean,
1157
+ ): RegExp {
1158
+ const escapedAlias = escapeRegularExpression(sourceTextAlias);
1159
+ const boundaryCharacterClass = '\\p{L}\\p{N}_-';
1160
+ const boundaryPattern = `[^${boundaryCharacterClass}]`;
1161
+ const aliasPattern = isMarkdownFormattingMatched ? `(?:\\*\\*|__)${escapedAlias}(?:\\*\\*|__)` : escapedAlias;
902
1162
 
903
- return href.startsWith(normalizedSourceHrefPrefix);
1163
+ return new RegExp(`(^|${boundaryPattern})${aliasPattern}(?=$|${boundaryPattern})`, 'giu');
904
1164
  }
905
1165
 
906
1166
  /**
907
- * Returns a comparable path for an absolute href when the configured source prefix is relative.
1167
+ * Replaces known project display names in agent markdown with inline-reference placeholders.
1168
+ *
1169
+ * Bold aliases are replaced first so an older message such as `**Prague Murders Map**` becomes one
1170
+ * chip rather than a chip nested inside formatting markup.
908
1171
  *
909
- * @param href - Href to normalize.
910
- * @returns Absolute URL pathname or the original href when it is relative/invalid.
1172
+ * @param markdown - Markdown with code and links already masked.
1173
+ * @param matchers - Non-ambiguous display-name aliases available to this render.
1174
+ * @param createPlaceholder - Renders a matched reference into a placeholder.
1175
+ * @returns Markdown containing inline-reference placeholders.
911
1176
  *
912
1177
  * @private utility of `renderMarkdown`
913
1178
  */
914
- function resolveAbsoluteHrefPath(href: string): string {
1179
+ function replaceMarkdownInlineReferenceTextAliases(
1180
+ markdown: string_markdown,
1181
+ matchers: ReadonlyArray<MarkdownInlineReferenceTextMatcher>,
1182
+ createPlaceholder: CreateMarkdownInlineReferencePlaceholder,
1183
+ ): string_markdown {
1184
+ let referencedMarkdown = markdown;
1185
+
1186
+ for (const matcher of matchers) {
1187
+ for (const isMarkdownFormattingMatched of [true, false]) {
1188
+ const aliasRegex = createMarkdownInlineReferenceTextAliasRegex(
1189
+ matcher.sourceTextAlias,
1190
+ isMarkdownFormattingMatched,
1191
+ );
1192
+ referencedMarkdown = referencedMarkdown.replace(aliasRegex, (_match, leadingBoundary: string) => {
1193
+ return `${leadingBoundary || ''}${createPlaceholder(matcher.reference)}`;
1194
+ }) as string_markdown;
1195
+ }
1196
+ }
1197
+
1198
+ return referencedMarkdown;
1199
+ }
1200
+
1201
+ /**
1202
+ * Comparable parts of one URL used to recognize inline references written as links or bare URLs.
1203
+ *
1204
+ * @private utility of `renderMarkdown`
1205
+ */
1206
+ type ComparableUrlParts = {
1207
+ /**
1208
+ * Lowercase host of an absolute URL, or an empty string for a host-independent application path.
1209
+ */
1210
+ readonly host: string;
1211
+
1212
+ /**
1213
+ * Lowercase decoded path without query, hash and trailing slashes.
1214
+ */
1215
+ readonly path: string;
1216
+ };
1217
+
1218
+ /**
1219
+ * One inline reference together with its comparable source URL prefixes.
1220
+ *
1221
+ * @private utility of `renderMarkdown`
1222
+ */
1223
+ type MarkdownInlineReferenceHrefMatcher = {
1224
+ /**
1225
+ * Reference rendered when one of its source prefixes matches.
1226
+ */
1227
+ readonly reference: MarkdownInlineReference;
1228
+
1229
+ /**
1230
+ * Comparable form of the reference source URL prefixes.
1231
+ */
1232
+ readonly sourceHrefPrefixes: ReadonlyArray<ComparableUrlParts>;
1233
+ };
1234
+
1235
+ /**
1236
+ * Renders one matched reference and returns the placeholder standing for it.
1237
+ *
1238
+ * @private utility of `renderMarkdown`
1239
+ */
1240
+ type CreateMarkdownInlineReferencePlaceholder = (reference: MarkdownInlineReference) => string;
1241
+
1242
+ /**
1243
+ * Decodes percent-encoded characters without failing on malformed input.
1244
+ *
1245
+ * @param value - Raw URL part.
1246
+ * @returns Decoded value, or the original value when it cannot be decoded.
1247
+ *
1248
+ * @private utility of `renderMarkdown`
1249
+ */
1250
+ function decodeUrlPartSafely(value: string): string {
915
1251
  try {
916
- return new URL(href).pathname;
1252
+ return decodeURIComponent(value);
917
1253
  } catch {
918
- return href;
1254
+ return value;
919
1255
  }
920
1256
  }
921
1257
 
922
1258
  /**
923
- * Returns whether one markdown link destination belongs to one inline reference.
1259
+ * Normalizes one URL path so that encoding, casing and trailing slashes do not break matching.
924
1260
  *
925
- * Relative project paths also match absolute URLs on the current server, which keeps
926
- * server-generated relative links and model-generated absolute links consistent.
1261
+ * @param path - Raw path including an optional query and hash.
1262
+ * @returns Comparable path.
927
1263
  *
928
- * @param reference - Candidate inline reference.
929
- * @param href - Markdown link destination.
930
- * @returns Whether the href should render as the reference chip.
1264
+ * @private utility of `renderMarkdown`
1265
+ */
1266
+ function normalizeUrlPathForComparison(path: string): string {
1267
+ const pathWithoutQuery = path.split(/[?#]/, 1)[0] || '';
1268
+
1269
+ return decodeUrlPartSafely(pathWithoutQuery).toLowerCase().replace(/\/+$/, '');
1270
+ }
1271
+
1272
+ /**
1273
+ * Splits one absolute URL or application path into its comparable parts.
1274
+ *
1275
+ * @param url - Raw link target written in markdown.
1276
+ * @returns Comparable URL parts, or `null` when the value cannot address a reference.
931
1277
  *
932
1278
  * @private utility of `renderMarkdown`
933
1279
  */
934
- function doesMarkdownInlineReferenceMatchHref(reference: MarkdownInlineReference, href: string): boolean {
935
- const normalizedHref = href.trim();
1280
+ function createComparableUrlParts(url: string): ComparableUrlParts | null {
1281
+ const trimmedUrl = url
1282
+ .trim()
1283
+ .replace(/^<([\s\S]*)>$/, '$1')
1284
+ .trim();
936
1285
 
937
- return (reference.sourceHrefPrefixes || []).some((sourceHrefPrefix) => {
938
- const normalizedSourceHrefPrefix = sourceHrefPrefix.trim();
939
- if (!normalizedSourceHrefPrefix) {
940
- return false;
941
- }
1286
+ if (trimmedUrl === '') {
1287
+ return null;
1288
+ }
942
1289
 
943
- if (doesHrefStartWithSourceHrefPrefix(normalizedHref, normalizedSourceHrefPrefix)) {
944
- return true;
945
- }
1290
+ const absoluteUrlMatch = trimmedUrl.match(ABSOLUTE_URL_REGEX);
1291
+ if (absoluteUrlMatch) {
1292
+ return {
1293
+ host: absoluteUrlMatch[1]!.toLowerCase(),
1294
+ path: normalizeUrlPathForComparison(absoluteUrlMatch[2] || ''),
1295
+ };
1296
+ }
946
1297
 
947
- const isRelativeSourceHrefPrefix = !/^[a-z][a-z0-9+.-]*:/i.test(normalizedSourceHrefPrefix);
948
- const isAbsoluteHref = /^[a-z][a-z0-9+.-]*:/i.test(normalizedHref);
1298
+ if (!trimmedUrl.startsWith('/')) {
1299
+ return null;
1300
+ }
949
1301
 
950
- return (
951
- isRelativeSourceHrefPrefix &&
952
- isAbsoluteHref &&
953
- doesHrefStartWithSourceHrefPrefix(resolveAbsoluteHrefPath(normalizedHref), normalizedSourceHrefPrefix)
954
- );
955
- });
1302
+ return {
1303
+ host: '',
1304
+ path: normalizeUrlPathForComparison(trimmedUrl),
1305
+ };
1306
+ }
1307
+
1308
+ /**
1309
+ * Returns whether one URL points into one reference source prefix.
1310
+ *
1311
+ * @param url - Comparable parts of the link target written in markdown.
1312
+ * @param prefix - Comparable parts of one reference source prefix.
1313
+ * @returns `true` when the URL belongs to the reference.
1314
+ *
1315
+ * @private utility of `renderMarkdown`
1316
+ */
1317
+ function isUrlWithinReferencePrefix(url: ComparableUrlParts, prefix: ComparableUrlParts): boolean {
1318
+ if (prefix.host !== '' && prefix.host !== url.host) {
1319
+ return false;
1320
+ }
1321
+
1322
+ if (prefix.path === '') {
1323
+ // Note: A prefix without a path covers the whole host, a prefix without both would cover everything
1324
+ return prefix.host !== '';
1325
+ }
1326
+
1327
+ return url.path === prefix.path || url.path.startsWith(`${prefix.path}/`);
956
1328
  }
957
1329
 
958
1330
  /**
959
- * Finds the inline reference represented by a markdown link destination.
1331
+ * Builds matchers for references which can also be written as a markdown link or a bare URL.
960
1332
  *
961
- * @param references - Inline references available to the markdown renderer.
962
- * @param href - Markdown link destination.
963
- * @returns Matching reference or `undefined` when the href is unrelated.
1333
+ * @param references - References available to this markdown render.
1334
+ * @returns Matchers of references declaring at least one usable source prefix.
964
1335
  *
965
1336
  * @private utility of `renderMarkdown`
966
1337
  */
967
- function findMarkdownInlineReferenceByHref(
1338
+ function createMarkdownInlineReferenceHrefMatchers(
968
1339
  references: ReadonlyArray<MarkdownInlineReference>,
1340
+ ): ReadonlyArray<MarkdownInlineReferenceHrefMatcher> {
1341
+ return references
1342
+ .map((reference) => ({
1343
+ reference,
1344
+ sourceHrefPrefixes: (reference.sourceHrefPrefixes || [])
1345
+ .map((sourceHrefPrefix) => createComparableUrlParts(sourceHrefPrefix))
1346
+ .filter((sourceHrefPrefix): sourceHrefPrefix is ComparableUrlParts => sourceHrefPrefix !== null),
1347
+ }))
1348
+ .filter((matcher) => matcher.sourceHrefPrefixes.length !== 0);
1349
+ }
1350
+
1351
+ /**
1352
+ * Finds the reference which owns one link target.
1353
+ *
1354
+ * @param href - Raw link target written in markdown.
1355
+ * @param matchers - Reference matchers of this markdown render.
1356
+ * @returns Matching reference or `null`.
1357
+ *
1358
+ * @private utility of `renderMarkdown`
1359
+ */
1360
+ function findMarkdownInlineReferenceForHref(
969
1361
  href: string,
970
- ): MarkdownInlineReference | undefined {
971
- return references.find((reference) => doesMarkdownInlineReferenceMatchHref(reference, href));
1362
+ matchers: ReadonlyArray<MarkdownInlineReferenceHrefMatcher>,
1363
+ ): MarkdownInlineReference | null {
1364
+ const urlParts = createComparableUrlParts(href);
1365
+
1366
+ if (urlParts === null) {
1367
+ return null;
1368
+ }
1369
+
1370
+ const matcher = matchers.find((candidateMatcher) =>
1371
+ candidateMatcher.sourceHrefPrefixes.some((sourceHrefPrefix) =>
1372
+ isUrlWithinReferencePrefix(urlParts, sourceHrefPrefix),
1373
+ ),
1374
+ );
1375
+
1376
+ return matcher?.reference || null;
972
1377
  }
973
1378
 
974
1379
  /**
@@ -985,12 +1390,50 @@ function renderMarkdownInlineReferenceHtml(reference: MarkdownInlineReference, c
985
1390
  return renderMarkdownInlineReferenceMenuHtml(reference, className);
986
1391
  }
987
1392
 
988
- const escapedClassName = escapeHtml(className);
1393
+ const escapedClassName = escapeHtml(createMarkdownInlineReferenceClassName(reference, className));
989
1394
  const escapedHref = escapeHtml(reference.href);
990
1395
  const escapedLabel = escapeHtml(reference.label);
991
1396
  const escapedTitle = escapeHtml(reference.title || reference.label);
1397
+ const iconHtml = renderMarkdownInlineReferenceIconHtml(reference.icon);
992
1398
 
993
- return `<a class="${escapedClassName}" href="${escapedHref}" title="${escapedTitle}">${escapedLabel}</a>`;
1399
+ return `<a class="${escapedClassName}" href="${escapedHref}" title="${escapedTitle}">${iconHtml}<span>${escapedLabel}</span></a>`;
1400
+ }
1401
+
1402
+ /**
1403
+ * Adds the icon marker class only to references which provide icon metadata.
1404
+ *
1405
+ * @param reference - Inline reference being rendered.
1406
+ * @param className - Base chip class name.
1407
+ * @returns Complete class name for the rendered chip.
1408
+ *
1409
+ * @private utility of `renderMarkdown`
1410
+ */
1411
+ function createMarkdownInlineReferenceClassName(reference: MarkdownInlineReference, className: string): string {
1412
+ return reference.icon ? `${className} inlineReferenceChip--with-icon` : className;
1413
+ }
1414
+
1415
+ /**
1416
+ * Renders one inline-reference favicon with a text fallback.
1417
+ *
1418
+ * @param icon - Optional icon metadata.
1419
+ * @returns Safe icon markup, or an empty string when no icon is configured.
1420
+ *
1421
+ * @private utility of `renderMarkdown`
1422
+ */
1423
+ function renderMarkdownInlineReferenceIconHtml(icon: MarkdownInlineReferenceIcon | undefined): string {
1424
+ if (!icon) {
1425
+ return '';
1426
+ }
1427
+
1428
+ const escapedFallbackText = escapeHtml(icon.fallbackText);
1429
+ const fallbackHtml = `<span class="inlineReferenceIconFallback">${escapedFallbackText}</span>`;
1430
+
1431
+ if (!icon.src) {
1432
+ return `<span class="inlineReferenceIcon" aria-hidden="true">${fallbackHtml}</span>`;
1433
+ }
1434
+
1435
+ const escapedSrc = escapeHtml(icon.src);
1436
+ return `<span class="inlineReferenceIcon" aria-hidden="true">${fallbackHtml}<img ${MARKDOWN_INLINE_REFERENCE_ICON_ATTRIBUTE} src="${escapedSrc}" alt=""></span>`;
994
1437
  }
995
1438
 
996
1439
  /**
@@ -1009,30 +1452,44 @@ function renderMarkdownInlineReferenceMenuHtml(reference: MarkdownInlineReferenc
1009
1452
  return renderMarkdownInlineReferenceHtml({ ...reference, menu: undefined }, className);
1010
1453
  }
1011
1454
 
1012
- const escapedClassName = escapeHtml(className);
1455
+ const escapedClassName = escapeHtml(createMarkdownInlineReferenceClassName(reference, className));
1013
1456
  const escapedLabel = escapeHtml(reference.label);
1014
1457
  const escapedTitle = escapeHtml(reference.title || reference.label);
1015
1458
  const escapedStatusLabel = escapeHtml(menu.status.label);
1016
1459
  const statusClassName = menu.status.isActive
1017
1460
  ? 'inlineReferenceMenuStatus inlineReferenceMenuStatus--active'
1018
- : 'inlineReferenceMenuStatus';
1019
- const optionsHtml = menu.options.map((option) => renderMarkdownInlineReferenceMenuOptionHtml(option)).join('');
1461
+ : 'inlineReferenceMenuStatus inlineReferenceMenuStatus--inactive';
1462
+ const iconHtml = renderMarkdownInlineReferenceIconHtml(reference.icon);
1463
+ const optionsHtml = menu.options
1464
+ .map((option) => renderMarkdownInlineReferenceMenuOptionHtml(reference, option))
1465
+ .join('');
1020
1466
 
1021
- return `<details class="${escapedClassName}" title="${escapedTitle}"><summary><span>${escapedLabel}</span><span class="${statusClassName}" title="${escapedStatusLabel}"></span></summary><div><span class="${statusClassName}">${escapedStatusLabel}</span>${optionsHtml}</div></details>`;
1467
+ return `<details class="${escapedClassName}" title="${escapedTitle}"><summary>${iconHtml}<span>${escapedLabel}</span><span class="${statusClassName}" title="${escapedStatusLabel}"></span></summary><div><span class="${statusClassName}">${escapedStatusLabel}</span>${optionsHtml}</div></details>`;
1022
1468
  }
1023
1469
 
1024
1470
  /**
1025
1471
  * Renders one option in an expandable markdown inline reference menu.
1026
1472
  *
1473
+ * @param reference - Inline reference which owns the option.
1027
1474
  * @param option - Menu option definition.
1028
1475
  * @returns HTML anchor or disabled label markup.
1029
1476
  *
1030
1477
  * @private utility of `renderMarkdown`
1031
1478
  */
1032
- function renderMarkdownInlineReferenceMenuOptionHtml(option: MarkdownInlineReferenceMenuOption): string {
1479
+ function renderMarkdownInlineReferenceMenuOptionHtml(
1480
+ reference: MarkdownInlineReference,
1481
+ option: MarkdownInlineReferenceMenuOption,
1482
+ ): string {
1033
1483
  const escapedLabel = escapeHtml(option.label);
1034
1484
  const escapedTitle = escapeHtml(option.title || option.label);
1035
1485
 
1486
+ if (option.action) {
1487
+ const escapedActionId = escapeHtml(option.action.id);
1488
+ const escapedReference = escapeHtml(reference.reference);
1489
+
1490
+ return `<button type="button" ${MARKDOWN_INLINE_REFERENCE_MENU_ACTION_ATTRIBUTE}="${escapedActionId}" ${MARKDOWN_INLINE_REFERENCE_MENU_ACTION_REFERENCE_ATTRIBUTE}="${escapedReference}" class="inlineReferenceMenuOption" title="${escapedTitle}">${escapedLabel}</button>`;
1491
+ }
1492
+
1036
1493
  if (option.href === null) {
1037
1494
  return `<span class="inlineReferenceMenuOption inlineReferenceMenuOption--disabled" title="${escapedTitle}">${escapedLabel}</span>`;
1038
1495
  }
@@ -1042,11 +1499,113 @@ function renderMarkdownInlineReferenceMenuOptionHtml(option: MarkdownInlineRefer
1042
1499
  }
1043
1500
 
1044
1501
  /**
1045
- * Replaces known `[[reference]]` tokens with link chips while leaving unknown tokens unchanged.
1502
+ * Replaces known `[[reference]]` tokens with chip placeholders while leaving unknown tokens unchanged.
1503
+ *
1504
+ * @param markdown - Markdown content after code masking.
1505
+ * @param references - References available to this markdown render.
1506
+ * @param createPlaceholder - Renders one matched reference into a placeholder.
1507
+ * @returns Markdown with known reference tokens replaced by placeholders.
1508
+ *
1509
+ * @private utility of `renderMarkdown`
1510
+ */
1511
+ function replaceMarkdownInlineReferenceTokens(
1512
+ markdown: string_markdown,
1513
+ references: ReadonlyArray<MarkdownInlineReference>,
1514
+ createPlaceholder: CreateMarkdownInlineReferencePlaceholder,
1515
+ ): string_markdown {
1516
+ const referenceByKey = createMarkdownInlineReferenceByKey(references);
1517
+
1518
+ if (referenceByKey.size === 0) {
1519
+ return markdown;
1520
+ }
1521
+
1522
+ return markdown.replace(INLINE_REFERENCE_REGEX, (match, rawReference: string) => {
1523
+ const reference = referenceByKey.get(normalizeMarkdownInlineReferenceKey(rawReference));
1524
+
1525
+ return reference ? createPlaceholder(reference) : match;
1526
+ }) as string_markdown;
1527
+ }
1528
+
1529
+ /**
1530
+ * Replaces markdown links pointing to a known reference with chip placeholders.
1531
+ *
1532
+ * Images keep their original markdown so that pictures served by a reference stay visible.
1533
+ *
1534
+ * @param markdown - Markdown content after code masking.
1535
+ * @param matchers - Reference matchers of this markdown render.
1536
+ * @param createPlaceholder - Renders one matched reference into a placeholder.
1537
+ * @returns Markdown with known reference links replaced by placeholders.
1538
+ *
1539
+ * @private utility of `renderMarkdown`
1540
+ */
1541
+ function replaceMarkdownInlineReferenceLinks(
1542
+ markdown: string_markdown,
1543
+ matchers: ReadonlyArray<MarkdownInlineReferenceHrefMatcher>,
1544
+ createPlaceholder: CreateMarkdownInlineReferencePlaceholder,
1545
+ ): string_markdown {
1546
+ return markdown.replace(MARKDOWN_LINK_REGEX, (match, imageMarker: string, _label: string, rawHref: string) => {
1547
+ if (imageMarker !== '') {
1548
+ return match;
1549
+ }
1550
+
1551
+ const reference = findMarkdownInlineReferenceForHref(rawHref, matchers);
1552
+
1553
+ return reference ? createPlaceholder(reference) : match;
1554
+ }) as string_markdown;
1555
+ }
1556
+
1557
+ /**
1558
+ * Replaces bare URLs of known references with chip placeholders.
1559
+ *
1560
+ * @param markdown - Markdown content after reference links were replaced.
1561
+ * @param matchers - Reference matchers of this markdown render.
1562
+ * @param createPlaceholder - Renders one matched reference into a placeholder.
1563
+ * @returns Markdown with known reference URLs replaced by placeholders.
1564
+ *
1565
+ * @private utility of `renderMarkdown`
1566
+ */
1567
+ function replaceMarkdownInlineReferenceBareUrls(
1568
+ markdown: string_markdown,
1569
+ matchers: ReadonlyArray<MarkdownInlineReferenceHrefMatcher>,
1570
+ createPlaceholder: CreateMarkdownInlineReferencePlaceholder,
1571
+ ): string_markdown {
1572
+ return markdown.replace(BARE_URL_REGEX, (match, leadingWhitespace: string, rawUrl: string) => {
1573
+ const trailingPunctuation = rawUrl.match(BARE_URL_TRAILING_PUNCTUATION_REGEX)?.[0] || '';
1574
+ const url = rawUrl.slice(0, rawUrl.length - trailingPunctuation.length);
1575
+ const reference = findMarkdownInlineReferenceForHref(url, matchers);
1576
+
1577
+ return reference ? `${leadingWhitespace}${createPlaceholder(reference)}${trailingPunctuation}` : match;
1578
+ }) as string_markdown;
1579
+ }
1580
+
1581
+ /**
1582
+ * Restores chips which replaced references during the reference passes.
1583
+ *
1584
+ * @param markdown - Markdown containing reference placeholders.
1585
+ * @param renderedChips - Chip HTML indexed by placeholder number.
1586
+ * @returns Markdown with inline references rendered as HTML chips.
1587
+ *
1588
+ * @private utility of `renderMarkdown`
1589
+ */
1590
+ function restoreMarkdownInlineReferenceChips(
1591
+ markdown: string_markdown,
1592
+ renderedChips: ReadonlyArray<string>,
1593
+ ): string_markdown {
1594
+ return markdown.replace(
1595
+ INLINE_REFERENCE_PLACEHOLDER_REGEX,
1596
+ (_match, index) => renderedChips[Number(index)] ?? '',
1597
+ ) as string_markdown;
1598
+ }
1599
+
1600
+ /**
1601
+ * Replaces known `[[reference]]` tokens, reference links and bare reference URLs with link chips.
1602
+ *
1603
+ * Every matched reference is first replaced by a placeholder so that the rendered chip HTML is
1604
+ * never processed again by a later pass.
1046
1605
  *
1047
1606
  * @param markdown - Markdown content after code masking.
1048
1607
  * @param options - Markdown render options.
1049
- * @returns Markdown with known inline references rendered as HTML anchors.
1608
+ * @returns Markdown with known inline references rendered as HTML chips.
1050
1609
  *
1051
1610
  * @private utility of `renderMarkdown`
1052
1611
  */
@@ -1058,33 +1617,36 @@ function applyMarkdownInlineReferences(markdown: string_markdown, options?: Rend
1058
1617
  return markdown;
1059
1618
  }
1060
1619
 
1061
- const referenceByKey = createMarkdownInlineReferenceByKey(references);
1062
- if (referenceByKey.size === 0) {
1063
- return markdown;
1064
- }
1620
+ const renderedChips: Array<string> = [];
1621
+ const createPlaceholder: CreateMarkdownInlineReferencePlaceholder = (reference) => {
1622
+ const placeholder = `${INLINE_REFERENCE_PLACEHOLDER_PREFIX}${renderedChips.length}__`;
1623
+ renderedChips.push(renderMarkdownInlineReferenceHtml(reference, className));
1065
1624
 
1066
- const markdownWithInlineReferenceTokens = markdown.replace(
1067
- INLINE_REFERENCE_REGEX,
1068
- (match, rawReference: string) => {
1069
- const reference = referenceByKey.get(normalizeMarkdownInlineReferenceKey(rawReference));
1625
+ return placeholder;
1626
+ };
1070
1627
 
1071
- return reference ? renderMarkdownInlineReferenceHtml(reference, className) : match;
1072
- },
1073
- );
1628
+ const hrefMatchers = createMarkdownInlineReferenceHrefMatchers(references);
1629
+ let referencedMarkdown = replaceMarkdownInlineReferenceTokens(markdown, references, createPlaceholder);
1074
1630
 
1075
- return markdownWithInlineReferenceTokens.replace(
1076
- MARKDOWN_INLINE_REFERENCE_LINK_REGEX,
1077
- (match, imageMarker: string, _linkLabel: string, rawHref: string) => {
1078
- if (imageMarker) {
1079
- return match;
1080
- }
1631
+ if (hrefMatchers.length !== 0) {
1632
+ referencedMarkdown = replaceMarkdownInlineReferenceLinks(referencedMarkdown, hrefMatchers, createPlaceholder);
1633
+ referencedMarkdown = replaceMarkdownInlineReferenceBareUrls(
1634
+ referencedMarkdown,
1635
+ hrefMatchers,
1636
+ createPlaceholder,
1637
+ );
1638
+ }
1081
1639
 
1082
- const href = rawHref.replace(/^<|>$/g, '');
1083
- const reference = findMarkdownInlineReferenceByHref(references, href);
1640
+ const textMatchers = createMarkdownInlineReferenceTextMatchers(references);
1641
+ if (textMatchers.length !== 0) {
1642
+ const { masked: markdownWithMaskedLinksAndUrls, restore: restoreLinksAndUrls } =
1643
+ maskMarkdownLinksAndBareUrls(referencedMarkdown);
1644
+ referencedMarkdown = restoreLinksAndUrls(
1645
+ replaceMarkdownInlineReferenceTextAliases(markdownWithMaskedLinksAndUrls, textMatchers, createPlaceholder),
1646
+ );
1647
+ }
1084
1648
 
1085
- return reference ? renderMarkdownInlineReferenceHtml(reference, className) : match;
1086
- },
1087
- ) as string_markdown;
1649
+ return restoreMarkdownInlineReferenceChips(referencedMarkdown, renderedChips);
1088
1650
  }
1089
1651
 
1090
1652
  /**
@@ -1129,7 +1691,7 @@ export function renderMarkdown(markdown: string_markdown, options?: RenderMarkdo
1129
1691
 
1130
1692
  try {
1131
1693
  const normalizedMarkdown = normalizeMarkdownSublists(markdown);
1132
- const { masked: maskedMarkdown, restore: restoreDetails } = maskDetailsBlocks(normalizedMarkdown, options);
1694
+ const { masked: maskedMarkdown, restore: restoreDetails } = maskDetailsBlocks(normalizedMarkdown);
1133
1695
  const { masked: codeMaskedMarkdown, restore: restoreCode } = maskMarkdownCodeSegments(maskedMarkdown);
1134
1696
  const referencedMarkdown = applyMarkdownInlineReferences(codeMaskedMarkdown, options);
1135
1697
  const inlineReferenceMarkdown = restoreCode(referencedMarkdown);