@promptbook/cli 0.114.0-0 → 0.114.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.
- package/README.md +20 -27
- package/agents/default/developer.book +1 -0
- package/apps/agents-server/README.md +1 -1
- package/apps/agents-server/{USE_TIMEOUT_CHIP_QA.md → TIMEOUT_CHIP_QA.md} +1 -1
- package/apps/agents-server/next.config.ts +33 -0
- package/apps/agents-server/package.json +11 -9
- package/apps/agents-server/playwright.config.ts +28 -38
- package/apps/agents-server/scripts/build-agents-server.js +98 -0
- package/apps/agents-server/scripts/build-e2e.js +48 -0
- package/apps/agents-server/scripts/ensure-root-dependencies.js +86 -0
- package/apps/agents-server/scripts/generate-reserved-paths/generate-reserved-paths.ts +30 -16
- package/apps/agents-server/scripts/kill-port.js +163 -0
- package/apps/agents-server/scripts/prerender-homepage.js +1 -1
- package/apps/agents-server/scripts/run-e2e-tests.js +47 -0
- package/apps/agents-server/scripts/run-npm.js +118 -0
- package/apps/agents-server/src/app/admin/email-server/page.tsx +17 -10
- package/apps/agents-server/src/app/admin/messages/MessageParticipants.tsx +84 -0
- package/apps/agents-server/src/app/admin/messages/MessageStatus.tsx +96 -0
- package/apps/agents-server/src/app/admin/messages/MessagesClient.tsx +21 -32
- package/apps/agents-server/src/app/admin/messages/messageAdminPresentation.ts +289 -0
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskRow.tsx +2 -0
- package/apps/agents-server/src/app/admin/task-manager/[taskId]/TaskManagerTaskDetailClient.tsx +2 -0
- package/apps/agents-server/src/app/admin/task-manager/taskManagerTaskPresentation.tsx +23 -0
- package/apps/agents-server/src/app/agents/[agentName]/AgentChatWrapper.tsx +5 -9
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileChat.tsx +5 -9
- package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +8 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/chat/resolveAgentChatRouteContext.ts +8 -16
- package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/[timeoutId]/route.ts +10 -153
- package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/route.ts +9 -4
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/route.ts +3 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/stream/route.ts +2 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/resolveUserChatScope.ts +8 -1
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/route.ts +15 -7
- package/apps/agents-server/src/app/agents/[agentName]/api/voice/route.ts +4 -9
- package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorSaving.ts +18 -28
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatHistoryClient.tsx +19 -1
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatSidebarDefault.tsx +17 -5
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentGoalChatNotice.tsx +23 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentGoalChatPlannedMessages.tsx +168 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatPanel.tsx +6 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatSurface.tsx +18 -9
- package/apps/agents-server/src/app/agents/[agentName]/chat/ExternalUserChatAdminActions.tsx +51 -3
- package/apps/agents-server/src/app/agents/[agentName]/chat/TeamMemberFrozenChatPrimaryAgentLink.tsx +31 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/useAgentChatSidebarState.ts +26 -2
- package/apps/agents-server/src/app/agents/[agentName]/goal/page.tsx +35 -0
- package/apps/agents-server/src/app/agents/[agentName]/projectRuntimeActions.ts +97 -0
- package/apps/agents-server/src/app/agents/[agentName]/projects/[projectName]/actions.ts +5 -50
- package/apps/agents-server/src/app/agents/[agentName]/projects/[projectName]/page.tsx +2 -2
- package/apps/agents-server/src/app/api/admin/dns-records/cloudflare/route.ts +26 -16
- package/apps/agents-server/src/app/api/elevenlabs/tts/route.ts +3 -3
- package/apps/agents-server/src/app/api/emails/incoming/stalwart/route.ts +9 -2
- package/apps/agents-server/src/app/api/internal/agent-goal-chat-planned-messages/route.ts +146 -0
- package/apps/agents-server/src/app/api/onboarding/book/route.ts +7 -6
- package/apps/agents-server/src/app/api/scrape/route.ts +1 -1
- package/apps/agents-server/src/app/layout.tsx +31 -0
- package/apps/agents-server/src/app/superadmin/servers/ServersRegistryTable.tsx +124 -129
- package/apps/agents-server/src/app/superadmin/servers/useServersRegistryState.ts +15 -7
- package/apps/agents-server/src/app/system/user-wallet/UserWalletDraft.ts +2 -2
- package/apps/agents-server/src/components/AgentNaming/legacyAgentTextTranslations.cs.yaml +7 -0
- package/apps/agents-server/src/components/AgentProfile/AgentCapabilityChips.tsx +1 -24
- package/apps/agents-server/src/components/AgentProfile/AgentProfile.tsx +10 -3
- package/apps/agents-server/src/components/AgentProjects/AgentProjectIcon.tsx +137 -0
- package/apps/agents-server/src/components/AgentProjects/AgentProjectItem.tsx +26 -10
- package/apps/agents-server/src/components/AgentProjects/useAgentProjectMarkdownReferences.ts +184 -0
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsApiTokenImportStep.tsx +5 -6
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsCheckStep.tsx +6 -5
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsManualStep.tsx +10 -14
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsWizard.tsx +11 -20
- package/apps/agents-server/src/components/CloudflareDnsWizard/useCloudflareDnsRecordImport.ts +5 -6
- package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsInstructions.tsx +91 -57
- package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsSectionPanel.tsx +63 -0
- package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsSectionVariantTabs.tsx +67 -0
- package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsTable.tsx +40 -0
- package/apps/agents-server/src/components/Header/Header.tsx +8 -0
- package/apps/agents-server/src/components/Header/HeaderTypes.ts +5 -0
- package/apps/agents-server/src/components/Header/buildActiveAgentViewItems.ts +5 -4
- package/apps/agents-server/src/components/Header/buildHeaderSystemMenuItems.ts +118 -30
- package/apps/agents-server/src/components/Header/createAgentViewLabel.tsx +4 -4
- package/apps/agents-server/src/components/Header/resolveActiveAgentNavigation.ts +2 -2
- package/apps/agents-server/src/components/Header/resolveHeaderSystemActivities.ts +86 -0
- package/apps/agents-server/src/components/Homepage/AgentCard.tsx +0 -3
- package/apps/agents-server/src/components/Homepage/useAgentsListImportExportState.ts +22 -10
- package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +8 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/ManGoBookEditor.tsx +82 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/WizardShell.tsx +2 -2
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/BookStep.tsx +13 -16
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/ZadaniStep.tsx +4 -4
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/config/bookSections.ts +23 -16
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/lib/bookSource.ts +54 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/bookService.ts +15 -8
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/createManGoAgentSource.ts +3 -37
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/createManGoOpenEditorRequest.ts +1 -1
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/state/OnboardingProvider.tsx +2 -2
- package/apps/agents-server/src/components/NewAgentDialog/NewAgentWizardState.ts +0 -12
- package/apps/agents-server/src/components/NewAgentDialog/NewAgentWizardUseSetupStep.tsx +0 -58
- package/apps/agents-server/src/components/NewAgentDialog/newAgentWizardPresets.ts +0 -56
- package/apps/agents-server/src/components/UsersList/CreateUserDialog.tsx +13 -22
- package/apps/agents-server/src/components/UsersList/PasswordGeneratorDialog.tsx +216 -0
- package/apps/agents-server/src/components/UsersList/UsersList.tsx +16 -11
- package/apps/agents-server/src/components/UsersList/generateSecurePassword.ts +112 -24
- package/apps/agents-server/src/components/UsersList/userDialogClassNames.ts +11 -0
- package/apps/agents-server/src/components/WalletRecordDialog/useWalletRecordDialogState.ts +1 -1
- package/apps/agents-server/src/components/_utils/generateMetaTxt.ts +1 -1
- package/apps/agents-server/src/database/migratePrefix.ts +13 -12
- package/apps/agents-server/src/database/migrations/2026-08-0100-agent-goal-chat-source.sql +10 -0
- package/apps/agents-server/src/generated/reservedPaths.ts +42 -42
- package/apps/agents-server/src/languages/ServerTranslationKeys.ts +20 -11
- package/apps/agents-server/src/languages/translations/czech.yaml +20 -11
- package/apps/agents-server/src/languages/translations/english.yaml +20 -11
- package/apps/agents-server/src/message-providers/email/smtp/SmtpMessageProvider.ts +1 -1
- package/apps/agents-server/src/message-providers/email/stalwart/StalwartMessageProvider.ts +57 -18
- package/apps/agents-server/src/message-providers/email/stalwart/parseInboundStalwartEmail.ts +17 -2
- package/apps/agents-server/src/tools/$provideOpenAiAgentKitExecutionToolsForServer.ts +0 -191
- package/apps/agents-server/src/tools/$provideOpenAiAssistantExecutionToolsForServer.ts +0 -3
- package/apps/agents-server/src/tools/agentGoalChatTimeoutToolFunctions.ts +180 -0
- package/apps/agents-server/src/tools/agentGoalChatTimeoutTools.ts +92 -0
- package/apps/agents-server/src/tools/createServerChatRuntimeTools.ts +20 -0
- package/apps/agents-server/src/tools/getAllToolFunctionsForServer.ts +2 -0
- package/apps/agents-server/src/tools/run_browser.ts +1 -1
- package/apps/agents-server/src/tools/send_email.ts +3 -3
- package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatConstants.ts +14 -0
- package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatIdentity.ts +28 -0
- package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatPlannedMessageActions.ts +307 -0
- package/apps/agents-server/src/utils/agentGoalChat/appendAgentGoalChatNote.ts +43 -0
- package/apps/agents-server/src/utils/agentGoalChat/canAccessAgentGoalChat.ts +14 -0
- package/apps/agents-server/src/utils/agentGoalChat/createAgentGoalChatNoteContent.ts +92 -0
- package/apps/agents-server/src/utils/agentGoalChat/enqueueAgentGoalChatTurn.ts +167 -0
- package/apps/agents-server/src/utils/agentGoalChat/ensureAgentGoalChat.ts +66 -0
- package/apps/agents-server/src/utils/agentGoalChat/prependAgentGoalChatSummarySeed.ts +40 -0
- package/apps/agents-server/src/utils/agentGoalChat/recordAgentGoalChatLifecycleNote.ts +53 -0
- package/apps/agents-server/src/utils/agentGoalChat/resolveAgentGoalChatOwnerUserId.ts +104 -0
- package/apps/agents-server/src/utils/agentGoalChat/resolveEffectiveAgentGoal.ts +29 -0
- package/apps/agents-server/src/utils/agentGoalChat/scheduleAgentGoalChatModifiedNote.ts +85 -0
- package/apps/agents-server/src/utils/agentGoalChat.ts +24 -0
- package/apps/agents-server/src/utils/agentProjects/AgentProjectInfo.ts +10 -1
- package/apps/agents-server/src/utils/agentProjects/AgentProjectReferenceInfo.ts +5 -2
- package/apps/agents-server/src/utils/agentProjects/AgentProjectRuntimeActionResult.ts +14 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectFileNames.ts +21 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectHrefs.ts +20 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectsPaths.ts +15 -5
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectDnsRecords.ts +53 -7
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectInitials.ts +36 -0
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectMarkdownReferences.ts +143 -28
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectsDnsRecordsSection.ts +113 -0
- package/apps/agents-server/src/utils/agentProjects/createStaticAgentProjectServer.ts +2 -6
- package/apps/agents-server/src/utils/agentProjects/humanizeAgentProjectName.ts +25 -0
- package/apps/agents-server/src/utils/agentProjects/listAgentProjectChatReferences.ts +10 -3
- package/apps/agents-server/src/utils/agentProjects/parseAgentProjectIndexHtml.ts +167 -0
- package/apps/agents-server/src/utils/agentProjects/readAgentProjectIndexHtmlProfile.ts +24 -0
- package/apps/agents-server/src/utils/agentProjects/readAgentProjectReadme.ts +3 -53
- package/apps/agents-server/src/utils/agentProjects/readAgentProjectRootTextFile.ts +73 -0
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectFaviconRelativePath.ts +108 -0
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectInfo.ts +12 -3
- package/apps/agents-server/src/utils/agentProjects/{resolveAgentProjectReadmeProfile.ts → resolveAgentProjectProfile.ts} +33 -33
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectPublicUrls.ts +34 -0
- package/apps/agents-server/src/utils/bookLanguageDocumentation/createBookLanguageDocumentationPdfResponse.ts +19 -17
- package/apps/agents-server/src/utils/chatTasksAdmin.ts +9 -0
- package/apps/agents-server/src/utils/createAgentWithDefaultVisibility.ts +8 -0
- package/apps/agents-server/src/utils/dnsRecords/DnsRecordInstruction.ts +20 -0
- package/apps/agents-server/src/utils/dnsRecords/DnsRecordsSection.ts +77 -0
- package/apps/agents-server/src/utils/dnsRecords/createServerDnsRecordsSections.ts +58 -0
- package/apps/agents-server/src/utils/dnsRecords/createServerDomainDnsRecordsSection.ts +48 -0
- package/apps/agents-server/src/utils/dnsRecords/dnsRecordGroups.ts +52 -0
- package/apps/agents-server/src/utils/dnsRecords/resolveDnsRecordBatchPlan.ts +47 -1
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/adminChatTaskSqlQuery.ts +41 -36
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskFallbackRows.ts +3 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskSqlRows.ts +2 -0
- package/apps/agents-server/src/utils/handleChatCompletion/createHandleChatCompletionPromptContext.ts +3 -2
- package/apps/agents-server/src/utils/handleChatCompletion/resolveHandleChatCompletionRuntime.ts +4 -12
- package/apps/agents-server/src/utils/localChatRunner/parseLocalTeamConversations.ts +281 -0
- package/apps/agents-server/src/utils/localChatRunner/persistLocalTeamConversations.ts +71 -0
- package/apps/agents-server/src/utils/localChatRunner/prepareLocalTeamConversationWorkspace.ts +233 -0
- package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +37 -6
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentBooks.ts +2 -14
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentRuntime.ts +21 -73
- package/apps/agents-server/src/utils/messages/parseUseEmailSmtpCredential.ts +1 -1
- package/apps/agents-server/src/utils/resolveUseEmailSmtpCredential.ts +1 -1
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/insertManagedServerRegistryRow.ts +2 -2
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerCoreAgents.ts +7 -6
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerDefaultAgents.ts +5 -4
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerMetadata.ts +3 -2
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerUsers.ts +3 -2
- package/apps/agents-server/src/utils/serverManagement/deleteManagedServer.ts +2 -2
- package/apps/agents-server/src/utils/stalwart/createEmailDnsInstructions.ts +9 -5
- package/apps/agents-server/src/utils/stalwart/createEmailDnsRecordsSection.ts +53 -0
- package/apps/agents-server/src/utils/stalwart/readStalwartEmailSnapshot.ts +23 -5
- package/apps/agents-server/src/utils/stalwart/stalwartBootstrap.ts +2 -1
- package/apps/agents-server/src/utils/stalwart/stalwartMailBridge.ts +7 -0
- package/apps/agents-server/src/utils/useEmailSmtpWalletConstants.ts +5 -5
- package/apps/agents-server/src/utils/userChat/UserChatRecord.ts +13 -0
- package/apps/agents-server/src/utils/userChat/UserChatSource.ts +14 -0
- package/apps/agents-server/src/utils/userChat/appendQueuedUserChatTurn.ts +9 -2
- package/apps/agents-server/src/utils/userChat/createRunUserChatJobExecutionContext.ts +7 -17
- package/apps/agents-server/src/utils/userChat/createUserChatSummary.ts +10 -2
- package/apps/agents-server/src/utils/userChat/finalizeUserChatJob.ts +3 -2
- package/apps/agents-server/src/utils/userChat/getUserChat.ts +16 -1
- package/apps/agents-server/src/utils/userChat/getUserChatForJobRunner.ts +31 -0
- package/apps/agents-server/src/utils/userChat/listUserChats.ts +113 -110
- package/apps/agents-server/src/utils/userChat/persistFrozenUserChat.ts +21 -6
- package/apps/agents-server/src/utils/userChat/resolveUserChatWorkerInternalToken.ts +5 -4
- package/apps/agents-server/src/utils/userChat/runImmediateUserChatAnswer.ts +2 -6
- package/apps/agents-server/src/utils/userChat/runUserChatJob.ts +2 -6
- package/apps/agents-server/src/utils/userChat/teamMemberUserChatContext.ts +63 -0
- package/apps/agents-server/src/utils/userChat/userChatMessageLifecycle.ts +6 -1
- package/apps/agents-server/src/utils/userChat.ts +5 -1
- package/apps/agents-server/src/utils/userChatClient/cancelAgentUserTimeout.ts +2 -2
- package/apps/agents-server/src/utils/userChatClient/fetchAgentUserTimeouts.ts +2 -2
- package/apps/agents-server/src/utils/userChatClient.ts +9 -31
- package/apps/agents-server/src/utils/userChatTimeout/UserChatTimeoutRecord.ts +10 -2
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/claimNextDueUserChatTimeout.ts +28 -25
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/getAgentScopedUserChatTimeout.ts +8 -4
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/listAgentUserChatTimeouts.ts +4 -1
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/recoverExpiredRunningUserChatTimeouts.ts +3 -2
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutWorker.ts +55 -0
- package/apps/agents-server/src/utils/userWallet/UserWalletRecord.ts +1 -1
- package/apps/agents-server/src/utils/userWallet/resolveUseEmailSmtpCredentialFromWallet.ts +1 -1
- package/apps/agents-server/src/utils/vpsSelfUpdate/deleteVpsSelfUpdateInstalledVersion.ts +2 -1
- package/apps/agents-server/src/utils/vpsSelfUpdate/isVpsSelfUpdateJobRunning.ts +16 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/startVpsSelfUpdate.ts +2 -1
- package/apps/agents-server/src/utils/vpsSelfUpdate.ts +1 -0
- package/apps/agents-server/tests/e2e/e2eEnvironment.cjs +49 -0
- package/esm/apps/agents-server/src/utils/agentGoalChat/agentGoalChatConstants.d.ts +12 -0
- package/esm/index.es.js +5260 -6573
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-agent-messages/messages/buildAgentGoalChatPromptSection.d.ts +8 -0
- package/esm/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +12 -1
- package/esm/scripts/run-agent-messages/messages/buildAgentProjectsPromptSection.d.ts +2 -14
- package/esm/scripts/run-agent-messages/messages/buildAgentTeamPromptSection.d.ts +12 -0
- package/esm/scripts/run-agent-messages/messages/finalizeAgentTeamConversationWorkspace.d.ts +16 -0
- package/esm/scripts/run-agent-messages/messages/loadAgentTeamConversationWorkspace.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/common/createCoderRunStepTracker.d.ts +48 -0
- package/esm/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
- package/esm/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +7 -0
- package/esm/scripts/run-codex-prompts/git/coderCommitScope.d.ts +31 -0
- package/esm/scripts/run-codex-prompts/git/coderGitSync.d.ts +56 -0
- package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +12 -3
- package/esm/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +40 -0
- package/esm/scripts/run-codex-prompts/main/resolvePromptRunner.d.ts +8 -1
- package/esm/scripts/run-codex-prompts/ping/buildCoderPingPrompt.d.ts +20 -0
- package/esm/scripts/run-codex-prompts/ping/extractCoderPingAnswer.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/ping/pingCoderHarness.d.ts +23 -0
- package/esm/scripts/run-codex-prompts/ping/printCoderPingResult.d.ts +5 -0
- package/esm/scripts/run-codex-prompts/prompts/buildPromptStatusDetails.d.ts +43 -0
- package/esm/scripts/run-codex-prompts/prompts/findNextTodoPrompt.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +6 -3
- package/esm/scripts/run-codex-prompts/prompts/isPromptCompatibleWithRunner.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/prompts/isPromptSectionUnfinished.d.ts +8 -0
- package/esm/scripts/run-codex-prompts/prompts/listRunnablePrompts.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/listUpcomingTasks.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/prompts/markPromptInProgress.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/prompts/resolvePromptStatusLine.d.ts +19 -0
- package/esm/scripts/run-codex-prompts/prompts/writePromptStatusLine.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/server/updatePromptSection.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/testing/TestBeforeMode.d.ts +16 -0
- package/esm/scripts/run-codex-prompts/testing/createTestBeforeRepairPrompt.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/testing/limitTestOutput.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/testing/runPromptTestCommand.d.ts +1 -2
- package/esm/scripts/run-codex-prompts/testing/runPromptWithTestFeedback.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/testing/runTestBefore.d.ts +24 -0
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +1 -0
- package/esm/scripts/verify-prompts/$orderPromptFiles.d.ts +9 -0
- package/esm/scripts/verify-prompts/VerifyPromptsOrder.d.ts +26 -0
- package/esm/scripts/verify-prompts/verify-prompts.d.ts +8 -2
- package/esm/src/_packages/components.index.d.ts +4 -0
- package/esm/src/_packages/types.index.d.ts +4 -0
- package/esm/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
- package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
- package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -3
- package/esm/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +1 -15
- package/esm/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +1 -1
- package/esm/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +0 -4
- package/esm/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
- package/esm/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +72 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/agentCodingFile.d.ts +2 -3
- package/esm/src/cli/cli-commands/coder/boilerplateCount.d.ts +52 -0
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +4 -3
- package/esm/src/cli/cli-commands/coder/ping.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/verify.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +34 -0
- package/esm/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.d.ts → npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
- package/{umd/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts → esm/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
- package/esm/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +66 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.d.ts +26 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts +7 -0
- package/esm/src/cli/common/loadPromptsModule.d.ts +16 -0
- package/esm/src/commitments/{COMPONENT/COMPONENT.d.ts → META_FULLNAME/META_FULLNAME.d.ts} +8 -5
- package/esm/src/commitments/META_ID/META_ID.d.ts +32 -0
- package/esm/src/commitments/index.d.ts +4 -12
- package/esm/src/llm-providers/agent/Agent.d.ts +1 -1
- package/esm/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +2 -2
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +1 -1
- package/esm/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +1 -1
- package/esm/src/llm-providers/openai/utils/loadOpenAiAgentsModule.d.ts +203 -0
- package/esm/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +1 -1
- package/esm/src/{commitments/USE_BROWSER → scrapers/_common/utils}/fetchUrlContent.d.ts +2 -3
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
- package/esm/src/utils/agents/terminalAgentAvatarVisual.d.ts +5 -2
- package/esm/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +6 -0
- package/esm/src/utils/ascii-art/createAnsiColorCode.d.ts +46 -0
- package/esm/src/utils/misc/createLazyModuleLoader.d.ts +14 -0
- package/esm/src/utils/misc/debounce.d.ts +4 -2
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/_packages/components.index.ts +4 -0
- package/src/_packages/components.readme.md +1 -1
- package/src/_packages/types.index.ts +4 -0
- package/src/avatars/renderAvatarVisualTerminalText.ts +249 -0
- package/src/avatars/types/AvatarVisualDefinition.ts +60 -0
- package/src/avatars/visuals/asciiOctopusAvatarVisual.ts +144 -22
- package/src/book-2.0/agent-source/AgentBasicInformation.ts +3 -9
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/filterCommitmentsForAgentModelRequirements.ts +0 -23
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.ts +0 -2
- package/src/book-2.0/agent-source/parseAgentSource/applyMetaCommitment.ts +16 -31
- package/src/book-2.0/agent-source/parseAgentSource/createCapabilitiesFromCommitment.ts +0 -35
- package/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.ts +1 -15
- package/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.ts +1 -27
- package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +96 -44
- package/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.ts +23 -71
- package/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.ts +22 -67
- package/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.ts +9 -1
- package/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.ts +5 -55
- package/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.ts +278 -4
- package/src/book-3.0/AgentTeamConversationWorkspace.ts +172 -0
- package/src/book-3.0/LiteAgent.ts +11 -9
- package/src/book-components/BookEditor/useBookEditorMonacoLanguage.ts +1 -1
- package/src/book-components/BookEditor/useBookEditorMonacoStyles.ts +56 -55
- package/src/book-components/Chat/Chat/Chat.module.css +1 -8
- package/src/book-components/Chat/Chat/ChatMessageMap.tsx +8 -4
- package/src/book-components/Chat/Chat/ChatProps.tsx +3 -2
- package/src/book-components/Chat/MarkdownContent/MarkdownContent.module.css +85 -17
- package/src/book-components/Chat/MarkdownContent/MarkdownContent.tsx +116 -2
- package/src/book-components/Chat/save/react/exports/chat-preview-2025-10-13 (1).jsx +95 -5
- package/src/book-components/Chat/utils/$provideServerDomWindow.ts +77 -0
- package/src/book-components/Chat/utils/renderMarkdown.ts +716 -44
- package/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.ts +14 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/ensureAgentsServerBuild.ts +1 -0
- package/src/cli/cli-commands/agents-server/startAgentsServer/createLocalAgentRunOptions.ts +1 -0
- package/src/cli/cli-commands/coder/add.ts +40 -12
- package/src/cli/cli-commands/coder/agentCodingFile.ts +6 -129
- package/src/cli/cli-commands/coder/boilerplateCount.ts +139 -0
- package/src/cli/cli-commands/coder/generate-boilerplates.ts +81 -47
- package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +7 -4
- package/src/cli/cli-commands/coder/init.ts +29 -2
- package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +1 -4
- package/src/cli/cli-commands/coder/ping.ts +72 -0
- package/src/cli/cli-commands/coder/run.ts +35 -4
- package/src/cli/cli-commands/coder/verify.ts +55 -16
- package/src/cli/cli-commands/coder.ts +4 -0
- package/src/cli/cli-commands/common/coderGitSyncCliOptions.ts +82 -0
- package/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.ts +2 -2
- package/src/cli/cli-commands/common/harness/$checkHarnessInstallation.ts +6 -4
- package/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.ts +2 -2
- package/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.ts +2 -1
- package/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.ts → npm/$askForNpmPackageInstallationApproval.ts} +3 -3
- package/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.ts +49 -0
- package/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.ts +28 -0
- package/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.ts +25 -0
- package/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.ts +165 -0
- package/src/cli/cli-commands/common/projectInitialization.ts +10 -1
- package/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.ts +69 -0
- package/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.ts +117 -0
- package/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.ts +259 -0
- package/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.ts +55 -0
- package/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.ts +76 -0
- package/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.ts +32 -0
- package/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.ts +13 -0
- package/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.ts +45 -0
- package/src/cli/cli-commands/run/prepareRunCommandResources.ts +2 -1
- package/src/cli/cli-commands/run/resolveRunInputParameters.ts +2 -1
- package/src/cli/cli-commands/runInteractiveChatbot.ts +2 -1
- package/src/cli/common/$provideLlmToolsForCli.ts +2 -1
- package/src/cli/common/loadPromptsModule.ts +13 -0
- package/src/commands/FORMAT/formatCommandParser.ts +2 -2
- package/src/commitments/ACTION/ACTION.ts +3 -3
- package/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.ts +1 -1
- package/src/commitments/META_FULLNAME/META_FULLNAME.ts +70 -0
- package/src/commitments/META_ID/META_ID.ts +78 -0
- package/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.ts +1 -49
- package/src/commitments/index.ts +6 -24
- package/src/conversion/archive/loadArchive.ts +2 -1
- package/src/conversion/archive/loadJsZipModule.ts +10 -0
- package/src/conversion/archive/saveArchive.ts +2 -1
- package/src/llm-providers/agent/Agent.ts +1 -1
- package/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.ts +13 -1
- package/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.ts +13 -1
- package/src/llm-providers/openai/OpenAiAgentKitExecutionTools.ts +6 -2
- package/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.ts +9 -7
- package/src/llm-providers/openai/OpenAiAssistantExecutionTools.ts +1 -1
- package/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.ts +1 -1
- package/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.ts +1 -1
- package/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.ts +1 -1
- package/src/llm-providers/openai/OpenAiCompatibleRequestManager.ts +12 -1
- package/src/llm-providers/openai/utils/buildToolInvocationScript.ts +21 -18
- package/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.ts +1 -1
- package/src/llm-providers/openai/utils/loadOpenAiAgentsModule.ts +11 -0
- package/src/llm-providers/openai/utils/uploadFilesToOpenAi.ts +1 -1
- package/src/other/templates/getTemplatesPipelineCollection.ts +786 -1141
- package/src/remote-server/createRemoteClient.ts +12 -1
- package/src/{commitments/USE_BROWSER → scrapers/_common/utils}/fetchUrlContent.ts +8 -9
- package/src/scrapers/website/WebsiteScraper.ts +22 -2
- package/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.ts +157 -3
- package/src/utils/agents/terminalAgentAvatarVisual.ts +31 -3
- package/src/utils/ascii-art/convertImageDataToAsciiArt.ts +9 -109
- package/src/utils/ascii-art/createAnsiColorCode.ts +132 -0
- package/src/utils/misc/createLazyModuleLoader.ts +27 -0
- package/src/utils/misc/debounce.ts +26 -5
- package/src/version.ts +2 -2
- package/src/versions.txt +8 -1
- package/umd/apps/agents-server/src/utils/agentGoalChat/agentGoalChatConstants.d.ts +12 -0
- package/umd/index.umd.js +5718 -7025
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-agent-messages/messages/buildAgentGoalChatPromptSection.d.ts +8 -0
- package/umd/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +12 -1
- package/umd/scripts/run-agent-messages/messages/buildAgentProjectsPromptSection.d.ts +2 -14
- package/umd/scripts/run-agent-messages/messages/buildAgentTeamPromptSection.d.ts +12 -0
- package/umd/scripts/run-agent-messages/messages/finalizeAgentTeamConversationWorkspace.d.ts +16 -0
- package/umd/scripts/run-agent-messages/messages/loadAgentTeamConversationWorkspace.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/common/createCoderRunStepTracker.d.ts +48 -0
- package/umd/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
- package/umd/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +7 -0
- package/umd/scripts/run-codex-prompts/git/coderCommitScope.d.ts +31 -0
- package/umd/scripts/run-codex-prompts/git/coderGitSync.d.ts +56 -0
- package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +12 -3
- package/umd/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +40 -0
- package/umd/scripts/run-codex-prompts/main/resolvePromptRunner.d.ts +8 -1
- package/umd/scripts/run-codex-prompts/ping/buildCoderPingPrompt.d.ts +20 -0
- package/umd/scripts/run-codex-prompts/ping/extractCoderPingAnswer.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/ping/pingCoderHarness.d.ts +23 -0
- package/umd/scripts/run-codex-prompts/ping/printCoderPingResult.d.ts +5 -0
- package/umd/scripts/run-codex-prompts/prompts/buildPromptStatusDetails.d.ts +43 -0
- package/umd/scripts/run-codex-prompts/prompts/findNextTodoPrompt.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +6 -3
- package/umd/scripts/run-codex-prompts/prompts/isPromptCompatibleWithRunner.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/prompts/isPromptSectionUnfinished.d.ts +8 -0
- package/umd/scripts/run-codex-prompts/prompts/listRunnablePrompts.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/listUpcomingTasks.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/prompts/markPromptInProgress.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/prompts/resolvePromptStatusLine.d.ts +19 -0
- package/umd/scripts/run-codex-prompts/prompts/writePromptStatusLine.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/server/updatePromptSection.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/testing/TestBeforeMode.d.ts +16 -0
- package/umd/scripts/run-codex-prompts/testing/createTestBeforeRepairPrompt.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/testing/limitTestOutput.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/testing/runPromptTestCommand.d.ts +1 -2
- package/umd/scripts/run-codex-prompts/testing/runPromptWithTestFeedback.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/testing/runTestBefore.d.ts +24 -0
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +1 -0
- package/umd/scripts/verify-prompts/$orderPromptFiles.d.ts +9 -0
- package/umd/scripts/verify-prompts/VerifyPromptsOrder.d.ts +26 -0
- package/umd/scripts/verify-prompts/verify-prompts.d.ts +8 -2
- package/umd/src/_packages/components.index.d.ts +4 -0
- package/umd/src/_packages/types.index.d.ts +4 -0
- package/umd/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
- package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
- package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -3
- package/umd/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +1 -15
- package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +1 -1
- package/umd/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +0 -4
- package/umd/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
- package/umd/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +72 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/agentCodingFile.d.ts +2 -3
- package/umd/src/cli/cli-commands/coder/boilerplateCount.d.ts +52 -0
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +4 -3
- package/umd/src/cli/cli-commands/coder/ping.d.ts +10 -0
- package/umd/src/cli/cli-commands/coder/verify.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +34 -0
- package/umd/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.d.ts → npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
- package/{esm/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts → umd/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
- package/umd/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +66 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.d.ts +26 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts +7 -0
- package/umd/src/cli/common/loadPromptsModule.d.ts +16 -0
- package/umd/src/commitments/{COMPONENT/COMPONENT.d.ts → META_FULLNAME/META_FULLNAME.d.ts} +8 -5
- package/umd/src/commitments/META_ID/META_ID.d.ts +32 -0
- package/umd/src/commitments/index.d.ts +4 -12
- package/umd/src/llm-providers/agent/Agent.d.ts +1 -1
- package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +2 -2
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +1 -1
- package/umd/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +1 -1
- package/umd/src/llm-providers/openai/utils/loadOpenAiAgentsModule.d.ts +203 -0
- package/umd/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +1 -1
- package/umd/src/{commitments/USE_BROWSER → scrapers/_common/utils}/fetchUrlContent.d.ts +2 -3
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
- package/umd/src/utils/agents/terminalAgentAvatarVisual.d.ts +5 -2
- package/umd/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +6 -0
- package/umd/src/utils/ascii-art/createAnsiColorCode.d.ts +46 -0
- package/umd/src/utils/misc/createLazyModuleLoader.d.ts +14 -0
- package/umd/src/utils/misc/debounce.d.ts +4 -2
- package/umd/src/utils/misc/debounce.test.d.ts +1 -0
- package/umd/src/version.d.ts +1 -1
- package/apps/agents-server/scripts/ignore-kill-eperm.js +0 -31
- package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/actions/route.ts +0 -103
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsClient.tsx +0 -43
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsEditDialog.tsx +0 -98
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsFiltersCard.tsx +0 -75
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsHeader.tsx +0 -53
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsSummaryMetrics.tsx +0 -70
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableCard.tsx +0 -58
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableRow.tsx +0 -242
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/loading.tsx +0 -15
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/page.tsx +0 -28
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/useAgentTimeoutsClientState.ts +0 -769
- package/apps/agents-server/src/app/api/onboarding/draft/route.ts +0 -23
- package/apps/agents-server/src/components/AgentProjectDnsInstructions/AgentProjectDnsInstructions.tsx +0 -182
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/BookLanguagePanel.tsx +0 -125
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/MarkdownBookEditor.tsx +0 -154
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/MarkdownPreview.tsx +0 -188
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/draftService.ts +0 -32
- package/apps/agents-server/src/tools/configureTimeoutToolRuntimeAdapterForServer.ts +0 -381
- package/apps/agents-server/src/utils/emails/extractUseEmailConfigurationFromAgentSource.ts +0 -42
- package/apps/agents-server/src/utils/userChatClient/runAgentUserTimeoutBulkAction.ts +0 -24
- package/apps/agents-server/src/utils/userChatClient/updateAgentUserTimeout.ts +0 -25
- package/esm/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +0 -11
- package/esm/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +0 -9
- package/esm/src/commitments/MEMORY/MEMORY.d.ts +0 -48
- package/esm/src/commitments/MEMORY/MemoryToolNames.d.ts +0 -11
- package/esm/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +0 -149
- package/esm/src/commitments/MEMORY/createMemorySystemMessage.d.ts +0 -6
- package/esm/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +0 -8
- package/esm/src/commitments/MEMORY/createMemoryTools.d.ts +0 -14
- package/esm/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +0 -6
- package/esm/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
- package/esm/src/commitments/MEMORY/getMemoryToolTitles.d.ts +0 -7
- package/esm/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +0 -61
- package/esm/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +0 -8
- package/esm/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +0 -13
- package/esm/src/commitments/META/META.d.ts +0 -65
- package/esm/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +0 -32
- package/esm/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -58
- package/esm/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.d.ts +0 -13
- package/esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +0 -10
- package/esm/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.d.ts +0 -47
- package/esm/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -38
- package/esm/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +0 -21
- package/esm/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +0 -11
- package/esm/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +0 -13
- package/esm/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -46
- package/esm/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -38
- package/esm/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +0 -9
- package/esm/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +0 -12
- package/esm/src/commitments/USE_TIME/USE_TIME.d.ts +0 -43
- package/esm/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +0 -11
- package/esm/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +0 -212
- package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -38
- package/esm/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +0 -6
- package/esm/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +0 -8
- package/esm/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +0 -7
- package/esm/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
- package/esm/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +0 -78
- package/esm/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +0 -8
- package/esm/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +0 -13
- package/esm/src/commitments/WALLET/WALLET.d.ts +0 -21
- package/esm/src/commitments/WALLET/WalletToolNames.d.ts +0 -12
- package/esm/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +0 -163
- package/esm/src/commitments/WALLET/createWalletSystemMessage.d.ts +0 -6
- package/esm/src/commitments/WALLET/createWalletToolFunctions.d.ts +0 -8
- package/esm/src/commitments/WALLET/createWalletTools.d.ts +0 -7
- package/esm/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +0 -6
- package/esm/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +0 -16
- package/esm/src/commitments/WALLET/getWalletToolTitles.d.ts +0 -7
- package/esm/src/commitments/WALLET/parseWalletToolArgs.d.ts +0 -51
- package/esm/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +0 -8
- package/esm/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +0 -13
- package/esm/src/commitments/_common/createSerpSearchToolFunction.d.ts +0 -12
- package/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.ts +0 -34
- package/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.ts +0 -28
- package/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.ts +0 -39
- package/src/commitments/COMPONENT/COMPONENT.ts +0 -70
- package/src/commitments/MEMORY/MEMORY.ts +0 -94
- package/src/commitments/MEMORY/MemoryToolNames.ts +0 -13
- package/src/commitments/MEMORY/MemoryToolRuntimeAdapter.ts +0 -180
- package/src/commitments/MEMORY/createMemorySystemMessage.ts +0 -27
- package/src/commitments/MEMORY/createMemoryToolFunctions.ts +0 -134
- package/src/commitments/MEMORY/createMemoryTools.ts +0 -115
- package/src/commitments/MEMORY/getMemoryCommitmentDocumentation.ts +0 -47
- package/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.ts +0 -104
- package/src/commitments/MEMORY/getMemoryToolTitles.ts +0 -16
- package/src/commitments/MEMORY/parseMemoryToolArgs.ts +0 -126
- package/src/commitments/MEMORY/resolveMemoryRuntimeContext.ts +0 -23
- package/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.ts +0 -26
- package/src/commitments/META/META.ts +0 -168
- package/src/commitments/USE/TODO.txt +0 -1
- package/src/commitments/USE/aggregateUseCommitmentSystemMessages.ts +0 -219
- package/src/commitments/USE_BROWSER/TODO.txt +0 -1
- package/src/commitments/USE_BROWSER/USE_BROWSER.ts +0 -257
- package/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.ts +0 -45
- package/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.ts +0 -83
- package/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.ts +0 -146
- package/src/commitments/USE_EMAIL/USE_EMAIL.ts +0 -201
- package/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.ts +0 -75
- package/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.ts +0 -44
- package/src/commitments/USE_EMAIL/sendEmailViaBrowser.ts +0 -47
- package/src/commitments/USE_SEARCH_ENGINE/TODO.txt +0 -1
- package/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.ts +0 -171
- package/src/commitments/USE_SPAWN/USE_SPAWN.ts +0 -150
- package/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.ts +0 -42
- package/src/commitments/USE_SPAWN/spawnAgentViaBrowser.ts +0 -50
- package/src/commitments/USE_TIME/USE_TIME.ts +0 -177
- package/src/commitments/USE_TIMEOUT/TimeoutToolNames.ts +0 -13
- package/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.ts +0 -255
- package/src/commitments/USE_TIMEOUT/USE_TIMEOUT.ts +0 -117
- package/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.ts +0 -22
- package/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.ts +0 -361
- package/src/commitments/USE_TIMEOUT/createTimeoutTools.ts +0 -127
- package/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.ts +0 -67
- package/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.ts +0 -460
- package/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.ts +0 -36
- package/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.ts +0 -26
- package/src/commitments/WALLET/WALLET.ts +0 -71
- package/src/commitments/WALLET/WalletToolNames.ts +0 -14
- package/src/commitments/WALLET/WalletToolRuntimeAdapter.ts +0 -180
- package/src/commitments/WALLET/createWalletSystemMessage.ts +0 -22
- package/src/commitments/WALLET/createWalletToolFunctions.ts +0 -145
- package/src/commitments/WALLET/createWalletTools.ts +0 -129
- package/src/commitments/WALLET/getWalletCommitmentDocumentation.ts +0 -14
- package/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.ts +0 -64
- package/src/commitments/WALLET/getWalletToolTitles.ts +0 -17
- package/src/commitments/WALLET/parseWalletToolArgs.ts +0 -231
- package/src/commitments/WALLET/resolveWalletRuntimeContext.ts +0 -23
- package/src/commitments/WALLET/setWalletToolRuntimeAdapter.ts +0 -26
- package/src/commitments/_common/createSerpSearchToolFunction.ts +0 -46
- package/umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +0 -11
- package/umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +0 -9
- package/umd/src/commitments/MEMORY/MEMORY.d.ts +0 -48
- package/umd/src/commitments/MEMORY/MemoryToolNames.d.ts +0 -11
- package/umd/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +0 -149
- package/umd/src/commitments/MEMORY/createMemorySystemMessage.d.ts +0 -6
- package/umd/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +0 -8
- package/umd/src/commitments/MEMORY/createMemoryTools.d.ts +0 -14
- package/umd/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +0 -6
- package/umd/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
- package/umd/src/commitments/MEMORY/getMemoryToolTitles.d.ts +0 -7
- package/umd/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +0 -61
- package/umd/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +0 -8
- package/umd/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +0 -13
- package/umd/src/commitments/META/META.d.ts +0 -65
- package/umd/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +0 -32
- package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -58
- package/umd/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.d.ts +0 -13
- package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +0 -10
- package/umd/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.d.ts +0 -47
- package/umd/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -38
- package/umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +0 -21
- package/umd/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +0 -11
- package/umd/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +0 -13
- package/umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -46
- package/umd/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -38
- package/umd/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +0 -9
- package/umd/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +0 -12
- package/umd/src/commitments/USE_TIME/USE_TIME.d.ts +0 -43
- package/umd/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +0 -11
- package/umd/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +0 -212
- package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -38
- package/umd/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +0 -6
- package/umd/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +0 -8
- package/umd/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +0 -7
- package/umd/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
- package/umd/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +0 -78
- package/umd/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +0 -8
- package/umd/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +0 -13
- package/umd/src/commitments/WALLET/WALLET.d.ts +0 -21
- package/umd/src/commitments/WALLET/WalletToolNames.d.ts +0 -12
- package/umd/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +0 -163
- package/umd/src/commitments/WALLET/createWalletSystemMessage.d.ts +0 -6
- package/umd/src/commitments/WALLET/createWalletToolFunctions.d.ts +0 -8
- package/umd/src/commitments/WALLET/createWalletTools.d.ts +0 -7
- package/umd/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +0 -6
- package/umd/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +0 -16
- package/umd/src/commitments/WALLET/getWalletToolTitles.d.ts +0 -7
- package/umd/src/commitments/WALLET/parseWalletToolArgs.d.ts +0 -51
- package/umd/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +0 -8
- package/umd/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +0 -13
- package/umd/src/commitments/_common/createSerpSearchToolFunction.d.ts +0 -12
- /package/esm/src/{book-2.0/agent-source/createAgentModelRequirements.useCommitmentAggregation.test.d.ts → avatars/renderAvatarVisualTerminalText.test.d.ts} +0 -0
- /package/esm/src/{cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → book-2.0/agent-source/createAgentModelRequirements.commitmentAggregation.test.d.ts} +0 -0
- /package/esm/src/cli/cli-commands/{common/harness/isHarnessVersionOutdated.test.d.ts → coder/boilerplateCount.test.d.ts} +0 -0
- /package/esm/src/{commitments/MEMORY/MEMORY.test.d.ts → cli/cli-commands/coder/generate-boilerplates.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_BROWSER/USE_BROWSER.test.d.ts → cli/cli-commands/coder/ping.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts → cli/cli-commands/common/coderGitSyncCliOptions.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.test.d.ts → cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_EMAIL/USE_EMAIL.test.d.ts → cli/cli-commands/common/npm/buildNpmPackageInstallCommand.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts → cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts → cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_SPAWN/USE_SPAWN.test.d.ts → cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_TIME/USE_TIME.test.d.ts → cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts → cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts} +0 -0
- /package/esm/src/{commitments/WALLET/WALLET.test.d.ts → cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.test.d.ts} +0 -0
- /package/esm/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.d.ts +0 -0
- /package/{umd/src/book-2.0/agent-source/createAgentModelRequirements.useCommitmentAggregation.test.d.ts → esm/src/utils/misc/debounce.test.d.ts} +0 -0
- /package/umd/src/{cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → avatars/renderAvatarVisualTerminalText.test.d.ts} +0 -0
- /package/umd/src/{cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts → book-2.0/agent-source/createAgentModelRequirements.commitmentAggregation.test.d.ts} +0 -0
- /package/umd/src/{commitments/MEMORY/MEMORY.test.d.ts → cli/cli-commands/coder/boilerplateCount.test.d.ts} +0 -0
- /package/umd/src/{commitments/USE_BROWSER/USE_BROWSER.test.d.ts → cli/cli-commands/coder/generate-boilerplates.test.d.ts} +0 -0
- /package/umd/src/{commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts → cli/cli-commands/coder/ping.test.d.ts} +0 -0
- /package/umd/src/{commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.test.d.ts → cli/cli-commands/common/coderGitSyncCliOptions.test.d.ts} +0 -0
- /package/umd/src/{commitments/USE_EMAIL/USE_EMAIL.test.d.ts → cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.test.d.ts} +0 -0
- /package/umd/src/{commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts → cli/cli-commands/common/npm/buildNpmPackageInstallCommand.test.d.ts} +0 -0
- /package/umd/src/{commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts → cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts} +0 -0
- /package/umd/src/{commitments/USE_SPAWN/USE_SPAWN.test.d.ts → cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts} +0 -0
- /package/umd/src/{commitments/USE_TIME/USE_TIME.test.d.ts → cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.test.d.ts} +0 -0
- /package/umd/src/{commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts → cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts} +0 -0
- /package/umd/src/{commitments/WALLET/WALLET.test.d.ts → cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts} +0 -0
- /package/umd/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.d.ts +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { $execCommand } from '../../../../utils/execCommand/$execCommand';
|
|
2
|
+
import { extractNpmPackageVersionFromOutput } from './extractNpmPackageVersionFromOutput';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Time limit for the whole `npm view` lookup of the newest published package version.
|
|
6
|
+
*/
|
|
7
|
+
const NPM_PACKAGE_LATEST_VERSION_COMMAND_TIMEOUT_MS = 60 * 1000;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Time limit for one npm registry request, so an unreachable registry never blocks the command.
|
|
11
|
+
*/
|
|
12
|
+
const NPM_REGISTRY_FETCH_TIMEOUT_MS = 20 * 1000;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Pattern matching npm's JSON-encoded package version result.
|
|
16
|
+
*/
|
|
17
|
+
const NPM_VIEW_JSON_VERSION_PATTERN = /"(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)"/u;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Reads the newest version of one npm package.
|
|
21
|
+
*
|
|
22
|
+
* Note: `$` is used to indicate that this function is not a pure function - it queries the npm registry
|
|
23
|
+
*
|
|
24
|
+
* @returns The newest published version or `null` when the registry could not be reached
|
|
25
|
+
* @private internal utility of `promptbookCli`
|
|
26
|
+
*/
|
|
27
|
+
export async function $resolveLatestNpmPackageVersion(npmPackageName: string): Promise<string | null> {
|
|
28
|
+
const output = await $execCommand({
|
|
29
|
+
command: `npm view ${npmPackageName} version --json --loglevel=error --fetch-timeout=${NPM_REGISTRY_FETCH_TIMEOUT_MS} --fetch-retries=1`,
|
|
30
|
+
crashOnError: true,
|
|
31
|
+
timeout: NPM_PACKAGE_LATEST_VERSION_COMMAND_TIMEOUT_MS,
|
|
32
|
+
isVerbose: false,
|
|
33
|
+
}).catch(() => '');
|
|
34
|
+
|
|
35
|
+
return extractLatestNpmPackageVersionFromNpmViewOutput(output);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Extracts the version from npm's JSON result while tolerating warnings emitted before or after that result.
|
|
40
|
+
*
|
|
41
|
+
* @private internal utility of `$resolveLatestNpmPackageVersion`
|
|
42
|
+
*/
|
|
43
|
+
function extractLatestNpmPackageVersionFromNpmViewOutput(output: string): string | null {
|
|
44
|
+
const jsonVersionMatch = NPM_VIEW_JSON_VERSION_PATTERN.exec(output);
|
|
45
|
+
|
|
46
|
+
return jsonVersionMatch?.[1] ?? extractNpmPackageVersionFromOutput(output, { isLastMatchPreferred: true });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Note: [🟡] Code for CLI npm package registry lookup [$resolveLatestNpmPackageVersion](src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.ts) should never be published outside of `@promptbook/cli`
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Place where an npm package should be installed or updated.
|
|
3
|
+
*
|
|
4
|
+
* @private internal utility of `promptbookCli`
|
|
5
|
+
*/
|
|
6
|
+
export type NpmPackageInstallationLocation = 'local-dependency' | 'local-development-dependency' | 'global';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Builds an npm command which installs or updates a package in the requested existing location.
|
|
10
|
+
*
|
|
11
|
+
* @private internal utility of `promptbookCli`
|
|
12
|
+
*/
|
|
13
|
+
export function buildNpmPackageInstallCommand(
|
|
14
|
+
npmPackageName: string,
|
|
15
|
+
installationLocation: NpmPackageInstallationLocation,
|
|
16
|
+
): string {
|
|
17
|
+
if (installationLocation === 'global') {
|
|
18
|
+
return `npm install -g ${npmPackageName}@latest`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (installationLocation === 'local-development-dependency') {
|
|
22
|
+
return `npm install --save-dev ${npmPackageName}@latest`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return `npm install --save ${npmPackageName}@latest`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Note: [🟡] Code for CLI npm install commands [buildNpmPackageInstallCommand](src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.ts) should never be published outside of `@promptbook/cli`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pattern matching one `major.minor.patch` version anywhere in npm or CLI command output.
|
|
3
|
+
*/
|
|
4
|
+
const NPM_PACKAGE_VERSION_PATTERN = /\b(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)/gu;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Extracts an npm package version from raw command output.
|
|
8
|
+
*
|
|
9
|
+
* Both npm and CLI commands may emit unrelated warnings before the version. CLI commands use the first matching token;
|
|
10
|
+
* npm registry commands can opt into the last matching token because npm warnings commonly precede their output.
|
|
11
|
+
*
|
|
12
|
+
* @returns The parsed version or `null` when the output contains no version
|
|
13
|
+
* @private internal utility of `promptbookCli`
|
|
14
|
+
*/
|
|
15
|
+
export function extractNpmPackageVersionFromOutput(
|
|
16
|
+
output: string,
|
|
17
|
+
{ isLastMatchPreferred = false }: { readonly isLastMatchPreferred?: boolean } = {},
|
|
18
|
+
): string | null {
|
|
19
|
+
const versionMatches = Array.from(output.matchAll(NPM_PACKAGE_VERSION_PATTERN));
|
|
20
|
+
const versionMatch = isLastMatchPreferred ? versionMatches[versionMatches.length - 1] : versionMatches[0];
|
|
21
|
+
|
|
22
|
+
return versionMatch?.[1] ?? null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Note: [🟡] Code for CLI npm package version parsing [extractNpmPackageVersionFromOutput](src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.ts) should never be published outside of `@promptbook/cli`
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parsed parts of one npm package version used for precedence comparison.
|
|
3
|
+
*
|
|
4
|
+
* @private internal utility of `isNpmPackageVersionOutdated`
|
|
5
|
+
*/
|
|
6
|
+
type ParsedNpmPackageVersion = {
|
|
7
|
+
readonly releaseSegments: ReadonlyArray<number>;
|
|
8
|
+
readonly prereleaseIdentifiers: ReadonlyArray<number | string> | null;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Compares an installed npm package version with the newest published version.
|
|
13
|
+
*
|
|
14
|
+
* Release and prerelease identifiers follow semantic-version precedence while build metadata is ignored. Harnesses can
|
|
15
|
+
* preserve their historical behavior by setting `isPrereleaseIgnored`, because some harness commands report a build
|
|
16
|
+
* suffix which does not correspond to npm release precedence.
|
|
17
|
+
*
|
|
18
|
+
* @private internal utility of `promptbookCli`
|
|
19
|
+
*/
|
|
20
|
+
export function isNpmPackageVersionOutdated(
|
|
21
|
+
installedVersion: string,
|
|
22
|
+
latestVersion: string,
|
|
23
|
+
{ isPrereleaseIgnored = false }: { readonly isPrereleaseIgnored?: boolean } = {},
|
|
24
|
+
): boolean {
|
|
25
|
+
const installedPackageVersion = parseNpmPackageVersion(installedVersion);
|
|
26
|
+
const latestPackageVersion = parseNpmPackageVersion(latestVersion);
|
|
27
|
+
const releaseComparison = compareNumericSegments(
|
|
28
|
+
installedPackageVersion.releaseSegments,
|
|
29
|
+
latestPackageVersion.releaseSegments,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
if (releaseComparison !== 0) {
|
|
33
|
+
return releaseComparison < 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (isPrereleaseIgnored) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
comparePrereleaseIdentifiers(
|
|
42
|
+
installedPackageVersion.prereleaseIdentifiers,
|
|
43
|
+
latestPackageVersion.prereleaseIdentifiers,
|
|
44
|
+
) < 0
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Parses semantic-version release and prerelease parts, ignoring build metadata.
|
|
50
|
+
*/
|
|
51
|
+
function parseNpmPackageVersion(version: string): ParsedNpmPackageVersion {
|
|
52
|
+
const buildMetadataSeparatorIndex = version.indexOf('+');
|
|
53
|
+
const versionWithoutBuildMetadata = (
|
|
54
|
+
buildMetadataSeparatorIndex === -1 ? version : version.slice(0, buildMetadataSeparatorIndex)
|
|
55
|
+
).trim();
|
|
56
|
+
const prereleaseSeparatorIndex = versionWithoutBuildMetadata.indexOf('-');
|
|
57
|
+
const releasePart =
|
|
58
|
+
prereleaseSeparatorIndex === -1
|
|
59
|
+
? versionWithoutBuildMetadata
|
|
60
|
+
: versionWithoutBuildMetadata.slice(0, prereleaseSeparatorIndex);
|
|
61
|
+
const prereleasePart =
|
|
62
|
+
prereleaseSeparatorIndex === -1 ? null : versionWithoutBuildMetadata.slice(prereleaseSeparatorIndex + 1);
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
releaseSegments: releasePart.split('.').map(parseNumericVersionIdentifier),
|
|
66
|
+
prereleaseIdentifiers:
|
|
67
|
+
prereleasePart === null
|
|
68
|
+
? null
|
|
69
|
+
: prereleasePart
|
|
70
|
+
.split('.')
|
|
71
|
+
.map((identifier) => (/^\d+$/u.test(identifier) ? Number.parseInt(identifier, 10) : identifier)),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Parses one numeric release identifier while retaining the former tolerant behavior for malformed input.
|
|
77
|
+
*/
|
|
78
|
+
function parseNumericVersionIdentifier(identifier: string): number {
|
|
79
|
+
const identifierNumber = Number.parseInt(identifier, 10);
|
|
80
|
+
|
|
81
|
+
return Number.isNaN(identifierNumber) ? 0 : identifierNumber;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Compares numeric version segments, treating omitted trailing segments as zero.
|
|
86
|
+
*/
|
|
87
|
+
function compareNumericSegments(firstSegments: ReadonlyArray<number>, secondSegments: ReadonlyArray<number>): number {
|
|
88
|
+
const segmentCount = Math.max(firstSegments.length, secondSegments.length);
|
|
89
|
+
|
|
90
|
+
for (let segmentIndex = 0; segmentIndex < segmentCount; segmentIndex++) {
|
|
91
|
+
const firstSegment = firstSegments[segmentIndex] ?? 0;
|
|
92
|
+
const secondSegment = secondSegments[segmentIndex] ?? 0;
|
|
93
|
+
|
|
94
|
+
if (firstSegment !== secondSegment) {
|
|
95
|
+
return firstSegment < secondSegment ? -1 : 1;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Compares semantic-version prerelease identifiers.
|
|
104
|
+
*/
|
|
105
|
+
function comparePrereleaseIdentifiers(
|
|
106
|
+
firstIdentifiers: ReadonlyArray<number | string> | null,
|
|
107
|
+
secondIdentifiers: ReadonlyArray<number | string> | null,
|
|
108
|
+
): number {
|
|
109
|
+
if (firstIdentifiers === null || secondIdentifiers === null) {
|
|
110
|
+
if (firstIdentifiers === secondIdentifiers) {
|
|
111
|
+
return 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Note: A version without prerelease identifiers has higher precedence than a prerelease
|
|
115
|
+
return firstIdentifiers === null ? 1 : -1;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const identifierCount = Math.max(firstIdentifiers.length, secondIdentifiers.length);
|
|
119
|
+
|
|
120
|
+
for (let identifierIndex = 0; identifierIndex < identifierCount; identifierIndex++) {
|
|
121
|
+
const firstIdentifier = firstIdentifiers[identifierIndex];
|
|
122
|
+
const secondIdentifier = secondIdentifiers[identifierIndex];
|
|
123
|
+
|
|
124
|
+
if (firstIdentifier === undefined || secondIdentifier === undefined) {
|
|
125
|
+
if (firstIdentifier === secondIdentifier) {
|
|
126
|
+
return 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return firstIdentifier === undefined ? -1 : 1;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const identifierComparison = comparePrereleaseIdentifier(firstIdentifier, secondIdentifier);
|
|
133
|
+
|
|
134
|
+
if (identifierComparison !== 0) {
|
|
135
|
+
return identifierComparison;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Compares two individual semantic-version prerelease identifiers.
|
|
144
|
+
*/
|
|
145
|
+
function comparePrereleaseIdentifier(firstIdentifier: number | string, secondIdentifier: number | string): number {
|
|
146
|
+
if (firstIdentifier === secondIdentifier) {
|
|
147
|
+
return 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (typeof firstIdentifier === 'number' && typeof secondIdentifier === 'number') {
|
|
151
|
+
return firstIdentifier < secondIdentifier ? -1 : 1;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (typeof firstIdentifier === 'number') {
|
|
155
|
+
return -1;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (typeof secondIdentifier === 'number') {
|
|
159
|
+
return 1;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return firstIdentifier < secondIdentifier ? -1 : 1;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Note: [🟡] Code for CLI npm package version comparison [isNpmPackageVersionOutdated](src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.ts) should never be published outside of `@promptbook/cli`
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFile, stat, writeFile } from 'fs/promises';
|
|
2
2
|
import { join } from 'path';
|
|
3
|
+
import { spaceTrim } from 'spacetrim';
|
|
3
4
|
import { escapeRegExp } from '../../../utils/chat/escapeRegExp';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -118,7 +119,15 @@ export async function ensureProjectGitignoreFile({
|
|
|
118
119
|
return 'unchanged';
|
|
119
120
|
}
|
|
120
121
|
|
|
121
|
-
const nextGitignoreContent = appendBlock(
|
|
122
|
+
const nextGitignoreContent = appendBlock(
|
|
123
|
+
currentGitignoreContent || '',
|
|
124
|
+
spaceTrim(
|
|
125
|
+
(block) => `
|
|
126
|
+
${block(blockHeader)}
|
|
127
|
+
${block(missingRules.join('\n'))}
|
|
128
|
+
`,
|
|
129
|
+
),
|
|
130
|
+
);
|
|
122
131
|
await writeFile(gitignorePath, nextGitignoreContent, 'utf-8');
|
|
123
132
|
return currentGitignoreContent === undefined ? 'created' : 'updated';
|
|
124
133
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { $resolveLatestNpmPackageVersion } from '../npm/$resolveLatestNpmPackageVersion';
|
|
2
|
+
import { isNpmPackageVersionOutdated } from '../npm/isNpmPackageVersionOutdated';
|
|
3
|
+
import { $resolvePromptbookCliInstallations } from './$resolvePromptbookCliInstallations';
|
|
4
|
+
import type { PromptbookCliInstallation } from './PromptbookCliInstallation';
|
|
5
|
+
import type {
|
|
6
|
+
PromptbookCliInstallationState,
|
|
7
|
+
PromptbookCliInstallationStatus,
|
|
8
|
+
} from './PromptbookCliInstallationStatus';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Checks every local and global Promptbook CLI installation against the newest npm version.
|
|
12
|
+
*
|
|
13
|
+
* Note: `$` is used to indicate that this function is not a pure function - it reads installed packages and queries npm
|
|
14
|
+
*
|
|
15
|
+
* @private internal utility of `promptbookCli`
|
|
16
|
+
*/
|
|
17
|
+
export async function $checkPromptbookCliInstallations(): Promise<ReadonlyArray<PromptbookCliInstallationStatus>> {
|
|
18
|
+
const installations = await $resolvePromptbookCliInstallations();
|
|
19
|
+
|
|
20
|
+
if (installations.length === 0) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const latestVersionsByNpmPackageName = await $resolveLatestVersionsByNpmPackageName(installations);
|
|
25
|
+
|
|
26
|
+
return installations.map((installation) => {
|
|
27
|
+
const latestVersion = latestVersionsByNpmPackageName.get(installation.npmPackageName) ?? null;
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
installation,
|
|
31
|
+
installationState: resolvePromptbookCliInstallationState(installation.installedVersion, latestVersion),
|
|
32
|
+
latestVersion,
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Resolves each package's newest version once, even when it is installed locally and globally.
|
|
39
|
+
*/
|
|
40
|
+
async function $resolveLatestVersionsByNpmPackageName(
|
|
41
|
+
installations: ReadonlyArray<PromptbookCliInstallation>,
|
|
42
|
+
): Promise<ReadonlyMap<PromptbookCliInstallation['npmPackageName'], string | null>> {
|
|
43
|
+
const npmPackageNames = Array.from(new Set(installations.map(({ npmPackageName }) => npmPackageName)));
|
|
44
|
+
const latestVersionEntries = await Promise.all(
|
|
45
|
+
npmPackageNames.map(async (npmPackageName) => {
|
|
46
|
+
const latestVersion = await $resolveLatestNpmPackageVersion(npmPackageName);
|
|
47
|
+
|
|
48
|
+
return [npmPackageName, latestVersion] as const;
|
|
49
|
+
}),
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
return new Map(latestVersionEntries);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Derives the update state of one installed Promptbook CLI package.
|
|
57
|
+
*/
|
|
58
|
+
function resolvePromptbookCliInstallationState(
|
|
59
|
+
installedVersion: string,
|
|
60
|
+
latestVersion: string | null,
|
|
61
|
+
): PromptbookCliInstallationState {
|
|
62
|
+
if (latestVersion === null) {
|
|
63
|
+
return 'unknown';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return isNpmPackageVersionOutdated(installedVersion, latestVersion) ? 'outdated' : 'up-to-date';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Note: [🟡] Code for Promptbook CLI installation check [$checkPromptbookCliInstallations](src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.ts) should never be published outside of `@promptbook/cli`
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import colors from 'colors';
|
|
2
|
+
import { spaceTrim } from 'spacetrim';
|
|
3
|
+
import { $askForNpmPackageInstallationApproval } from '../npm/$askForNpmPackageInstallationApproval';
|
|
4
|
+
import { $checkPromptbookCliInstallations } from './$checkPromptbookCliInstallations';
|
|
5
|
+
import { $updatePromptbookCliInstallation } from './$updatePromptbookCliInstallation';
|
|
6
|
+
import { buildPromptbookCliInstallCommand } from './buildPromptbookCliInstallCommand';
|
|
7
|
+
import type { PromptbookCliInstallationStatus } from './PromptbookCliInstallationStatus';
|
|
8
|
+
import { formatPromptbookCliInstallationWarning } from './formatPromptbookCliInstallationWarning';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Checks local and global Promptbook CLI installations before an interactive coder run and offers to update them.
|
|
12
|
+
*
|
|
13
|
+
* Once an update succeeds, the caller must stop the current run and let the user start a fresh process. A local npm
|
|
14
|
+
* update can modify `package.json` and a lockfile, which would make the coder's clean-working-tree preflight fail;
|
|
15
|
+
* the current Node.js process has also already loaded the old CLI implementation.
|
|
16
|
+
*
|
|
17
|
+
* Note: `$` is used to indicate that this function is not a pure function - it reads package manifests, queries npm,
|
|
18
|
+
* asks the user, and may install npm packages
|
|
19
|
+
*
|
|
20
|
+
* @returns `true` when at least one installation was updated and the current coder run should stop
|
|
21
|
+
* @private internal utility of `promptbookCli`
|
|
22
|
+
*/
|
|
23
|
+
export async function $ensurePromptbookCliInstallations(): Promise<boolean> {
|
|
24
|
+
if (!process.stdin.isTTY) {
|
|
25
|
+
// Note: Non-interactive runs cannot approve an update and should not wait for registry checks
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const statuses = await $checkPromptbookCliInstallations();
|
|
30
|
+
const outdatedStatuses = statuses.filter(({ installationState }) => installationState === 'outdated');
|
|
31
|
+
|
|
32
|
+
if (outdatedStatuses.length === 0) {
|
|
33
|
+
reportPromptbookCliInstallationStatuses(statuses);
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
console.warn(colors.yellow(formatPromptbookCliInstallationWarning(outdatedStatuses)));
|
|
38
|
+
|
|
39
|
+
const isUpdateApproved = await $askForNpmPackageInstallationApproval('Update Promptbook CLI now?');
|
|
40
|
+
|
|
41
|
+
if (!isUpdateApproved) {
|
|
42
|
+
reportManualPromptbookCliUpdateCommands(outdatedStatuses);
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const updateResults: Array<boolean> = [];
|
|
47
|
+
|
|
48
|
+
for (const status of outdatedStatuses) {
|
|
49
|
+
updateResults.push(await $updatePromptbookCliInstallation(status));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const isAnyInstallationUpdated = updateResults.some(Boolean);
|
|
53
|
+
const isEveryInstallationUpdated = updateResults.every(Boolean);
|
|
54
|
+
|
|
55
|
+
if (!isAnyInstallationUpdated) {
|
|
56
|
+
console.info(colors.gray('Promptbook CLI could not be updated; continuing with the installed version.'));
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
console.info(
|
|
61
|
+
isEveryInstallationUpdated
|
|
62
|
+
? colors.green('Promptbook CLI update is complete. Run the command again to use the new version.')
|
|
63
|
+
: colors.yellow(
|
|
64
|
+
'Some Promptbook CLI installations were updated. Resolve the errors above, then run the command again.',
|
|
65
|
+
),
|
|
66
|
+
);
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Reports successful and unverifiable Promptbook CLI checks when no update is required.
|
|
72
|
+
*/
|
|
73
|
+
function reportPromptbookCliInstallationStatuses(statuses: ReadonlyArray<PromptbookCliInstallationStatus>): void {
|
|
74
|
+
for (const status of statuses) {
|
|
75
|
+
const { npmPackageName, installedVersion } = status.installation;
|
|
76
|
+
|
|
77
|
+
if (status.installationState === 'up-to-date') {
|
|
78
|
+
console.info(colors.gray(`✔ Promptbook CLI \`${npmPackageName}\` ${installedVersion} is up to date.`));
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (status.installationState === 'unknown') {
|
|
83
|
+
console.info(
|
|
84
|
+
colors.gray(
|
|
85
|
+
`✔ Promptbook CLI \`${npmPackageName}\` ${installedVersion} is installed; the newest version could not be checked.`,
|
|
86
|
+
),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Prints the exact commands which would update all declined outdated installations.
|
|
94
|
+
*/
|
|
95
|
+
function reportManualPromptbookCliUpdateCommands(
|
|
96
|
+
outdatedStatuses: ReadonlyArray<PromptbookCliInstallationStatus>,
|
|
97
|
+
): void {
|
|
98
|
+
const manualInstallCommands = outdatedStatuses
|
|
99
|
+
.map((status) => `- \`${buildPromptbookCliInstallCommand(status.installation)}\``)
|
|
100
|
+
.join('\n');
|
|
101
|
+
|
|
102
|
+
console.info(
|
|
103
|
+
colors.gray(
|
|
104
|
+
spaceTrim(
|
|
105
|
+
(block) => `
|
|
106
|
+
Skipped updating Promptbook CLI.
|
|
107
|
+
|
|
108
|
+
Run these commands manually:
|
|
109
|
+
|
|
110
|
+
${block(manualInstallCommands)}
|
|
111
|
+
`,
|
|
112
|
+
),
|
|
113
|
+
),
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Note: [🟡] Code for Promptbook CLI installation orchestration [$ensurePromptbookCliInstallations](src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.ts) should never be published outside of `@promptbook/cli`
|