@promptbook/cli 0.114.0-5 → 0.114.0-50
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 +65 -31
- package/agents/default/.core/adam.book +33 -0
- package/agents/default/copywriter.book +15 -0
- package/agents/default/developer.book +16 -18
- package/agents/default/lawyer.book +14 -0
- package/agents/default/planner.book +16 -0
- package/apps/agents-server/README.md +1 -1
- package/apps/agents-server/next.config.ts +28 -0
- package/apps/agents-server/package.json +7 -7
- package/apps/agents-server/scripts/build-agents-server.js +47 -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/about/page.tsx +1 -1
- 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 +3 -4
- 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]/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/globals.css +15 -0
- package/apps/agents-server/src/app/page.tsx +1 -1
- package/apps/agents-server/src/app/superadmin/servers/ServersRegistryTable.tsx +31 -39
- package/apps/agents-server/src/app/swagger/SwaggerPageClient.tsx +35 -19
- package/apps/agents-server/src/components/AgentNaming/legacyAgentTextTranslations.cs.yaml +7 -0
- 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/ContextMenu/ContextMenuPanel.tsx +1 -11
- 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/buildActiveAgentViewItems.ts +5 -4
- package/apps/agents-server/src/components/Header/buildHeaderSystemMenuItems.ts +7 -0
- 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/Homepage/DefaultAgentsStatusNotice.tsx +1 -7
- package/apps/agents-server/src/components/Homepage/useAgentsListImportExportState.ts +22 -10
- package/apps/agents-server/src/components/_utils/generateMetaTxt.ts +1 -1
- package/apps/agents-server/src/constants/federatedAgentImport.ts +7 -0
- 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 -1
- package/apps/agents-server/src/languages/translations/czech.yaml +16 -1
- package/apps/agents-server/src/languages/translations/english.yaml +16 -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/middleware/createMiddlewareRequestContext/loadRegisteredServers.ts +8 -0
- package/apps/agents-server/src/tools/$provideServer.ts +2 -1
- 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/mapRegisteredServerContexts.ts +1 -1
- package/apps/agents-server/src/types/swagger-ui-dist.d.ts +5 -0
- 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 +60 -13
- 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/listAllAgentProjectSummaries.ts +2 -1
- 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/AgentReferenceResolutionIssue.ts +1 -69
- 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/extractAgentReferenceTokens.ts +1 -61
- package/apps/agents-server/src/utils/agentReferenceResolver/resolveCoreAgentAwareMissingReferences.ts +156 -0
- package/apps/agents-server/src/utils/applicationFonts.ts +4 -25
- 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/createWellKnownAgentUrl.ts +17 -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/currentServerRegistryContext.ts +2 -1
- package/apps/agents-server/src/utils/customDomainRouting.ts +143 -10
- 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 +1 -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/getFederatedServers.ts +5 -15
- package/apps/agents-server/src/utils/getWellKnownAgentUrl.ts +2 -3
- package/apps/agents-server/src/utils/handleChatCompletion/createHandleChatCompletionPromptContext.ts +3 -1
- 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 -11
- 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/parseFederatedServers.ts +14 -0
- 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 +33 -799
- 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/serverManagement/getManagedServerById.ts +1 -1
- package/apps/agents-server/src/utils/serverManagement/listManagedServers.ts +1 -1
- package/apps/agents-server/src/utils/serverRegistry.ts +0 -24
- package/apps/agents-server/src/utils/serverRegistryNode.ts +27 -0
- package/apps/agents-server/src/utils/stalwart/createEmailDnsRecordsSection.ts +53 -0
- 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/createImmediateUserChatAnswerModelRequirements.ts +1 -0
- package/apps/agents-server/src/utils/userChat/createRunUserChatJobExecutionContext.ts +2 -5
- 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/vpsSelfUpdate/vpsSelfUpdateCron.ts +23 -316
- package/apps/agents-server/tests/e2e/mockSupabaseServer.cjs +79 -2
- package/apps/agents-server/tests/e2e/support/AgentManagementApi.ts +3 -3
- package/apps/agents-server/tests/e2e/support/ChatHistoryNavigationSupport.ts +12 -2
- package/apps/agents-server/tests/e2e/support/auth.ts +6 -0
- package/esm/apps/agents-server/src/constants/federatedAgentImport.d.ts +6 -0
- package/esm/index.es.js +48587 -33692
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/find-fresh-emoji-tags/find-fresh-emoji-tags.d.ts +1 -1
- package/esm/scripts/find-refactor-candidates/find-refactor-candidates.d.ts +2 -0
- package/esm/scripts/find-refactor-candidates/resolveRefactorCandidateProject.d.ts +3 -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/createAgentRunnerSystemMessage.d.ts +2 -1
- 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/checks/CheckBeforeMode.d.ts +20 -0
- package/esm/scripts/run-codex-prompts/checks/CoderCheckExecutionError.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/checks/CoderCheckFailedError.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/checks/buildCheckBeforeScriptPath.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/checks/checkRepairInstructions.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/checks/createCheckBeforeRepairPrompt.d.ts +11 -0
- package/esm/scripts/run-codex-prompts/checks/limitCheckOutput.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/checks/projectCheck.d.ts +26 -0
- package/esm/scripts/run-codex-prompts/checks/projectScriptReferences.d.ts +7 -0
- package/esm/scripts/run-codex-prompts/checks/runCheckBefore.d.ts +31 -0
- package/esm/scripts/run-codex-prompts/checks/runCoderCheck.d.ts +17 -0
- package/esm/scripts/run-codex-prompts/checks/runCoderCheckRepair.d.ts +40 -0
- package/esm/scripts/run-codex-prompts/checks/runPromptCheckCommand.d.ts +16 -0
- package/esm/scripts/run-codex-prompts/{testing/runPromptWithTestFeedback.d.ts → checks/runPromptWithCheckFeedback.d.ts} +14 -9
- 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/createFreeDiskSpaceGuard.d.ts +28 -0
- package/esm/scripts/run-codex-prompts/common/formatCoderRunControlFeedback.d.ts +13 -0
- package/esm/scripts/run-codex-prompts/common/formatUnknownErrorDetails.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/common/listenForCoderRunControls.d.ts +18 -0
- package/esm/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
- package/esm/scripts/run-codex-prompts/common/resolveCoderAgent.d.ts +44 -5
- package/esm/scripts/run-codex-prompts/common/resolveCoderContext.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/common/resolveCoderProjectContext.d.ts +19 -0
- package/esm/scripts/run-codex-prompts/common/resolveInlineOrFileText.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/$spawnLoggedBashScript.d.ts +29 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/$terminateLoggedBashProcessTree.d.ts +11 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/buildCoderExecutionArtifactPaths.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/captureLiveScriptOutput.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/createScriptOutputLineReader.d.ts +26 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/quoteBashArgument.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/resolveShellHereDocumentDelimiter.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +7 -1
- package/esm/scripts/run-codex-prompts/common/sleepWithCountdown.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/common/waitForPause.d.ts +0 -8
- package/esm/scripts/run-codex-prompts/common/waitForSkippableWorldTimeDeadline.d.ts +16 -0
- package/esm/scripts/run-codex-prompts/common/withCoderWorkspaceLock.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/git/CoderGitOperationError.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/git/CoderPhasePersistence.d.ts +105 -0
- package/esm/scripts/run-codex-prompts/git/CoderPhaseRecovery.d.ts +43 -0
- package/esm/scripts/run-codex-prompts/git/buildCoderCheckCommitMessage.d.ts +11 -0
- package/esm/scripts/run-codex-prompts/git/coderCommitScope.d.ts +47 -0
- package/esm/scripts/run-codex-prompts/git/coderFinalizationFiles.d.ts +14 -0
- package/esm/scripts/run-codex-prompts/git/coderGitSync.d.ts +20 -2
- package/esm/scripts/run-codex-prompts/git/coderIndexLease.d.ts +11 -0
- package/esm/scripts/run-codex-prompts/git/coderRepositoryFiles.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/git/coderRepositorySnapshot.d.ts +62 -0
- package/esm/scripts/run-codex-prompts/git/coderRepositoryView.d.ts +30 -0
- package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +43 -4
- package/esm/scripts/run-codex-prompts/git/commitInitializedAgentBooks.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/git/ensureWorkingTreeClean.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/git/gitLongPathsSupport.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/git/pullLatestChanges.d.ts +3 -1
- package/esm/scripts/run-codex-prompts/git/quoteGitArgument.d.ts +5 -0
- package/esm/scripts/run-codex-prompts/git/runGitCommand.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/git/runWorkspaceGitWithIndexReadRetry.d.ts +7 -0
- package/esm/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +40 -0
- package/esm/scripts/run-codex-prompts/isolation/coderIsolationArtifacts.d.ts +16 -0
- package/esm/scripts/run-codex-prompts/isolation/coderIsolationIgnoredFiles.d.ts +18 -0
- package/esm/scripts/run-codex-prompts/isolation/copyCoderIsolationEnvironment.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/isolation/createCoderIsolationWorktree.d.ts +3 -2
- package/esm/scripts/run-codex-prompts/isolation/mapProjectReferenceToWorktree.d.ts +5 -0
- package/esm/scripts/run-codex-prompts/isolation/mergeCoderIsolationWorktree.d.ts +5 -5
- package/esm/scripts/run-codex-prompts/isolation/preserveCoderIsolationRecovery.d.ts +3 -0
- package/esm/scripts/run-codex-prompts/isolation/runIsolatedPromptRound.d.ts +2 -2
- package/esm/scripts/run-codex-prompts/main/findUnwrittenPrompts.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/main/listCoderPrompts.d.ts +22 -0
- package/esm/scripts/run-codex-prompts/main/prepareCoderPromptExecution.d.ts +18 -0
- package/esm/scripts/run-codex-prompts/main/resolvePromptRunner.d.ts +16 -8
- package/esm/scripts/run-codex-prompts/main/runCoderFix.d.ts +24 -0
- package/esm/scripts/run-codex-prompts/main/runPromptRound.d.ts +16 -6
- package/esm/scripts/run-codex-prompts/ping/pingCoderHarnessPeriodically.d.ts +22 -0
- package/esm/scripts/run-codex-prompts/prompts/buildPromptLabel.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/prompts/buildPromptLabelForDisplay.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/prompts/buildPromptRunTraceContent.d.ts +70 -0
- package/esm/scripts/run-codex-prompts/prompts/buildPromptRunTracePath.d.ts +10 -0
- package/esm/scripts/run-codex-prompts/prompts/buildPromptStatusDetails.d.ts +9 -13
- package/esm/scripts/run-codex-prompts/prompts/findFirstNonEmptyLineIndex.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +2 -2
- package/esm/scripts/run-codex-prompts/prompts/formatRunnerSignature.d.ts +14 -1
- package/esm/scripts/run-codex-prompts/prompts/isPromptCompatibleWithRunner.d.ts +11 -6
- package/esm/scripts/run-codex-prompts/prompts/listPromptsByStatus.d.ts +7 -0
- package/esm/scripts/run-codex-prompts/prompts/listUpcomingTasks.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/prompts/loadPromptFiles.d.ts +10 -2
- package/esm/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +15 -4
- package/esm/scripts/run-codex-prompts/prompts/markPromptFailed.d.ts +28 -1
- package/esm/scripts/run-codex-prompts/prompts/printPromptsToBeWritten.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/prompts/promptRunnerAttribution.d.ts +30 -0
- package/esm/scripts/run-codex-prompts/prompts/refreshPromptSelection.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/prompts/resolveInterruptedPrompt.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/prompts/writePromptErrorLog.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/prompts/writePromptFile.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/prompts/writePromptRunTrace.d.ts +21 -0
- package/esm/scripts/run-codex-prompts/prompts/writePromptStatusLine.d.ts +3 -2
- package/esm/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/runners/claude-code/parseClaudeCodeOutputEvents.d.ts +3 -0
- package/esm/scripts/run-codex-prompts/runners/claude-code/parseClaudeCodeSubscriptionUsage.d.ts +11 -0
- package/esm/scripts/run-codex-prompts/runners/cline/ClineRunner.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/runners/common/buildHarnessAuthenticationError.d.ts +20 -0
- package/esm/scripts/run-codex-prompts/runners/common/createAuthenticationAwarePromptRunner.d.ts +11 -0
- package/esm/scripts/run-codex-prompts/runners/common/estimateUsageFromTextLength.d.ts +33 -0
- package/esm/scripts/run-codex-prompts/runners/common/extractHarnessAuthenticationFailureReason.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/runners/common/modelPricing.d.ts +41 -0
- package/esm/scripts/run-codex-prompts/runners/gemini/GeminiRunner.d.ts +3 -1
- package/esm/scripts/run-codex-prompts/runners/gemini/gemini-pricing.d.ts +5 -18
- package/esm/scripts/run-codex-prompts/runners/github-copilot/GitHubCopilotRunner.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/runners/openai-codex/OpenAiCodexRunner.d.ts +10 -0
- package/esm/scripts/run-codex-prompts/runners/openai-codex/buildCodexUsageFromOutput.d.ts +4 -1
- package/esm/scripts/run-codex-prompts/runners/openai-codex/getCodexSubscriptionUsage.d.ts +19 -0
- package/esm/scripts/run-codex-prompts/runners/opencode/OpencodeRunner.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/runners/qwen-code/QwenCodeRunner.d.ts +25 -0
- package/esm/scripts/run-codex-prompts/runners/qwen-code/buildQwenCodeScript.d.ts +8 -0
- package/esm/scripts/run-codex-prompts/runners/qwen-code/parseQwenCodeUsageFromOutput.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/runners/qwen-code/qwen-code-pricing.d.ts +30 -0
- package/esm/scripts/run-codex-prompts/runners/types/HarnessSubscriptionUsage.d.ts +43 -0
- package/esm/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +3 -1
- package/esm/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/server/runCoderHttpServer.d.ts +3 -0
- package/esm/scripts/run-codex-prompts/team/CoderTeamRuntime.d.ts +87 -0
- package/esm/scripts/run-codex-prompts/team/coderTeamProtocol.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/team/compileCoderTeamAgent.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/team/createCoderTeamPromptRunner.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/team/startCoderTeamBridge.d.ts +14 -0
- package/esm/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +39 -4
- package/esm/scripts/run-codex-prompts/ui/buildCoderCheckRepairUiFrame.d.ts +3 -0
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +17 -1
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiViewport.d.ts +5 -0
- package/esm/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +15 -1
- package/esm/scripts/run-codex-prompts/ui/buildSubscriptionUsageSessionRows.d.ts +11 -0
- package/esm/scripts/run-codex-prompts/ui/coderRunUiText.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/ui/output/CoderOutputEvent.d.ts +20 -0
- package/esm/scripts/run-codex-prompts/ui/output/CoderRunOutput.d.ts +48 -0
- package/esm/scripts/run-codex-prompts/ui/output/buildCoderOutputLines.d.ts +18 -0
- package/esm/scripts/run-codex-prompts/ui/output/normalizeCoderOutputRecord.d.ts +10 -0
- package/esm/scripts/run-codex-prompts/ui/refreshCoderRunUiSubscriptionUsage.d.ts +14 -0
- package/esm/scripts/run-codex-prompts/ui/renderCoderRunUi.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/ui/startCoderRunUiSubscriptionUsageRefresh.d.ts +37 -0
- package/esm/scripts/utils/emojiTags/scanEmojiTagUsage.d.ts +2 -0
- package/esm/scripts/utils/emojiTags/validSinglePictogramEmojis.d.ts +17 -0
- package/esm/scripts/utils/prompts/isPromptDocumentationFile.d.ts +5 -0
- package/esm/scripts/utils/prompts/promptEmojiTags.d.ts +2 -0
- package/esm/scripts/verify-prompts/verify-prompts.d.ts +3 -0
- 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/AgentReferenceResolutionIssue.d.ts +45 -0
- package/esm/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +5 -0
- package/esm/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.d.ts +2 -0
- package/esm/src/book-2.0/agent-source/ParsedUnknownCommitment.d.ts +26 -0
- package/esm/src/book-2.0/agent-source/deduplicateSystemMessage.d.ts +14 -0
- package/esm/src/book-2.0/agent-source/explicitFromCommitment.d.ts +62 -0
- package/esm/src/book-2.0/agent-source/extractAgentReferenceTokens.d.ts +32 -0
- package/esm/src/book-2.0/agent-source/getBookCommitmentLineType.d.ts +19 -0
- package/esm/src/book-2.0/agent-source/parseAgentSourceWithCommitments.unknown.test.d.ts +1 -0
- package/esm/src/book-2.0/agent-source/resolveInheritedAgentSource.d.ts +73 -0
- package/esm/src/book-2.0/book-language-documentation/getSafeCodeBlock.d.ts +1 -1
- 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/AgentPlannedMessagesSidecar.test.d.ts +1 -0
- package/esm/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
- package/esm/src/book-3.0/cliAgentEnv.d.ts +3 -3
- 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/createDuplicateFromCommitmentDiagnostics.test.d.ts +1 -0
- package/esm/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.d.ts +28 -0
- package/esm/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.test.d.ts +1 -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/MockedChat/MockedChat.test.d.ts +2 -0
- package/esm/src/book-components/Chat/utils/agentProjectToolCall.d.ts +85 -0
- package/esm/src/book-components/Chat/utils/agentProjectToolCall.test.d.ts +1 -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/$initializePromptbookCliProgram.d.ts +8 -0
- package/esm/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/GitChangesMode.d.ts +28 -0
- package/esm/src/cli/cli-commands/coder/add.d.ts +22 -1
- package/esm/src/cli/cli-commands/coder/agentCliOptions.d.ts +27 -0
- package/esm/src/cli/cli-commands/coder/augmentCoderAgentTeam.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/boilerplateCount.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +8 -21
- package/esm/src/cli/cli-commands/coder/coderAgentRole.d.ts +21 -0
- package/esm/src/cli/cli-commands/coder/coderReferencedArtifacts.d.ts +34 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.d.ts +8 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderGitattributesFile.d.ts +13 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +14 -1
- package/esm/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.d.ts +5 -2
- package/esm/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderRoleAgentFile.d.ts +12 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderVscodeSettingsFile.d.ts +2 -0
- package/esm/src/cli/cli-commands/coder/ensureDirectory.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/findLegacyCoderCheckCallers.d.ts +5 -0
- package/esm/src/cli/cli-commands/coder/fix.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/fix.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/fixWorkflow.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +2 -2
- package/esm/src/cli/cli-commands/coder/getCoderInitializationCommitPaths.d.ts +9 -0
- package/esm/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/init.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +18 -6
- package/esm/src/cli/cli-commands/coder/list.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/list.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/mergeStringRecordJsonFile.d.ts +21 -1
- package/esm/src/cli/cli-commands/coder/plan.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/planning/assertPlanningCommitSafe.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/planning/assertPlanningPrdCommitScope.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/planning/assertPlanningRuntimePath.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/planning/createPlanningTerminal.d.ts +8 -0
- package/esm/src/cli/cli-commands/coder/planning/createPlanningTerminal.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/createPlanningWorkspace.d.ts +11 -0
- package/esm/src/cli/cli-commands/coder/planning/discussPlanningTurn.d.ts +15 -0
- package/esm/src/cli/cli-commands/coder/planning/fixtures/snapshotPlanningProject.d.ts +5 -0
- package/esm/src/cli/cli-commands/coder/planning/planningGitSync.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/planningPackagedCli.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/planningProtocol.d.ts +152 -0
- package/esm/src/cli/cli-commands/coder/planning/planningTeam.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/preparePlanningChanges.d.ts +16 -0
- package/esm/src/cli/cli-commands/coder/planning/readPlanningContext.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/planning/resolvePlanningPath.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/planning/runPlanningHarness.d.ts +30 -0
- package/esm/src/cli/cli-commands/coder/planning/runPlanningHarness.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/runPlanningSession.d.ts +24 -0
- package/esm/src/cli/cli-commands/coder/planning/runPlanningSession.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/savePlanningChanges.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/prepareCoderPackageJsonScripts.d.ts +12 -0
- package/esm/src/cli/cli-commands/coder/printCoderRunFailure.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/printInitializationSummary.d.ts +2 -1
- package/esm/src/cli/cli-commands/coder/promptsReadmeTemplate.d.ts +13 -0
- package/esm/src/cli/cli-commands/coder/promptsReadmeTemplate.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/readCoderAgentBook.d.ts +8 -0
- package/esm/src/cli/cli-commands/coder/server.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/waitOptions.d.ts +12 -0
- package/esm/src/cli/cli-commands/coder/workspacePreflight.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder.d.ts +3 -0
- package/esm/src/cli/cli-commands/common/$askForConfirmation.d.ts +11 -0
- package/esm/src/cli/cli-commands/common/$askForConfirmation.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/LocalAgentBookCollection.d.ts +48 -0
- package/esm/src/cli/cli-commands/common/coderCheckCliOptions.d.ts +21 -0
- package/esm/src/cli/cli-commands/common/coderCheckCliOptions.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/createLocalAgentReferenceResolver.d.ts +8 -0
- package/esm/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.d.ts +11 -0
- package/esm/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/disk-space/FreeDiskSpaceStatus.d.ts +33 -0
- package/esm/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.d.ts +6 -0
- package/esm/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/disk-space/formatLowFreeDiskSpaceWarning.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/disk-space/freeDiskSpaceConstants.d.ts +28 -0
- package/esm/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/ensureAdamAgentBook.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/ensureProjectTextFile.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +3 -2
- package/esm/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +3 -3
- package/esm/src/cli/cli-commands/common/harness/$checkHarnessInstallation.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +6 -3
- package/esm/src/cli/cli-commands/common/harness/$resolveHarnessCommandPath.d.ts +14 -0
- package/esm/src/cli/cli-commands/common/harness/$resolveHarnessInstallationOrigin.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/$runHarnessInstallationCommand.d.ts +43 -0
- package/esm/src/cli/cli-commands/common/harness/HARNESS_DEFAULT_MODELS.d.ts +25 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +62 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessInstallationOrigin.d.ts +36 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +8 -2
- package/esm/src/cli/cli-commands/common/harness/HarnessUpdatePlan.d.ts +23 -0
- package/esm/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.d.ts +4 -1
- package/esm/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.d.ts +8 -0
- package/esm/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.d.ts +31 -0
- package/esm/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.d.ts +11 -0
- 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/$resolveLatestNpmPackageVersion.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/npm/$resolveNpmGlobalPrefixPath.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/projectCliOptions.d.ts +30 -0
- package/esm/src/cli/cli-commands/common/projectCliOptions.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/projectInitialization.d.ts +6 -0
- package/esm/src/cli/cli-commands/common/promptPriorityCliOptions.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +17 -4
- package/esm/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +15 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.test.d.ts +1 -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/cli-commands/common/questionsCliOptions.d.ts +45 -0
- package/esm/src/cli/cli-commands/common/questionsCliOptions.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/resolveBundledAgentBookPath.d.ts +6 -0
- package/esm/src/cli/cli-commands/common/resolveLocalAgentSource.d.ts +26 -0
- package/esm/src/cli/cli-commands/common/validateCoderRunOptions.d.ts +6 -0
- package/esm/src/cli/cli-commands/common/workspaceRepository.d.ts +48 -0
- package/esm/src/cli/cli-commands/common/workspaceRepository.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/workspaceRepositoryCliOptions.d.ts +11 -0
- package/esm/src/cli/common/$deprecateCliCommand.d.ts +3 -0
- package/esm/src/cli/common/$hideCliCommandFromHelp.d.ts +11 -0
- package/esm/src/cli/common/$hideCliCommandFromHelp.test.d.ts +1 -0
- package/esm/src/cli/common/$requireCliSubcommand.d.ts +18 -0
- package/esm/src/cli/common/$requireCliSubcommand.test.d.ts +1 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +15 -0
- package/esm/src/commitments/TEAM/TEAM.test.d.ts +1 -0
- package/esm/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +14 -7
- package/esm/src/commitments/index.d.ts +1 -1
- package/esm/src/conversion/archive/loadJsZipModule.d.ts +10 -0
- package/esm/src/executables/platforms/locateAppOnWindows.d.ts +1 -1
- package/esm/src/executables/platforms/locateAppOnWindows.test.d.ts +1 -0
- package/esm/src/llm-providers/vercel/VercelExecutionToolsOptions.d.ts +5 -2
- 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/resolveAgentMessageTouchedExternalSources.test.d.ts +1 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.d.ts +19 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.test.d.ts +1 -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/files/findFilesByGlob.d.ts +28 -0
- package/esm/src/utils/misc/debounce.d.ts +4 -2
- package/esm/src/utils/misc/debounce.test.d.ts +1 -0
- package/esm/src/utils/misc/emojis.d.ts +3 -2
- package/esm/src/utils/random/$generateBookBoilerplate.test.d.ts +1 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +20 -25
- package/src/_packages/cli.readme.md +15 -0
- package/src/_packages/components.index.ts +4 -0
- 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/AgentReferenceResolutionIssue.ts +75 -0
- package/src/book-2.0/agent-source/AgentSourceParseResult.ts +6 -0
- package/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.ts +2 -0
- package/src/book-2.0/agent-source/ParsedUnknownCommitment.ts +29 -0
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/applyCommitmentsToAgentModelRequirements.ts +8 -3
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/augmentAgentModelRequirementsFromSource.ts +38 -1
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.ts +9 -2
- package/src/book-2.0/agent-source/deduplicateSystemMessage.ts +327 -0
- package/src/book-2.0/agent-source/explicitFromCommitment.ts +132 -0
- package/src/book-2.0/agent-source/extractAgentReferenceTokens.ts +65 -0
- package/src/book-2.0/agent-source/getBookCommitmentLineType.ts +36 -0
- package/src/book-2.0/agent-source/parseAgentSourceWithCommitments.ts +128 -61
- package/src/book-2.0/agent-source/resolveInheritedAgentSource.ts +841 -0
- package/src/book-2.0/agent-source/string_book.ts +1 -1
- package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +5 -4
- package/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.ts +6 -1
- package/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.ts +6 -1
- package/src/book-2.0/book-language-documentation/getSafeCodeBlock.ts +1 -1
- 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/cliAgentEnv.ts +3 -2
- 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/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/MockedChat/MockedChat.tsx +25 -1
- package/src/book-components/Chat/save/react/exports/chat-preview-2025-10-13 (1).jsx +95 -5
- 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 +658 -96
- package/src/book-components/Chat/utils/timeoutToolCallPresentation.ts +34 -3
- package/src/cli/$initializePromptbookCliProgram.ts +89 -0
- package/src/cli/cli-commands/agent/chat.ts +11 -2
- package/src/cli/cli-commands/agent/exec.ts +11 -2
- package/src/cli/cli-commands/agent-folder/init.ts +6 -2
- package/src/cli/cli-commands/agent-folder/initializeAgentRunnerCommand.ts +9 -2
- package/src/cli/cli-commands/agent-folder.ts +2 -6
- package/src/cli/cli-commands/agent.ts +2 -6
- package/src/cli/cli-commands/agents-server/startAgentsServer/createLocalAgentRunOptions.ts +1 -1
- package/src/cli/cli-commands/agents-server.ts +2 -6
- package/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.ts +54 -0
- package/src/cli/cli-commands/coder/GitChangesMode.ts +35 -0
- package/src/cli/cli-commands/coder/add.ts +97 -19
- package/src/cli/cli-commands/coder/agentCliOptions.ts +48 -0
- package/src/cli/cli-commands/coder/augmentCoderAgentTeam.ts +152 -0
- package/src/cli/cli-commands/coder/boilerplateCount.ts +1 -1
- package/src/cli/cli-commands/coder/boilerplateTemplates.ts +20 -59
- package/src/cli/cli-commands/coder/coderAgentRole.ts +28 -0
- package/src/cli/cli-commands/coder/coderReferencedArtifacts.ts +103 -0
- package/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.ts +90 -0
- package/src/cli/cli-commands/coder/ensureCoderDeveloperAgentFile.ts +2 -47
- package/src/cli/cli-commands/coder/ensureCoderGitattributesFile.ts +25 -0
- package/src/cli/cli-commands/coder/ensureCoderGitignoreFile.ts +37 -3
- package/src/cli/cli-commands/coder/ensureCoderMarkdownFile.ts +2 -20
- package/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.ts +24 -3
- package/src/cli/cli-commands/coder/ensureCoderRoleAgentFile.ts +36 -0
- package/src/cli/cli-commands/coder/ensureCoderVscodeSettingsFile.ts +5 -1
- package/src/cli/cli-commands/coder/ensureDirectory.ts +27 -1
- package/src/cli/cli-commands/coder/find-fresh-emoji-tags.ts +14 -2
- package/src/cli/cli-commands/coder/find-refactor-candidates.ts +13 -1
- package/src/cli/cli-commands/coder/find-unwritten.ts +13 -1
- package/src/cli/cli-commands/coder/findLegacyCoderCheckCallers.ts +87 -0
- package/src/cli/cli-commands/coder/fix.ts +166 -0
- package/src/cli/cli-commands/coder/fixtures/fix.cjs +29 -0
- package/src/cli/cli-commands/coder/fixtures/healthyDisk.cjs +4 -0
- package/src/cli/cli-commands/coder/generate-boilerplates.ts +41 -29
- package/src/cli/cli-commands/coder/getCoderInitializationCommitPaths.ts +44 -0
- package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +103 -9
- package/src/cli/cli-commands/coder/init.ts +116 -26
- package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +93 -32
- package/src/cli/cli-commands/coder/list.ts +102 -0
- package/src/cli/cli-commands/coder/mergeStringRecordJsonFile.ts +42 -8
- package/src/cli/cli-commands/coder/ping.ts +73 -19
- package/src/cli/cli-commands/coder/plan.ts +139 -0
- package/src/cli/cli-commands/coder/planning/README.md +39 -0
- package/src/cli/cli-commands/coder/planning/assertPlanningCommitSafe.ts +23 -0
- package/src/cli/cli-commands/coder/planning/assertPlanningPrdCommitScope.ts +57 -0
- package/src/cli/cli-commands/coder/planning/assertPlanningRuntimePath.ts +34 -0
- package/src/cli/cli-commands/coder/planning/createPlanningTerminal.ts +57 -0
- package/src/cli/cli-commands/coder/planning/createPlanningWorkspace.ts +36 -0
- package/src/cli/cli-commands/coder/planning/discussPlanningTurn.ts +61 -0
- package/src/cli/cli-commands/coder/planning/fixtures/codex.cjs +54 -0
- package/src/cli/cli-commands/coder/planning/fixtures/coding.cjs +26 -0
- package/src/cli/cli-commands/coder/planning/fixtures/conversation.json +70 -0
- package/src/cli/cli-commands/coder/planning/fixtures/snapshotPlanningProject.ts +17 -0
- package/src/cli/cli-commands/coder/planning/fixtures/terminal.cjs +26 -0
- package/src/cli/cli-commands/coder/planning/planningProtocol.ts +132 -0
- package/src/cli/cli-commands/coder/planning/preparePlanningChanges.ts +178 -0
- package/src/cli/cli-commands/coder/planning/readPlanningContext.ts +108 -0
- package/src/cli/cli-commands/coder/planning/resolvePlanningPath.ts +72 -0
- package/src/cli/cli-commands/coder/planning/runPlanningHarness.ts +249 -0
- package/src/cli/cli-commands/coder/planning/runPlanningSession.ts +254 -0
- package/src/cli/cli-commands/coder/planning/savePlanningChanges.ts +105 -0
- package/src/cli/cli-commands/coder/prepareCoderPackageJsonScripts.ts +304 -0
- package/src/cli/cli-commands/coder/printCoderRunFailure.ts +14 -0
- package/src/cli/cli-commands/coder/printInitializationSummary.ts +61 -19
- package/src/cli/cli-commands/coder/promptsReadmeTemplate.ts +400 -0
- package/src/cli/cli-commands/coder/readCoderAgentBook.ts +62 -0
- package/src/cli/cli-commands/coder/run.ts +109 -90
- package/src/cli/cli-commands/coder/server.ts +87 -71
- package/src/cli/cli-commands/coder/verify.ts +21 -1
- package/src/cli/cli-commands/coder/waitOptions.ts +33 -0
- package/src/cli/cli-commands/coder.ts +17 -6
- package/src/cli/cli-commands/common/$askForConfirmation.ts +41 -0
- package/src/cli/cli-commands/common/LocalAgentBookCollection.ts +258 -0
- package/src/cli/cli-commands/common/coderCheckCliOptions.ts +108 -0
- package/src/cli/cli-commands/common/coderGitSyncCliOptions.ts +7 -3
- package/src/cli/cli-commands/common/createLocalAgentReferenceResolver.ts +69 -0
- package/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.ts +35 -0
- package/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.ts +37 -0
- package/src/cli/cli-commands/common/disk-space/FreeDiskSpaceStatus.ts +39 -0
- package/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.ts +26 -0
- package/src/cli/cli-commands/common/disk-space/formatLowFreeDiskSpaceWarning.ts +33 -0
- package/src/cli/cli-commands/common/disk-space/freeDiskSpaceConstants.ts +33 -0
- package/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.ts +21 -0
- package/src/cli/cli-commands/common/ensureAdamAgentBook.ts +40 -0
- package/src/cli/cli-commands/common/ensureProjectTextFile.ts +35 -0
- package/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.ts +79 -11
- package/src/cli/cli-commands/common/harness/$checkHarnessInstallation.ts +32 -9
- package/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.ts +25 -4
- package/src/cli/cli-commands/common/harness/$resolveHarnessCommandPath.ts +46 -0
- package/src/cli/cli-commands/common/harness/$resolveHarnessInstallationOrigin.ts +36 -0
- package/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.ts +2 -2
- package/src/cli/cli-commands/common/harness/$runHarnessInstallationCommand.ts +100 -0
- package/src/cli/cli-commands/common/harness/HARNESS_DEFAULT_MODELS.ts +37 -0
- package/src/cli/cli-commands/common/harness/HarnessDefinition.ts +101 -0
- package/src/cli/cli-commands/common/harness/HarnessInstallationOrigin.ts +44 -0
- package/src/cli/cli-commands/common/harness/HarnessInstallationStatus.ts +9 -2
- package/src/cli/cli-commands/common/harness/HarnessUpdatePlan.ts +27 -0
- package/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.ts +6 -2
- package/src/cli/cli-commands/common/harness/formatHarnessInstallationWarning.ts +28 -6
- package/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.ts +41 -0
- package/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.ts +111 -0
- package/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.ts +47 -0
- package/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.ts +20 -0
- package/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.ts +49 -0
- package/src/cli/cli-commands/common/npm/$resolveNpmGlobalPrefixPath.ts +51 -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/projectCliOptions.ts +78 -0
- package/src/cli/cli-commands/common/projectInitialization.ts +35 -3
- package/src/cli/cli-commands/common/promptPriorityCliOptions.ts +30 -0
- package/src/cli/cli-commands/common/promptRunnerCliOptions.ts +51 -17
- package/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.ts +71 -0
- package/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.ts +129 -0
- package/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.ts +263 -0
- package/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.ts +58 -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/common/questionsCliOptions.ts +89 -0
- package/src/cli/cli-commands/common/resolveBundledAgentBookPath.ts +38 -0
- package/src/cli/cli-commands/common/resolveLocalAgentSource.ts +147 -0
- package/src/cli/cli-commands/common/validateCoderRunOptions.ts +113 -0
- package/src/cli/cli-commands/common/workspaceRepository.md +46 -0
- package/src/cli/cli-commands/common/workspaceRepository.ts +301 -0
- package/src/cli/cli-commands/common/workspaceRepositoryCliOptions.ts +31 -0
- package/src/cli/cli-commands/prettify.ts +2 -2
- package/src/cli/cli-commands/run.ts +3 -1
- package/src/cli/cli-commands/test-command.ts +2 -2
- package/src/cli/common/$deprecateCliCommand.ts +5 -0
- package/src/cli/common/$hideCliCommandFromHelp.ts +27 -0
- package/src/cli/common/$requireCliSubcommand.ts +35 -0
- package/src/cli/promptbookCli.ts +6 -87
- 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/FROM/FROM.ts +13 -0
- package/src/commitments/TEAM/TEAM.ts +26 -4
- package/src/commitments/WRITING_RULES/WRITING_RULES.ts +16 -8
- package/src/commitments/index.ts +2 -1
- package/src/conversion/archive/loadJsZipModule.ts +3 -1
- package/src/executables/platforms/locateAppOnWindows.ts +12 -9
- package/src/execution/translation/automatic-translate/translateMessages.ts +2 -2
- package/src/llm-providers/openai/utils/buildToolInvocationScript.ts +21 -18
- package/src/llm-providers/vercel/VercelExecutionToolsOptions.ts +7 -2
- package/src/llm-providers/vercel/createExecutionToolsFromVercelProvider.ts +18 -17
- package/src/other/templates/getTemplatesPipelineCollection.ts +2156 -950
- 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/execCommand/$execCommand.ts +2 -1
- package/src/utils/files/findFilesByGlob.ts +46 -0
- package/src/utils/misc/debounce.ts +26 -5
- package/src/utils/misc/emojis.ts +3 -3
- package/src/utils/random/$generateBookBoilerplate.ts +1 -1
- package/src/version.ts +2 -2
- package/src/versions.txt +42 -0
- package/umd/apps/agents-server/src/constants/federatedAgentImport.d.ts +6 -0
- package/umd/index.umd.js +48038 -33148
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/find-fresh-emoji-tags/find-fresh-emoji-tags.d.ts +1 -1
- package/umd/scripts/find-refactor-candidates/find-refactor-candidates.d.ts +2 -0
- package/umd/scripts/find-refactor-candidates/resolveRefactorCandidateProject.d.ts +3 -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/createAgentRunnerSystemMessage.d.ts +2 -1
- 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/checks/CheckBeforeMode.d.ts +20 -0
- package/umd/scripts/run-codex-prompts/checks/CoderCheckExecutionError.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/checks/CoderCheckFailedError.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/checks/buildCheckBeforeScriptPath.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/checks/checkRepairInstructions.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/checks/createCheckBeforeRepairPrompt.d.ts +11 -0
- package/umd/scripts/run-codex-prompts/checks/limitCheckOutput.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/checks/projectCheck.d.ts +26 -0
- package/umd/scripts/run-codex-prompts/checks/projectScriptReferences.d.ts +7 -0
- package/umd/scripts/run-codex-prompts/checks/runCheckBefore.d.ts +31 -0
- package/umd/scripts/run-codex-prompts/checks/runCoderCheck.d.ts +17 -0
- package/umd/scripts/run-codex-prompts/checks/runCoderCheckRepair.d.ts +40 -0
- package/umd/scripts/run-codex-prompts/checks/runPromptCheckCommand.d.ts +16 -0
- package/umd/scripts/run-codex-prompts/{testing/runPromptWithTestFeedback.d.ts → checks/runPromptWithCheckFeedback.d.ts} +14 -9
- 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/createFreeDiskSpaceGuard.d.ts +28 -0
- package/umd/scripts/run-codex-prompts/common/formatCoderRunControlFeedback.d.ts +13 -0
- package/umd/scripts/run-codex-prompts/common/formatUnknownErrorDetails.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/common/listenForCoderRunControls.d.ts +18 -0
- package/umd/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
- package/umd/scripts/run-codex-prompts/common/resolveCoderAgent.d.ts +44 -5
- package/umd/scripts/run-codex-prompts/common/resolveCoderContext.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/common/resolveCoderProjectContext.d.ts +19 -0
- package/umd/scripts/run-codex-prompts/common/resolveInlineOrFileText.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/$spawnLoggedBashScript.d.ts +29 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/$terminateLoggedBashProcessTree.d.ts +11 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/buildCoderExecutionArtifactPaths.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/captureLiveScriptOutput.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/createScriptOutputLineReader.d.ts +26 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/quoteBashArgument.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/resolveShellHereDocumentDelimiter.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +7 -1
- package/umd/scripts/run-codex-prompts/common/sleepWithCountdown.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/common/waitForPause.d.ts +0 -8
- package/umd/scripts/run-codex-prompts/common/waitForSkippableWorldTimeDeadline.d.ts +16 -0
- package/umd/scripts/run-codex-prompts/common/withCoderWorkspaceLock.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/git/CoderGitOperationError.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/git/CoderPhasePersistence.d.ts +105 -0
- package/umd/scripts/run-codex-prompts/git/CoderPhaseRecovery.d.ts +43 -0
- package/umd/scripts/run-codex-prompts/git/buildCoderCheckCommitMessage.d.ts +11 -0
- package/umd/scripts/run-codex-prompts/git/coderCommitScope.d.ts +47 -0
- package/umd/scripts/run-codex-prompts/git/coderFinalizationFiles.d.ts +14 -0
- package/umd/scripts/run-codex-prompts/git/coderGitSync.d.ts +20 -2
- package/umd/scripts/run-codex-prompts/git/coderIndexLease.d.ts +11 -0
- package/umd/scripts/run-codex-prompts/git/coderRepositoryFiles.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/git/coderRepositorySnapshot.d.ts +62 -0
- package/umd/scripts/run-codex-prompts/git/coderRepositoryView.d.ts +30 -0
- package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +43 -4
- package/umd/scripts/run-codex-prompts/git/commitInitializedAgentBooks.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/git/ensureWorkingTreeClean.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/git/gitLongPathsSupport.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/git/pullLatestChanges.d.ts +3 -1
- package/umd/scripts/run-codex-prompts/git/quoteGitArgument.d.ts +5 -0
- package/umd/scripts/run-codex-prompts/git/runGitCommand.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/git/runWorkspaceGitWithIndexReadRetry.d.ts +7 -0
- package/umd/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +40 -0
- package/umd/scripts/run-codex-prompts/isolation/coderIsolationArtifacts.d.ts +16 -0
- package/umd/scripts/run-codex-prompts/isolation/coderIsolationIgnoredFiles.d.ts +18 -0
- package/umd/scripts/run-codex-prompts/isolation/copyCoderIsolationEnvironment.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/isolation/createCoderIsolationWorktree.d.ts +3 -2
- package/umd/scripts/run-codex-prompts/isolation/mapProjectReferenceToWorktree.d.ts +5 -0
- package/umd/scripts/run-codex-prompts/isolation/mergeCoderIsolationWorktree.d.ts +5 -5
- package/umd/scripts/run-codex-prompts/isolation/preserveCoderIsolationRecovery.d.ts +3 -0
- package/umd/scripts/run-codex-prompts/isolation/runIsolatedPromptRound.d.ts +2 -2
- package/umd/scripts/run-codex-prompts/main/findUnwrittenPrompts.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/main/listCoderPrompts.d.ts +22 -0
- package/umd/scripts/run-codex-prompts/main/prepareCoderPromptExecution.d.ts +18 -0
- package/umd/scripts/run-codex-prompts/main/resolvePromptRunner.d.ts +16 -8
- package/umd/scripts/run-codex-prompts/main/runCoderFix.d.ts +24 -0
- package/umd/scripts/run-codex-prompts/main/runPromptRound.d.ts +16 -6
- package/umd/scripts/run-codex-prompts/ping/pingCoderHarnessPeriodically.d.ts +22 -0
- package/umd/scripts/run-codex-prompts/prompts/buildPromptLabel.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/prompts/buildPromptLabelForDisplay.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/prompts/buildPromptRunTraceContent.d.ts +70 -0
- package/umd/scripts/run-codex-prompts/prompts/buildPromptRunTracePath.d.ts +10 -0
- package/umd/scripts/run-codex-prompts/prompts/buildPromptStatusDetails.d.ts +9 -13
- package/umd/scripts/run-codex-prompts/prompts/findFirstNonEmptyLineIndex.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +2 -2
- package/umd/scripts/run-codex-prompts/prompts/formatRunnerSignature.d.ts +14 -1
- package/umd/scripts/run-codex-prompts/prompts/isPromptCompatibleWithRunner.d.ts +11 -6
- package/umd/scripts/run-codex-prompts/prompts/listPromptsByStatus.d.ts +7 -0
- package/umd/scripts/run-codex-prompts/prompts/listUpcomingTasks.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/prompts/loadPromptFiles.d.ts +10 -2
- package/umd/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +15 -4
- package/umd/scripts/run-codex-prompts/prompts/markPromptFailed.d.ts +28 -1
- package/umd/scripts/run-codex-prompts/prompts/printPromptsToBeWritten.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/prompts/promptRunnerAttribution.d.ts +30 -0
- package/umd/scripts/run-codex-prompts/prompts/refreshPromptSelection.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/prompts/resolveInterruptedPrompt.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/prompts/writePromptErrorLog.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/prompts/writePromptFile.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/prompts/writePromptRunTrace.d.ts +21 -0
- package/umd/scripts/run-codex-prompts/prompts/writePromptStatusLine.d.ts +3 -2
- package/umd/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/runners/claude-code/parseClaudeCodeOutputEvents.d.ts +3 -0
- package/umd/scripts/run-codex-prompts/runners/claude-code/parseClaudeCodeSubscriptionUsage.d.ts +11 -0
- package/umd/scripts/run-codex-prompts/runners/cline/ClineRunner.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/runners/common/buildHarnessAuthenticationError.d.ts +20 -0
- package/umd/scripts/run-codex-prompts/runners/common/createAuthenticationAwarePromptRunner.d.ts +11 -0
- package/umd/scripts/run-codex-prompts/runners/common/estimateUsageFromTextLength.d.ts +33 -0
- package/umd/scripts/run-codex-prompts/runners/common/extractHarnessAuthenticationFailureReason.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/runners/common/modelPricing.d.ts +41 -0
- package/umd/scripts/run-codex-prompts/runners/gemini/GeminiRunner.d.ts +3 -1
- package/umd/scripts/run-codex-prompts/runners/gemini/gemini-pricing.d.ts +5 -18
- package/umd/scripts/run-codex-prompts/runners/github-copilot/GitHubCopilotRunner.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/runners/openai-codex/OpenAiCodexRunner.d.ts +10 -0
- package/umd/scripts/run-codex-prompts/runners/openai-codex/buildCodexUsageFromOutput.d.ts +4 -1
- package/umd/scripts/run-codex-prompts/runners/openai-codex/getCodexSubscriptionUsage.d.ts +19 -0
- package/umd/scripts/run-codex-prompts/runners/opencode/OpencodeRunner.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/runners/qwen-code/QwenCodeRunner.d.ts +25 -0
- package/umd/scripts/run-codex-prompts/runners/qwen-code/buildQwenCodeScript.d.ts +8 -0
- package/umd/scripts/run-codex-prompts/runners/qwen-code/parseQwenCodeUsageFromOutput.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/runners/qwen-code/qwen-code-pricing.d.ts +30 -0
- package/umd/scripts/run-codex-prompts/runners/types/HarnessSubscriptionUsage.d.ts +43 -0
- package/umd/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +3 -1
- package/umd/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/server/runCoderHttpServer.d.ts +3 -0
- package/umd/scripts/run-codex-prompts/team/CoderTeamRuntime.d.ts +87 -0
- package/umd/scripts/run-codex-prompts/team/coderTeamProtocol.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/team/compileCoderTeamAgent.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/team/createCoderTeamPromptRunner.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/team/startCoderTeamBridge.d.ts +14 -0
- package/umd/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +39 -4
- package/umd/scripts/run-codex-prompts/ui/buildCoderCheckRepairUiFrame.d.ts +3 -0
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +17 -1
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiViewport.d.ts +5 -0
- package/umd/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +15 -1
- package/umd/scripts/run-codex-prompts/ui/buildSubscriptionUsageSessionRows.d.ts +11 -0
- package/umd/scripts/run-codex-prompts/ui/coderRunUiText.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/ui/output/CoderOutputEvent.d.ts +20 -0
- package/umd/scripts/run-codex-prompts/ui/output/CoderRunOutput.d.ts +48 -0
- package/umd/scripts/run-codex-prompts/ui/output/buildCoderOutputLines.d.ts +18 -0
- package/umd/scripts/run-codex-prompts/ui/output/normalizeCoderOutputRecord.d.ts +10 -0
- package/umd/scripts/run-codex-prompts/ui/refreshCoderRunUiSubscriptionUsage.d.ts +14 -0
- package/umd/scripts/run-codex-prompts/ui/renderCoderRunUi.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/ui/startCoderRunUiSubscriptionUsageRefresh.d.ts +37 -0
- package/umd/scripts/utils/emojiTags/scanEmojiTagUsage.d.ts +2 -0
- package/umd/scripts/utils/emojiTags/validSinglePictogramEmojis.d.ts +17 -0
- package/umd/scripts/utils/prompts/isPromptDocumentationFile.d.ts +5 -0
- package/umd/scripts/utils/prompts/promptEmojiTags.d.ts +2 -0
- package/umd/scripts/verify-prompts/verify-prompts.d.ts +3 -0
- 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/renderAvatarVisualTerminalText.test.d.ts +1 -0
- package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
- package/umd/src/book-2.0/agent-source/AgentReferenceResolutionIssue.d.ts +45 -0
- package/umd/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +5 -0
- package/umd/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.d.ts +2 -0
- package/umd/src/book-2.0/agent-source/ParsedUnknownCommitment.d.ts +26 -0
- package/umd/src/book-2.0/agent-source/createAgentModelRequirements.deduplication.test.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.unknown.test.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/deduplicateSystemMessage.d.ts +14 -0
- package/umd/src/book-2.0/agent-source/deduplicateSystemMessage.test.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/explicitFromCommitment.d.ts +62 -0
- package/umd/src/book-2.0/agent-source/extractAgentReferenceTokens.d.ts +32 -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-2.0/agent-source/resolveInheritedAgentSource.d.ts +73 -0
- package/umd/src/book-2.0/book-language-documentation/getSafeCodeBlock.d.ts +1 -1
- 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/cliAgentEnv.d.ts +3 -3
- 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/MockedChat/MockedChat.test.d.ts +2 -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/$initializePromptbookCliProgram.d.ts +8 -0
- package/umd/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.d.ts +10 -0
- package/umd/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/GitChangesMode.d.ts +28 -0
- package/umd/src/cli/cli-commands/coder/add.d.ts +22 -1
- package/umd/src/cli/cli-commands/coder/agentCliOptions.d.ts +27 -0
- package/umd/src/cli/cli-commands/coder/augmentCoderAgentTeam.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/boilerplateCount.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +8 -21
- package/umd/src/cli/cli-commands/coder/coderAgentRole.d.ts +21 -0
- package/umd/src/cli/cli-commands/coder/coderReferencedArtifacts.d.ts +34 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.d.ts +8 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderGitattributesFile.d.ts +13 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +14 -1
- package/umd/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.d.ts +5 -2
- package/umd/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderRoleAgentFile.d.ts +12 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderVscodeSettingsFile.d.ts +2 -0
- package/umd/src/cli/cli-commands/coder/ensureDirectory.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/findLegacyCoderCheckCallers.d.ts +5 -0
- package/umd/src/cli/cli-commands/coder/fix.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/fix.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/fixWorkflow.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +2 -2
- package/umd/src/cli/cli-commands/coder/getCoderInitializationCommitPaths.d.ts +9 -0
- package/umd/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/init.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +18 -6
- package/umd/src/cli/cli-commands/coder/list.d.ts +10 -0
- package/umd/src/cli/cli-commands/coder/list.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/mergeStringRecordJsonFile.d.ts +21 -1
- package/umd/src/cli/cli-commands/coder/plan.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/planning/assertPlanningCommitSafe.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/planning/assertPlanningPrdCommitScope.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/planning/assertPlanningRuntimePath.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/planning/createPlanningTerminal.d.ts +8 -0
- package/umd/src/cli/cli-commands/coder/planning/createPlanningTerminal.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/createPlanningWorkspace.d.ts +11 -0
- package/umd/src/cli/cli-commands/coder/planning/discussPlanningTurn.d.ts +15 -0
- package/umd/src/cli/cli-commands/coder/planning/fixtures/snapshotPlanningProject.d.ts +5 -0
- package/umd/src/cli/cli-commands/coder/planning/planningGitSync.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/planningPackagedCli.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/planningProtocol.d.ts +152 -0
- package/umd/src/cli/cli-commands/coder/planning/planningTeam.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/preparePlanningChanges.d.ts +16 -0
- package/umd/src/cli/cli-commands/coder/planning/readPlanningContext.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/planning/resolvePlanningPath.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/planning/runPlanningHarness.d.ts +30 -0
- package/umd/src/cli/cli-commands/coder/planning/runPlanningHarness.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/runPlanningSession.d.ts +24 -0
- package/umd/src/cli/cli-commands/coder/planning/runPlanningSession.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/savePlanningChanges.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/prepareCoderPackageJsonScripts.d.ts +12 -0
- package/umd/src/cli/cli-commands/coder/printCoderRunFailure.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/printInitializationSummary.d.ts +2 -1
- package/umd/src/cli/cli-commands/coder/promptsReadmeTemplate.d.ts +13 -0
- package/umd/src/cli/cli-commands/coder/promptsReadmeTemplate.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/readCoderAgentBook.d.ts +8 -0
- package/umd/src/cli/cli-commands/coder/server.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/waitOptions.d.ts +12 -0
- package/umd/src/cli/cli-commands/coder/workspacePreflight.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder.d.ts +3 -0
- package/umd/src/cli/cli-commands/common/$askForConfirmation.d.ts +11 -0
- package/umd/src/cli/cli-commands/common/$askForConfirmation.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/LocalAgentBookCollection.d.ts +48 -0
- package/umd/src/cli/cli-commands/common/coderCheckCliOptions.d.ts +21 -0
- package/umd/src/cli/cli-commands/common/coderCheckCliOptions.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +1 -1
- package/umd/src/cli/cli-commands/common/createLocalAgentReferenceResolver.d.ts +8 -0
- package/umd/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.d.ts +11 -0
- package/umd/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/disk-space/FreeDiskSpaceStatus.d.ts +33 -0
- package/umd/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.d.ts +6 -0
- package/umd/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/disk-space/formatLowFreeDiskSpaceWarning.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/disk-space/freeDiskSpaceConstants.d.ts +28 -0
- package/umd/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/ensureAdamAgentBook.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/ensureProjectTextFile.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +3 -2
- 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 +6 -3
- package/umd/src/cli/cli-commands/common/harness/$resolveHarnessCommandPath.d.ts +14 -0
- package/umd/src/cli/cli-commands/common/harness/$resolveHarnessInstallationOrigin.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/$runHarnessInstallationCommand.d.ts +43 -0
- package/umd/src/cli/cli-commands/common/harness/HARNESS_DEFAULT_MODELS.d.ts +25 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +62 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessInstallationOrigin.d.ts +36 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +8 -2
- package/umd/src/cli/cli-commands/common/harness/HarnessUpdatePlan.d.ts +23 -0
- package/umd/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.d.ts +4 -1
- package/umd/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.d.ts +8 -0
- package/umd/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.d.ts +31 -0
- package/umd/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.d.ts +11 -0
- 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/$resolveNpmGlobalPrefixPath.d.ts +9 -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/projectCliOptions.d.ts +30 -0
- package/umd/src/cli/cli-commands/common/projectCliOptions.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/projectInitialization.d.ts +6 -0
- package/umd/src/cli/cli-commands/common/promptPriorityCliOptions.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +17 -4
- 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 +15 -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/cli-commands/common/questionsCliOptions.d.ts +45 -0
- package/umd/src/cli/cli-commands/common/questionsCliOptions.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/resolveBundledAgentBookPath.d.ts +6 -0
- package/umd/src/cli/cli-commands/common/resolveLocalAgentSource.d.ts +26 -0
- package/umd/src/cli/cli-commands/common/validateCoderRunOptions.d.ts +6 -0
- package/umd/src/cli/cli-commands/common/workspaceRepository.d.ts +48 -0
- package/umd/src/cli/cli-commands/common/workspaceRepository.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/workspaceRepositoryCliOptions.d.ts +11 -0
- package/umd/src/cli/common/$deprecateCliCommand.d.ts +3 -0
- package/umd/src/cli/common/$hideCliCommandFromHelp.d.ts +11 -0
- package/umd/src/cli/common/$hideCliCommandFromHelp.test.d.ts +1 -0
- package/umd/src/cli/common/$requireCliSubcommand.d.ts +18 -0
- package/umd/src/cli/common/$requireCliSubcommand.test.d.ts +1 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +15 -0
- package/umd/src/commitments/TEAM/TEAM.test.d.ts +1 -0
- package/umd/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +14 -7
- package/umd/src/commitments/index.d.ts +1 -1
- package/umd/src/conversion/archive/loadJsZipModule.d.ts +10 -0
- 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/vercel/VercelExecutionToolsOptions.d.ts +5 -2
- 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/files/findFilesByGlob.d.ts +28 -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/misc/emojis.d.ts +3 -2
- 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/utils/userChatClient/runAgentUserTimeoutBulkAction.ts +0 -24
- package/apps/agents-server/src/utils/userChatClient/updateAgentUserTimeout.ts +0 -25
- package/esm/apps/agents-server/src/database/sqlite/$provideAgentsServerSqliteDatabase.d.ts +0 -69
- package/esm/apps/agents-server/src/database/sqlite/localSqliteSupabase/ensureTable.d.ts +0 -7
- package/esm/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteSql.d.ts +0 -30
- package/esm/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteTableSchema.d.ts +0 -76
- package/esm/apps/agents-server/src/database/sqlite/resolveAgentsServerSqliteDatabasePath.d.ts +0 -4
- package/esm/apps/agents-server/src/database/sqlite/resolveServerSqliteDatabasePath.d.ts +0 -28
- package/esm/apps/agents-server/src/database/sqlite/standaloneServerRegistryStore.d.ts +0 -110
- package/esm/scripts/find-fresh-emoji-tags/utils/emojis.d.ts +0 -16
- package/esm/scripts/run-codex-prompts/testing/TestBeforeMode.d.ts +0 -16
- package/esm/scripts/run-codex-prompts/testing/createTestBeforeRepairPrompt.d.ts +0 -9
- package/esm/scripts/run-codex-prompts/testing/limitTestOutput.d.ts +0 -4
- package/esm/scripts/run-codex-prompts/testing/runPromptTestCommand.d.ts +0 -14
- package/esm/scripts/run-codex-prompts/testing/runTestBefore.d.ts +0 -24
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunOctopusVisual.d.ts +0 -13
- package/esm/src/cli/cli-commands/coder/agentCodingFile.d.ts +0 -13
- package/esm/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts +0 -9
- package/esm/src/cli/cli-commands/common/harness/$installHarness.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/src/cli/cli-commands/coder/agentCodingFile.ts +0 -25
- package/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.ts +0 -31
- package/src/cli/cli-commands/common/harness/$installHarness.ts +0 -56
- 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/umd/apps/agents-server/src/database/sqlite/$provideAgentsServerSqliteDatabase.d.ts +0 -69
- package/umd/apps/agents-server/src/database/sqlite/localSqliteSupabase/ensureTable.d.ts +0 -7
- package/umd/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteSql.d.ts +0 -30
- package/umd/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteTableSchema.d.ts +0 -76
- package/umd/apps/agents-server/src/database/sqlite/resolveAgentsServerSqliteDatabasePath.d.ts +0 -4
- package/umd/apps/agents-server/src/database/sqlite/resolveServerSqliteDatabasePath.d.ts +0 -28
- package/umd/apps/agents-server/src/database/sqlite/standaloneServerRegistryStore.d.ts +0 -110
- package/umd/scripts/find-fresh-emoji-tags/utils/emojis.d.ts +0 -16
- package/umd/scripts/run-codex-prompts/testing/TestBeforeMode.d.ts +0 -16
- package/umd/scripts/run-codex-prompts/testing/createTestBeforeRepairPrompt.d.ts +0 -9
- package/umd/scripts/run-codex-prompts/testing/limitTestOutput.d.ts +0 -4
- package/umd/scripts/run-codex-prompts/testing/runPromptTestCommand.d.ts +0 -14
- package/umd/scripts/run-codex-prompts/testing/runTestBefore.d.ts +0 -24
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunOctopusVisual.d.ts +0 -13
- package/umd/src/cli/cli-commands/coder/agentCodingFile.d.ts +0 -13
- package/umd/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts +0 -9
- package/umd/src/cli/cli-commands/common/harness/$installHarness.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/esm/src/{cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → avatars/renderAvatarVisualTerminalText.test.d.ts} +0 -0
- /package/esm/src/{cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts → book-2.0/agent-source/createAgentModelRequirements.deduplication.test.d.ts} +0 -0
- /package/{umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → esm/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.unknown.test.d.ts} +0 -0
- /package/{umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts → esm/src/book-2.0/agent-source/deduplicateSystemMessage.test.d.ts} +0 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'fs';
|
|
2
|
+
import { realpath } from 'fs/promises';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
import { resolveCoderAgent } from '../../../../../scripts/run-codex-prompts/common/resolveCoderAgent';
|
|
5
|
+
import {
|
|
6
|
+
resolveCoderProjectContext,
|
|
7
|
+
type ResolvedCoderProjectContext,
|
|
8
|
+
} from '../../../../../scripts/run-codex-prompts/common/resolveCoderProjectContext';
|
|
9
|
+
import { DEFAULT_CODER_AGENT_ROLE } from '../coderAgentRole';
|
|
10
|
+
import { CoderTeamRuntime } from '../../../../../scripts/run-codex-prompts/team/CoderTeamRuntime';
|
|
11
|
+
import { appendCoderTeamEvent } from '../../../../../scripts/run-codex-prompts/team/createCoderTeamPromptRunner';
|
|
12
|
+
import type { Usage } from '../../../../execution/Usage';
|
|
13
|
+
import { addUsage } from '../../../../execution/utils/addUsage';
|
|
14
|
+
import { NotFoundError } from '../../../../errors/NotFoundError';
|
|
15
|
+
import { spaceTrim } from '../../../../utils/organization/spaceTrim';
|
|
16
|
+
import type { NormalizedPromptRunnerSelectionCliOptions } from '../../common/promptRunnerCliOptions';
|
|
17
|
+
import { COMMON_PROMPT_TEMPLATE_FILE_PATH, resolveCoderPromptTemplate } from '../boilerplateTemplates';
|
|
18
|
+
import { assertPlanningPrdCommitScope } from './assertPlanningPrdCommitScope';
|
|
19
|
+
import { createPlanningWorkspace } from './createPlanningWorkspace';
|
|
20
|
+
import { resolvePlanningPath } from './resolvePlanningPath';
|
|
21
|
+
import { PLANNING_PROTOCOL, type PlanningMessage } from './planningProtocol';
|
|
22
|
+
import { discussPlanningTurn } from './discussPlanningTurn';
|
|
23
|
+
import { preparePlanningChanges, type PlanningChange } from './preparePlanningChanges';
|
|
24
|
+
import { readPlanningContext } from './readPlanningContext';
|
|
25
|
+
import { assertPlanningHarnessSupported, runPlanningHarness } from './runPlanningHarness';
|
|
26
|
+
import { savePlanningChanges } from './savePlanningChanges';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Terminal interface also used by deterministic conversation fixtures.
|
|
30
|
+
* @private internal type of `coder plan`
|
|
31
|
+
*/
|
|
32
|
+
export type PlanningSessionIo = {
|
|
33
|
+
readonly readMessage: () => Promise<string | undefined>;
|
|
34
|
+
readonly write: (message: string) => void;
|
|
35
|
+
readonly signal: AbortSignal;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Runs one multi-topic planning conversation; only explicit save commands cross the PRD write boundary.
|
|
40
|
+
* @private internal utility of `coder plan`
|
|
41
|
+
*/
|
|
42
|
+
export async function runPlanningSession(
|
|
43
|
+
options: NormalizedPromptRunnerSelectionCliOptions & {
|
|
44
|
+
readonly projectPath: string;
|
|
45
|
+
readonly agent?: string;
|
|
46
|
+
readonly context?: string;
|
|
47
|
+
readonly projectContext?: ResolvedCoderProjectContext;
|
|
48
|
+
readonly template?: string;
|
|
49
|
+
readonly preexistingChangedPaths?: ReadonlySet<string>;
|
|
50
|
+
},
|
|
51
|
+
io: PlanningSessionIo,
|
|
52
|
+
harness: typeof runPlanningHarness = runPlanningHarness,
|
|
53
|
+
): Promise<ReadonlyMap<string, string>> {
|
|
54
|
+
const projectPath = await realpath(options.projectPath);
|
|
55
|
+
assertPlanningHarnessSupported(options.agentName);
|
|
56
|
+
const projectContext = options.projectContext ?? (await resolveCoderProjectContext({ ...options, projectPath }));
|
|
57
|
+
const agent = await resolveCoderAgent(options.agent, projectPath, {
|
|
58
|
+
defaultRole: DEFAULT_CODER_AGENT_ROLE,
|
|
59
|
+
isInitializationAllowed: false,
|
|
60
|
+
signal: io.signal,
|
|
61
|
+
});
|
|
62
|
+
if (!existsSync(join(projectPath, 'prompts'))) {
|
|
63
|
+
throw new NotFoundError(spaceTrim('Planning requires `prompts/`. Run `ptbk coder init` first.'));
|
|
64
|
+
}
|
|
65
|
+
if (!agent) throw new NotFoundError(spaceTrim('Primary Book is missing. Run `ptbk coder init`.'));
|
|
66
|
+
resolvePlanningPath(projectPath, 'prompts');
|
|
67
|
+
const templateOption =
|
|
68
|
+
options.template ??
|
|
69
|
+
(existsSync(join(projectPath, COMMON_PROMPT_TEMPLATE_FILE_PATH))
|
|
70
|
+
? COMMON_PROMPT_TEMPLATE_FILE_PATH
|
|
71
|
+
: undefined);
|
|
72
|
+
const template = await resolveCoderPromptTemplate({ projectPath, templateOption });
|
|
73
|
+
const workspacePath = await createPlanningWorkspace(projectPath);
|
|
74
|
+
const primaryUsage: Usage[] = [];
|
|
75
|
+
const team = new CoderTeamRuntime({
|
|
76
|
+
agent: agent.teamAgent,
|
|
77
|
+
taskId: workspacePath,
|
|
78
|
+
signal: io.signal,
|
|
79
|
+
onEvent: (event) => appendCoderTeamEvent(join(workspacePath, 'runtime.log'), event),
|
|
80
|
+
execute: async ({ scope, message, context, reportUsage }) => {
|
|
81
|
+
const consultationHistory: PlanningMessage[] = [
|
|
82
|
+
{
|
|
83
|
+
role: 'context',
|
|
84
|
+
content: `Selected Book (${scope.agent.name}):\n${
|
|
85
|
+
scope.agent.systemMessage
|
|
86
|
+
}\nAvailable TEAM tools: ${JSON.stringify(scope.agent.teammates.map(({ tool }) => tool))}`,
|
|
87
|
+
},
|
|
88
|
+
{ role: 'user', content: JSON.stringify({ message, context }) },
|
|
89
|
+
];
|
|
90
|
+
const reply = await discussPlanningTurn({
|
|
91
|
+
projectPath,
|
|
92
|
+
history: consultationHistory,
|
|
93
|
+
signal: scope.signal,
|
|
94
|
+
team: scope,
|
|
95
|
+
isAdviser: true,
|
|
96
|
+
infer: () =>
|
|
97
|
+
harness({
|
|
98
|
+
...options,
|
|
99
|
+
workspacePath,
|
|
100
|
+
signal: scope.signal,
|
|
101
|
+
onUsage: reportUsage,
|
|
102
|
+
prompt: `${PLANNING_PROTOCOL}\nYou are a TEAM adviser. Return advice in message, no proposals.\nConversation (JSON data):\n${JSON.stringify(
|
|
103
|
+
consultationHistory,
|
|
104
|
+
)}`,
|
|
105
|
+
}),
|
|
106
|
+
});
|
|
107
|
+
return { answer: reply.message };
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
try {
|
|
111
|
+
const history: PlanningMessage[] = [
|
|
112
|
+
{
|
|
113
|
+
role: 'context',
|
|
114
|
+
content: `Selected Book (${agent.agentName}):\n${
|
|
115
|
+
agent.systemMessage
|
|
116
|
+
}\nAvailable TEAM tools: ${JSON.stringify(
|
|
117
|
+
agent.teamAgent.teammates.map(({ tool }) => tool),
|
|
118
|
+
)}\n\nSelected PRD template:\n${template.content}`,
|
|
119
|
+
},
|
|
120
|
+
{ role: 'context', content: await readPlanningContext(projectPath, { kind: 'list', path: '.' }) },
|
|
121
|
+
];
|
|
122
|
+
if (projectContext.context !== undefined) {
|
|
123
|
+
history.push({ role: 'context', content: projectContext.context });
|
|
124
|
+
}
|
|
125
|
+
for (const path of ['README.md']) {
|
|
126
|
+
if (existsSync(join(projectPath, path))) {
|
|
127
|
+
history.push({
|
|
128
|
+
role: 'context',
|
|
129
|
+
content: `${path}:\n${await readPlanningContext(projectPath, {
|
|
130
|
+
kind: 'read',
|
|
131
|
+
path,
|
|
132
|
+
startLine: 1,
|
|
133
|
+
lineCount: 200,
|
|
134
|
+
})}`,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const savedContents = new Map<string, string>();
|
|
139
|
+
let pending: PlanningChange[] = [];
|
|
140
|
+
io.write(
|
|
141
|
+
`${agent.agentName}: Discuss features and review PRD proposals. /save applies the preview; /draft saves unresolved drafts; /discard drops it; /exit ends. Ctrl+C cancels.\n`,
|
|
142
|
+
);
|
|
143
|
+
while (!io.signal.aborted) {
|
|
144
|
+
const message = (await io.readMessage())?.trim();
|
|
145
|
+
if (message === undefined || ['/exit', 'exit', 'quit'].includes(message)) break;
|
|
146
|
+
if (!message) continue;
|
|
147
|
+
if (message === '/discard') {
|
|
148
|
+
pending = [];
|
|
149
|
+
history.push({ role: 'context', content: 'The user discarded the unsaved proposals.' });
|
|
150
|
+
io.write('Discarded unsaved proposals.');
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
if (message === '/save' || message === '/draft') {
|
|
154
|
+
if (!pending.length) {
|
|
155
|
+
io.write('There are no proposed changes to save.');
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
if (io.signal.aborted) break;
|
|
159
|
+
try {
|
|
160
|
+
if (options.preexistingChangedPaths) {
|
|
161
|
+
await assertPlanningPrdCommitScope(
|
|
162
|
+
projectPath,
|
|
163
|
+
pending,
|
|
164
|
+
savedContents,
|
|
165
|
+
options.preexistingChangedPaths,
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
if (io.signal.aborted) break;
|
|
169
|
+
const paths = savePlanningChanges(projectPath, workspacePath, pending, message === '/draft');
|
|
170
|
+
for (const path of paths)
|
|
171
|
+
savedContents.set(path, readFileSync(resolvePlanningPath(projectPath, path), 'utf-8'));
|
|
172
|
+
history.push({
|
|
173
|
+
role: 'context',
|
|
174
|
+
content: `Saved ${message === '/draft' ? 'draft' : 'reviewed'} PRDs:\n${paths.join('\n')}`,
|
|
175
|
+
});
|
|
176
|
+
io.write(`Saved:\n${paths.join('\n')}`);
|
|
177
|
+
pending = [];
|
|
178
|
+
} catch (error) {
|
|
179
|
+
io.write(`Could not save: ${(error as Error).message}`);
|
|
180
|
+
}
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
// Continuing the discussion invalidates any earlier preview so a later save cannot apply stale decisions.
|
|
184
|
+
pending = [];
|
|
185
|
+
history.push({ role: 'user', content: message });
|
|
186
|
+
io.write(`${agent.agentName} is reading and thinking…`);
|
|
187
|
+
const reply = await discussPlanningTurn({
|
|
188
|
+
projectPath,
|
|
189
|
+
history,
|
|
190
|
+
signal: io.signal,
|
|
191
|
+
write: io.write,
|
|
192
|
+
team: team.root,
|
|
193
|
+
infer: () =>
|
|
194
|
+
harness({
|
|
195
|
+
...options,
|
|
196
|
+
workspacePath,
|
|
197
|
+
signal: io.signal,
|
|
198
|
+
onUsage: (item) => {
|
|
199
|
+
primaryUsage.push(item);
|
|
200
|
+
},
|
|
201
|
+
prompt: `${PLANNING_PROTOCOL}\n\nConversation (JSON data):\n${JSON.stringify(history)}`,
|
|
202
|
+
}),
|
|
203
|
+
});
|
|
204
|
+
if (io.signal.aborted) break;
|
|
205
|
+
io.write(`${agent.agentName}: ${reply.message}`);
|
|
206
|
+
pending = await preparePlanningChanges(projectPath, reply.proposals, templateOption);
|
|
207
|
+
for (const change of pending) io.write(formatPlanningPreview(change));
|
|
208
|
+
if (pending.length)
|
|
209
|
+
io.write(
|
|
210
|
+
'Review the changes above. /save applies this preview; /draft saves drafts; continue discussing to revise it.',
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
io.write(
|
|
214
|
+
io.signal.aborted
|
|
215
|
+
? 'Planning cancelled. Saved PRDs remain intact.'
|
|
216
|
+
: 'Planning ended. Unsaved proposals were discarded.',
|
|
217
|
+
);
|
|
218
|
+
return savedContents;
|
|
219
|
+
} finally {
|
|
220
|
+
await team.close();
|
|
221
|
+
await appendCoderTeamEvent(join(workspacePath, 'runtime.log'), {
|
|
222
|
+
type: 'team_summary',
|
|
223
|
+
sessionId: team.sessionId,
|
|
224
|
+
taskId: workspacePath,
|
|
225
|
+
invocationId: team.root.invocationId,
|
|
226
|
+
agent: agent.agentName,
|
|
227
|
+
data: { usage: addUsage(...primaryUsage, team.usage), isAggregate: true },
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/** Shows exact before/after content, including lifecycle lines, without requiring an external diff command. */
|
|
233
|
+
function formatPlanningPreview(change: PlanningChange): string {
|
|
234
|
+
if (change.before === null)
|
|
235
|
+
return `Create ${change.path}\n${change.after
|
|
236
|
+
.split(/\r?\n/u)
|
|
237
|
+
.map((line) => `+ ${line}`)
|
|
238
|
+
.join('\n')}`;
|
|
239
|
+
const before = change.before.split(/\r?\n/u);
|
|
240
|
+
const after = change.after.split(/\r?\n/u);
|
|
241
|
+
let start = 0;
|
|
242
|
+
while (start < before.length && start < after.length && before[start] === after[start]) start++;
|
|
243
|
+
let end = 0;
|
|
244
|
+
while (
|
|
245
|
+
end < before.length - start &&
|
|
246
|
+
end < after.length - start &&
|
|
247
|
+
before[before.length - end - 1] === after[after.length - end - 1]
|
|
248
|
+
)
|
|
249
|
+
end++;
|
|
250
|
+
return `Edit ${change.path}\n@@ line ${start + 1} @@\n${[
|
|
251
|
+
...before.slice(start, before.length - end).map((line) => `- ${line}`),
|
|
252
|
+
...after.slice(start, after.length - end).map((line) => `+ ${line}`),
|
|
253
|
+
].join('\n')}`;
|
|
254
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import {
|
|
2
|
+
closeSync,
|
|
3
|
+
existsSync,
|
|
4
|
+
fsyncSync,
|
|
5
|
+
linkSync,
|
|
6
|
+
openSync,
|
|
7
|
+
readFileSync,
|
|
8
|
+
renameSync,
|
|
9
|
+
unlinkSync,
|
|
10
|
+
writeFileSync,
|
|
11
|
+
} from 'fs';
|
|
12
|
+
import { join } from 'path';
|
|
13
|
+
import { NotAllowed } from '../../../../errors/NotAllowed';
|
|
14
|
+
import { spaceTrim } from '../../../../utils/organization/spaceTrim';
|
|
15
|
+
import { assertPlanningRuntimePath } from './assertPlanningRuntimePath';
|
|
16
|
+
import { resolvePlanningPath } from './resolvePlanningPath';
|
|
17
|
+
import type { PlanningChange } from './preparePlanningChanges';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Validates the entire batch before writing, stages outside the queue, then atomically replaces each file.
|
|
21
|
+
* The synchronous commit region cannot be interrupted by a SIGINT callback halfway through a save.
|
|
22
|
+
* @private internal execution boundary of `coder plan`
|
|
23
|
+
*/
|
|
24
|
+
export function savePlanningChanges(
|
|
25
|
+
projectPath: string,
|
|
26
|
+
workspacePath: string,
|
|
27
|
+
changes: ReadonlyArray<PlanningChange>,
|
|
28
|
+
isDraft: boolean,
|
|
29
|
+
): string[] {
|
|
30
|
+
assertPlanningRuntimePath(projectPath, workspacePath);
|
|
31
|
+
const prepared = changes.map((change, index) => {
|
|
32
|
+
const path = resolvePlanningPath(projectPath, change.path, true);
|
|
33
|
+
const current = existsSync(path) ? readFileSync(path, 'utf-8') : null;
|
|
34
|
+
if (current !== change.before) {
|
|
35
|
+
throw new NotAllowed(
|
|
36
|
+
spaceTrim(
|
|
37
|
+
`\`${change.path}\` changed since the preview. Nothing was saved; ask Planner to read it again.`,
|
|
38
|
+
),
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
if (isDraft && !change.draft) {
|
|
42
|
+
throw new NotAllowed(
|
|
43
|
+
spaceTrim(
|
|
44
|
+
`\`${change.path}\` has routing metadata that cannot be converted to [-] safely. Save the reviewed ready revision or keep discussing it.`,
|
|
45
|
+
),
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
...change,
|
|
50
|
+
planningPath: change.path,
|
|
51
|
+
path,
|
|
52
|
+
content: isDraft ? change.draft : change.after,
|
|
53
|
+
temporaryPath: join(workspacePath, `save-${index}.tmp`),
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
const saved: typeof prepared = [];
|
|
57
|
+
try {
|
|
58
|
+
for (const change of prepared) {
|
|
59
|
+
writeDurableFile(change.temporaryPath, change.content);
|
|
60
|
+
}
|
|
61
|
+
for (const change of prepared) {
|
|
62
|
+
resolvePlanningPath(projectPath, change.planningPath, true);
|
|
63
|
+
const current = existsSync(change.path) ? readFileSync(change.path, 'utf-8') : null;
|
|
64
|
+
if (current !== change.before) {
|
|
65
|
+
throw new NotAllowed(
|
|
66
|
+
spaceTrim(`\`${change.planningPath}\` changed while saving. Review a fresh preview.`),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
if (change.before === null) {
|
|
70
|
+
// Hard-link creation is exclusive: unlike rename, it cannot overwrite a concurrently created task.
|
|
71
|
+
linkSync(change.temporaryPath, change.path);
|
|
72
|
+
saved.push(change);
|
|
73
|
+
unlinkSync(change.temporaryPath);
|
|
74
|
+
} else {
|
|
75
|
+
renameSync(change.temporaryPath, change.path);
|
|
76
|
+
saved.push(change);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
} catch (error) {
|
|
80
|
+
for (const change of saved.reverse()) {
|
|
81
|
+
if (change.before === null) unlinkSync(change.path);
|
|
82
|
+
else {
|
|
83
|
+
writeDurableFile(change.temporaryPath, change.before);
|
|
84
|
+
renameSync(change.temporaryPath, change.path);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
throw error;
|
|
88
|
+
} finally {
|
|
89
|
+
for (const change of prepared) {
|
|
90
|
+
if (existsSync(change.temporaryPath)) unlinkSync(change.temporaryPath);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return changes.map((change) => change.path);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Flushes a staged PRD before publishing its directory entry. */
|
|
97
|
+
function writeDurableFile(path: string, content: string): void {
|
|
98
|
+
const descriptor = openSync(path, 'wx');
|
|
99
|
+
try {
|
|
100
|
+
writeFileSync(descriptor, content, 'utf-8');
|
|
101
|
+
fsyncSync(descriptor);
|
|
102
|
+
} finally {
|
|
103
|
+
closeSync(descriptor);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertProjectCheckScriptsAreConfigured,
|
|
3
|
+
CHECK_SETUP_PLACEHOLDER_COMMAND,
|
|
4
|
+
CoderCheckSetupError,
|
|
5
|
+
isCheckSetupRequired,
|
|
6
|
+
} from '../../../../scripts/run-codex-prompts/checks/projectCheck';
|
|
7
|
+
import { getDefaultCoderPackageJsonScripts } from './getDefaultCoderPackageJsonScripts';
|
|
8
|
+
import { projectScriptReferences } from '../../../../scripts/run-codex-prompts/checks/projectScriptReferences';
|
|
9
|
+
|
|
10
|
+
/** Old initialized aggregate entries, used only at this migration boundary. */
|
|
11
|
+
const LEGACY_CHECK_SCRIPT_NAMES = ['test-for-ptbk-coder', 'check-for-ptbk-coder'] as const;
|
|
12
|
+
|
|
13
|
+
/** Conventional project validation scripts, ordered from lightweight checks to tests. */
|
|
14
|
+
const VALIDATION_SCRIPT_GROUPS = [
|
|
15
|
+
['lint', 'test-lint'],
|
|
16
|
+
['typecheck', 'type-check', 'type-checking', 'check-types', 'test-types'],
|
|
17
|
+
['build', 'test-build'],
|
|
18
|
+
] as const;
|
|
19
|
+
|
|
20
|
+
/** Conventional leaf test families used when the project has no usable test aggregate. */
|
|
21
|
+
const TEST_SCRIPT_GROUPS = [
|
|
22
|
+
['test-unit', 'test:unit'],
|
|
23
|
+
['test-integration', 'test:integration'],
|
|
24
|
+
['test-e2e', 'test:e2e'],
|
|
25
|
+
] as const;
|
|
26
|
+
|
|
27
|
+
/** Script names that must never be reached by a generated aggregate. */
|
|
28
|
+
const NON_VALIDATION_SCRIPT_PATTERN =
|
|
29
|
+
/^(?:check$|coder:|(?:dev|start|serve|watch|deploy|publish|install|preinstall|postinstall|prepare|reset|clean)(?:$|[:-]))/iu;
|
|
30
|
+
|
|
31
|
+
/** Clearly unsuitable shell bodies are excluded even under a conventional validation name. */
|
|
32
|
+
const UNSUITABLE_VALIDATION_BODY_PATTERN =
|
|
33
|
+
/(?:\b(?:ptbk|promptbook)\s+coder\s+(?:run|fix)|\bcoder:(?:run|fix)\b|--watch(?:All)?(?:\b|=)|\b(?:watch|nodemon|concurrently|serve|deploy|publish|install|reset|rm|rmdir|del|remove-item)\b|--if-present|\|\||(?:^|[^&])&(?:$|[^&])|;|\bexit\s+0\b)/iu;
|
|
34
|
+
|
|
35
|
+
/** Npm lifecycle hooks that run implicitly before and after a selected project script. */
|
|
36
|
+
const SCRIPT_LIFECYCLE_PREFIXES = ['pre', 'post'] as const;
|
|
37
|
+
|
|
38
|
+
/** Result of preparing project-owned checks and migrating recognized generated callers. @private internal initializer result */
|
|
39
|
+
export type PreparedCoderPackageJsonScripts = {
|
|
40
|
+
readonly scripts: Readonly<Record<string, string>>;
|
|
41
|
+
readonly checkScriptSummary: string;
|
|
42
|
+
readonly migrationInstructions: ReadonlyArray<string>;
|
|
43
|
+
readonly isCheckConfigured: boolean;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Preserves project scripts, creates one canonical check, and migrates only exact generated caller forms.
|
|
48
|
+
* @private shared package-script preparation for Coder initialization
|
|
49
|
+
*/
|
|
50
|
+
export function prepareCoderPackageJsonScripts(
|
|
51
|
+
existing: Readonly<Record<string, string>>,
|
|
52
|
+
externalCallers: Readonly<Record<string, ReadonlyArray<string>>> = {},
|
|
53
|
+
): PreparedCoderPackageJsonScripts {
|
|
54
|
+
const scripts = { ...existing };
|
|
55
|
+
const migrationInstructions: string[] = [];
|
|
56
|
+
const legacyNames = LEGACY_CHECK_SCRIPT_NAMES.filter((name) =>
|
|
57
|
+
Object.prototype.hasOwnProperty.call(existing, name),
|
|
58
|
+
);
|
|
59
|
+
let checkScriptSummary: string;
|
|
60
|
+
|
|
61
|
+
if (Object.prototype.hasOwnProperty.call(existing, 'check')) {
|
|
62
|
+
checkScriptSummary = 'Preserved project scripts.check exactly; Coder executes npm run check.';
|
|
63
|
+
} else if (legacyNames.length > 0) {
|
|
64
|
+
const sourceName = legacyNames[0]!;
|
|
65
|
+
const isRecursive =
|
|
66
|
+
scriptReaches(sourceName, 'check', existing, new Set()) ||
|
|
67
|
+
scriptReaches(sourceName, sourceName, existing, new Set()) ||
|
|
68
|
+
scriptReaches(sourceName, 'coder:run', existing, new Set()) ||
|
|
69
|
+
scriptReaches(sourceName, 'coder:fix', existing, new Set());
|
|
70
|
+
const conflictingLifecycleNames = SCRIPT_LIFECYCLE_PREFIXES.filter(
|
|
71
|
+
(prefix) =>
|
|
72
|
+
existing[`${prefix}check`] !== undefined &&
|
|
73
|
+
existing[`${prefix}${sourceName}`] !== existing[`${prefix}check`],
|
|
74
|
+
).map((prefix) => `${prefix}check`);
|
|
75
|
+
scripts.check =
|
|
76
|
+
isRecursive || conflictingLifecycleNames.length > 0
|
|
77
|
+
? CHECK_SETUP_PLACEHOLDER_COMMAND
|
|
78
|
+
: existing[sourceName]!;
|
|
79
|
+
if (!isRecursive && conflictingLifecycleNames.length === 0) {
|
|
80
|
+
// npm runs these hooks implicitly. Preserve their bodies as well as the main script's scope.
|
|
81
|
+
for (const prefix of SCRIPT_LIFECYCLE_PREFIXES) {
|
|
82
|
+
const legacyHook = existing[`${prefix}${sourceName}`];
|
|
83
|
+
if (legacyHook !== undefined) scripts[`${prefix}check`] = legacyHook;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
checkScriptSummary = isRecursive
|
|
87
|
+
? `Kept recursive scripts.${sourceName} unchanged; configure scripts.check with validation that does not call check or Coder recursively.`
|
|
88
|
+
: conflictingLifecycleNames.length > 0
|
|
89
|
+
? `Kept scripts.${sourceName} and conflicting ${conflictingLifecycleNames.join(
|
|
90
|
+
', ',
|
|
91
|
+
)} hooks unchanged; configure scripts.check and its lifecycle hooks to preserve the required validation.`
|
|
92
|
+
: `Preserved scripts.${sourceName}'s validation command and npm lifecycle hooks in scripts.check: ${scripts.check}`;
|
|
93
|
+
} else {
|
|
94
|
+
const selectedScripts = selectValidationScripts(existing);
|
|
95
|
+
scripts.check =
|
|
96
|
+
selectedScripts.length > 0
|
|
97
|
+
? selectedScripts.map((name) => (name === 'test' ? 'npm test' : `npm run ${name}`)).join(' && ')
|
|
98
|
+
: CHECK_SETUP_PLACEHOLDER_COMMAND;
|
|
99
|
+
checkScriptSummary =
|
|
100
|
+
selectedScripts.length > 0
|
|
101
|
+
? `Generated scripts.check from the available validation scripts (${selectedScripts.join(', ')}): ${
|
|
102
|
+
scripts.check
|
|
103
|
+
}`
|
|
104
|
+
: 'No usable validation scripts found. scripts.check contains a failing setup placeholder; configure it before running Coder.';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
for (const [name, command] of Object.entries(existing)) {
|
|
108
|
+
if (
|
|
109
|
+
['check', ...legacyNames].some(
|
|
110
|
+
(verificationName) =>
|
|
111
|
+
name === verificationName ||
|
|
112
|
+
SCRIPT_LIFECYCLE_PREFIXES.some((prefix) => name === `${prefix}${verificationName}`),
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
continue;
|
|
116
|
+
const migratedCaller = migrateGeneratedCoderRunScript(command);
|
|
117
|
+
if (migratedCaller !== undefined) {
|
|
118
|
+
// A different existing check is authoritative, but changing a custom legacy caller's scope is not safe.
|
|
119
|
+
const referencedLegacyName = legacyNames.find((legacyName) => command.includes(legacyName));
|
|
120
|
+
const isConflictingCustomCheck =
|
|
121
|
+
referencedLegacyName !== undefined &&
|
|
122
|
+
!isLegacyCheckScopePreserved(referencedLegacyName, scripts) &&
|
|
123
|
+
!isUnchangedLegacyCheckDefault(referencedLegacyName, scripts);
|
|
124
|
+
if (!isConflictingCustomCheck) scripts[name] = migratedCaller;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
for (const legacyName of legacyNames) {
|
|
129
|
+
const callers = Object.entries(scripts)
|
|
130
|
+
.filter(([name, command]) => name !== legacyName && command.includes(legacyName))
|
|
131
|
+
.map(([name]) => name);
|
|
132
|
+
const isPreservedScope = isLegacyCheckScopePreserved(legacyName, scripts);
|
|
133
|
+
const isObsoleteGeneratedDefault =
|
|
134
|
+
isUnchangedLegacyCheckDefault(legacyName, scripts) && !isCheckSetupRequired(scripts.check!);
|
|
135
|
+
const files = externalCallers[legacyName] ?? [];
|
|
136
|
+
if (callers.length === 0 && files.length === 0 && (isPreservedScope || isObsoleteGeneratedDefault)) {
|
|
137
|
+
delete scripts[legacyName];
|
|
138
|
+
for (const prefix of SCRIPT_LIFECYCLE_PREFIXES) delete scripts[`${prefix}${legacyName}`];
|
|
139
|
+
} else {
|
|
140
|
+
migrationInstructions.push(
|
|
141
|
+
`Kept scripts.${legacyName}${
|
|
142
|
+
callers.length ? `; referenced by scripts.${callers.join(', scripts.')}` : ''
|
|
143
|
+
}${files.length ? `; referenced by ${files.join(', ')}` : ''}${
|
|
144
|
+
!isPreservedScope && !isObsoleteGeneratedDefault
|
|
145
|
+
? '; its custom command or npm lifecycle hooks differ from scripts.check'
|
|
146
|
+
: ''
|
|
147
|
+
}. Preserve its required validation and pre/post hooks in scripts.check, update those callers to npm run check, then remove scripts.${legacyName} and its unused lifecycle hooks.`,
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
for (const [name, command] of Object.entries(scripts)) {
|
|
152
|
+
if (
|
|
153
|
+
/\b(?:ptbk|promptbook)\s+coder\s+(?:run|server)\b|\brun-codex-prompts\b/u.test(command) &&
|
|
154
|
+
/--test(?:-before)?(?:\s|=|$)/u.test(command)
|
|
155
|
+
) {
|
|
156
|
+
migrationInstructions.push(
|
|
157
|
+
`Update scripts.${name}: replace --test with --check and --test-before with --check-before; review its shell expression manually. Existing command was preserved: ${command}`,
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
let isCheckConfigured = true;
|
|
163
|
+
try {
|
|
164
|
+
assertProjectCheckScriptsAreConfigured(scripts);
|
|
165
|
+
} catch (error) {
|
|
166
|
+
if (!(error instanceof CoderCheckSetupError)) throw error;
|
|
167
|
+
isCheckConfigured = false;
|
|
168
|
+
checkScriptSummary += ` Additional setup required: ${error.message}`;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return {
|
|
172
|
+
scripts,
|
|
173
|
+
checkScriptSummary,
|
|
174
|
+
migrationInstructions,
|
|
175
|
+
isCheckConfigured,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** Determines whether both the legacy command and its implicit npm validation hooks have been preserved. */
|
|
180
|
+
function isLegacyCheckScopePreserved(name: string, scripts: Readonly<Record<string, string>>): boolean {
|
|
181
|
+
return (
|
|
182
|
+
scripts[name] === scripts.check &&
|
|
183
|
+
SCRIPT_LIFECYCLE_PREFIXES.every((prefix) => scripts[`${prefix}${name}`] === scripts[`${prefix}check`])
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** Recognizes the generated default only when no custom lifecycle hooks extend its validation scope. */
|
|
188
|
+
function isUnchangedLegacyCheckDefault(name: string, scripts: Readonly<Record<string, string>>): boolean {
|
|
189
|
+
return (
|
|
190
|
+
scripts[name] === 'npm test' &&
|
|
191
|
+
SCRIPT_LIFECYCLE_PREFIXES.every((prefix) => scripts[`${prefix}${name}`] === undefined)
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Recognizes unchanged generated run scripts, including the previous explicit Developer/context defaults.
|
|
197
|
+
* Unknown shell expressions and custom harness configuration are preserved for manual migration.
|
|
198
|
+
*/
|
|
199
|
+
function migrateGeneratedCoderRunScript(command: string): string | undefined {
|
|
200
|
+
const prefix = 'npx ptbk coder run --harness openai-codex --thinking-level max';
|
|
201
|
+
const defaultArguments = ['', ' --agent agents/developer.book --context AGENTS.md'];
|
|
202
|
+
const verificationArguments = [
|
|
203
|
+
' --test-before yes-and-fix',
|
|
204
|
+
...LEGACY_CHECK_SCRIPT_NAMES.map((name) => ` --test "npm run ${name}" --test-before yes-and-fix`),
|
|
205
|
+
...LEGACY_CHECK_SCRIPT_NAMES.map((name) => ` --check "npm run ${name}" --check-before yes-and-fix`),
|
|
206
|
+
];
|
|
207
|
+
const isGenerated = defaultArguments.some((defaults) =>
|
|
208
|
+
verificationArguments.some((verification) => command === prefix + defaults + verification),
|
|
209
|
+
);
|
|
210
|
+
return isGenerated ? getDefaultCoderPackageJsonScripts()['coder:run'] : undefined;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** Selects safe conventional scripts, avoiding duplicates already reached by another selected aggregate. */
|
|
214
|
+
function selectValidationScripts(scripts: Readonly<Record<string, string>>): string[] {
|
|
215
|
+
if (
|
|
216
|
+
SCRIPT_LIFECYCLE_PREFIXES.some(
|
|
217
|
+
(prefix) =>
|
|
218
|
+
scripts[`${prefix}check`] !== undefined &&
|
|
219
|
+
!isUsableValidationScript(`${prefix}check`, scripts, new Set()),
|
|
220
|
+
)
|
|
221
|
+
)
|
|
222
|
+
return [];
|
|
223
|
+
const selected: string[] = [];
|
|
224
|
+
for (const group of VALIDATION_SCRIPT_GROUPS) {
|
|
225
|
+
const name = group.find((candidate) => isUsableValidationScript(candidate, scripts, new Set()));
|
|
226
|
+
if (name !== undefined) selected.push(name);
|
|
227
|
+
}
|
|
228
|
+
if (isUsableValidationScript('test', scripts, new Set())) selected.push('test');
|
|
229
|
+
else
|
|
230
|
+
for (const group of TEST_SCRIPT_GROUPS) {
|
|
231
|
+
const name = group.find((candidate) => isUsableValidationScript(candidate, scripts, new Set()));
|
|
232
|
+
if (name !== undefined) selected.push(name);
|
|
233
|
+
}
|
|
234
|
+
return selected.filter(
|
|
235
|
+
(name) => !selected.some((other) => other !== name && scriptReaches(other, name, scripts, new Set())),
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/** Inspects each body, referenced script, and implicit lifecycle hook before including it in an aggregate. */
|
|
240
|
+
function isUsableValidationScript(
|
|
241
|
+
name: string,
|
|
242
|
+
scripts: Readonly<Record<string, string>>,
|
|
243
|
+
visited: ReadonlySet<string>,
|
|
244
|
+
): boolean {
|
|
245
|
+
const command = scripts[name];
|
|
246
|
+
if (
|
|
247
|
+
!command ||
|
|
248
|
+
visited.has(name) ||
|
|
249
|
+
NON_VALIDATION_SCRIPT_PATTERN.test(name) ||
|
|
250
|
+
isCheckSetupRequired(command) ||
|
|
251
|
+
UNSUITABLE_VALIDATION_BODY_PATTERN.test(command)
|
|
252
|
+
)
|
|
253
|
+
return false;
|
|
254
|
+
if (
|
|
255
|
+
command.split('&&').every((part) => /^\s*(?:echo|printf|true|:)(?:\s|$)/iu.test(part)) ||
|
|
256
|
+
/\bprocess\.exit\(\s*0\s*\)/u.test(command)
|
|
257
|
+
)
|
|
258
|
+
return false;
|
|
259
|
+
if (
|
|
260
|
+
/\b(?:vite|next|astro|webpack-dev-server)\s+(?:dev|start|serve)\b/iu.test(command) ||
|
|
261
|
+
/(?:^|&&)\s*(?:vite|webpack-dev-server)(?:\s*$|\s+--)/iu.test(command) ||
|
|
262
|
+
(/\bvitest\b/iu.test(command) && !/\bvitest\s+run\b/iu.test(command))
|
|
263
|
+
)
|
|
264
|
+
return false;
|
|
265
|
+
const nextVisited = new Set([...visited, name]);
|
|
266
|
+
const references = projectScriptReferences(command);
|
|
267
|
+
// Ambiguous package-manager flags and cwd switches cannot be composed confidently as root validation.
|
|
268
|
+
if (
|
|
269
|
+
/\b(?:npm|pnpm|yarn)\s+(?:--|run(?:-script)?\s+--)/u.test(command) ||
|
|
270
|
+
(/\b(?:npm|pnpm|yarn)\b/u.test(command) && references.length === 0)
|
|
271
|
+
)
|
|
272
|
+
return false;
|
|
273
|
+
if (references.some((reference) => !isUsableValidationScript(reference, scripts, nextVisited))) return false;
|
|
274
|
+
return SCRIPT_LIFECYCLE_PREFIXES.every((prefix) => {
|
|
275
|
+
const lifecycleName = `${prefix}${name}`;
|
|
276
|
+
return scripts[lifecycleName] === undefined || isUsableValidationScript(lifecycleName, scripts, nextVisited);
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** Checks whether a selected aggregate already reaches another selected script. */
|
|
281
|
+
function scriptReaches(
|
|
282
|
+
name: string,
|
|
283
|
+
target: string,
|
|
284
|
+
scripts: Readonly<Record<string, string>>,
|
|
285
|
+
visited: ReadonlySet<string>,
|
|
286
|
+
): boolean {
|
|
287
|
+
if (visited.has(name)) return false;
|
|
288
|
+
const nextVisited = new Set([...visited, name]);
|
|
289
|
+
const command = scripts[name] ?? '';
|
|
290
|
+
if (
|
|
291
|
+
(target === 'coder:run' && /\b(?:ptbk|promptbook)\s+coder\s+run\b/u.test(command)) ||
|
|
292
|
+
(target === 'coder:fix' && /\b(?:ptbk|promptbook)\s+coder\s+fix\b/u.test(command))
|
|
293
|
+
)
|
|
294
|
+
return true;
|
|
295
|
+
const references = [
|
|
296
|
+
...projectScriptReferences(command),
|
|
297
|
+
...SCRIPT_LIFECYCLE_PREFIXES.map((prefix) => `${prefix}${name}`).filter(
|
|
298
|
+
(lifecycleName) => scripts[lifecycleName] !== undefined,
|
|
299
|
+
),
|
|
300
|
+
];
|
|
301
|
+
return references.some(
|
|
302
|
+
(reference) => reference === target || scriptReaches(reference, target, scripts, nextVisited),
|
|
303
|
+
);
|
|
304
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import colors from 'colors';
|
|
2
|
+
import { formatUnknownErrorDetails } from '../../../../scripts/run-codex-prompts/common/formatUnknownErrorDetails';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Prints why a coder run has ended to the terminal.
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of `coder run` and `coder server` commands
|
|
8
|
+
*/
|
|
9
|
+
export function printCoderRunFailure(error: Error): void {
|
|
10
|
+
console.error(colors.bgRed(`${error.name}`));
|
|
11
|
+
console.error(colors.red(formatUnknownErrorDetails(error)));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Note: [🟡] Code for coder failure reporting [printCoderRunFailure](src/cli/cli-commands/coder/printCoderRunFailure.ts) should never be published outside of `@promptbook/cli`
|