@promptbook/cli 0.113.0-0 → 0.113.0-10

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 (710) hide show
  1. package/README.md +1 -17
  2. package/agents/default/developer.book +3 -0
  3. package/apps/agents-server/next.config.ts +6 -3
  4. package/apps/agents-server/src/app/admin/resource-monitor/page.tsx +456 -0
  5. package/apps/agents-server/src/app/admin/task-manager/TaskManagerClient.tsx +17 -5
  6. package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskLogActions.tsx +150 -0
  7. package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskRow.tsx +69 -20
  8. package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskTerminalDialog.tsx +125 -0
  9. package/apps/agents-server/src/app/admin/task-manager/TaskManagerTasksCard.tsx +8 -6
  10. package/apps/agents-server/src/app/admin/task-manager/page.tsx +3 -2
  11. package/apps/agents-server/src/app/admin/update/AdvancedOriginRepositoryPanel.tsx +81 -0
  12. package/apps/agents-server/src/app/admin/update/AutomaticSelfUpdateConfigurationCard.tsx +90 -0
  13. package/apps/agents-server/src/app/admin/update/CurrentDeploymentCard.tsx +162 -0
  14. package/apps/agents-server/src/app/admin/update/CustomCommitPicker.tsx +10 -10
  15. package/apps/agents-server/src/app/admin/update/InstalledVersionsCard.tsx +112 -0
  16. package/apps/agents-server/src/app/admin/update/PendingCommitsCard.tsx +87 -0
  17. package/apps/agents-server/src/app/admin/update/TargetEnvironmentCard.tsx +331 -0
  18. package/apps/agents-server/src/app/admin/update/UpdateClient.tsx +35 -878
  19. package/apps/agents-server/src/app/admin/update/UpdateDatabaseMigrationsPanel.tsx +305 -0
  20. package/apps/agents-server/src/app/admin/update/UpdateJobCard.tsx +350 -0
  21. package/apps/agents-server/src/app/admin/update/UpdateOverview.ts +142 -0
  22. package/apps/agents-server/src/app/admin/update/buildDeploymentTimeBehindLabel.ts +29 -0
  23. package/apps/agents-server/src/app/admin/update/formatHumanReadableTimestamp.ts +18 -0
  24. package/apps/agents-server/src/app/admin/update/getUpdateJobFailureMessage.ts +13 -0
  25. package/apps/agents-server/src/app/admin/update/getUpdateJobSuccessMessage.ts +13 -0
  26. package/apps/agents-server/src/app/admin/update/updatePageCardClassName.ts +6 -0
  27. package/apps/agents-server/src/app/admin/update/useUpdateClientState.ts +675 -0
  28. package/apps/agents-server/src/app/agents/[agentName]/AgentChatWrapper.tsx +17 -3
  29. package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +13 -1
  30. package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatSurface.tsx +6 -2
  31. package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/AgentCodePageClient.tsx +14 -559
  32. package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/AgentCodePageHeader.tsx +84 -0
  33. package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/AgentCodePageSection.tsx +52 -0
  34. package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/GeneratedCodePreview.tsx +138 -0
  35. package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/GeneratedHarnessSection.tsx +98 -0
  36. package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/SourceBookSection.tsx +66 -0
  37. package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/TranspiledCodeErrorBanner.tsx +30 -0
  38. package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/TranspiledCodeExportWarningBanner.tsx +62 -0
  39. package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/Transpiler.ts +9 -0
  40. package/apps/agents-server/src/app/agents/[agentName]/export-as-transpiled-code/useAgentCodeExportState.ts +478 -0
  41. package/apps/agents-server/src/app/api/admin/chat-tasks/[taskId]/terminal/route.ts +52 -0
  42. package/apps/agents-server/src/app/api/admin/update/route.ts +55 -8
  43. package/apps/agents-server/src/app/api/admin/update/versions/route.ts +34 -0
  44. package/apps/agents-server/src/app/api/auth/shibboleth/acs/route.ts +4 -2
  45. package/apps/agents-server/src/app/api/auth/shibboleth/login/route.ts +3 -1
  46. package/apps/agents-server/src/app/api/auth/shibboleth/metadata/route.ts +5 -2
  47. package/apps/agents-server/src/app/api/auth/shibboleth/status/route.ts +5 -2
  48. package/apps/agents-server/src/app/api/page-preview/input/route.ts +161 -0
  49. package/apps/agents-server/src/app/api/page-preview/stream/route.ts +81 -0
  50. package/apps/agents-server/src/app/layout.tsx +39 -25
  51. package/apps/agents-server/src/app/system/utilities/mocked-chats/cloneMockedChatPreset.ts +17 -0
  52. package/apps/agents-server/src/app/system/utilities/mocked-chats/confirmDeleteMockedChat.ts +16 -0
  53. package/apps/agents-server/src/app/system/utilities/mocked-chats/createDraftWithUpdatedMessage.ts +81 -0
  54. package/apps/agents-server/src/app/system/utilities/mocked-chats/createDraftWithUpdatedParticipant.ts +146 -0
  55. package/apps/agents-server/src/app/system/utilities/mocked-chats/createDraftWithUpdatedSettings.ts +19 -0
  56. package/apps/agents-server/src/app/system/utilities/mocked-chats/createDuplicatedDraft.ts +66 -0
  57. package/apps/agents-server/src/app/system/utilities/mocked-chats/findMockedChatById.ts +51 -0
  58. package/apps/agents-server/src/app/system/utilities/mocked-chats/persistMockedChats.ts +51 -0
  59. package/apps/agents-server/src/app/system/utilities/mocked-chats/useMockedChatsEditorState.ts +16 -426
  60. package/apps/agents-server/src/components/AgentAvatar/AgentAvatar.tsx +1 -1
  61. package/apps/agents-server/src/components/AgentAvatar/DefaultAgentAvatarVisualProvider.tsx +1 -1
  62. package/apps/agents-server/src/components/CronJobConfiguration/CronJobConfiguration.tsx +834 -0
  63. package/apps/agents-server/src/components/Header/Header.tsx +16 -3
  64. package/apps/agents-server/src/components/Header/HeaderDesktopTopMenuNavigation.tsx +22 -2
  65. package/apps/agents-server/src/components/Header/HeaderHomepageLink.tsx +1 -1
  66. package/apps/agents-server/src/components/Header/HeaderMobileDrawer.tsx +22 -2
  67. package/apps/agents-server/src/components/Header/HeaderTypes.ts +12 -1
  68. package/apps/agents-server/src/components/Header/buildAgentMenuStructure.tsx +6 -4
  69. package/apps/agents-server/src/components/Header/buildDocumentationDropdownItems.tsx +198 -3
  70. package/apps/agents-server/src/components/Header/buildHeaderMenuItems.ts +6 -0
  71. package/apps/agents-server/src/components/Header/buildHeaderSystemMenuItems.ts +182 -16
  72. package/apps/agents-server/src/components/Homepage/buildFreeGraphBoxLayout.ts +446 -0
  73. package/apps/agents-server/src/components/Homepage/buildGraphLayoutNodes.ts +415 -157
  74. package/apps/agents-server/src/components/Homepage/useAgentsGraphCanvasState.ts +2 -1
  75. package/apps/agents-server/src/components/Homepage/useAgentsListState.ts +1 -1
  76. package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +21 -5
  77. package/apps/agents-server/src/constants/chatVisualMode.ts +1 -1
  78. package/apps/agents-server/src/constants/defaultAgentAvatarVisual.ts +4 -3
  79. package/apps/agents-server/src/constants/themeMode.ts +1 -1
  80. package/apps/agents-server/src/database/metadataDefaults.ts +1 -1
  81. package/apps/agents-server/src/database/migrate.ts +25 -1
  82. package/apps/agents-server/src/database/migratePrefix.ts +24 -0
  83. package/apps/agents-server/src/database/migrations/2026-05-2600-default-theme.sql +2 -2
  84. package/apps/agents-server/src/database/runDatabaseMigrations.ts +9 -1
  85. package/apps/agents-server/src/database/sqlite/$provideLocalSqliteSupabase.ts +3 -1541
  86. package/apps/agents-server/src/database/sqlite/localSqliteSupabase/LocalSqliteQueryBuilder.ts +623 -0
  87. package/apps/agents-server/src/database/sqlite/localSqliteSupabase/LocalSqliteSupabaseClient.ts +64 -0
  88. package/apps/agents-server/src/database/sqlite/localSqliteSupabase/ensureTable.ts +93 -0
  89. package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteFilters.ts +202 -0
  90. package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteMutationPayload.ts +131 -0
  91. package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteRowOperations.ts +102 -0
  92. package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteSql.ts +59 -0
  93. package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteTableSchema.ts +329 -0
  94. package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteTypes.ts +84 -0
  95. package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteValueCodec.ts +63 -0
  96. package/apps/agents-server/src/database/sqlite/localSqliteSupabase/normalizeSqliteError.ts +22 -0
  97. package/apps/agents-server/src/instrumentation-node.ts +15 -0
  98. package/apps/agents-server/src/languages/ServerTranslationKeys.ts +1 -0
  99. package/apps/agents-server/src/languages/translations/czech.yaml +1 -0
  100. package/apps/agents-server/src/languages/translations/english.yaml +1 -0
  101. package/apps/agents-server/src/search/createDefaultServerSearchProviders/loadLocalOrganizationSearchDataset.ts +12 -1
  102. package/apps/agents-server/src/tools/send_email.ts +1 -2
  103. package/apps/agents-server/src/{components/Homepage → utils/agentOrganization}/hiddenFolders.ts +49 -29
  104. package/apps/agents-server/src/utils/agentOrganization/loadAgentOrganizationState.ts +13 -1
  105. package/apps/agents-server/src/utils/backup/createServerBackupZipStream.ts +7 -1382
  106. package/apps/agents-server/src/utils/backup/serverBackup/appendAgentBackupEntriesToZip.ts +27 -0
  107. package/apps/agents-server/src/utils/backup/serverBackup/appendConversationBackupEntriesToZip.ts +140 -0
  108. package/apps/agents-server/src/utils/backup/serverBackup/appendFileBackupEntriesToZip.ts +147 -0
  109. package/apps/agents-server/src/utils/backup/serverBackup/appendMessageBackupEntriesToZip.ts +65 -0
  110. package/apps/agents-server/src/utils/backup/serverBackup/appendMetadataBackupEntriesToZip.ts +39 -0
  111. package/apps/agents-server/src/utils/backup/serverBackup/appendSectionEntriesToZip.ts +92 -0
  112. package/apps/agents-server/src/utils/backup/serverBackup/appendUserBackupEntriesToZip.ts +80 -0
  113. package/apps/agents-server/src/utils/backup/serverBackup/createRedactedWalletBackupRecord.ts +34 -0
  114. package/apps/agents-server/src/utils/backup/serverBackup/createServerBackupManifest.ts +82 -0
  115. package/apps/agents-server/src/utils/backup/serverBackup/downloadBackupBinaryContent.ts +39 -0
  116. package/apps/agents-server/src/utils/backup/serverBackup/resolveFeedbackThreadMessages.ts +53 -0
  117. package/apps/agents-server/src/utils/backup/serverBackup/serverBackupAttachments.ts +151 -0
  118. package/apps/agents-server/src/utils/backup/serverBackup/serverBackupContext.ts +167 -0
  119. package/apps/agents-server/src/utils/backup/serverBackup/serverBackupFilenames.ts +161 -0
  120. package/apps/agents-server/src/utils/backup/serverBackup/serverBackupPreviews.ts +97 -0
  121. package/apps/agents-server/src/utils/backup/serverBackup/serverBackupRowUtilities.ts +158 -0
  122. package/apps/agents-server/src/utils/backup/serverBackup/serverBackupTypes.ts +59 -0
  123. package/apps/agents-server/src/utils/chat/createAttachmentAwareCitationLabelResolver.ts +147 -0
  124. package/apps/agents-server/src/utils/chatTasksAdmin.ts +4 -1
  125. package/apps/agents-server/src/utils/createLocalAgentSourceImporter.ts +159 -0
  126. package/apps/agents-server/src/utils/createMissingImportedAgentFallback.ts +60 -0
  127. package/apps/agents-server/src/utils/createPagePreviewBrowserStream.ts +179 -0
  128. package/apps/agents-server/src/utils/customDomainRouting.ts +157 -12
  129. package/apps/agents-server/src/utils/externalChatRunner/processExternalUserChatJob.ts +12 -6
  130. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/GetAdminChatTasksData.ts +12 -0
  131. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/adminChatTaskSqlQuery.ts +264 -0
  132. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/adminChatTaskSqlValues.ts +35 -0
  133. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/adminChatTaskTimeUtilities.ts +30 -0
  134. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/compareAdminChatTasks.ts +135 -0
  135. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/createAdminChatTaskCounters.ts +29 -0
  136. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/filterAdminChatTasks.ts +78 -0
  137. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/getAdminChatTasksViaClientSql.ts +62 -0
  138. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/getAdminChatTasksViaSupabaseQuery.ts +29 -0
  139. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/loadAdminChatTaskFallbackData.ts +193 -0
  140. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskFallbackRows.ts +99 -0
  141. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskSqlRows.ts +94 -0
  142. package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks.ts +4 -947
  143. package/apps/agents-server/src/utils/getAdminChatTasksResponse/mapVpsSelfUpdateJobToAdminChatTask.ts +97 -0
  144. package/apps/agents-server/src/utils/getAdminChatTasksResponse.ts +258 -6
  145. package/apps/agents-server/src/utils/importAgentWithFallback.ts +1 -58
  146. package/apps/agents-server/src/utils/localAgentRouteReferences.ts +167 -0
  147. package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +21 -6
  148. package/apps/agents-server/src/utils/managementApi/managementApiAgents.ts +17 -3
  149. package/apps/agents-server/src/utils/messages/sendMessage.ts +5 -3
  150. package/apps/agents-server/src/utils/pagePreviewBrowserSessions.ts +246 -0
  151. package/apps/agents-server/src/utils/resolveAgentStateFromSource.ts +7 -1
  152. package/apps/agents-server/src/utils/resolveInheritedAgentSource.ts +54 -5
  153. package/apps/agents-server/src/utils/resolveServerAgentContext.ts +12 -1
  154. package/apps/agents-server/src/utils/resolveStoredAgentState.ts +2 -1
  155. package/apps/agents-server/src/utils/resourceMonitor/formatResourceMonitorValue.ts +50 -0
  156. package/apps/agents-server/src/utils/resourceMonitor/readCpuResourceUsage.ts +75 -0
  157. package/apps/agents-server/src/utils/resourceMonitor/readDiskResourceUsage.ts +42 -0
  158. package/apps/agents-server/src/utils/resourceMonitor/readMemoryResourceUsage.ts +28 -0
  159. package/apps/agents-server/src/utils/resourceMonitor/readNetworkResourceUsage.ts +271 -0
  160. package/apps/agents-server/src/utils/resourceMonitor/readServerResourceMonitorSnapshot.ts +47 -0
  161. package/apps/agents-server/src/utils/resourceMonitor/resolveServerResourceWarningStatus.ts +72 -0
  162. package/apps/agents-server/src/utils/resourceMonitor/resourceMonitorConstants.ts +29 -0
  163. package/apps/agents-server/src/utils/resourceMonitor/resourceMonitorTypes.ts +155 -0
  164. package/apps/agents-server/src/utils/resourceMonitor/waitForResourceMonitorSample.ts +11 -0
  165. package/apps/agents-server/src/utils/shibbolethAuthentication/createShibbolethSamlClient.ts +35 -0
  166. package/apps/agents-server/src/utils/shibbolethAuthentication/createShibbolethServiceProviderMetadataXml.ts +25 -0
  167. package/apps/agents-server/src/utils/shibbolethAuthentication/extractShibbolethProfileAttributes.ts +173 -0
  168. package/apps/agents-server/src/utils/shibbolethAuthentication/fetchIdentityProviderMetadataXml.ts +21 -0
  169. package/apps/agents-server/src/utils/shibbolethAuthentication/findOrCreateShibbolethUser.ts +323 -0
  170. package/apps/agents-server/src/utils/shibbolethAuthentication/getShibbolethAuthenticationAttemptTableName.ts +13 -0
  171. package/apps/agents-server/src/utils/shibbolethAuthentication/getShibbolethRequestDetails.ts +19 -0
  172. package/apps/agents-server/src/utils/shibbolethAuthentication/getShibbolethUserIdentityTableName.ts +13 -0
  173. package/apps/agents-server/src/utils/shibbolethAuthentication/parseIdentityProviderMetadataXml.ts +110 -0
  174. package/apps/agents-server/src/utils/shibbolethAuthentication/recordShibbolethAuthenticationAttempt.ts +57 -0
  175. package/apps/agents-server/src/utils/shibbolethAuthentication/resolveShibbolethAuthenticationConfiguration.ts +78 -0
  176. package/apps/agents-server/src/utils/shibbolethAuthentication/resolveShibbolethPublicRequestUrl.ts +101 -0
  177. package/apps/agents-server/src/utils/shibbolethAuthentication/resolveShibbolethServiceProviderUrls.ts +63 -0
  178. package/apps/agents-server/src/utils/shibbolethAuthentication/sanitizeShibbolethRelayState.ts +17 -0
  179. package/apps/agents-server/src/utils/shibbolethAuthentication/shibbolethAuthenticationConstants.ts +62 -0
  180. package/apps/agents-server/src/utils/shibbolethAuthentication/shibbolethAuthenticationTypes.ts +105 -0
  181. package/apps/agents-server/src/utils/shibbolethAuthentication.ts +25 -957
  182. package/apps/agents-server/src/utils/speech-to-text/SpeechToTextFailoverRecognition/SpeechToTextFailoverRecognitionProviderRuntime.ts +0 -1
  183. package/apps/agents-server/src/utils/speech-to-text/SpeechToTextFailoverRecognition.ts +34 -2
  184. package/apps/agents-server/src/utils/taskTerminal/resolveAdminTaskTerminalSession.ts +512 -0
  185. package/apps/agents-server/src/utils/taskTerminal/runWithTaskTerminalCapture.ts +134 -0
  186. package/apps/agents-server/src/utils/taskTerminal/taskTerminalLog.ts +360 -0
  187. package/apps/agents-server/src/utils/userChat/finalizeUserChatJob.ts +16 -0
  188. package/apps/agents-server/src/utils/userChat/userChatMessageLifecycle.ts +39 -9
  189. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/updateUserChatTimeoutTerminalState.ts +3 -0
  190. package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutWorker.ts +4 -1
  191. package/apps/agents-server/src/utils/vpsConfiguration.ts +4 -0
  192. package/apps/agents-server/src/utils/vpsSelfUpdate/deleteVpsSelfUpdateInstalledVersion.ts +81 -0
  193. package/apps/agents-server/src/utils/vpsSelfUpdate/listVpsSelfUpdateCandidateCommits.ts +217 -0
  194. package/apps/agents-server/src/utils/vpsSelfUpdate/readPersistedVpsSelfUpdateJob.ts +310 -0
  195. package/apps/agents-server/src/utils/vpsSelfUpdate/readVpsSelfUpdateOverview.ts +178 -0
  196. package/apps/agents-server/src/utils/vpsSelfUpdate/resolveVpsSelfUpdateJobForOverview.ts +42 -0
  197. package/apps/agents-server/src/utils/vpsSelfUpdate/startVpsSelfUpdate.ts +201 -0
  198. package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateAutomaticConfiguration.ts +152 -0
  199. package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateConfiguration.ts +81 -0
  200. package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateCron.ts +357 -0
  201. package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateEnvironment.ts +120 -0
  202. package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateInstalledVersions.ts +162 -0
  203. package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateJobConstants.ts +15 -0
  204. package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateJobHistory.ts +387 -0
  205. package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateJobIdentity.ts +26 -0
  206. package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateOriginRepository.ts +90 -0
  207. package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateRepository.ts +286 -0
  208. package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateScheduler.ts +191 -0
  209. package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateStateFiles.ts +197 -0
  210. package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateTypes.ts +452 -0
  211. package/apps/agents-server/src/utils/vpsSelfUpdate.ts +66 -1535
  212. package/apps/agents-server/tests/e2e/support/ChatHistoryNavigationSupport.ts +5 -0
  213. package/esm/apps/agents-server/src/database/migratePrefix.d.ts +19 -0
  214. package/esm/apps/agents-server/src/database/runDatabaseMigrations.d.ts +4 -0
  215. package/esm/book/scripts/import-markdown/increaseHeadings.d.ts +8 -0
  216. package/esm/index.es.js +28592 -27063
  217. package/esm/index.es.js.map +1 -1
  218. package/esm/scripts/find-refactor-candidates/find-refactor-candidates.d.ts +7 -0
  219. package/esm/scripts/find-refactor-candidates/selectMostImportantRefactorCandidates.d.ts +12 -0
  220. package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages/MultipleAgentAutoPuller.d.ts +27 -0
  221. package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages/MultipleAgentGithubSynchronizer.d.ts +26 -0
  222. package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages/MultipleAgentRunUiPresenter.d.ts +66 -0
  223. package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages/RunMultipleAgentMessageTaskScheduler.d.ts +67 -0
  224. package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages/formatProjectPath.d.ts +6 -0
  225. package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages/loadLocalAgentRunnerProjectSummaries.d.ts +11 -0
  226. package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages/wait.d.ts +6 -0
  227. package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages.d.ts +1 -1
  228. package/esm/scripts/run-codex-prompts/common/buildCoderRunProgressSnapshot.d.ts +1 -1
  229. package/esm/scripts/run-codex-prompts/common/cliProgressDisplay.d.ts +2 -1
  230. package/esm/scripts/run-codex-prompts/common/resolveCoderAgent.d.ts +20 -0
  231. package/esm/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +4 -0
  232. package/esm/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeSessionResurrection.d.ts +37 -0
  233. package/esm/scripts/run-codex-prompts/runners/claude-code/parseClaudeCodeOutputEvents.d.ts +47 -0
  234. package/esm/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +8 -1
  235. package/esm/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +54 -0
  236. package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +10 -0
  237. package/esm/scripts/run-codex-prompts/ui/coderRunUiRefresh.d.ts +2 -2
  238. package/esm/src/_packages/types.index.d.ts +2 -2
  239. package/esm/src/avatars/renderAvatarVisualAsciiArt.d.ts +98 -0
  240. package/esm/src/avatars/visuals/octopus3dAvatarVisualShared.d.ts +1 -1
  241. package/esm/src/book-components/BookEditor/BookEditorMonacoUploadPanel.d.ts +1 -1
  242. package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/bookEditorMonacoUploadTypes.d.ts +120 -0
  243. package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/clearScheduledTimer.d.ts +6 -0
  244. package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/enqueueFilesForUpload.d.ts +26 -0
  245. package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadEditorSync.d.ts +23 -0
  246. package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadItemsState.d.ts +21 -0
  247. package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadProgressQueue.d.ts +12 -0
  248. package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadQueue.d.ts +27 -0
  249. package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads/useCompletedUploadsAutoClear.d.ts +12 -0
  250. package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads.d.ts +5 -58
  251. package/esm/src/book-components/Chat/Chat/ChatImageAttachmentModal.d.ts +25 -0
  252. package/esm/src/book-components/Chat/Chat/ChatInputArea.d.ts +3 -0
  253. package/esm/src/book-components/Chat/Chat/ChatMessageAttachments.d.ts +27 -0
  254. package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -1
  255. package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +1 -0
  256. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +8 -0
  257. package/esm/src/book-components/Chat/Chat/CitationIframePreview.d.ts +2 -2
  258. package/esm/src/book-components/Chat/Chat/CitationIframePreview.test.d.ts +2 -0
  259. package/esm/src/book-components/Chat/Chat/insertDictationChunk.d.ts +1 -1
  260. package/esm/src/book-components/Chat/Chat/insertDictationChunk.test.d.ts +1 -0
  261. package/esm/src/book-components/Chat/Chat/learnDictationDictionary.test.d.ts +1 -0
  262. package/esm/src/book-components/Chat/Chat/refineFinalDictationChunk.test.d.ts +1 -0
  263. package/esm/src/book-components/Chat/Chat/useChatInputAreaComposer.d.ts +12 -0
  264. package/esm/src/book-components/Chat/Chat/useChatInputAreaComposer.draftMessage.test.d.ts +2 -0
  265. package/esm/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +1 -1
  266. package/esm/src/book-components/Chat/utils/parseMessageButtons.d.ts +16 -2
  267. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_BUILD_CACHE_FILENAME.d.ts +6 -0
  268. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_BUILD_CACHE_VERSION.d.ts +6 -0
  269. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_NEXT_BUILD_ID_FILENAME.d.ts +6 -0
  270. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/AgentsServerBuildCache.d.ts +10 -0
  271. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/AgentsServerBuildCacheOptions.d.ts +10 -0
  272. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/NODE_MODULES_DIRECTORY_NAME.d.ts +6 -0
  273. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/PreparedAgentsServerRuntime.d.ts +18 -0
  274. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerBuildSourceFingerprint.d.ts +6 -0
  275. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +28 -0
  276. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/ensureAgentsServerBuild.d.ts +19 -0
  277. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/getAgentsServerBuildInputRelativePaths.d.ts +11 -0
  278. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerAppPath.d.ts +6 -0
  279. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerAppPathMaterialized.d.ts +6 -0
  280. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerBuildCacheCurrent.d.ts +7 -0
  281. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerBuildInputTestFile.d.ts +6 -0
  282. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerBuildInputDirectoryName.d.ts +6 -0
  283. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerBuildInputPath.d.ts +6 -0
  284. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerRuntimeSourcePath.d.ts +6 -0
  285. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isFile.d.ts +6 -0
  286. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/isPathInsideNodeModules.d.ts +6 -0
  287. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/normalizeAgentsServerBuildInputPath.d.ts +6 -0
  288. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/prepareAgentsServerRuntime.d.ts +9 -0
  289. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/readAgentsServerBuildCache.d.ts +8 -0
  290. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerAppPath.d.ts +6 -0
  291. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerBuildAppPath.d.ts +9 -0
  292. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerBuildOutputPath.d.ts +7 -0
  293. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/resolveNextCliPath.d.ts +6 -0
  294. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/resolveNodeModulesPath.d.ts +6 -0
  295. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/runNextBuild.d.ts +12 -0
  296. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/shouldCopyAgentsServerRuntimePath.d.ts +6 -0
  297. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/synchronizeMaterializedAgentsServerRuntime.d.ts +11 -0
  298. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/writeAgentsServerBuildCache.d.ts +7 -0
  299. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +8 -109
  300. package/esm/src/cli/cli-commands/agents-server/ensureAgentsServerEnvFile.d.ts +1 -1
  301. package/esm/src/cli/cli-commands/agents-server/ensureAgentsServerGitignoreFile.d.ts +1 -1
  302. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.d.ts +16 -0
  303. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerLogStreams.d.ts +30 -0
  304. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerRuntimePaths.d.ts +19 -0
  305. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerSupervisorState.d.ts +37 -0
  306. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/LocalAgentRunnerLimits.d.ts +9 -0
  307. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/PreparedAgentsServerLaunch.d.ts +13 -0
  308. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/StartAgentsServerOptions.d.ts +24 -0
  309. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/createInternalRouteErrorMessage.d.ts +6 -0
  310. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/createLocalAgentRunOptions.d.ts +9 -0
  311. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/forwardChildOutput.d.ts +13 -0
  312. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/loadAgentsServerProjectEnvironment.d.ts +6 -0
  313. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/prepareAgentsServerLaunch.d.ts +18 -0
  314. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/readInternalRouteErrorDetails.d.ts +6 -0
  315. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/resolveAgentsServerChildHostname.d.ts +7 -0
  316. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/startNextServer.d.ts +20 -0
  317. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/startUserChatJobWorkerPump.d.ts +15 -0
  318. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/stopChildProcess.d.ts +8 -0
  319. package/esm/src/cli/cli-commands/agents-server/startAgentsServer/waitForLocalAgentRunnerLimits.d.ts +16 -0
  320. package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +3 -30
  321. package/esm/src/cli/cli-commands/common/createPositiveIntegerOptionParser.d.ts +10 -0
  322. package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +1 -1
  323. package/esm/src/collection/agent-collection/CreateAgentInput.d.ts +1 -1
  324. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +1 -1
  325. package/esm/src/commitments/META/META.d.ts +2 -2
  326. package/esm/src/commitments/META_AVATAR/META_AVATAR.d.ts +9 -4
  327. package/esm/src/commitments/index.d.ts +1 -1
  328. package/esm/src/conversion/validation/validatePipeline/createPipelineValidationContext.d.ts +16 -0
  329. package/esm/src/conversion/validation/validatePipeline/validatePipelineCollectionsStructure.d.ts +7 -0
  330. package/esm/src/conversion/validation/validatePipeline/validatePipelineDependencyResolution.d.ts +7 -0
  331. package/esm/src/conversion/validation/validatePipeline/validatePipelineMetadata.d.ts +7 -0
  332. package/esm/src/conversion/validation/validatePipeline/validatePipelineParameters.d.ts +7 -0
  333. package/esm/src/conversion/validation/validatePipeline/validatePipelineTasks.d.ts +7 -0
  334. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/RegisteredLlmToolsMessageContext.d.ts +46 -0
  335. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/USED_ENV_FILENAME.d.ts +11 -0
  336. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolConfigurationStatusMessage.d.ts +7 -0
  337. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolEntryKey.d.ts +7 -0
  338. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolInstallationStatusMessage.d.ts +7 -0
  339. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolStatus.d.ts +14 -0
  340. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolsMessageContext.d.ts +7 -0
  341. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/getAvailableRegisteredLlmToolsEnvironmentVariables.d.ts +7 -0
  342. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/getRegisteredLlmToolRegisters.d.ts +7 -0
  343. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/hasRegisteredLlmToolEntry.d.ts +7 -0
  344. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/listRegisteredLlmToolEntries.d.ts +9 -0
  345. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/listRegisteredLlmToolStatuses.d.ts +7 -0
  346. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderAvailableRegisteredLlmTools.d.ts +7 -0
  347. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderNoRegisteredLlmToolsMessage.d.ts +7 -0
  348. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderRegisteredLlmToolsMessage.d.ts +8 -0
  349. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderRelevantRegisteredLlmToolsEnvironmentVariables.d.ts +7 -0
  350. package/esm/src/utils/agent-message-runtime/agentMessageRuntimePaths.d.ts +24 -0
  351. package/esm/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +2 -2
  352. package/esm/src/utils/ascii-art/$detectTerminalAnsiColorDepth.d.ts +15 -0
  353. package/esm/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +80 -0
  354. package/esm/src/utils/color/Color.d.ts +1 -1
  355. package/esm/src/version.d.ts +1 -1
  356. package/package.json +1 -1
  357. package/src/_packages/types.index.ts +2 -2
  358. package/src/avatars/Avatar.tsx +2 -13
  359. package/src/avatars/avatarAnimationScheduler.ts +2 -1
  360. package/src/avatars/renderAvatarVisual.ts +2 -13
  361. package/src/avatars/renderAvatarVisualAsciiArt.ts +257 -0
  362. package/src/avatars/visuals/asciiOctopusAvatarVisual.ts +1 -6
  363. package/src/avatars/visuals/avatarVisualRegistry.ts +1 -1
  364. package/src/avatars/visuals/minecraft2AvatarVisual.ts +1 -2
  365. package/src/avatars/visuals/octopus2AvatarVisual.ts +1 -5
  366. package/src/avatars/visuals/octopus3AvatarVisual.ts +1 -8
  367. package/src/avatars/visuals/octopus3d2AvatarVisual.ts +4 -13
  368. package/src/avatars/visuals/octopus3d3AvatarVisual.ts +10 -15
  369. package/src/avatars/visuals/octopus3d4AvatarVisual.ts +18 -31
  370. package/src/avatars/visuals/octopus3dAvatarVisual.ts +3 -3
  371. package/src/avatars/visuals/octopus3dAvatarVisualShared.ts +2 -7
  372. package/src/book-2.0/agent-source/parseAgentSource/applyMetaCommitment.ts +2 -1
  373. package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +3 -5
  374. package/src/book-3.0/CliAgent.ts +1 -7
  375. package/src/book-3.0/LiteAgent.ts +5 -5
  376. package/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.tsx +1 -4
  377. package/src/book-components/BookEditor/BookEditor.tsx +2 -2
  378. package/src/book-components/BookEditor/BookEditorAboutPromptbookInformation.tsx +3 -2
  379. package/src/book-components/BookEditor/BookEditorActionbar.tsx +1 -1
  380. package/src/book-components/BookEditor/BookEditorMonaco.tsx +2 -2
  381. package/src/book-components/BookEditor/BookEditorMonacoUploadPanel.tsx +1 -1
  382. package/src/book-components/BookEditor/useBookEditorMonacoLanguage.ts +1 -1
  383. package/src/book-components/BookEditor/useBookEditorMonacoStyles.ts +1 -1
  384. package/src/book-components/BookEditor/useBookEditorMonacoUploads/bookEditorMonacoUploadTypes.ts +147 -0
  385. package/src/book-components/BookEditor/useBookEditorMonacoUploads/clearScheduledTimer.ts +10 -0
  386. package/src/book-components/BookEditor/useBookEditorMonacoUploads/enqueueFilesForUpload.ts +209 -0
  387. package/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadEditorSync.ts +164 -0
  388. package/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadItemsState.ts +121 -0
  389. package/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadProgressQueue.ts +81 -0
  390. package/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadQueue.ts +360 -0
  391. package/src/book-components/BookEditor/useBookEditorMonacoUploads/useCompletedUploadsAutoClear.ts +47 -0
  392. package/src/book-components/BookEditor/useBookEditorMonacoUploads.ts +10 -1067
  393. package/src/book-components/Chat/Chat/Chat.module.css +196 -0
  394. package/src/book-components/Chat/Chat/Chat.tsx +16 -1
  395. package/src/book-components/Chat/Chat/ChatCitationModal.tsx +2 -2
  396. package/src/book-components/Chat/Chat/ChatImageAttachmentModal.tsx +108 -0
  397. package/src/book-components/Chat/Chat/ChatInputArea.tsx +43 -27
  398. package/src/book-components/Chat/Chat/ChatMessageAttachments.tsx +212 -0
  399. package/src/book-components/Chat/Chat/ChatMessageItem.tsx +32 -18
  400. package/src/book-components/Chat/Chat/ChatMessageList.tsx +3 -0
  401. package/src/book-components/Chat/Chat/ChatProps.tsx +9 -0
  402. package/src/book-components/Chat/Chat/CitationIframePreview.tsx +138 -11
  403. package/src/book-components/Chat/Chat/createProgressCardChecklistMarkdown.ts +1 -8
  404. package/src/book-components/Chat/Chat/insertDictationChunk.ts +3 -3
  405. package/src/book-components/Chat/Chat/learnDictationDictionary.ts +1 -1
  406. package/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.tsx +1 -5
  407. package/src/book-components/Chat/Chat/useChatInputAreaComposer.ts +59 -7
  408. package/src/book-components/Chat/Chat/useChatInputAreaDictation.ts +140 -33
  409. package/src/book-components/Chat/Chat/useChatToolCallModalState.ts +1 -4
  410. package/src/book-components/Chat/hooks/useChatRatings.ts +1 -1
  411. package/src/book-components/Chat/save/html/htmlSaveFormatDefinition.ts +2 -3
  412. package/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.ts +2 -2
  413. package/src/book-components/Chat/save/pdf/buildChatPdf.ts +1 -1
  414. package/src/book-components/Chat/utils/getToolCallChipletInfo.ts +1 -5
  415. package/src/book-components/Chat/utils/isVisibleChatToolCall.ts +2 -1
  416. package/src/book-components/Chat/utils/parseMessageButtons.ts +27 -2
  417. package/src/cli/cli-commands/about.ts +1 -1
  418. package/src/cli/cli-commands/agent/agentCliOptions.ts +2 -5
  419. package/src/cli/cli-commands/agent-folder/agentProjectPaths.ts +6 -12
  420. package/src/cli/cli-commands/agent-folder/init.ts +3 -8
  421. package/src/cli/cli-commands/agent-folder/initializeAgentProjectConfiguration.ts +2 -11
  422. package/src/cli/cli-commands/agent-folder/printAgentInitializationSummary.ts +2 -9
  423. package/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_BUILD_CACHE_FILENAME.ts +6 -0
  424. package/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_BUILD_CACHE_VERSION.ts +6 -0
  425. package/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_NEXT_BUILD_ID_FILENAME.ts +6 -0
  426. package/src/cli/cli-commands/agents-server/buildAgentsServer/AgentsServerBuildCache.ts +11 -0
  427. package/src/cli/cli-commands/agents-server/buildAgentsServer/AgentsServerBuildCacheOptions.ts +9 -0
  428. package/src/cli/cli-commands/agents-server/buildAgentsServer/NODE_MODULES_DIRECTORY_NAME.ts +6 -0
  429. package/src/cli/cli-commands/agents-server/buildAgentsServer/PreparedAgentsServerRuntime.ts +19 -0
  430. package/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerBuildSourceFingerprint.ts +71 -0
  431. package/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.ts +69 -0
  432. package/src/cli/cli-commands/agents-server/buildAgentsServer/ensureAgentsServerBuild.ts +59 -0
  433. package/src/cli/cli-commands/agents-server/buildAgentsServer/getAgentsServerBuildInputRelativePaths.ts +23 -0
  434. package/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerAppPath.ts +20 -0
  435. package/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerAppPathMaterialized.ts +17 -0
  436. package/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerBuildCacheCurrent.ts +27 -0
  437. package/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerBuildInputTestFile.ts +21 -0
  438. package/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerBuildInputDirectoryName.ts +22 -0
  439. package/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerBuildInputPath.ts +30 -0
  440. package/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerRuntimeSourcePath.ts +41 -0
  441. package/src/cli/cli-commands/agents-server/buildAgentsServer/isFile.ts +14 -0
  442. package/src/cli/cli-commands/agents-server/buildAgentsServer/isPathInsideNodeModules.ts +10 -0
  443. package/src/cli/cli-commands/agents-server/buildAgentsServer/normalizeAgentsServerBuildInputPath.ts +10 -0
  444. package/src/cli/cli-commands/agents-server/buildAgentsServer/prepareAgentsServerRuntime.ts +31 -0
  445. package/src/cli/cli-commands/agents-server/buildAgentsServer/readAgentsServerBuildCache.ts +35 -0
  446. package/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerAppPath.ts +33 -0
  447. package/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerBuildAppPath.ts +30 -0
  448. package/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerBuildOutputPath.ts +19 -0
  449. package/src/cli/cli-commands/agents-server/buildAgentsServer/resolveNextCliPath.ts +21 -0
  450. package/src/cli/cli-commands/agents-server/buildAgentsServer/resolveNodeModulesPath.ts +19 -0
  451. package/src/cli/cli-commands/agents-server/buildAgentsServer/runNextBuild.ts +184 -0
  452. package/src/cli/cli-commands/agents-server/buildAgentsServer/shouldCopyAgentsServerRuntimePath.ts +48 -0
  453. package/src/cli/cli-commands/agents-server/buildAgentsServer/synchronizeMaterializedAgentsServerRuntime.ts +179 -0
  454. package/src/cli/cli-commands/agents-server/buildAgentsServer/writeAgentsServerBuildCache.ts +28 -0
  455. package/src/cli/cli-commands/agents-server/buildAgentsServer.ts +22 -1043
  456. package/src/cli/cli-commands/agents-server/ensureAgentsServerEnvFile.ts +2 -1
  457. package/src/cli/cli-commands/agents-server/ensureAgentsServerGitignoreFile.ts +2 -1
  458. package/src/cli/cli-commands/agents-server/run.ts +2 -5
  459. package/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.ts +67 -0
  460. package/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerLogStreams.ts +43 -0
  461. package/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerRuntimePaths.ts +44 -0
  462. package/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerSupervisorState.ts +59 -0
  463. package/src/cli/cli-commands/agents-server/startAgentsServer/LocalAgentRunnerLimits.ts +9 -0
  464. package/src/cli/cli-commands/agents-server/startAgentsServer/PreparedAgentsServerLaunch.ts +14 -0
  465. package/src/cli/cli-commands/agents-server/startAgentsServer/StartAgentsServerOptions.ts +26 -0
  466. package/src/cli/cli-commands/agents-server/startAgentsServer/createInternalRouteErrorMessage.ts +15 -0
  467. package/src/cli/cli-commands/agents-server/startAgentsServer/createLocalAgentRunOptions.ts +29 -0
  468. package/src/cli/cli-commands/agents-server/startAgentsServer/forwardChildOutput.ts +32 -0
  469. package/src/cli/cli-commands/agents-server/startAgentsServer/loadAgentsServerProjectEnvironment.ts +18 -0
  470. package/src/cli/cli-commands/agents-server/startAgentsServer/prepareAgentsServerLaunch.ts +81 -0
  471. package/src/cli/cli-commands/agents-server/startAgentsServer/readInternalRouteErrorDetails.ts +52 -0
  472. package/src/cli/cli-commands/agents-server/startAgentsServer/resolveAgentsServerChildHostname.ts +17 -0
  473. package/src/cli/cli-commands/agents-server/startAgentsServer/startNextServer.ts +97 -0
  474. package/src/cli/cli-commands/agents-server/startAgentsServer/startUserChatJobWorkerPump.ts +132 -0
  475. package/src/cli/cli-commands/agents-server/startAgentsServer/stopChildProcess.ts +14 -0
  476. package/src/cli/cli-commands/agents-server/startAgentsServer/waitForLocalAgentRunnerLimits.ts +132 -0
  477. package/src/cli/cli-commands/agents-server/startAgentsServer.ts +24 -797
  478. package/src/cli/cli-commands/agents-server.ts +2 -6
  479. package/src/cli/cli-commands/coder/agentCodingFile.ts +1 -7
  480. package/src/cli/cli-commands/coder/boilerplateTemplates.ts +14 -21
  481. package/src/cli/cli-commands/coder/find-refactor-candidates.ts +9 -2
  482. package/src/cli/cli-commands/coder/generate-boilerplates.ts +2 -6
  483. package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +2 -10
  484. package/src/cli/cli-commands/coder/run.ts +3 -27
  485. package/src/cli/cli-commands/coder/server.ts +4 -2
  486. package/src/cli/cli-commands/common/createPositiveIntegerOptionParser.ts +31 -0
  487. package/src/cli/cli-commands/common/promptRunnerCliOptions.ts +3 -8
  488. package/src/cli/cli-commands/make.ts +1 -1
  489. package/src/cli/cli-commands/run/runCommandAction.ts +1 -1
  490. package/src/cli/promptbookCli.ts +28 -3
  491. package/src/collection/agent-collection/CreateAgentInput.ts +2 -5
  492. package/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.ts +1 -1
  493. package/src/commitments/MEMORY/createMemoryToolFunctions.ts +1 -10
  494. package/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.ts +1 -10
  495. package/src/commitments/MEMORY/parseMemoryToolArgs.ts +1 -6
  496. package/src/commitments/META/META.ts +4 -4
  497. package/src/commitments/META_AVATAR/META_AVATAR.ts +16 -10
  498. package/src/commitments/TEAM/TEAM.ts +5 -5
  499. package/src/commitments/USE_CALENDAR/createUseCalendarToolFunctions.ts +1 -4
  500. package/src/commitments/USE_PROJECT/createUseProjectToolFunctions.ts +2 -10
  501. package/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.ts +1 -11
  502. package/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.ts +1 -6
  503. package/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.ts +1 -6
  504. package/src/commitments/WALLET/createWalletToolFunctions.ts +2 -11
  505. package/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.ts +1 -6
  506. package/src/commitments/WALLET/parseWalletToolArgs.ts +1 -10
  507. package/src/commitments/index.ts +1 -0
  508. package/src/conversion/parsePipeline/applyPipelineHead.ts +1 -1
  509. package/src/conversion/parsePipeline/createUniqueSectionNameResolver.ts +1 -1
  510. package/src/conversion/parsePipeline/processPipelineSection.ts +1 -1
  511. package/src/conversion/validation/validatePipeline/createPipelineValidationContext.ts +43 -0
  512. package/src/conversion/validation/validatePipeline/validatePipelineCollectionsStructure.ts +72 -0
  513. package/src/conversion/validation/validatePipeline/validatePipelineDependencyResolution.ts +220 -0
  514. package/src/conversion/validation/validatePipeline/validatePipelineMetadata.ts +66 -0
  515. package/src/conversion/validation/validatePipeline/validatePipelineParameters.ts +136 -0
  516. package/src/conversion/validation/validatePipeline/validatePipelineTasks.ts +243 -0
  517. package/src/conversion/validation/validatePipeline.ts +7 -750
  518. package/src/execution/LlmExecutionTools.ts +1 -6
  519. package/src/execution/createPipelineExecutor/getReservedParametersForTask.ts +1 -5
  520. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/RegisteredLlmToolsMessageContext.ts +51 -0
  521. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/USED_ENV_FILENAME.ts +30 -0
  522. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolConfigurationStatusMessage.ts +62 -0
  523. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolEntryKey.ts +10 -0
  524. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolInstallationStatusMessage.ts +75 -0
  525. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolStatus.ts +101 -0
  526. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolsMessageContext.ts +24 -0
  527. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/getAvailableRegisteredLlmToolsEnvironmentVariables.ts +17 -0
  528. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/getRegisteredLlmToolRegisters.ts +15 -0
  529. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/hasRegisteredLlmToolEntry.ts +19 -0
  530. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/listRegisteredLlmToolEntries.ts +44 -0
  531. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/listRegisteredLlmToolStatuses.ts +21 -0
  532. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderAvailableRegisteredLlmTools.ts +97 -0
  533. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderNoRegisteredLlmToolsMessage.ts +17 -0
  534. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderRegisteredLlmToolsMessage.ts +30 -0
  535. package/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderRelevantRegisteredLlmToolsEnvironmentVariables.ts +32 -0
  536. package/src/llm-providers/_common/register/$registeredLlmToolsMessage.ts +5 -568
  537. package/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.ts +1 -6
  538. package/src/llm-providers/openai/OpenAiAgentKitExecutionTools.ts +2 -2
  539. package/src/llm-providers/openai/OpenAiAssistantExecutionTools.ts +1 -1
  540. package/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.ts +2 -2
  541. package/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.ts +1 -1
  542. package/src/llm-providers/openai/OpenAiCompatibleExecutionTools.ts +2 -7
  543. package/src/llm-providers/openai/utils/OpenAiCompatibleChatPromptBuilder.ts +1 -1
  544. package/src/llm-providers/openai/utils/OpenAiCompatibleChatToolCaller.ts +2 -2
  545. package/src/llm-providers/openai/utils/OpenAiCompatibleUnsupportedParameterRetrier.ts +1 -5
  546. package/src/llm-providers/openai/utils/buildToolInvocationScript.ts +1 -6
  547. package/src/other/templates/getTemplatesPipelineCollection.ts +889 -773
  548. package/src/remote-server/startRemoteServer/registerExecutionRoutes.ts +1 -1
  549. package/src/remote-server/startRemoteServer/registerServerIndexRoute.ts +1 -1
  550. package/src/scrapers/_common/utils/makeKnowledgeSourceHandler.ts +1 -6
  551. package/src/speech-recognition/OpenAiSpeechRecognition.ts +1 -6
  552. package/src/transpilers/_common/prepareSdkTranspilerContext.ts +1 -4
  553. package/src/types/Prompt.ts +1 -7
  554. package/src/types/string_host.ts +1 -9
  555. package/src/types/string_pipeline_url.ts +1 -4
  556. package/src/utils/agent-message-runtime/agentMessageRuntimePaths.ts +66 -0
  557. package/src/utils/agents/resolveAgentAvatarImageUrl.ts +2 -2
  558. package/src/utils/ascii-art/$detectTerminalAnsiColorDepth.ts +45 -0
  559. package/src/utils/ascii-art/convertImageDataToAsciiArt.ts +396 -0
  560. package/src/utils/color/Color.ts +2 -2
  561. package/src/utils/markdown/parseMarkdownSection.ts +1 -5
  562. package/src/utils/random/$randomFullnameWithColor.ts +1 -6
  563. package/src/version.ts +2 -2
  564. package/src/versions.txt +7 -0
  565. package/umd/apps/agents-server/src/database/migratePrefix.d.ts +19 -0
  566. package/umd/apps/agents-server/src/database/runDatabaseMigrations.d.ts +4 -0
  567. package/umd/book/scripts/import-markdown/increaseHeadings.d.ts +8 -0
  568. package/umd/index.umd.js +28594 -27065
  569. package/umd/index.umd.js.map +1 -1
  570. package/umd/scripts/find-refactor-candidates/find-refactor-candidates.d.ts +7 -0
  571. package/umd/scripts/find-refactor-candidates/selectMostImportantRefactorCandidates.d.ts +12 -0
  572. package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages/MultipleAgentAutoPuller.d.ts +27 -0
  573. package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages/MultipleAgentGithubSynchronizer.d.ts +26 -0
  574. package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages/MultipleAgentRunUiPresenter.d.ts +66 -0
  575. package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages/RunMultipleAgentMessageTaskScheduler.d.ts +67 -0
  576. package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages/formatProjectPath.d.ts +6 -0
  577. package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages/loadLocalAgentRunnerProjectSummaries.d.ts +11 -0
  578. package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages/wait.d.ts +6 -0
  579. package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages.d.ts +1 -1
  580. package/umd/scripts/run-codex-prompts/common/buildCoderRunProgressSnapshot.d.ts +1 -1
  581. package/umd/scripts/run-codex-prompts/common/cliProgressDisplay.d.ts +2 -1
  582. package/umd/scripts/run-codex-prompts/common/resolveCoderAgent.d.ts +20 -0
  583. package/umd/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +4 -0
  584. package/umd/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeSessionResurrection.d.ts +37 -0
  585. package/umd/scripts/run-codex-prompts/runners/claude-code/parseClaudeCodeOutputEvents.d.ts +47 -0
  586. package/umd/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +8 -1
  587. package/umd/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +54 -0
  588. package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +10 -0
  589. package/umd/scripts/run-codex-prompts/ui/coderRunUiRefresh.d.ts +2 -2
  590. package/umd/src/_packages/types.index.d.ts +2 -2
  591. package/umd/src/avatars/renderAvatarVisualAsciiArt.d.ts +98 -0
  592. package/umd/src/avatars/visuals/octopus3dAvatarVisualShared.d.ts +1 -1
  593. package/umd/src/book-components/BookEditor/BookEditorMonacoUploadPanel.d.ts +1 -1
  594. package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/bookEditorMonacoUploadTypes.d.ts +120 -0
  595. package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/clearScheduledTimer.d.ts +6 -0
  596. package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/enqueueFilesForUpload.d.ts +26 -0
  597. package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadEditorSync.d.ts +23 -0
  598. package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadItemsState.d.ts +21 -0
  599. package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadProgressQueue.d.ts +12 -0
  600. package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadQueue.d.ts +27 -0
  601. package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads/useCompletedUploadsAutoClear.d.ts +12 -0
  602. package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads.d.ts +5 -58
  603. package/umd/src/book-components/Chat/Chat/ChatImageAttachmentModal.d.ts +25 -0
  604. package/umd/src/book-components/Chat/Chat/ChatInputArea.d.ts +3 -0
  605. package/umd/src/book-components/Chat/Chat/ChatMessageAttachments.d.ts +27 -0
  606. package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -1
  607. package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +1 -0
  608. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +8 -0
  609. package/umd/src/book-components/Chat/Chat/CitationIframePreview.d.ts +2 -2
  610. package/umd/src/book-components/Chat/Chat/CitationIframePreview.test.d.ts +2 -0
  611. package/umd/src/book-components/Chat/Chat/insertDictationChunk.d.ts +1 -1
  612. package/umd/src/book-components/Chat/Chat/insertDictationChunk.test.d.ts +1 -0
  613. package/umd/src/book-components/Chat/Chat/learnDictationDictionary.test.d.ts +1 -0
  614. package/umd/src/book-components/Chat/Chat/refineFinalDictationChunk.test.d.ts +1 -0
  615. package/umd/src/book-components/Chat/Chat/useChatInputAreaComposer.d.ts +12 -0
  616. package/umd/src/book-components/Chat/Chat/useChatInputAreaComposer.draftMessage.test.d.ts +2 -0
  617. package/umd/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +1 -1
  618. package/umd/src/book-components/Chat/utils/parseMessageButtons.d.ts +16 -2
  619. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_BUILD_CACHE_FILENAME.d.ts +6 -0
  620. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_BUILD_CACHE_VERSION.d.ts +6 -0
  621. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/AGENTS_SERVER_NEXT_BUILD_ID_FILENAME.d.ts +6 -0
  622. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/AgentsServerBuildCache.d.ts +10 -0
  623. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/AgentsServerBuildCacheOptions.d.ts +10 -0
  624. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/NODE_MODULES_DIRECTORY_NAME.d.ts +6 -0
  625. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/PreparedAgentsServerRuntime.d.ts +18 -0
  626. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerBuildSourceFingerprint.d.ts +6 -0
  627. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +28 -0
  628. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/ensureAgentsServerBuild.d.ts +19 -0
  629. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/getAgentsServerBuildInputRelativePaths.d.ts +11 -0
  630. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerAppPath.d.ts +6 -0
  631. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerAppPathMaterialized.d.ts +6 -0
  632. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerBuildCacheCurrent.d.ts +7 -0
  633. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isAgentsServerBuildInputTestFile.d.ts +6 -0
  634. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerBuildInputDirectoryName.d.ts +6 -0
  635. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerBuildInputPath.d.ts +6 -0
  636. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isExcludedAgentsServerRuntimeSourcePath.d.ts +6 -0
  637. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isFile.d.ts +6 -0
  638. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/isPathInsideNodeModules.d.ts +6 -0
  639. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/normalizeAgentsServerBuildInputPath.d.ts +6 -0
  640. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/prepareAgentsServerRuntime.d.ts +9 -0
  641. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/readAgentsServerBuildCache.d.ts +8 -0
  642. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerAppPath.d.ts +6 -0
  643. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerBuildAppPath.d.ts +9 -0
  644. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/resolveAgentsServerBuildOutputPath.d.ts +7 -0
  645. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/resolveNextCliPath.d.ts +6 -0
  646. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/resolveNodeModulesPath.d.ts +6 -0
  647. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/runNextBuild.d.ts +12 -0
  648. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/shouldCopyAgentsServerRuntimePath.d.ts +6 -0
  649. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/synchronizeMaterializedAgentsServerRuntime.d.ts +11 -0
  650. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/writeAgentsServerBuildCache.d.ts +7 -0
  651. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +8 -109
  652. package/umd/src/cli/cli-commands/agents-server/ensureAgentsServerEnvFile.d.ts +1 -1
  653. package/umd/src/cli/cli-commands/agents-server/ensureAgentsServerGitignoreFile.d.ts +1 -1
  654. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.d.ts +16 -0
  655. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerLogStreams.d.ts +30 -0
  656. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerRuntimePaths.d.ts +19 -0
  657. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerSupervisorState.d.ts +37 -0
  658. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/LocalAgentRunnerLimits.d.ts +9 -0
  659. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/PreparedAgentsServerLaunch.d.ts +13 -0
  660. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/StartAgentsServerOptions.d.ts +24 -0
  661. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/createInternalRouteErrorMessage.d.ts +6 -0
  662. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/createLocalAgentRunOptions.d.ts +9 -0
  663. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/forwardChildOutput.d.ts +13 -0
  664. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/loadAgentsServerProjectEnvironment.d.ts +6 -0
  665. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/prepareAgentsServerLaunch.d.ts +18 -0
  666. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/readInternalRouteErrorDetails.d.ts +6 -0
  667. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/resolveAgentsServerChildHostname.d.ts +7 -0
  668. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/startNextServer.d.ts +20 -0
  669. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/startUserChatJobWorkerPump.d.ts +15 -0
  670. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/stopChildProcess.d.ts +8 -0
  671. package/umd/src/cli/cli-commands/agents-server/startAgentsServer/waitForLocalAgentRunnerLimits.d.ts +16 -0
  672. package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +3 -30
  673. package/umd/src/cli/cli-commands/common/createPositiveIntegerOptionParser.d.ts +10 -0
  674. package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +1 -1
  675. package/umd/src/collection/agent-collection/CreateAgentInput.d.ts +1 -1
  676. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +1 -1
  677. package/umd/src/commitments/META/META.d.ts +2 -2
  678. package/umd/src/commitments/META_AVATAR/META_AVATAR.d.ts +9 -4
  679. package/umd/src/commitments/index.d.ts +1 -1
  680. package/umd/src/conversion/validation/validatePipeline/createPipelineValidationContext.d.ts +16 -0
  681. package/umd/src/conversion/validation/validatePipeline/validatePipelineCollectionsStructure.d.ts +7 -0
  682. package/umd/src/conversion/validation/validatePipeline/validatePipelineDependencyResolution.d.ts +7 -0
  683. package/umd/src/conversion/validation/validatePipeline/validatePipelineMetadata.d.ts +7 -0
  684. package/umd/src/conversion/validation/validatePipeline/validatePipelineParameters.d.ts +7 -0
  685. package/umd/src/conversion/validation/validatePipeline/validatePipelineTasks.d.ts +7 -0
  686. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/RegisteredLlmToolsMessageContext.d.ts +46 -0
  687. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/USED_ENV_FILENAME.d.ts +11 -0
  688. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolConfigurationStatusMessage.d.ts +7 -0
  689. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolEntryKey.d.ts +7 -0
  690. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolInstallationStatusMessage.d.ts +7 -0
  691. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolStatus.d.ts +14 -0
  692. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolsMessageContext.d.ts +7 -0
  693. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/getAvailableRegisteredLlmToolsEnvironmentVariables.d.ts +7 -0
  694. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/getRegisteredLlmToolRegisters.d.ts +7 -0
  695. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/hasRegisteredLlmToolEntry.d.ts +7 -0
  696. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/listRegisteredLlmToolEntries.d.ts +9 -0
  697. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/listRegisteredLlmToolStatuses.d.ts +7 -0
  698. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderAvailableRegisteredLlmTools.d.ts +7 -0
  699. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderNoRegisteredLlmToolsMessage.d.ts +7 -0
  700. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderRegisteredLlmToolsMessage.d.ts +8 -0
  701. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderRelevantRegisteredLlmToolsEnvironmentVariables.d.ts +7 -0
  702. package/umd/src/utils/agent-message-runtime/agentMessageRuntimePaths.d.ts +24 -0
  703. package/umd/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +2 -2
  704. package/umd/src/utils/ascii-art/$detectTerminalAnsiColorDepth.d.ts +15 -0
  705. package/umd/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +80 -0
  706. package/umd/src/utils/color/Color.d.ts +1 -1
  707. package/umd/src/version.d.ts +1 -1
  708. package/apps/agents-server/src/utils/userChat/createUserChatRunnerProgressCard.ts +0 -57
  709. package/esm/scripts/run-codex-prompts/common/resolveAgentSystemMessage.d.ts +0 -6
  710. package/umd/scripts/run-codex-prompts/common/resolveAgentSystemMessage.d.ts +0 -6
@@ -1,15 +1,13 @@
1
1
  import { spaceTrim } from 'spacetrim';
2
- import { IS_PIPELINE_LOGIC_VALIDATED, LOOP_LIMIT } from '../../config';
3
- import { RESERVED_PARAMETER_NAMES } from '../../constants';
4
- import { ParseError } from '../../errors/ParseError';
2
+ import { IS_PIPELINE_LOGIC_VALIDATED } from '../../config';
5
3
  import { PipelineLogicError } from '../../errors/PipelineLogicError';
6
- import { UnexpectedError } from '../../errors/UnexpectedError';
7
- import type { ParameterJson } from '../../pipeline/PipelineJson/ParameterJson';
8
4
  import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
9
- import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
10
- import type { string_name, string_reserved_parameter_name } from '../../types/string_name';
11
- import { isValidPromptbookVersion } from '../../utils/validators/semanticVersion/isValidPromptbookVersion';
12
- import { isValidPipelineUrl } from '../../utils/validators/url/isValidPipelineUrl';
5
+ import { createPipelineValidationContext } from './validatePipeline/createPipelineValidationContext';
6
+ import { validatePipelineCollectionsStructure } from './validatePipeline/validatePipelineCollectionsStructure';
7
+ import { validatePipelineDependencyResolution } from './validatePipeline/validatePipelineDependencyResolution';
8
+ import { validatePipelineMetadata } from './validatePipeline/validatePipelineMetadata';
9
+ import { validatePipelineParameters } from './validatePipeline/validatePipelineParameters';
10
+ import { validatePipelineTasks } from './validatePipeline/validatePipelineTasks';
13
11
 
14
12
  /**
15
13
  * Validates PipelineJson if it is logically valid
@@ -75,747 +73,6 @@ export function validatePipeline_InnerFunction(pipeline: PipelineJson): void {
75
73
  // pipeline.formfactorName
76
74
  }
77
75
 
78
- /**
79
- * Shared validation context for one pipeline validation pass.
80
- *
81
- * @private type of `validatePipeline`
82
- */
83
- type PipelineValidationContext = {
84
- pipeline: PipelineJson;
85
- pipelineIdentification: string;
86
- };
87
-
88
- /**
89
- * Creates the shared validation context for one pipeline.
90
- *
91
- * @private internal utility of `validatePipeline`
92
- */
93
- function createPipelineValidationContext(pipeline: PipelineJson): PipelineValidationContext {
94
- return {
95
- pipeline,
96
- pipelineIdentification: getPipelineIdentification(pipeline),
97
- };
98
- }
99
-
100
- /**
101
- * Builds a short file/url identification block for validation errors.
102
- *
103
- * @private internal utility of `validatePipeline`
104
- */
105
- function getPipelineIdentification(pipeline: Pick<PipelineJson, 'sourceFile' | 'pipelineUrl'>): string {
106
- // Note: This is a 😐 implementation of [🚞]
107
- const pipelineIdentificationParts: Array<string> = [];
108
-
109
- if (pipeline.sourceFile !== undefined) {
110
- pipelineIdentificationParts.push(`File: ${pipeline.sourceFile}`);
111
- }
112
-
113
- if (pipeline.pipelineUrl !== undefined) {
114
- pipelineIdentificationParts.push(`Url: ${pipeline.pipelineUrl}`);
115
- }
116
-
117
- return pipelineIdentificationParts.join('\n');
118
- }
119
-
120
- /**
121
- * Validates pipeline-level metadata fields.
122
- *
123
- * @private internal step of `validatePipeline`
124
- */
125
- function validatePipelineMetadata({ pipeline, pipelineIdentification }: PipelineValidationContext): void {
126
- validatePipelineUrl(pipeline, pipelineIdentification);
127
- validatePipelineBookVersion(pipeline, pipelineIdentification);
128
- }
129
-
130
- /**
131
- * Validates that the expected top-level collections have array structure.
132
- *
133
- * @private internal step of `validatePipeline`
134
- */
135
- function validatePipelineCollectionsStructure({ pipeline, pipelineIdentification }: PipelineValidationContext): void {
136
- validatePipelineParametersCollection(pipeline, pipelineIdentification);
137
- validatePipelineTasksCollection(pipeline, pipelineIdentification);
138
- }
139
-
140
- /**
141
- * Validates all pipeline parameter declarations.
142
- *
143
- * @private internal step of `validatePipeline`
144
- */
145
- function validatePipelineParameters({ pipeline, pipelineIdentification }: PipelineValidationContext): void {
146
- for (const parameter of pipeline.parameters) {
147
- validatePipelineParameter(parameter, pipeline, pipelineIdentification);
148
- }
149
- }
150
-
151
- /**
152
- * Validates all pipeline tasks and their per-task invariants.
153
- *
154
- * @private internal step of `validatePipeline`
155
- */
156
- function validatePipelineTasks({ pipeline, pipelineIdentification }: PipelineValidationContext): void {
157
- // Note: All input parameters are defined - so that they can be used as result of some task
158
- const definedParameters = createInitiallyDefinedParameters(pipeline);
159
-
160
- for (const task of pipeline.tasks) {
161
- validatePipelineTask(task, definedParameters, pipelineIdentification);
162
- }
163
- }
164
-
165
- /**
166
- * Validates that task dependencies can be resolved without cycles or missing definitions.
167
- *
168
- * @private internal step of `validatePipeline`
169
- */
170
- function validatePipelineDependencyResolution({ pipeline, pipelineIdentification }: PipelineValidationContext): void {
171
- let dependencyResolutionState = createInitialDependencyResolutionState(pipeline);
172
- let loopLimit = LOOP_LIMIT;
173
-
174
- while (hasUnresolvedTasks(dependencyResolutionState)) {
175
- if (loopLimit-- < 0) {
176
- throw createDependencyResolutionLoopLimitError(pipelineIdentification);
177
- }
178
-
179
- dependencyResolutionState = resolveNextDependencyResolutionState(
180
- dependencyResolutionState,
181
- pipelineIdentification,
182
- );
183
- }
184
- }
185
-
186
- /**
187
- * Validates one pipeline parameter declaration.
188
- *
189
- * @private internal step of `validatePipeline`
190
- */
191
- function validatePipelineParameter(
192
- parameter: ParameterJson,
193
- pipeline: Pick<PipelineJson, 'tasks'>,
194
- pipelineIdentification: string,
195
- ): void {
196
- validateParameterDirection(parameter, pipelineIdentification);
197
- validateParameterUsage(parameter, pipeline, pipelineIdentification);
198
- validateParameterDefinition(parameter, pipeline, pipelineIdentification);
199
- }
200
-
201
- /**
202
- * Validates one pipeline task and its invariants.
203
- *
204
- * @private internal step of `validatePipeline`
205
- */
206
- function validatePipelineTask(task: TaskJson, definedParameters: Set<string>, pipelineIdentification: string): void {
207
- validateTaskResultingParameter(task, definedParameters, pipelineIdentification);
208
- validateTaskJokers(task, pipelineIdentification);
209
- validateTaskExpectations(task, pipelineIdentification);
210
- }
211
-
212
- /**
213
- * Validates the pipeline URL, when present.
214
- *
215
- * @private internal utility of `validatePipeline`
216
- */
217
- function validatePipelineUrl(pipeline: Pick<PipelineJson, 'pipelineUrl'>, pipelineIdentification: string): void {
218
- if (pipeline.pipelineUrl === undefined || isValidPipelineUrl(pipeline.pipelineUrl)) {
219
- return;
220
- }
221
-
222
- // <- Note: [🚲]
223
- throw new PipelineLogicError(
224
- spaceTrim(
225
- (block) => `
226
- Invalid promptbook URL "${pipeline.pipelineUrl}"
227
-
228
- ${block(pipelineIdentification)}
229
- `,
230
- ),
231
- // <- TODO: [🐠]
232
- // <- TODO: [🚞]
233
- );
234
- }
235
-
236
- /**
237
- * Validates the Promptbook version, when present.
238
- *
239
- * @private internal utility of `validatePipeline`
240
- */
241
- function validatePipelineBookVersion(
242
- pipeline: Pick<PipelineJson, 'bookVersion'>,
243
- pipelineIdentification: string,
244
- ): void {
245
- if (pipeline.bookVersion === undefined || isValidPromptbookVersion(pipeline.bookVersion)) {
246
- return;
247
- }
248
-
249
- // <- Note: [🚲]
250
- throw new PipelineLogicError(
251
- spaceTrim(
252
- (block) => `
253
- Invalid Promptbook Version "${pipeline.bookVersion}"
254
-
255
- ${block(pipelineIdentification)}
256
- `,
257
- ),
258
- // <- TODO: [🚞]
259
- );
260
- }
261
-
262
- /**
263
- * Validates that `pipeline.parameters` is an array.
264
- *
265
- * @private internal utility of `validatePipeline`
266
- */
267
- function validatePipelineParametersCollection(
268
- pipeline: Pick<PipelineJson, 'parameters'>,
269
- pipelineIdentification: string,
270
- ): void {
271
- // TODO: [🧠] Maybe do here some proper JSON-schema / ZOD checking
272
- if (Array.isArray(pipeline.parameters)) {
273
- return;
274
- }
275
-
276
- // TODO: [🧠] what is the correct error tp throw - maybe PromptbookSchemaError
277
- throw new ParseError(
278
- spaceTrim(
279
- (block) => `
280
- Pipeline is valid JSON but with wrong structure
281
-
282
- \`PipelineJson.parameters\` expected to be an array, but got ${typeof pipeline.parameters}
283
-
284
- ${block(pipelineIdentification)}
285
- `,
286
- ),
287
- // <- TODO: [🚞]
288
- );
289
- }
290
-
291
- /**
292
- * Validates that `pipeline.tasks` is an array.
293
- *
294
- * @private internal utility of `validatePipeline`
295
- */
296
- function validatePipelineTasksCollection(pipeline: Pick<PipelineJson, 'tasks'>, pipelineIdentification: string): void {
297
- // TODO: [🧠] Maybe do here some proper JSON-schema / ZOD checking
298
- if (Array.isArray(pipeline.tasks)) {
299
- return;
300
- }
301
-
302
- // TODO: [🧠] what is the correct error tp throw - maybe PromptbookSchemaError
303
- throw new ParseError(
304
- spaceTrim(
305
- (block) => `
306
- Pipeline is valid JSON but with wrong structure
307
-
308
- \`PipelineJson.tasks\` expected to be an array, but got ${typeof pipeline.tasks}
309
-
310
- ${block(pipelineIdentification)}
311
- `,
312
- ),
313
- // <- TODO: [🚞]
314
- );
315
- }
316
-
317
- /**
318
- * Validates that one parameter does not declare incompatible directions.
319
- *
320
- * @private internal utility of `validatePipeline`
321
- */
322
- function validateParameterDirection(parameter: ParameterJson, pipelineIdentification: string): void {
323
- if (!parameter.isInput || !parameter.isOutput) {
324
- return;
325
- }
326
-
327
- const parameterName = (parameter as ParameterJson).name;
328
-
329
- throw new PipelineLogicError(
330
- spaceTrim(
331
- (block) => `
332
-
333
- Parameter \`{${parameterName}}\` can not be both input and output
334
-
335
- ${block(pipelineIdentification)}
336
- `,
337
- ),
338
- // <- Note: [🆑]
339
- // <- TODO: [🚞]
340
- );
341
- }
342
-
343
- /**
344
- * Validates that one intermediate parameter is actually consumed by at least one task.
345
- *
346
- * @private internal utility of `validatePipeline`
347
- */
348
- function validateParameterUsage(
349
- parameter: ParameterJson,
350
- pipeline: Pick<PipelineJson, 'tasks'>,
351
- pipelineIdentification: string,
352
- ): void {
353
- if (parameter.isInput || parameter.isOutput || isParameterUsedByAnyTask(parameter, pipeline.tasks)) {
354
- return;
355
- }
356
-
357
- throw new PipelineLogicError(
358
- spaceTrim(
359
- (block) => `
360
- Parameter \`{${parameter.name}}\` is created but not used
361
-
362
- You can declare {${parameter.name}} as output parameter by adding in the header:
363
- - OUTPUT PARAMETER \`{${parameter.name}}\` ${parameter.description || ''}
364
-
365
- ${block(pipelineIdentification)}
366
-
367
- `,
368
- ),
369
- // <- TODO: [🚞]
370
- );
371
- }
372
-
373
- /**
374
- * Validates that one non-input parameter is produced by at least one task.
375
- *
376
- * @private internal utility of `validatePipeline`
377
- */
378
- function validateParameterDefinition(
379
- parameter: ParameterJson,
380
- pipeline: Pick<PipelineJson, 'tasks'>,
381
- pipelineIdentification: string,
382
- ): void {
383
- if (parameter.isInput || isParameterDefinedByAnyTask(parameter, pipeline.tasks)) {
384
- return;
385
- }
386
-
387
- throw new PipelineLogicError(
388
- spaceTrim(
389
- (block) => `
390
- Parameter \`{${parameter.name}}\` is declared but not defined
391
-
392
- You can do one of these:
393
- 1) Remove declaration of \`{${parameter.name}}\`
394
- 2) Add task that results in \`-> {${parameter.name}}\`
395
-
396
- ${block(pipelineIdentification)}
397
- `,
398
- ),
399
- // <- TODO: [🚞]
400
- );
401
- }
402
-
403
- /**
404
- * Checks whether one parameter is consumed by at least one task dependency list.
405
- *
406
- * @private internal utility of `validatePipeline`
407
- */
408
- function isParameterUsedByAnyTask(parameter: ParameterJson, tasks: ReadonlyArray<TaskJson>): boolean {
409
- return tasks.some((task) => task.dependentParameterNames.includes(parameter.name));
410
- }
411
-
412
- /**
413
- * Checks whether one parameter is produced by at least one task.
414
- *
415
- * @private internal utility of `validatePipeline`
416
- */
417
- function isParameterDefinedByAnyTask(parameter: ParameterJson, tasks: ReadonlyArray<TaskJson>): boolean {
418
- return tasks.some((task) => task.resultingParameterName === parameter.name);
419
- }
420
-
421
- /**
422
- * Collects the parameter names that are already defined before task validation starts.
423
- *
424
- * @private internal utility of `validatePipeline`
425
- */
426
- function createInitiallyDefinedParameters(pipeline: Pick<PipelineJson, 'parameters'>): Set<string> {
427
- return new Set(pipeline.parameters.filter(({ isInput }) => isInput).map(({ name }) => name));
428
- }
429
-
430
- /**
431
- * Validates one task result parameter declaration and marks it as defined.
432
- *
433
- * @private internal utility of `validatePipeline`
434
- */
435
- function validateTaskResultingParameter(
436
- task: TaskJson,
437
- definedParameters: Set<string>,
438
- pipelineIdentification: string,
439
- ): void {
440
- if (definedParameters.has(task.resultingParameterName)) {
441
- throw new PipelineLogicError(
442
- spaceTrim(
443
- (block) => `
444
- Parameter \`{${task.resultingParameterName}}\` is defined multiple times
445
-
446
- ${block(pipelineIdentification)}
447
- `,
448
- ),
449
- // <- TODO: [🚞]
450
- );
451
- }
452
-
453
- if (RESERVED_PARAMETER_NAMES.includes(task.resultingParameterName as string_reserved_parameter_name)) {
454
- throw new PipelineLogicError(
455
- spaceTrim(
456
- (block) => `
457
- Parameter name {${task.resultingParameterName}} is reserved, please use different name
458
-
459
- ${block(pipelineIdentification)}
460
- `,
461
- ),
462
-
463
- // <- TODO: [🚞]
464
- );
465
- }
466
-
467
- definedParameters.add(task.resultingParameterName);
468
- }
469
-
470
- /**
471
- * Validates joker parameters for one task.
472
- *
473
- * @private internal utility of `validatePipeline`
474
- */
475
- function validateTaskJokers(task: TaskJson, pipelineIdentification: string): void {
476
- if (!hasTaskJokers(task)) {
477
- return;
478
- }
479
-
480
- validateTaskSupportsJokers(task, pipelineIdentification);
481
- validateTaskJokerDependencies(task, pipelineIdentification);
482
- }
483
-
484
- /**
485
- * Checks whether one task declares any joker parameters.
486
- *
487
- * @private internal utility of `validatePipeline`
488
- */
489
- function hasTaskJokers(task: TaskJson): task is TaskJson & { jokerParameterNames: ReadonlyArray<string_name> } {
490
- return !!task.jokerParameterNames && task.jokerParameterNames.length > 0;
491
- }
492
-
493
- /**
494
- * Validates that a task has the required supporting features when using jokers.
495
- *
496
- * @private internal utility of `validatePipeline`
497
- */
498
- function validateTaskSupportsJokers(task: TaskJson, pipelineIdentification: string): void {
499
- if (task.format || task.expectations /* <- TODO: Require at least 1 -> min <- expectation to use jokers */) {
500
- return;
501
- }
502
-
503
- throw new PipelineLogicError(
504
- spaceTrim(
505
- (block) => `
506
- Joker parameters are used for {${task.resultingParameterName}} but no expectations are defined
507
-
508
- ${block(pipelineIdentification)}
509
- `,
510
- ),
511
- // <- TODO: [🚞]
512
- );
513
- }
514
-
515
- /**
516
- * Validates that every joker parameter is also listed among task dependencies.
517
- *
518
- * @private internal utility of `validatePipeline`
519
- */
520
- function validateTaskJokerDependencies(
521
- task: TaskJson & { jokerParameterNames: ReadonlyArray<string_name> },
522
- pipelineIdentification: string,
523
- ): void {
524
- for (const joker of task.jokerParameterNames) {
525
- if (task.dependentParameterNames.includes(joker)) {
526
- continue;
527
- }
528
-
529
- throw new PipelineLogicError(
530
- spaceTrim(
531
- (block) => `
532
- Parameter \`{${joker}}\` is used for {${
533
- task.resultingParameterName
534
- }} as joker but not in \`dependentParameterNames\`
535
-
536
- ${block(pipelineIdentification)}
537
- `,
538
- ),
539
- // <- TODO: [🚞]
540
- );
541
- }
542
- }
543
-
544
- /**
545
- * Validates all expectation bounds configured on one task.
546
- *
547
- * @private internal utility of `validatePipeline`
548
- */
549
- function validateTaskExpectations(task: TaskJson, pipelineIdentification: string): void {
550
- if (!task.expectations) {
551
- return;
552
- }
553
-
554
- for (const [unit, { min, max }] of Object.entries(task.expectations)) {
555
- validateTaskExpectationRange(unit, min, max, pipelineIdentification);
556
- validateTaskExpectationMin(unit, min, pipelineIdentification);
557
- validateTaskExpectationMax(unit, max, pipelineIdentification);
558
- }
559
- }
560
-
561
- /**
562
- * Validates the minimum and maximum expectation ordering for one unit.
563
- *
564
- * @private internal utility of `validatePipeline`
565
- */
566
- function validateTaskExpectationRange(
567
- unit: string,
568
- min: number | undefined,
569
- max: number | undefined,
570
- pipelineIdentification: string,
571
- ): void {
572
- if (min === undefined || max === undefined || min <= max) {
573
- return;
574
- }
575
-
576
- throw new PipelineLogicError(
577
- spaceTrim(
578
- (block) => `
579
- Min expectation (=${min}) of ${unit} is higher than max expectation (=${max})
580
-
581
- ${block(pipelineIdentification)}
582
- `,
583
- ),
584
- // <- TODO: [🚞]
585
- );
586
- }
587
-
588
- /**
589
- * Validates the minimum expectation bound for one unit.
590
- *
591
- * @private internal utility of `validatePipeline`
592
- */
593
- function validateTaskExpectationMin(unit: string, min: number | undefined, pipelineIdentification: string): void {
594
- if (min === undefined || min >= 0) {
595
- return;
596
- }
597
-
598
- throw new PipelineLogicError(
599
- spaceTrim(
600
- (block) => `
601
- Min expectation of ${unit} must be zero or positive
602
-
603
- ${block(pipelineIdentification)}
604
- `,
605
- ),
606
- // <- TODO: [🚞]
607
- );
608
- }
609
-
610
- /**
611
- * Validates the maximum expectation bound for one unit.
612
- *
613
- * @private internal utility of `validatePipeline`
614
- */
615
- function validateTaskExpectationMax(unit: string, max: number | undefined, pipelineIdentification: string): void {
616
- if (max === undefined || max > 0) {
617
- return;
618
- }
619
-
620
- throw new PipelineLogicError(
621
- spaceTrim(
622
- (block) => `
623
- Max expectation of ${unit} must be positive
624
-
625
- ${block(pipelineIdentification)}
626
- `,
627
- ),
628
- // <- TODO: [🚞]
629
- );
630
- }
631
-
632
- /**
633
- * Shared state for one dependency-resolution validation pass.
634
- *
635
- * @private type of `validatePipeline`
636
- */
637
- type PipelineDependencyResolutionState = {
638
- resolvedParameterNames: ReadonlyArray<string_name>;
639
- unresolvedTasks: ReadonlyArray<TaskJson>;
640
- };
641
-
642
- /**
643
- * Collects the parameter names that are already resolvable before dependency traversal starts.
644
- *
645
- * @private internal utility of `validatePipeline`
646
- */
647
- function createInitialDependencyResolutionState(
648
- pipeline: Pick<PipelineJson, 'parameters' | 'tasks'>,
649
- ): PipelineDependencyResolutionState {
650
- return {
651
- resolvedParameterNames: createInitiallyResolvedParameterNames(pipeline),
652
- unresolvedTasks: [...pipeline.tasks],
653
- };
654
- }
655
-
656
- /**
657
- * Checks whether dependency resolution still has tasks left to process.
658
- *
659
- * @private internal utility of `validatePipeline`
660
- */
661
- function hasUnresolvedTasks({ unresolvedTasks }: PipelineDependencyResolutionState): boolean {
662
- return unresolvedTasks.length > 0;
663
- }
664
-
665
- /**
666
- * Resolves the next batch of currently satisfiable tasks.
667
- *
668
- * @private internal utility of `validatePipeline`
669
- */
670
- function resolveNextDependencyResolutionState(
671
- dependencyResolutionState: PipelineDependencyResolutionState,
672
- pipelineIdentification: string,
673
- ): PipelineDependencyResolutionState {
674
- const currentlyResolvedTasks = getCurrentlyResolvedTasks(
675
- dependencyResolutionState.unresolvedTasks,
676
- dependencyResolutionState.resolvedParameterNames,
677
- );
678
-
679
- if (currentlyResolvedTasks.length === 0) {
680
- throw createUnresolvedTasksError(
681
- dependencyResolutionState.unresolvedTasks,
682
- dependencyResolutionState.resolvedParameterNames,
683
- pipelineIdentification,
684
- );
685
- }
686
-
687
- return {
688
- resolvedParameterNames: appendResolvedTaskParameterNames(
689
- dependencyResolutionState.resolvedParameterNames,
690
- currentlyResolvedTasks,
691
- ),
692
- unresolvedTasks: dependencyResolutionState.unresolvedTasks.filter(
693
- (task) => !currentlyResolvedTasks.includes(task),
694
- ),
695
- };
696
- }
697
-
698
- /**
699
- * Collects the parameter names that are already resolvable before dependency traversal starts.
700
- *
701
- * @private internal utility of `validatePipeline`
702
- */
703
- function createInitiallyResolvedParameterNames(pipeline: Pick<PipelineJson, 'parameters'>): ReadonlyArray<string_name> {
704
- let resolvedParameterNames: ReadonlyArray<string_name> = pipeline.parameters
705
- .filter(({ isInput }) => isInput)
706
- .map(({ name }) => name);
707
-
708
- for (const reservedParameterName of RESERVED_PARAMETER_NAMES) {
709
- resolvedParameterNames = [...resolvedParameterNames, reservedParameterName];
710
- }
711
-
712
- return resolvedParameterNames;
713
- }
714
-
715
- /**
716
- * Adds newly resolved task outputs to the resolved parameter list.
717
- *
718
- * @private internal utility of `validatePipeline`
719
- */
720
- function appendResolvedTaskParameterNames(
721
- resolvedParameterNames: ReadonlyArray<string_name>,
722
- currentlyResolvedTasks: ReadonlyArray<TaskJson>,
723
- ): ReadonlyArray<string_name> {
724
- return [
725
- ...resolvedParameterNames,
726
- ...currentlyResolvedTasks.map(({ resultingParameterName }) => resultingParameterName),
727
- ];
728
- }
729
-
730
- /**
731
- * Selects tasks whose dependencies are already resolved.
732
- *
733
- * @private internal utility of `validatePipeline`
734
- */
735
- function getCurrentlyResolvedTasks(
736
- unresolvedTasks: ReadonlyArray<TaskJson>,
737
- resolvedParameterNames: ReadonlyArray<string_name>,
738
- ): ReadonlyArray<TaskJson> {
739
- return unresolvedTasks.filter((task) =>
740
- task.dependentParameterNames.every((name) => resolvedParameterNames.includes(name)),
741
- );
742
- }
743
-
744
- /**
745
- * Creates the unexpected loop-limit error for dependency resolution.
746
- *
747
- * @private internal utility of `validatePipeline`
748
- */
749
- function createDependencyResolutionLoopLimitError(pipelineIdentification: string): UnexpectedError {
750
- // Note: Really UnexpectedError not LimitReachedError - this should not happen and be caught below
751
- return new UnexpectedError(
752
- spaceTrim(
753
- (block) => `
754
- Loop limit reached during detection of circular dependencies in \`validatePipeline\`
755
-
756
- ${block(pipelineIdentification)}
757
- `,
758
- ),
759
- // <- TODO: [🚞]
760
- );
761
- }
762
-
763
- /**
764
- * Creates the detailed error for unresolved or circular task dependencies.
765
- *
766
- * @private internal utility of `validatePipeline`
767
- */
768
- function createUnresolvedTasksError(
769
- unresolvedTasks: ReadonlyArray<TaskJson>,
770
- resolvedParameterNames: ReadonlyArray<string_name>,
771
- pipelineIdentification: string,
772
- ): PipelineLogicError {
773
- return new PipelineLogicError(
774
- // TODO: [🐎] DRY
775
- spaceTrim(
776
- (block) => `
777
-
778
- Can not resolve some parameters:
779
- Either you are using a parameter that is not defined, or there are some circular dependencies.
780
-
781
- ${block(pipelineIdentification)}
782
-
783
- **Can not resolve:**
784
- ${block(
785
- unresolvedTasks
786
- .map(
787
- ({ resultingParameterName, dependentParameterNames }) =>
788
- `- Parameter \`{${resultingParameterName}}\` which depends on ${dependentParameterNames
789
- .map((dependentParameterName) => `\`{${dependentParameterName}}\``)
790
- .join(' and ')}`,
791
- )
792
- .join('\n'),
793
- )}
794
-
795
- **Resolved:**
796
- ${block(
797
- resolvedParameterNames
798
- .filter((name) => !RESERVED_PARAMETER_NAMES.includes(name as string_reserved_parameter_name))
799
- .map((name) => `- Parameter \`{${name}}\``)
800
- .join('\n'),
801
- )}
802
-
803
-
804
- **Reserved (which are available):**
805
- ${block(
806
- resolvedParameterNames
807
- .filter((name) => RESERVED_PARAMETER_NAMES.includes(name as string_reserved_parameter_name))
808
- .map((name) => `- Parameter \`{${name}}\``)
809
- .join('\n'),
810
- )}
811
-
812
-
813
- `,
814
- // <- TODO: [🚞]
815
- ),
816
- );
817
- }
818
-
819
76
  /**
820
77
  * TODO: [🧞‍♀️] Do not allow joker + foreach
821
78
  * TODO: [🧠] Work with promptbookVersion