@promptbook/cli 0.114.0-2 → 0.114.0-21
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 +8 -16
- 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 +39 -0
- package/apps/agents-server/package.json +6 -6
- package/apps/agents-server/scripts/build-agents-server.js +43 -7
- package/apps/agents-server/scripts/build-e2e.js +12 -2
- 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/run-e2e-tests.js +21 -8
- package/apps/agents-server/scripts/run-npm.js +81 -5
- package/apps/agents-server/src/app/admin/_components/AdminFilterFields.tsx +84 -0
- package/apps/agents-server/src/app/admin/_components/AdminMetricCard.tsx +36 -0
- package/apps/agents-server/src/app/admin/_components/AdminTaskManagerTabs.tsx +97 -0
- package/apps/agents-server/src/app/admin/email-server/page.tsx +17 -18
- 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 +29 -33
- package/apps/agents-server/src/app/admin/messages/messageAdminPresentation.ts +289 -0
- package/apps/agents-server/src/app/admin/messages/send-email/SendEmailClient.tsx +193 -63
- package/apps/agents-server/src/app/admin/messages/send-email/actions.ts +25 -28
- package/apps/agents-server/src/app/admin/messages/send-email/emailTesting.ts +153 -0
- package/apps/agents-server/src/app/admin/messages/send-email/emailTestingAccess.ts +30 -0
- package/apps/agents-server/src/app/admin/messages/send-email/page.tsx +18 -5
- package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerClient.tsx +103 -0
- package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerEditDialog.tsx +232 -0
- package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerFiltersCard.tsx +195 -0
- package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerRow.tsx +189 -0
- package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerSummaryMetrics.tsx +60 -0
- package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerTableCard.tsx +147 -0
- package/apps/agents-server/src/app/admin/planned-messages/page.tsx +17 -0
- package/apps/agents-server/src/app/admin/planned-messages/plannedMessageEditForm.ts +186 -0
- package/apps/agents-server/src/app/admin/planned-messages/plannedMessageManagerDialogs.ts +46 -0
- package/apps/agents-server/src/app/admin/planned-messages/plannedMessageManagerPresentation.tsx +188 -0
- package/apps/agents-server/src/app/admin/planned-messages/resolvePlannedMessageSortValue.ts +115 -0
- package/apps/agents-server/src/app/admin/planned-messages/usePlannedMessageManagerData.ts +116 -0
- package/apps/agents-server/src/app/admin/planned-messages/usePlannedMessageManagerState.ts +289 -0
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerClient.tsx +7 -2
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerFiltersCard.tsx +7 -73
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerSummaryMetrics.tsx +5 -30
- 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 +3 -1
- package/apps/agents-server/src/app/admin/task-manager/taskManagerTaskPresentation.tsx +23 -0
- package/apps/agents-server/src/app/agents/[agentName]/AgentChatWrapper.tsx +8 -9
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileChat.tsx +5 -9
- package/apps/agents-server/src/app/agents/[agentName]/api/book/reference-diagnostics/route.ts +30 -7
- package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +9 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/book/test.http +3 -3
- 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/BookEditorMissingReferences.tsx +106 -12
- package/apps/agents-server/src/app/agents/[agentName]/book/BookEditorWrapper.tsx +3 -0
- package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorDiagnostics.ts +12 -0
- package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorSaving.ts +18 -28
- package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorWrapper.tsx +2 -0
- 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 +226 -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 +32 -12
- 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/page.tsx +2 -20
- 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]/page.tsx +2 -1
- package/apps/agents-server/src/app/agents/[agentName]/projectReferenceActions.ts +61 -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/default-agents/reinstate/route.ts +5 -1
- package/apps/agents-server/src/app/api/admin/dns-records/cloudflare/route.ts +26 -16
- package/apps/agents-server/src/app/api/admin/planned-messages/[timeoutId]/route.ts +80 -0
- package/apps/agents-server/src/app/api/admin/planned-messages/route.ts +19 -0
- 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 +201 -0
- 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 +31 -39
- 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/resolveLatestCompletedAgentMessageKey.ts +32 -0
- package/apps/agents-server/src/components/AgentProjects/useAgentProjectMarkdownReferences.ts +306 -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/DefaultAgents/ReinstateBundledAgentsButton.tsx +7 -0
- package/apps/agents-server/src/components/DefaultAgents/coreAgentsAdminRoute.ts +6 -0
- 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 +125 -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/DefaultAgentsStatusNotice.tsx +1 -7
- 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/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/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/database/migrations/2026-08-1800-user-chat-timeout-schedule.sql +11 -0
- package/apps/agents-server/src/generated/reservedPaths.ts +42 -42
- package/apps/agents-server/src/instrumentation-node.ts +18 -0
- package/apps/agents-server/src/languages/ServerTranslationKeys.ts +16 -11
- package/apps/agents-server/src/languages/translations/czech.yaml +16 -11
- package/apps/agents-server/src/languages/translations/english.yaml +16 -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 +59 -19
- 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 +249 -0
- package/apps/agents-server/src/tools/agentGoalChatTimeoutTools.ts +147 -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/adminEntityLookups/loadAgentNamesByPermanentId.ts +45 -0
- package/apps/agents-server/src/utils/adminEntityLookups/loadUsernamesByUserId.ts +36 -0
- package/apps/agents-server/src/utils/adminEntityLookups.ts +2 -0
- 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 +583 -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 +129 -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 +25 -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 -11
- package/apps/agents-server/src/utils/agentProjects/agentProjectIdentity.ts +46 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeAutostartScheduler.ts +162 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeDesiredState.ts +252 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeDisplay.ts +6 -3
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeDomains.ts +2 -44
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimePaths.ts +25 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimePm2.ts +4 -3
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeRegistry.ts +77 -24
- package/apps/agents-server/src/utils/agentProjects/agentProjectStateMutationQueue.ts +58 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectsPaths.ts +15 -5
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectInitials.ts +36 -0
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectMarkdownReferences.ts +124 -19
- 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/listAgentProjectNames.ts +35 -0
- package/apps/agents-server/src/utils/agentProjects/listAgentProjects.ts +6 -23
- package/apps/agents-server/src/utils/agentProjects/listAllLocalAgentProjectIdentities.ts +48 -0
- 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/resolveAgentChatProjectReferences.ts +25 -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/agentProjects/resolveAgentProjectRuntimeEnvironmentFlag.ts +23 -0
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectRuntimeStatus.ts +73 -0
- package/apps/agents-server/src/utils/agentProjects/startDefaultAgentProjectRuntimes.ts +110 -0
- package/apps/agents-server/src/utils/agentReferenceResolver/MissingCoreAgentRecovery.ts +19 -0
- package/apps/agents-server/src/utils/agentReferenceResolver/bookScopedAgentReferences.ts +7 -0
- package/apps/agents-server/src/utils/agentReferenceResolver/createAgentInheritanceDiagnostics.ts +457 -0
- package/apps/agents-server/src/utils/agentReferenceResolver/createUnresolvedAgentReferenceDiagnostics.ts +27 -0
- package/apps/agents-server/src/utils/agentReferenceResolver/resolveCoreAgentAwareMissingReferences.ts +156 -0
- package/apps/agents-server/src/utils/bookLanguageDocumentation/createBookLanguageDocumentationPdfResponse.ts +19 -17
- package/apps/agents-server/src/utils/chatMessageChips/createAnsweredMessageChipToolCalls.ts +49 -0
- package/apps/agents-server/src/utils/chatMessageChips/createPlannedMessageChipToolCalls.ts +44 -0
- package/apps/agents-server/src/utils/chatMessageChips/createTouchedExternalSourceChipToolCalls.ts +39 -0
- package/apps/agents-server/src/utils/chatMessageChips/createTouchedProjectChipResult.ts +45 -0
- package/apps/agents-server/src/utils/chatMessageChips/createTouchedProjectChipToolCalls.ts +109 -0
- 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/cronExpression/CronExpression.ts +63 -0
- package/apps/agents-server/src/utils/cronExpression/normalizeCronExpression.ts +34 -0
- package/apps/agents-server/src/utils/cronExpression/normalizeCronExpressionWhitespace.ts +11 -0
- package/apps/agents-server/src/utils/cronExpression/parseCronExpression.ts +41 -0
- package/apps/agents-server/src/utils/cronExpression/parseCronExpressionField.ts +140 -0
- package/apps/agents-server/src/utils/cronExpression/resolveNextCronRun.ts +100 -0
- package/apps/agents-server/src/utils/cronExpression/throwInvalidCronExpressionField.ts +20 -0
- package/apps/agents-server/src/utils/cronExpression.ts +10 -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/email/agentEmailAddress.ts +14 -0
- package/apps/agents-server/src/utils/email/sendEmailThroughStalwart.ts +2 -1
- package/apps/agents-server/src/utils/explicitFromCommitment.ts +130 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/adminChatTaskSqlQuery.ts +41 -36
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/loadAdminChatTaskFallbackData.ts +3 -77
- 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/applyLocalAgentPlannedMessageCommands.ts +261 -0
- 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/prepareLocalAgentPlannedMessagesSidecar.ts +74 -0
- package/apps/agents-server/src/utils/localChatRunner/prepareLocalTeamConversationWorkspace.ts +233 -0
- package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +154 -27
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentBooks.ts +5 -12
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentRuntime.ts +2 -2
- package/apps/agents-server/src/utils/managementApi/managementApiSchemas.ts +2 -2
- package/apps/agents-server/src/utils/messages/parseUseEmailSmtpCredential.ts +1 -1
- package/apps/agents-server/src/utils/plannedMessageManager/cancelManagedPlannedMessage.ts +35 -0
- package/apps/agents-server/src/utils/plannedMessageManager/collectPlannedMessageAgentOptions.ts +56 -0
- package/apps/agents-server/src/utils/plannedMessageManager/createPlannedMessageManagerCounters.ts +104 -0
- package/apps/agents-server/src/utils/plannedMessageManager/filterPlannedMessages.ts +191 -0
- package/apps/agents-server/src/utils/plannedMessageManager/getPlannedMessageManagerResponse.ts +55 -0
- package/apps/agents-server/src/utils/plannedMessageManager/isPlannedMessageStillPlanned.ts +18 -0
- package/apps/agents-server/src/utils/plannedMessageManager/loadPlannedMessageManagerRecord.ts +32 -0
- package/apps/agents-server/src/utils/plannedMessageManager/mapPlannedMessageManagerRecord.ts +73 -0
- package/apps/agents-server/src/utils/plannedMessageManager/parsePlannedMessageManagerUpdateRequest.ts +76 -0
- package/apps/agents-server/src/utils/plannedMessageManager/resolvePlannedMessageEndReason.ts +59 -0
- package/apps/agents-server/src/utils/plannedMessageManager/resolvePlannedMessageLifecycle.ts +99 -0
- package/apps/agents-server/src/utils/plannedMessageManager/resolvePlannedMessageRecurrenceKind.ts +40 -0
- package/apps/agents-server/src/utils/plannedMessageManager/updateManagedPlannedMessage.ts +121 -0
- package/apps/agents-server/src/utils/plannedMessagesAdmin.ts +200 -0
- package/apps/agents-server/src/utils/resolveInheritedAgentSource.ts +114 -95
- 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/createEmailDnsRecordsSection.ts +53 -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/persistUserChatJobTerminalState.ts +5 -0
- 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/userChatJobRunReport.ts +30 -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 +13 -31
- package/apps/agents-server/src/utils/userChatTimeout/UserChatTimeoutRecord.ts +47 -3
- package/apps/agents-server/src/utils/userChatTimeout/agentScopedTimeoutBulkActions.ts +11 -17
- package/apps/agents-server/src/utils/userChatTimeout/createTimeoutWakeUpMessage.ts +38 -6
- package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/PlannedMessageSchedule.ts +52 -0
- package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/hasPlannedMessageRecurrence.ts +13 -0
- package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/isPlannedMessageScheduleFinished.ts +30 -0
- package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/normalizePlannedMessageScheduleValues.ts +62 -0
- package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/parsePlannedMessageSchedule.ts +202 -0
- package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/resolvePlannedMessageDueAt.ts +121 -0
- package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule.ts +12 -0
- package/apps/agents-server/src/utils/userChatTimeout/setAgentScopedUserChatTimeoutPausedState.ts +66 -0
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/claimNextDueUserChatTimeout.ts +28 -25
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/createUserChatTimeout.ts +76 -5
- 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/listAllUserChatTimeouts.ts +37 -0
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/mapUserChatTimeoutRow.ts +9 -0
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/recoverExpiredRunningUserChatTimeouts.ts +3 -2
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/repeatFiredUserChatTimeout.ts +84 -0
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/updateAgentScopedUserChatTimeout.ts +39 -6
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore.ts +2 -0
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutWorker.ts +220 -57
- package/apps/agents-server/src/utils/userChatTimeout.ts +16 -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/vpsSelfUpdateCron.ts +23 -316
- package/apps/agents-server/src/utils/vpsSelfUpdate.ts +1 -0
- package/apps/agents-server/tests/e2e/support/AgentManagementApi.ts +3 -3
- package/esm/index.es.js +10579 -10176
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-agent-messages/git/commitAgentProjectChanges.d.ts +15 -0
- package/esm/scripts/run-agent-messages/git/commitAnsweredMessageProjectChanges.d.ts +24 -0
- package/esm/scripts/run-agent-messages/git/ensureAgentProjectGitRepository.d.ts +20 -0
- package/esm/scripts/run-agent-messages/git/readAgentProjectCommitChange.d.ts +11 -0
- package/esm/scripts/run-agent-messages/git/runAgentProjectGitCommand.d.ts +29 -0
- package/esm/scripts/run-agent-messages/messages/buildAgentGoalChatPromptSection.d.ts +26 -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/listAgentProjectDirectoryNames.d.ts +7 -0
- package/esm/scripts/run-agent-messages/messages/loadAgentPlannedMessagesSidecar.d.ts +10 -0
- package/esm/scripts/run-agent-messages/messages/loadAgentTeamConversationWorkspace.d.ts +6 -0
- package/esm/scripts/run-agent-messages/messages/resolveAnsweredMessageTouches.d.ts +29 -0
- package/esm/scripts/run-codex-prompts/common/CoderRunControlFeedback.d.ts +54 -0
- package/esm/scripts/run-codex-prompts/common/applyCoderRunControlKey.d.ts +14 -0
- package/esm/scripts/run-codex-prompts/common/buildCoderRunControlKeyBadge.d.ts +7 -0
- package/esm/scripts/run-codex-prompts/common/createCoderRunStepTracker.d.ts +48 -0
- package/esm/scripts/run-codex-prompts/common/formatCoderRunControlFeedback.d.ts +13 -0
- package/esm/scripts/run-codex-prompts/common/listenForCoderRunControls.d.ts +17 -0
- package/esm/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
- package/esm/scripts/run-codex-prompts/common/runGoScript/$spawnLoggedBashScript.d.ts +25 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/$terminateLoggedBashProcessTree.d.ts +11 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +11 -0
- package/esm/scripts/run-codex-prompts/common/waitForPause.d.ts +0 -8
- package/esm/scripts/run-codex-prompts/common/waitForSkippableWorldTimeDeadline.d.ts +15 -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/pingCoderHarnessPeriodically.d.ts +22 -0
- package/esm/scripts/run-codex-prompts/ping/printCoderPingResult.d.ts +5 -0
- package/esm/scripts/run-codex-prompts/prompts/buildPromptLabel.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/prompts/buildPromptStatusDetails.d.ts +50 -0
- package/esm/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +6 -3
- package/esm/scripts/run-codex-prompts/prompts/isPromptSectionUnfinished.d.ts +8 -0
- package/esm/scripts/run-codex-prompts/prompts/listPromptsByStatus.d.ts +7 -0
- package/esm/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +15 -4
- package/esm/scripts/run-codex-prompts/prompts/markPromptFailed.d.ts +34 -1
- package/esm/scripts/run-codex-prompts/prompts/markPromptInProgress.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/prompts/promptRunnerAttribution.d.ts +24 -0
- package/esm/scripts/run-codex-prompts/prompts/resolveInterruptedPrompt.d.ts +9 -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/runPromptWithTestFeedback.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +15 -1
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +6 -1
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +11 -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/agent-source/AgentSourceParseResult.d.ts +5 -0
- package/esm/src/book-2.0/agent-source/ParsedUnknownCommitment.d.ts +26 -0
- package/esm/src/book-2.0/agent-source/getBookCommitmentLineType.d.ts +19 -0
- package/esm/src/book-3.0/AgentMessageRunReport.d.ts +46 -0
- package/esm/src/book-3.0/AgentPlannedMessagesSidecar.d.ts +127 -0
- package/esm/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
- package/esm/src/book-3.0/createAgentMessageSidecarBaseName.d.ts +13 -0
- package/esm/src/book-3.0/describeAgentPlannedMessageSchedule.d.ts +31 -0
- package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +1 -9
- package/esm/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.d.ts +28 -0
- package/esm/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.d.ts +28 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
- package/esm/src/book-components/Chat/Chat/renderAgentProjectDiff.d.ts +13 -0
- package/esm/src/book-components/Chat/Chat/renderAgentProjectToolCallDetails.d.ts +16 -0
- package/esm/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
- package/esm/src/book-components/Chat/utils/agentProjectToolCall.d.ts +85 -0
- package/esm/src/book-components/Chat/utils/externalSourceToolCall.d.ts +38 -0
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +68 -3
- package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +30 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/GitChangesMode.d.ts +28 -0
- 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 +2 -5
- package/esm/src/cli/cli-commands/coder/verify.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/waitOptions.d.ts +12 -0
- package/esm/src/cli/cli-commands/coder.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +34 -0
- package/esm/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +3 -3
- package/esm/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +3 -3
- package/esm/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +3 -2
- package/esm/src/cli/cli-commands/common/harnessUpdateCliOptions.d.ts +29 -0
- package/{umd/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts → esm/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
- package/esm/src/cli/cli-commands/common/{harness/$resolveLatestHarnessVersion.d.ts → 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/promptRunnerCliOptions.d.ts +9 -2
- 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/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +15 -0
- package/{umd/src/commitments/COMPONENT/COMPONENT.d.ts → esm/src/commitments/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/executables/platforms/locateAppOnWindows.d.ts +1 -1
- 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/AgentMessageProjectChange.d.ts +76 -0
- package/esm/src/utils/agent-message-runtime/AgentMessageTouchedExternalSource.d.ts +45 -0
- package/esm/src/utils/agent-message-runtime/parseAgentMessageRuntimeLogEvents.d.ts +62 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.d.ts +18 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.d.ts +19 -0
- 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/AgentSourceParseResult.ts +6 -0
- package/src/book-2.0/agent-source/ParsedUnknownCommitment.ts +29 -0
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/augmentAgentModelRequirementsFromSource.ts +38 -1
- 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/getBookCommitmentLineType.ts +36 -0
- 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/agent-source/parseAgentSourceWithCommitments.ts +128 -61
- package/src/book-2.0/agent-source/string_book.ts +1 -1
- package/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.ts +0 -25
- package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +6 -14
- package/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.ts +13 -33
- package/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.ts +12 -32
- package/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.ts +1 -4
- package/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.ts +4 -17
- package/src/book-3.0/AgentMessageRunReport.ts +135 -0
- package/src/book-3.0/AgentPlannedMessagesSidecar.ts +284 -0
- package/src/book-3.0/AgentTeamConversationWorkspace.ts +170 -0
- package/src/book-3.0/LiteAgent.ts +11 -9
- package/src/book-3.0/createAgentMessageSidecarBaseName.ts +20 -0
- package/src/book-3.0/describeAgentPlannedMessageSchedule.ts +94 -0
- package/src/book-components/BookEditor/BookEditorMonaco.tsx +8 -1
- package/src/book-components/BookEditor/BookEditorMonacoTokenization.ts +3 -1
- package/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.ts +3 -11
- package/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.ts +71 -0
- package/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.ts +50 -0
- 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 +172 -27
- package/src/book-components/Chat/Chat/ChatMessageMap.tsx +7 -4
- package/src/book-components/Chat/Chat/ChatProps.tsx +3 -2
- package/src/book-components/Chat/Chat/renderAgentProjectDiff.tsx +85 -0
- package/src/book-components/Chat/Chat/renderAgentProjectToolCallDetails.tsx +206 -0
- package/src/book-components/Chat/Chat/renderToolCallDetails.tsx +9 -12
- package/src/book-components/Chat/MarkdownContent/MarkdownContent.module.css +85 -17
- package/src/book-components/Chat/MarkdownContent/MarkdownContent.tsx +115 -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/agentProjectToolCall.ts +151 -0
- package/src/book-components/Chat/utils/externalSourceToolCall.ts +65 -0
- package/src/book-components/Chat/utils/getToolCallChipletInfo.ts +64 -0
- package/src/book-components/Chat/utils/renderMarkdown.ts +660 -119
- package/src/book-components/Chat/utils/timeoutToolCallPresentation.ts +34 -3
- 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 -1
- package/src/cli/cli-commands/coder/GitChangesMode.ts +35 -0
- package/src/cli/cli-commands/coder/add.ts +40 -12
- package/src/cli/cli-commands/coder/boilerplateCount.ts +139 -0
- package/src/cli/cli-commands/coder/boilerplateTemplates.ts +3 -15
- 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 +40 -4
- package/src/cli/cli-commands/coder/ping.ts +58 -44
- package/src/cli/cli-commands/coder/run.ts +23 -4
- package/src/cli/cli-commands/coder/server.ts +12 -3
- package/src/cli/cli-commands/coder/verify.ts +55 -16
- package/src/cli/cli-commands/coder/waitOptions.ts +33 -0
- package/src/cli/cli-commands/coder.ts +3 -3
- package/src/cli/cli-commands/common/coderGitSyncCliOptions.ts +82 -0
- package/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.ts +9 -2
- package/src/cli/cli-commands/common/harness/$checkHarnessInstallation.ts +24 -8
- package/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.ts +6 -3
- package/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.ts +2 -2
- package/src/cli/cli-commands/common/harness/HarnessInstallationStatus.ts +3 -2
- package/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.ts +2 -1
- package/src/cli/cli-commands/common/harnessUpdateCliOptions.ts +46 -0
- 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/promptRunnerCliOptions.ts +22 -4
- 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/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.ts +47 -3
- package/src/commands/FORMAT/formatCommandParser.ts +4 -2
- package/src/commitments/ACTION/ACTION.ts +3 -3
- package/src/commitments/FROM/FROM.ts +13 -0
- 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/executables/platforms/locateAppOnWindows.ts +12 -9
- 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 +843 -772
- 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/AgentMessageProjectChange.ts +183 -0
- package/src/utils/agent-message-runtime/AgentMessageTouchedExternalSource.ts +80 -0
- package/src/utils/agent-message-runtime/parseAgentMessageRuntimeLogEvents.ts +108 -0
- package/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.ts +78 -75
- package/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.ts +341 -0
- package/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.ts +147 -0
- 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/utils/random/$generateBookBoilerplate.ts +1 -1
- package/src/version.ts +2 -2
- package/src/versions.txt +17 -0
- package/umd/index.umd.js +8545 -8136
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-agent-messages/git/commitAgentProjectChanges.d.ts +15 -0
- package/umd/scripts/run-agent-messages/git/commitAnsweredMessageProjectChanges.d.ts +24 -0
- package/umd/scripts/run-agent-messages/git/ensureAgentProjectGitRepository.d.ts +20 -0
- package/umd/scripts/run-agent-messages/git/readAgentProjectCommitChange.d.ts +11 -0
- package/umd/scripts/run-agent-messages/git/runAgentProjectGitCommand.d.ts +29 -0
- package/umd/scripts/run-agent-messages/messages/buildAgentGoalChatPromptSection.d.ts +26 -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/listAgentProjectDirectoryNames.d.ts +7 -0
- package/umd/scripts/run-agent-messages/messages/loadAgentPlannedMessagesSidecar.d.ts +10 -0
- package/umd/scripts/run-agent-messages/messages/loadAgentTeamConversationWorkspace.d.ts +6 -0
- package/umd/scripts/run-agent-messages/messages/resolveAnsweredMessageTouches.d.ts +29 -0
- package/umd/scripts/run-codex-prompts/common/CoderRunControlFeedback.d.ts +54 -0
- package/umd/scripts/run-codex-prompts/common/applyCoderRunControlKey.d.ts +14 -0
- package/umd/scripts/run-codex-prompts/common/buildCoderRunControlKeyBadge.d.ts +7 -0
- package/umd/scripts/run-codex-prompts/common/createCoderRunStepTracker.d.ts +48 -0
- package/umd/scripts/run-codex-prompts/common/formatCoderRunControlFeedback.d.ts +13 -0
- package/umd/scripts/run-codex-prompts/common/listenForCoderRunControls.d.ts +17 -0
- package/umd/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
- package/umd/scripts/run-codex-prompts/common/runGoScript/$spawnLoggedBashScript.d.ts +25 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/$terminateLoggedBashProcessTree.d.ts +11 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +11 -0
- package/umd/scripts/run-codex-prompts/common/waitForPause.d.ts +0 -8
- package/umd/scripts/run-codex-prompts/common/waitForSkippableWorldTimeDeadline.d.ts +15 -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/pingCoderHarnessPeriodically.d.ts +22 -0
- package/umd/scripts/run-codex-prompts/ping/printCoderPingResult.d.ts +5 -0
- package/umd/scripts/run-codex-prompts/prompts/buildPromptLabel.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/prompts/buildPromptStatusDetails.d.ts +50 -0
- package/umd/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +6 -3
- package/umd/scripts/run-codex-prompts/prompts/isPromptSectionUnfinished.d.ts +8 -0
- package/umd/scripts/run-codex-prompts/prompts/listPromptsByStatus.d.ts +7 -0
- package/umd/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +15 -4
- package/umd/scripts/run-codex-prompts/prompts/markPromptFailed.d.ts +34 -1
- package/umd/scripts/run-codex-prompts/prompts/markPromptInProgress.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/prompts/promptRunnerAttribution.d.ts +24 -0
- package/umd/scripts/run-codex-prompts/prompts/resolveInterruptedPrompt.d.ts +9 -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/runPromptWithTestFeedback.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +15 -1
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +6 -1
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +11 -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/agent-source/AgentSourceParseResult.d.ts +5 -0
- package/umd/src/book-2.0/agent-source/ParsedUnknownCommitment.d.ts +26 -0
- package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.unknown.test.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/getBookCommitmentLineType.d.ts +19 -0
- package/umd/src/book-2.0/agent-source/parseAgentSourceWithCommitments.unknown.test.d.ts +1 -0
- package/umd/src/book-3.0/AgentMessageRunReport.d.ts +46 -0
- package/umd/src/book-3.0/AgentPlannedMessagesSidecar.d.ts +127 -0
- package/umd/src/book-3.0/AgentPlannedMessagesSidecar.test.d.ts +1 -0
- package/umd/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
- package/umd/src/book-3.0/createAgentMessageSidecarBaseName.d.ts +13 -0
- package/umd/src/book-3.0/describeAgentPlannedMessageSchedule.d.ts +31 -0
- package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +1 -9
- package/umd/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.d.ts +28 -0
- package/umd/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.test.d.ts +1 -0
- package/umd/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.d.ts +28 -0
- package/umd/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.test.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
- package/umd/src/book-components/Chat/Chat/renderAgentProjectDiff.d.ts +13 -0
- package/umd/src/book-components/Chat/Chat/renderAgentProjectToolCallDetails.d.ts +16 -0
- package/umd/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
- package/umd/src/book-components/Chat/utils/agentProjectToolCall.d.ts +85 -0
- package/umd/src/book-components/Chat/utils/agentProjectToolCall.test.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/externalSourceToolCall.d.ts +38 -0
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +68 -3
- package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +30 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/GitChangesMode.d.ts +28 -0
- package/umd/src/cli/cli-commands/coder/boilerplateCount.d.ts +52 -0
- package/umd/src/cli/cli-commands/coder/boilerplateCount.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +4 -3
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/ping.d.ts +2 -5
- package/umd/src/cli/cli-commands/coder/verify.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/waitOptions.d.ts +12 -0
- package/umd/src/cli/cli-commands/coder.d.ts +1 -1
- package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +34 -0
- package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +3 -3
- package/umd/src/cli/cli-commands/common/harness/$checkHarnessInstallation.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +3 -3
- package/umd/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +3 -2
- package/umd/src/cli/cli-commands/common/harnessUpdateCliOptions.d.ts +29 -0
- package/umd/src/cli/cli-commands/common/harnessUpdateCliOptions.test.d.ts +1 -0
- package/{esm/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts → umd/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
- package/umd/src/cli/cli-commands/common/{harness/$resolveLatestHarnessVersion.d.ts → npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
- package/umd/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +9 -2
- package/umd/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts +1 -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/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +15 -0
- package/{esm/src/commitments/COMPONENT/COMPONENT.d.ts → umd/src/commitments/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/executables/platforms/locateAppOnWindows.d.ts +1 -1
- package/umd/src/executables/platforms/locateAppOnWindows.test.d.ts +1 -0
- 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/AgentMessageProjectChange.d.ts +76 -0
- package/umd/src/utils/agent-message-runtime/AgentMessageTouchedExternalSource.d.ts +45 -0
- package/umd/src/utils/agent-message-runtime/parseAgentMessageRuntimeLogEvents.d.ts +62 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.d.ts +18 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.test.d.ts +1 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.d.ts +19 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.test.d.ts +1 -0
- 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/utils/random/$generateBookBoilerplate.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/admin/task-manager/TaskManagerScopeTabs.tsx +0 -74
- 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/components/AgentProjectDnsInstructions/AgentProjectDnsInstructions.tsx +0 -182
- 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/scripts/run-agent-chat/runCoderPing.d.ts +0 -48
- package/esm/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +0 -7
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunOctopusVisual.d.ts +0 -13
- 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/scripts/run-agent-chat/runCoderPing.d.ts +0 -48
- package/umd/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +0 -7
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunOctopusVisual.d.ts +0 -13
- 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 → book-2.0/agent-source/createAgentModelRequirementsWithCommitments.unknown.test.d.ts} +0 -0
- /package/esm/src/{commitments/MEMORY/MEMORY.test.d.ts → book-2.0/agent-source/parseAgentSourceWithCommitments.unknown.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_BROWSER/USE_BROWSER.test.d.ts → book-3.0/AgentPlannedMessagesSidecar.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts → book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.test.d.ts → book-components/BookEditor/createUnknownCommitmentDiagnostics.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_EMAIL/USE_EMAIL.test.d.ts → book-components/Chat/utils/agentProjectToolCall.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts → cli/cli-commands/coder/boilerplateCount.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts → cli/cli-commands/coder/generate-boilerplates.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_SPAWN/USE_SPAWN.test.d.ts → cli/cli-commands/common/coderGitSyncCliOptions.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_TIME/USE_TIME.test.d.ts → cli/cli-commands/common/harness/$checkHarnessInstallation.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts → cli/cli-commands/common/harnessUpdateCliOptions.test.d.ts} +0 -0
- /package/esm/src/{commitments/WALLET/WALLET.test.d.ts → cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.test.d.ts} +0 -0
- /package/{umd/src/book-2.0/agent-source/createAgentModelRequirements.useCommitmentAggregation.test.d.ts → esm/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.test.d.ts} +0 -0
- /package/{umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts} +0 -0
- /package/{umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts → esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts} +0 -0
- /package/{umd/src/commitments/MEMORY/MEMORY.test.d.ts → esm/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.test.d.ts} +0 -0
- /package/{umd/src/commitments/USE_BROWSER/USE_BROWSER.test.d.ts → esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts} +0 -0
- /package/{umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts → esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts} +0 -0
- /package/{umd/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.test.d.ts → esm/src/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/commitments/USE_EMAIL/USE_EMAIL.test.d.ts → esm/src/executables/platforms/locateAppOnWindows.test.d.ts} +0 -0
- /package/{umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts → esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.test.d.ts} +0 -0
- /package/{umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts → esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.test.d.ts} +0 -0
- /package/{umd/src/commitments/USE_SPAWN/USE_SPAWN.test.d.ts → esm/src/utils/misc/debounce.test.d.ts} +0 -0
- /package/{umd/src/commitments/USE_TIME/USE_TIME.test.d.ts → esm/src/utils/random/$generateBookBoilerplate.test.d.ts} +0 -0
- /package/umd/src/{commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts → avatars/renderAvatarVisualTerminalText.test.d.ts} +0 -0
- /package/umd/src/{commitments/WALLET/WALLET.test.d.ts → book-2.0/agent-source/createAgentModelRequirements.commitmentAggregation.test.d.ts} +0 -0
- /package/umd/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.d.ts +0 -0
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
resolveAgentProjectDomainRegistryFilePath,
|
|
10
10
|
resolveAgentProjectDomainsFilePath,
|
|
11
11
|
} from './agentProjectRuntimePaths';
|
|
12
|
+
import { runAgentProjectStateMutation } from './agentProjectStateMutationQueue';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Current on-disk domain registry schema version.
|
|
@@ -139,23 +140,6 @@ type PersistedAgentProjectDomainRegistry = {
|
|
|
139
140
|
readonly domains: ReadonlyArray<AgentProjectDomainRecord>;
|
|
140
141
|
};
|
|
141
142
|
|
|
142
|
-
/**
|
|
143
|
-
* Process-wide domain registry state.
|
|
144
|
-
*/
|
|
145
|
-
type AgentProjectDomainRegistryState = {
|
|
146
|
-
/**
|
|
147
|
-
* Promise chain used as a lightweight mutation queue.
|
|
148
|
-
*/
|
|
149
|
-
domainMutationQueue: Promise<void>;
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Global object shape used for process-wide domain registry state.
|
|
154
|
-
*/
|
|
155
|
-
type AgentProjectDomainRegistryGlobal = typeof globalThis & {
|
|
156
|
-
[AGENT_PROJECT_DOMAIN_REGISTRY_GLOBAL_KEY]?: AgentProjectDomainRegistryState;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
143
|
/**
|
|
160
144
|
* Assigns or refreshes the stable public domain for one agent project.
|
|
161
145
|
*
|
|
@@ -483,21 +467,7 @@ async function writeAgentProjectDomainRecords(records: ReadonlyArray<AgentProjec
|
|
|
483
467
|
* Runs one domain-registry mutation after previous mutations have finished.
|
|
484
468
|
*/
|
|
485
469
|
async function runAgentProjectDomainRegistryMutation<TValue>(operation: () => Promise<TValue>): Promise<TValue> {
|
|
486
|
-
|
|
487
|
-
const previousMutation = registryState.domainMutationQueue;
|
|
488
|
-
let releaseMutation!: () => void;
|
|
489
|
-
|
|
490
|
-
registryState.domainMutationQueue = new Promise<void>((resolve) => {
|
|
491
|
-
releaseMutation = resolve;
|
|
492
|
-
});
|
|
493
|
-
|
|
494
|
-
await previousMutation.catch(() => undefined);
|
|
495
|
-
|
|
496
|
-
try {
|
|
497
|
-
return await operation();
|
|
498
|
-
} finally {
|
|
499
|
-
releaseMutation();
|
|
500
|
-
}
|
|
470
|
+
return await runAgentProjectStateMutation(AGENT_PROJECT_DOMAIN_REGISTRY_GLOBAL_KEY, operation);
|
|
501
471
|
}
|
|
502
472
|
|
|
503
473
|
/**
|
|
@@ -719,15 +689,3 @@ async function writeTextFile(filePath: string, content: string): Promise<void> {
|
|
|
719
689
|
await mkdir(dirname(filePath), { recursive: true });
|
|
720
690
|
await writeFile(filePath, content, 'utf-8');
|
|
721
691
|
}
|
|
722
|
-
|
|
723
|
-
/**
|
|
724
|
-
* Returns process-wide project-domain registry state.
|
|
725
|
-
*/
|
|
726
|
-
function getAgentProjectDomainRegistryState(): AgentProjectDomainRegistryState {
|
|
727
|
-
const registryGlobal = globalThis as AgentProjectDomainRegistryGlobal;
|
|
728
|
-
registryGlobal[AGENT_PROJECT_DOMAIN_REGISTRY_GLOBAL_KEY] ??= {
|
|
729
|
-
domainMutationQueue: Promise.resolve(),
|
|
730
|
-
};
|
|
731
|
-
|
|
732
|
-
return registryGlobal[AGENT_PROJECT_DOMAIN_REGISTRY_GLOBAL_KEY]!;
|
|
733
|
-
}
|
|
@@ -15,6 +15,11 @@ export const PTBK_AGENT_PROJECT_DOMAIN_REGISTRY_FILE_ENV = 'PTBK_AGENT_PROJECT_D
|
|
|
15
15
|
*/
|
|
16
16
|
export const PTBK_AGENT_PROJECT_DOMAINS_FILE_ENV = 'PTBK_AGENT_PROJECT_DOMAINS_FILE';
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Environment variable overriding the persisted project desired-state file.
|
|
20
|
+
*/
|
|
21
|
+
export const PTBK_AGENT_PROJECT_RUNTIME_DESIRED_STATE_FILE_ENV = 'PTBK_AGENT_PROJECT_RUNTIME_DESIRED_STATE_FILE';
|
|
22
|
+
|
|
18
23
|
/**
|
|
19
24
|
* Directory under the Agents Server data root used for project runtime state.
|
|
20
25
|
*/
|
|
@@ -35,6 +40,11 @@ const AGENT_PROJECT_DOMAIN_REGISTRY_FILE_NAME = 'domains.json';
|
|
|
35
40
|
*/
|
|
36
41
|
const AGENT_PROJECT_DOMAINS_FILE_NAME = 'domains.txt';
|
|
37
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Persisted desired-state filename.
|
|
45
|
+
*/
|
|
46
|
+
const AGENT_PROJECT_RUNTIME_DESIRED_STATE_FILE_NAME = 'desired-states.json';
|
|
47
|
+
|
|
38
48
|
/**
|
|
39
49
|
* Resolves the durable state root used by agent project runtime managers.
|
|
40
50
|
*
|
|
@@ -86,6 +96,21 @@ export function resolveAgentProjectDomainRegistryFilePath(): string {
|
|
|
86
96
|
return join(resolveAgentProjectRuntimeStateRoot(), AGENT_PROJECT_DOMAIN_REGISTRY_FILE_NAME);
|
|
87
97
|
}
|
|
88
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Resolves the JSON file remembering which projects were explicitly started or stopped.
|
|
101
|
+
*
|
|
102
|
+
* @returns Absolute file path.
|
|
103
|
+
*/
|
|
104
|
+
export function resolveAgentProjectRuntimeDesiredStateFilePath(): string {
|
|
105
|
+
const configuredFilePath = process.env[PTBK_AGENT_PROJECT_RUNTIME_DESIRED_STATE_FILE_ENV]?.trim();
|
|
106
|
+
|
|
107
|
+
if (configuredFilePath) {
|
|
108
|
+
return resolve(configuredFilePath);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return join(resolveAgentProjectRuntimeStateRoot(), AGENT_PROJECT_RUNTIME_DESIRED_STATE_FILE_NAME);
|
|
112
|
+
}
|
|
113
|
+
|
|
89
114
|
/**
|
|
90
115
|
* Resolves the newline-separated domain file consumed by the VPS installer.
|
|
91
116
|
*
|
|
@@ -3,6 +3,7 @@ import { createHash } from 'crypto';
|
|
|
3
3
|
import { promisify } from 'util';
|
|
4
4
|
import { AGENT_PROJECT_RUNTIME_HOST } from './agentProjectRuntimeConstants';
|
|
5
5
|
import type { AgentProjectRuntimeMode } from './AgentProjectRuntimeInfo';
|
|
6
|
+
import { resolveAgentProjectRuntimeEnvironmentFlag } from './resolveAgentProjectRuntimeEnvironmentFlag';
|
|
6
7
|
|
|
7
8
|
const execFileAsync = promisify(execFile);
|
|
8
9
|
|
|
@@ -137,10 +138,10 @@ export type StartAgentProjectRuntimePm2ProcessOptions = {
|
|
|
137
138
|
* @returns `true` on production Linux unless explicitly disabled.
|
|
138
139
|
*/
|
|
139
140
|
export function isAgentProjectRuntimePm2Enabled(): boolean {
|
|
140
|
-
const
|
|
141
|
+
const configuredFlag = resolveAgentProjectRuntimeEnvironmentFlag(PTBK_AGENT_PROJECT_RUNTIME_PM2_ENABLED_ENV);
|
|
141
142
|
|
|
142
|
-
if (
|
|
143
|
-
return
|
|
143
|
+
if (configuredFlag !== null) {
|
|
144
|
+
return configuredFlag;
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
return process.platform === 'linux' && process.env.NODE_ENV === 'production';
|
|
@@ -13,6 +13,7 @@ import type {
|
|
|
13
13
|
AgentProjectRuntimeMode,
|
|
14
14
|
AgentProjectRuntimeStatus,
|
|
15
15
|
} from './AgentProjectRuntimeInfo';
|
|
16
|
+
import { isSameAgentProjectIdentity } from './agentProjectIdentity';
|
|
16
17
|
import {
|
|
17
18
|
AGENT_PROJECT_RUNTIME_DEFAULT_DEV_COMMAND,
|
|
18
19
|
AGENT_PROJECT_RUNTIME_HOST,
|
|
@@ -21,6 +22,7 @@ import {
|
|
|
21
22
|
AGENT_PROJECT_RUNTIME_STOP_POLL_INTERVAL_MS,
|
|
22
23
|
AGENT_PROJECT_RUNTIME_STOP_TIMEOUT_MS,
|
|
23
24
|
} from './agentProjectRuntimeConstants';
|
|
25
|
+
import { setAgentProjectRuntimeDesiredState } from './agentProjectRuntimeDesiredState';
|
|
24
26
|
import {
|
|
25
27
|
assignAgentProjectDomain,
|
|
26
28
|
resolveAgentProjectDomainRecord,
|
|
@@ -207,6 +209,9 @@ export async function assignAgentProjectPort(
|
|
|
207
209
|
/**
|
|
208
210
|
* Starts one project using its npm `dev` script when available, otherwise a static file server.
|
|
209
211
|
*
|
|
212
|
+
* Starting a project also makes it expected to be running, so a project which was stopped earlier
|
|
213
|
+
* is started again by itself after the next server restart.
|
|
214
|
+
*
|
|
210
215
|
* @param options - Agent and project identification.
|
|
211
216
|
* @returns Runtime info for the started project.
|
|
212
217
|
*/
|
|
@@ -216,6 +221,15 @@ export async function startAgentProjectRuntime(
|
|
|
216
221
|
await hydrateAgentProjectRuntimeRegistryState();
|
|
217
222
|
|
|
218
223
|
const project = await resolveExistingAgentProject(options);
|
|
224
|
+
|
|
225
|
+
// Note: The intent is remembered before the project is started so that a project which fails to
|
|
226
|
+
// start now is still tried again by the next automatic pass.
|
|
227
|
+
await setAgentProjectRuntimeDesiredState({
|
|
228
|
+
agentPermanentId: options.agentPermanentId,
|
|
229
|
+
projectName: project.projectName,
|
|
230
|
+
desiredState: 'running',
|
|
231
|
+
});
|
|
232
|
+
|
|
219
233
|
const isDevRuntime = await hasAgentProjectDevScript(project.absolutePath);
|
|
220
234
|
const preparedStart = await prepareAgentProjectRuntimeStart(options, project);
|
|
221
235
|
|
|
@@ -375,7 +389,9 @@ export async function listAgentProjectRuntimes(): Promise<ReadonlyArray<AgentPro
|
|
|
375
389
|
}
|
|
376
390
|
|
|
377
391
|
/**
|
|
378
|
-
* Terminates one runtime by runtime id.
|
|
392
|
+
* Terminates one runtime by runtime id on explicit request.
|
|
393
|
+
*
|
|
394
|
+
* The project is remembered as stopped, so it stays down until it is started again.
|
|
379
395
|
*
|
|
380
396
|
* @param runtimeId - Runtime id.
|
|
381
397
|
* @returns Terminated runtime info or `null` when it no longer exists.
|
|
@@ -389,14 +405,19 @@ export async function terminateAgentProjectRuntimeById(runtimeId: string): Promi
|
|
|
389
405
|
return null;
|
|
390
406
|
}
|
|
391
407
|
|
|
392
|
-
await
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
408
|
+
await setAgentProjectRuntimeDesiredState({
|
|
409
|
+
agentPermanentId: runtimeRecord.agentPermanentId,
|
|
410
|
+
projectName: runtimeRecord.projectName,
|
|
411
|
+
desiredState: 'stopped',
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
return await removeAgentProjectRuntimeById(runtimeId);
|
|
396
415
|
}
|
|
397
416
|
|
|
398
417
|
/**
|
|
399
|
-
* Terminates any runtime assigned to one project.
|
|
418
|
+
* Terminates any runtime assigned to one project on explicit request.
|
|
419
|
+
*
|
|
420
|
+
* The project is remembered as stopped, so it stays down until it is started again.
|
|
400
421
|
*
|
|
401
422
|
* @param options - Agent and project identification.
|
|
402
423
|
* @returns Terminated runtime info or `null` when no runtime exists.
|
|
@@ -405,30 +426,64 @@ export async function terminateAgentProjectRuntimeForProject(
|
|
|
405
426
|
options: AgentProjectRuntimeProjectOptions,
|
|
406
427
|
): Promise<AgentProjectRuntimeInfo | null> {
|
|
407
428
|
await hydrateAgentProjectRuntimeRegistryState();
|
|
429
|
+
await setAgentProjectRuntimeDesiredState({
|
|
430
|
+
agentPermanentId: options.agentPermanentId,
|
|
431
|
+
projectName: options.projectName,
|
|
432
|
+
desiredState: 'stopped',
|
|
433
|
+
});
|
|
408
434
|
|
|
409
|
-
|
|
435
|
+
return await removeAgentProjectRuntimeForProject(options);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Terminates all project runtimes in the current process.
|
|
440
|
+
*
|
|
441
|
+
* This is used by tests and process-level cleanup, so it says nothing about which projects should
|
|
442
|
+
* be running — every project keeps the state it is expected to be in.
|
|
443
|
+
*/
|
|
444
|
+
export async function terminateAllAgentProjectRuntimes(): Promise<void> {
|
|
445
|
+
await hydrateAgentProjectRuntimeRegistryState();
|
|
446
|
+
|
|
447
|
+
const runtimeIds = [...getAgentProjectRuntimeRegistryState().runtimesById.keys()];
|
|
448
|
+
|
|
449
|
+
await Promise.all(runtimeIds.map((runtimeId) => removeAgentProjectRuntimeById(runtimeId)));
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Terminates one runtime by runtime id without changing which state the project is expected to be in.
|
|
454
|
+
*
|
|
455
|
+
* @param runtimeId - Runtime id.
|
|
456
|
+
* @returns Terminated runtime info or `null` when it no longer exists.
|
|
457
|
+
*/
|
|
458
|
+
async function removeAgentProjectRuntimeById(runtimeId: string): Promise<AgentProjectRuntimeInfo | null> {
|
|
459
|
+
const runtimeRecord = getAgentProjectRuntimeRegistryState().runtimesById.get(runtimeId);
|
|
410
460
|
|
|
411
461
|
if (!runtimeRecord) {
|
|
412
462
|
return null;
|
|
413
463
|
}
|
|
414
464
|
|
|
415
465
|
await terminateAgentProjectRuntimeRecord(runtimeRecord);
|
|
416
|
-
getAgentProjectRuntimeRegistryState().runtimesById.delete(
|
|
466
|
+
getAgentProjectRuntimeRegistryState().runtimesById.delete(runtimeId);
|
|
417
467
|
await persistAgentProjectRuntimeRegistryState();
|
|
418
468
|
return toAgentProjectRuntimeInfo(runtimeRecord);
|
|
419
469
|
}
|
|
420
470
|
|
|
421
471
|
/**
|
|
422
|
-
* Terminates
|
|
472
|
+
* Terminates the runtime of one project without changing which state the project is expected to be in.
|
|
423
473
|
*
|
|
424
|
-
*
|
|
474
|
+
* @param options - Agent and project identification.
|
|
475
|
+
* @returns Terminated runtime info or `null` when no runtime exists.
|
|
425
476
|
*/
|
|
426
|
-
|
|
427
|
-
|
|
477
|
+
async function removeAgentProjectRuntimeForProject(
|
|
478
|
+
options: AgentProjectRuntimeProjectOptions,
|
|
479
|
+
): Promise<AgentProjectRuntimeInfo | null> {
|
|
480
|
+
const runtimeRecord = findAgentProjectRuntimeRecord(options.agentPermanentId, options.projectName);
|
|
428
481
|
|
|
429
|
-
|
|
482
|
+
if (!runtimeRecord) {
|
|
483
|
+
return null;
|
|
484
|
+
}
|
|
430
485
|
|
|
431
|
-
await
|
|
486
|
+
return await removeAgentProjectRuntimeById(runtimeRecord.id);
|
|
432
487
|
}
|
|
433
488
|
|
|
434
489
|
/**
|
|
@@ -438,7 +493,7 @@ async function prepareAgentProjectRuntimeStart(
|
|
|
438
493
|
options: AgentProjectRuntimeProjectOptions,
|
|
439
494
|
project: NonNullable<Awaited<ReturnType<typeof resolveAgentProjectInfo>>>,
|
|
440
495
|
): Promise<PreparedAgentProjectRuntimeStart> {
|
|
441
|
-
await
|
|
496
|
+
await removeAgentProjectRuntimeForProject({
|
|
442
497
|
agentPermanentId: options.agentPermanentId,
|
|
443
498
|
projectName: project.projectName,
|
|
444
499
|
});
|
|
@@ -595,12 +650,16 @@ function startChildProcessAgentProjectDevRuntime(runtimeRecord: MutableAgentProj
|
|
|
595
650
|
}
|
|
596
651
|
|
|
597
652
|
/**
|
|
598
|
-
* Applies installer-managed nginx and SSL configuration when a
|
|
653
|
+
* Applies installer-managed nginx and SSL configuration when a project domain was added or changed.
|
|
654
|
+
*
|
|
655
|
+
* The generated nginx configuration resolves the runtime port of a project per request, so it only
|
|
656
|
+
* has to be regenerated when the set of project domains itself changes — never when an unchanged
|
|
657
|
+
* project is merely started again on a new port.
|
|
599
658
|
*/
|
|
600
659
|
async function applyAgentProjectRuntimePublicConfiguration(
|
|
601
660
|
domainAssignment: AgentProjectDomainAssignment,
|
|
602
661
|
): Promise<void> {
|
|
603
|
-
if (!domainAssignment.record) {
|
|
662
|
+
if (!domainAssignment.record || !domainAssignment.isChanged) {
|
|
604
663
|
return;
|
|
605
664
|
}
|
|
606
665
|
|
|
@@ -642,14 +701,8 @@ function findAgentProjectRuntimeRecord(
|
|
|
642
701
|
agentPermanentId: string,
|
|
643
702
|
projectName: string,
|
|
644
703
|
): MutableAgentProjectRuntimeRecord | null {
|
|
645
|
-
const normalizedAgentPermanentId = agentPermanentId.toLowerCase();
|
|
646
|
-
const normalizedProjectName = projectName.toLowerCase();
|
|
647
|
-
|
|
648
704
|
for (const runtimeRecord of getAgentProjectRuntimeRegistryState().runtimesById.values()) {
|
|
649
|
-
if (
|
|
650
|
-
runtimeRecord.agentPermanentId.toLowerCase() === normalizedAgentPermanentId &&
|
|
651
|
-
runtimeRecord.projectName.toLowerCase() === normalizedProjectName
|
|
652
|
-
) {
|
|
705
|
+
if (isSameAgentProjectIdentity(runtimeRecord, { agentPermanentId, projectName })) {
|
|
653
706
|
return runtimeRecord;
|
|
654
707
|
}
|
|
655
708
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global key used to keep one mutation queue per agent-project state file across module reloads.
|
|
3
|
+
*/
|
|
4
|
+
const AGENT_PROJECT_STATE_MUTATION_QUEUES_GLOBAL_KEY = '__PROMPTBOOK_AGENT_PROJECT_STATE_MUTATION_QUEUES__';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Global object shape used for process-wide state-file mutation queues.
|
|
8
|
+
*/
|
|
9
|
+
type AgentProjectStateMutationQueuesGlobal = typeof globalThis & {
|
|
10
|
+
[AGENT_PROJECT_STATE_MUTATION_QUEUES_GLOBAL_KEY]?: Map<string, Promise<void>>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Runs one agent-project state mutation after all previously queued mutations of the same state file finished.
|
|
15
|
+
*
|
|
16
|
+
* The project state files are read-modify-write JSON documents, so two concurrent mutations would
|
|
17
|
+
* silently drop one of the two changes. Every mutation of one file goes through its own queue, while
|
|
18
|
+
* mutations of unrelated files still run in parallel.
|
|
19
|
+
*
|
|
20
|
+
* @param queueName - Stable name of the mutated state file.
|
|
21
|
+
* @param operation - Mutation to run exclusively for that state file.
|
|
22
|
+
* @returns Whatever the mutation returns.
|
|
23
|
+
*/
|
|
24
|
+
export async function runAgentProjectStateMutation<TValue>(
|
|
25
|
+
queueName: string,
|
|
26
|
+
operation: () => Promise<TValue>,
|
|
27
|
+
): Promise<TValue> {
|
|
28
|
+
const mutationQueues = getAgentProjectStateMutationQueues();
|
|
29
|
+
const previousMutation = mutationQueues.get(queueName) ?? Promise.resolve();
|
|
30
|
+
let releaseMutation!: () => void;
|
|
31
|
+
|
|
32
|
+
mutationQueues.set(
|
|
33
|
+
queueName,
|
|
34
|
+
new Promise<void>((resolve) => {
|
|
35
|
+
releaseMutation = resolve;
|
|
36
|
+
}),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
await previousMutation.catch(() => undefined);
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
return await operation();
|
|
43
|
+
} finally {
|
|
44
|
+
releaseMutation();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Returns the process-wide mutation queues of all agent-project state files.
|
|
50
|
+
*
|
|
51
|
+
* @returns Mutable map of pending mutations keyed by state file name.
|
|
52
|
+
*/
|
|
53
|
+
function getAgentProjectStateMutationQueues(): Map<string, Promise<void>> {
|
|
54
|
+
const mutationQueuesGlobal = globalThis as AgentProjectStateMutationQueuesGlobal;
|
|
55
|
+
mutationQueuesGlobal[AGENT_PROJECT_STATE_MUTATION_QUEUES_GLOBAL_KEY] ??= new Map();
|
|
56
|
+
|
|
57
|
+
return mutationQueuesGlobal[AGENT_PROJECT_STATE_MUTATION_QUEUES_GLOBAL_KEY]!;
|
|
58
|
+
}
|
|
@@ -61,18 +61,28 @@ export function parseAgentPermanentIdFromDirectoryName(agentDirectoryName: strin
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
64
|
+
* Returns whether one path segment stays inside its parent directory.
|
|
65
65
|
*
|
|
66
66
|
* @param pathSegment - Single decoded path segment (project name or one file path part).
|
|
67
|
-
* @
|
|
68
|
-
* @throws {NotAllowed} When the segment is empty or attempts path traversal.
|
|
67
|
+
* @returns `true` when the segment is non-empty and cannot escape its parent directory.
|
|
69
68
|
*/
|
|
70
|
-
export function
|
|
69
|
+
export function isSafeAgentProjectPathSegment(pathSegment: string): boolean {
|
|
71
70
|
const isTraversalSegment = pathSegment === '.' || pathSegment === '..';
|
|
72
71
|
const hasPathSeparator = pathSegment.includes('/') || pathSegment.includes('\\');
|
|
73
72
|
const hasNullByte = pathSegment.includes('\0');
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
return pathSegment.length > 0 && !isTraversalSegment && !hasPathSeparator && !hasNullByte;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Asserts that one path segment coming from a URL cannot escape its parent directory.
|
|
79
|
+
*
|
|
80
|
+
* @param pathSegment - Single decoded path segment (project name or one file path part).
|
|
81
|
+
* @param segmentPurpose - Human-readable description used in the error message.
|
|
82
|
+
* @throws {NotAllowed} When the segment is empty or attempts path traversal.
|
|
83
|
+
*/
|
|
84
|
+
export function assertSafeAgentProjectPathSegment(pathSegment: string, segmentPurpose: string): void {
|
|
85
|
+
if (!isSafeAgentProjectPathSegment(pathSegment)) {
|
|
76
86
|
throw new NotAllowed(
|
|
77
87
|
spaceTrim(`
|
|
78
88
|
Invalid ${segmentPurpose} \`${pathSegment}\`.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { humanizeAgentProjectName } from './humanizeAgentProjectName';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Maximum count of letters shown in one project initials icon.
|
|
5
|
+
*/
|
|
6
|
+
const AGENT_PROJECT_INITIALS_MAX_LENGTH = 3;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Matches the first letter or digit of one word of a project name.
|
|
10
|
+
*/
|
|
11
|
+
const PROJECT_NAME_WORD_INITIAL_REGEX = /[\p{L}\p{N}]/u;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initials used for a project whose name has no letters and no digits at all.
|
|
15
|
+
*/
|
|
16
|
+
const AGENT_PROJECT_FALLBACK_INITIALS = '#';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Creates the initials shown for one project which has no favicon.
|
|
20
|
+
*
|
|
21
|
+
* For example `prague-murders-map` becomes `PMM`.
|
|
22
|
+
*
|
|
23
|
+
* @param projectName - Project directory name.
|
|
24
|
+
* @returns Up to three uppercase initials of the project name.
|
|
25
|
+
*/
|
|
26
|
+
export function createAgentProjectInitials(projectName: string): string {
|
|
27
|
+
const projectInitials = humanizeAgentProjectName(projectName)
|
|
28
|
+
.split(/\s+/u)
|
|
29
|
+
.map((projectNameWord) => PROJECT_NAME_WORD_INITIAL_REGEX.exec(projectNameWord)?.[0] || '')
|
|
30
|
+
.filter((projectNameInitial) => projectNameInitial !== '')
|
|
31
|
+
.slice(0, AGENT_PROJECT_INITIALS_MAX_LENGTH)
|
|
32
|
+
.join('')
|
|
33
|
+
.toUpperCase();
|
|
34
|
+
|
|
35
|
+
return projectInitials || AGENT_PROJECT_FALLBACK_INITIALS;
|
|
36
|
+
}
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import type { MarkdownInlineReference } from '@promptbook-local/types';
|
|
2
2
|
import type { AgentProjectReferenceInfo } from './AgentProjectReferenceInfo';
|
|
3
|
-
import {
|
|
3
|
+
import { buildAgentProjectFileHref, buildAgentProjectProfileHref } from './agentProjectHrefs';
|
|
4
|
+
import { createAgentProjectInitials } from './createAgentProjectInitials';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Stable action id used by a stopped project's open-and-start menu option.
|
|
8
|
+
*/
|
|
9
|
+
const OPEN_AGENT_PROJECT_ACTION_ID = 'open-agent-project';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Stable action id used by a project runtime start menu option.
|
|
13
|
+
*/
|
|
14
|
+
const START_AGENT_PROJECT_ACTION_ID = 'start-agent-project';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Stable action id used by a project runtime stop menu option.
|
|
18
|
+
*/
|
|
19
|
+
const STOP_AGENT_PROJECT_ACTION_ID = 'stop-agent-project';
|
|
4
20
|
|
|
5
21
|
/**
|
|
6
22
|
* Markdown inline reference data consumed by chat markdown rendering.
|
|
@@ -20,18 +36,40 @@ type CreateAgentProjectMarkdownReferencesOptions = {
|
|
|
20
36
|
* Project references available to this agent chat.
|
|
21
37
|
*/
|
|
22
38
|
readonly projects: ReadonlyArray<AgentProjectMarkdownReferenceInfo>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Opens a project, starting its runtime first when needed.
|
|
42
|
+
*/
|
|
43
|
+
readonly onOpenProject?: (project: AgentProjectMarkdownReferenceInfo) => void | Promise<void>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Starts or stops one project runtime.
|
|
47
|
+
*/
|
|
48
|
+
readonly onChangeProjectRuntime?: (
|
|
49
|
+
project: AgentProjectMarkdownReferenceInfo,
|
|
50
|
+
isRunning: boolean,
|
|
51
|
+
) => void | Promise<void>;
|
|
23
52
|
};
|
|
24
53
|
|
|
25
54
|
/**
|
|
26
55
|
* Project fields required to create a chat markdown reference.
|
|
27
56
|
*/
|
|
28
|
-
type AgentProjectMarkdownReferenceInfo = Pick<
|
|
57
|
+
export type AgentProjectMarkdownReferenceInfo = Pick<
|
|
29
58
|
AgentProjectReferenceInfo,
|
|
30
|
-
'projectName' | 'displayName' | 'description' | 'isRunning' | 'projectUrl'
|
|
59
|
+
'projectName' | 'displayName' | 'description' | 'faviconRelativePath' | 'isRunning' | 'projectUrl'
|
|
31
60
|
>;
|
|
32
61
|
|
|
33
62
|
/**
|
|
34
|
-
*
|
|
63
|
+
* One menu option belonging to a project markdown reference.
|
|
64
|
+
*/
|
|
65
|
+
type AgentProjectMarkdownReferenceMenuOption = NonNullable<AgentProjectMarkdownReference['menu']>['options'][number];
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Creates markdown references rendering every mention of one project as a project chip.
|
|
69
|
+
*
|
|
70
|
+
* One project is mentioned either by its display name in chat prose, its `[[project-name]]` token,
|
|
71
|
+
* a link into its project page or files, or its public project URL. All of them render the same chip
|
|
72
|
+
* showing the project name together with its running state.
|
|
35
73
|
*
|
|
36
74
|
* @param options - Agent and project metadata.
|
|
37
75
|
* @returns Inline markdown references for the shared chat renderer.
|
|
@@ -42,38 +80,105 @@ export function createAgentProjectMarkdownReferences(
|
|
|
42
80
|
return options.projects.map((project) => {
|
|
43
81
|
const projectProfileHref = buildAgentProjectProfileHref(options.agentPermanentId, project.projectName);
|
|
44
82
|
const projectUrl = project.projectUrl || null;
|
|
83
|
+
const label = project.displayName || project.projectName;
|
|
84
|
+
const faviconHref = project.faviconRelativePath
|
|
85
|
+
? buildAgentProjectFileHref(options.agentPermanentId, project.projectName, project.faviconRelativePath)
|
|
86
|
+
: null;
|
|
45
87
|
|
|
46
88
|
return {
|
|
47
89
|
reference: project.projectName,
|
|
48
|
-
|
|
90
|
+
sourceTextAliases: [label],
|
|
91
|
+
label,
|
|
49
92
|
href: projectProfileHref,
|
|
50
|
-
sourceHrefPrefixes: [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
93
|
+
sourceHrefPrefixes: [projectProfileHref, ...(projectUrl ? [projectUrl] : [])],
|
|
94
|
+
title: project.description || label,
|
|
95
|
+
icon: {
|
|
96
|
+
src: faviconHref,
|
|
97
|
+
fallbackText: createAgentProjectInitials(project.projectName),
|
|
98
|
+
},
|
|
56
99
|
menu: {
|
|
57
100
|
status: {
|
|
58
101
|
label: project.isRunning ? 'Project is running' : 'Project is not running',
|
|
59
102
|
isActive: project.isRunning ?? false,
|
|
60
103
|
},
|
|
61
104
|
options: [
|
|
62
|
-
|
|
63
|
-
label: 'Open the project in a new tab',
|
|
64
|
-
href: project.isRunning ? projectUrl : null,
|
|
65
|
-
title:
|
|
66
|
-
project.isRunning && projectUrl
|
|
67
|
-
? 'Open the project in a new tab'
|
|
68
|
-
: 'The project must run before it can be opened.',
|
|
69
|
-
},
|
|
105
|
+
createOpenAgentProjectMenuOption(project, options.onOpenProject),
|
|
70
106
|
{
|
|
71
107
|
label: 'Open the project page in a new tab',
|
|
72
108
|
href: projectProfileHref,
|
|
73
109
|
title: 'Open the project page in a new tab',
|
|
74
110
|
},
|
|
111
|
+
...(options.onChangeProjectRuntime
|
|
112
|
+
? [createChangeAgentProjectRuntimeMenuOption(project, options.onChangeProjectRuntime)]
|
|
113
|
+
: []),
|
|
75
114
|
],
|
|
76
115
|
},
|
|
77
116
|
};
|
|
78
117
|
});
|
|
79
118
|
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Creates the project destination option, using a client action when the runtime must be started.
|
|
122
|
+
*
|
|
123
|
+
* @param project - Project represented by the menu.
|
|
124
|
+
* @param onOpenProject - Optional open-and-start callback.
|
|
125
|
+
* @returns Project destination menu option.
|
|
126
|
+
*/
|
|
127
|
+
function createOpenAgentProjectMenuOption(
|
|
128
|
+
project: AgentProjectMarkdownReferenceInfo,
|
|
129
|
+
onOpenProject: CreateAgentProjectMarkdownReferencesOptions['onOpenProject'],
|
|
130
|
+
): AgentProjectMarkdownReferenceMenuOption {
|
|
131
|
+
const projectUrl = project.projectUrl || null;
|
|
132
|
+
|
|
133
|
+
if (project.isRunning && projectUrl) {
|
|
134
|
+
return {
|
|
135
|
+
label: 'Open the project in a new tab',
|
|
136
|
+
href: projectUrl,
|
|
137
|
+
title: 'Open the project in a new tab',
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (onOpenProject) {
|
|
142
|
+
return {
|
|
143
|
+
label: 'Open the project in a new tab',
|
|
144
|
+
href: null,
|
|
145
|
+
title: 'Start the project and open it in a new tab',
|
|
146
|
+
action: {
|
|
147
|
+
id: OPEN_AGENT_PROJECT_ACTION_ID,
|
|
148
|
+
onSelect: () => onOpenProject(project),
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return {
|
|
154
|
+
label: 'Open the project in a new tab',
|
|
155
|
+
href: null,
|
|
156
|
+
title: 'The project must run before it can be opened.',
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Creates the start or stop action matching a project's current runtime state.
|
|
162
|
+
*
|
|
163
|
+
* @param project - Project represented by the menu.
|
|
164
|
+
* @param onChangeProjectRuntime - Runtime state callback.
|
|
165
|
+
* @returns Start or stop project menu option.
|
|
166
|
+
*/
|
|
167
|
+
function createChangeAgentProjectRuntimeMenuOption(
|
|
168
|
+
project: AgentProjectMarkdownReferenceInfo,
|
|
169
|
+
onChangeProjectRuntime: NonNullable<CreateAgentProjectMarkdownReferencesOptions['onChangeProjectRuntime']>,
|
|
170
|
+
): AgentProjectMarkdownReferenceMenuOption {
|
|
171
|
+
const isRunning = project.isRunning === true;
|
|
172
|
+
const actionId = isRunning ? STOP_AGENT_PROJECT_ACTION_ID : START_AGENT_PROJECT_ACTION_ID;
|
|
173
|
+
const label = isRunning ? 'Stop the project' : 'Start the project';
|
|
174
|
+
|
|
175
|
+
return {
|
|
176
|
+
label,
|
|
177
|
+
href: null,
|
|
178
|
+
title: label,
|
|
179
|
+
action: {
|
|
180
|
+
id: actionId,
|
|
181
|
+
onSelect: () => onChangeProjectRuntime(project, !isRunning),
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
}
|