@promptbook/cli 0.114.0-2 → 0.114.0-4
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 +1 -9
- package/apps/agents-server/{USE_TIMEOUT_CHIP_QA.md → TIMEOUT_CHIP_QA.md} +1 -1
- package/apps/agents-server/next.config.ts +11 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/chat/resolveAgentChatRouteContext.ts +5 -12
- package/apps/agents-server/src/app/agents/[agentName]/api/voice/route.ts +4 -9
- package/apps/agents-server/src/app/api/scrape/route.ts +1 -1
- package/apps/agents-server/src/app/layout.tsx +31 -0
- package/apps/agents-server/src/app/system/user-wallet/UserWalletDraft.ts +2 -2
- package/apps/agents-server/src/components/AgentProfile/AgentCapabilityChips.tsx +1 -24
- package/apps/agents-server/src/components/Header/Header.tsx +8 -0
- package/apps/agents-server/src/components/Header/HeaderTypes.ts +5 -0
- package/apps/agents-server/src/components/Header/buildHeaderSystemMenuItems.ts +118 -30
- package/apps/agents-server/src/components/Header/resolveHeaderSystemActivities.ts +86 -0
- package/apps/agents-server/src/components/Homepage/AgentCard.tsx +0 -3
- package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +8 -0
- package/apps/agents-server/src/components/NewAgentDialog/NewAgentWizardState.ts +0 -12
- package/apps/agents-server/src/components/NewAgentDialog/NewAgentWizardUseSetupStep.tsx +0 -58
- package/apps/agents-server/src/components/NewAgentDialog/newAgentWizardPresets.ts +0 -56
- package/apps/agents-server/src/components/WalletRecordDialog/useWalletRecordDialogState.ts +1 -1
- package/apps/agents-server/src/languages/ServerTranslationKeys.ts +0 -10
- package/apps/agents-server/src/languages/translations/czech.yaml +0 -10
- package/apps/agents-server/src/languages/translations/english.yaml +0 -10
- package/apps/agents-server/src/message-providers/email/smtp/SmtpMessageProvider.ts +1 -1
- package/apps/agents-server/src/tools/$provideOpenAiAgentKitExecutionToolsForServer.ts +0 -191
- package/apps/agents-server/src/tools/$provideOpenAiAssistantExecutionToolsForServer.ts +0 -3
- package/apps/agents-server/src/tools/run_browser.ts +1 -1
- package/apps/agents-server/src/tools/send_email.ts +3 -3
- package/apps/agents-server/src/utils/handleChatCompletion/createHandleChatCompletionPromptContext.ts +0 -1
- package/apps/agents-server/src/utils/handleChatCompletion/resolveHandleChatCompletionRuntime.ts +4 -12
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentBooks.ts +0 -1
- package/apps/agents-server/src/utils/messages/parseUseEmailSmtpCredential.ts +1 -1
- package/apps/agents-server/src/utils/resolveUseEmailSmtpCredential.ts +1 -1
- package/apps/agents-server/src/utils/useEmailSmtpWalletConstants.ts +5 -5
- package/apps/agents-server/src/utils/userChat/createRunUserChatJobExecutionContext.ts +5 -12
- package/apps/agents-server/src/utils/userWallet/UserWalletRecord.ts +1 -1
- package/apps/agents-server/src/utils/userWallet/resolveUseEmailSmtpCredentialFromWallet.ts +1 -1
- package/apps/agents-server/src/utils/vpsSelfUpdate/deleteVpsSelfUpdateInstalledVersion.ts +2 -1
- package/apps/agents-server/src/utils/vpsSelfUpdate/isVpsSelfUpdateJobRunning.ts +16 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/startVpsSelfUpdate.ts +2 -1
- package/apps/agents-server/src/utils/vpsSelfUpdate.ts +1 -0
- package/esm/index.es.js +1974 -5149
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +7 -0
- package/esm/scripts/run-codex-prompts/git/coderGitSync.d.ts +43 -0
- package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +3 -0
- package/esm/scripts/run-codex-prompts/main/resolvePromptRunner.d.ts +8 -1
- package/esm/scripts/run-codex-prompts/ping/buildCoderPingPrompt.d.ts +20 -0
- package/esm/scripts/run-codex-prompts/ping/extractCoderPingAnswer.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/ping/pingCoderHarness.d.ts +23 -0
- package/esm/scripts/run-codex-prompts/ping/printCoderPingResult.d.ts +5 -0
- package/esm/scripts/verify-prompts/verify-prompts.d.ts +5 -0
- package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -3
- package/esm/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/boilerplateCount.d.ts +52 -0
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +3 -2
- package/esm/src/cli/cli-commands/coder/ping.d.ts +2 -5
- package/esm/src/cli/cli-commands/coder.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +34 -0
- package/esm/src/cli/common/loadPromptsModule.d.ts +16 -0
- package/esm/src/commitments/{COMPONENT/COMPONENT.d.ts → META_FULLNAME/META_FULLNAME.d.ts} +8 -5
- package/esm/src/commitments/META_ID/META_ID.d.ts +32 -0
- package/esm/src/commitments/index.d.ts +4 -12
- package/esm/src/llm-providers/agent/Agent.d.ts +1 -1
- package/esm/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +2 -2
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +1 -1
- package/esm/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +1 -1
- package/esm/src/llm-providers/openai/utils/loadOpenAiAgentsModule.d.ts +203 -0
- package/esm/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +1 -1
- package/esm/src/{commitments/USE_BROWSER → scrapers/_common/utils}/fetchUrlContent.d.ts +2 -3
- package/esm/src/utils/misc/createLazyModuleLoader.d.ts +14 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/_packages/components.readme.md +1 -1
- package/src/book-2.0/agent-source/AgentBasicInformation.ts +3 -9
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/filterCommitmentsForAgentModelRequirements.ts +0 -23
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.ts +0 -2
- package/src/book-2.0/agent-source/parseAgentSource/applyMetaCommitment.ts +16 -31
- package/src/book-2.0/agent-source/parseAgentSource/createCapabilitiesFromCommitment.ts +0 -35
- package/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.ts +0 -25
- package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +2 -10
- package/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.ts +7 -32
- package/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.ts +6 -31
- package/src/book-3.0/LiteAgent.ts +11 -9
- package/src/book-components/BookEditor/useBookEditorMonacoLanguage.ts +1 -1
- package/src/book-components/Chat/utils/$provideServerDomWindow.ts +77 -0
- package/src/book-components/Chat/utils/renderMarkdown.ts +2 -23
- package/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.ts +14 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/ensureAgentsServerBuild.ts +1 -0
- package/src/cli/cli-commands/coder/add.ts +40 -12
- package/src/cli/cli-commands/coder/boilerplateCount.ts +139 -0
- package/src/cli/cli-commands/coder/generate-boilerplates.ts +82 -48
- package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +3 -1
- package/src/cli/cli-commands/coder/init.ts +29 -2
- package/src/cli/cli-commands/coder/ping.ts +23 -45
- package/src/cli/cli-commands/coder/verify.ts +27 -12
- package/src/cli/cli-commands/coder.ts +3 -3
- package/src/cli/cli-commands/common/coderGitSyncCliOptions.ts +78 -0
- package/src/cli/cli-commands/run/prepareRunCommandResources.ts +2 -1
- package/src/cli/cli-commands/run/resolveRunInputParameters.ts +2 -1
- package/src/cli/cli-commands/runInteractiveChatbot.ts +2 -1
- package/src/cli/common/$provideLlmToolsForCli.ts +2 -1
- package/src/cli/common/loadPromptsModule.ts +13 -0
- package/src/commitments/ACTION/ACTION.ts +3 -3
- package/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.ts +1 -1
- package/src/commitments/META_FULLNAME/META_FULLNAME.ts +70 -0
- package/src/commitments/META_ID/META_ID.ts +78 -0
- package/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.ts +1 -49
- package/src/commitments/index.ts +6 -24
- package/src/conversion/archive/loadArchive.ts +2 -1
- package/src/conversion/archive/loadJsZipModule.ts +10 -0
- package/src/conversion/archive/saveArchive.ts +2 -1
- package/src/llm-providers/agent/Agent.ts +1 -1
- package/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.ts +13 -1
- package/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.ts +13 -1
- package/src/llm-providers/openai/OpenAiAgentKitExecutionTools.ts +6 -2
- package/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.ts +9 -7
- package/src/llm-providers/openai/OpenAiAssistantExecutionTools.ts +1 -1
- package/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.ts +1 -1
- package/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.ts +1 -1
- package/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.ts +1 -1
- package/src/llm-providers/openai/OpenAiCompatibleRequestManager.ts +12 -1
- package/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.ts +1 -1
- package/src/llm-providers/openai/utils/loadOpenAiAgentsModule.ts +11 -0
- package/src/llm-providers/openai/utils/uploadFilesToOpenAi.ts +1 -1
- package/src/other/templates/getTemplatesPipelineCollection.ts +715 -823
- package/src/remote-server/createRemoteClient.ts +12 -1
- package/src/{commitments/USE_BROWSER → scrapers/_common/utils}/fetchUrlContent.ts +8 -9
- package/src/scrapers/website/WebsiteScraper.ts +22 -2
- package/src/utils/misc/createLazyModuleLoader.ts +27 -0
- package/src/version.ts +2 -2
- package/src/versions.txt +2 -0
- package/umd/index.umd.js +2047 -5216
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +7 -0
- package/umd/scripts/run-codex-prompts/git/coderGitSync.d.ts +43 -0
- package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +3 -0
- package/umd/scripts/run-codex-prompts/main/resolvePromptRunner.d.ts +8 -1
- package/umd/scripts/run-codex-prompts/ping/buildCoderPingPrompt.d.ts +20 -0
- package/umd/scripts/run-codex-prompts/ping/extractCoderPingAnswer.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/ping/pingCoderHarness.d.ts +23 -0
- package/umd/scripts/run-codex-prompts/ping/printCoderPingResult.d.ts +5 -0
- package/umd/scripts/verify-prompts/verify-prompts.d.ts +5 -0
- package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -3
- package/umd/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/boilerplateCount.d.ts +52 -0
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +3 -2
- package/umd/src/cli/cli-commands/coder/ping.d.ts +2 -5
- package/umd/src/cli/cli-commands/coder.d.ts +1 -1
- package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +34 -0
- package/umd/src/cli/common/loadPromptsModule.d.ts +16 -0
- package/umd/src/commitments/{COMPONENT/COMPONENT.d.ts → META_FULLNAME/META_FULLNAME.d.ts} +8 -5
- package/umd/src/commitments/META_ID/META_ID.d.ts +32 -0
- package/umd/src/commitments/index.d.ts +4 -12
- package/umd/src/llm-providers/agent/Agent.d.ts +1 -1
- package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +2 -2
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +1 -1
- package/umd/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +1 -1
- package/umd/src/llm-providers/openai/utils/loadOpenAiAgentsModule.d.ts +203 -0
- package/umd/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +1 -1
- package/umd/src/{commitments/USE_BROWSER → scrapers/_common/utils}/fetchUrlContent.d.ts +2 -3
- package/umd/src/utils/misc/createLazyModuleLoader.d.ts +14 -0
- package/umd/src/version.d.ts +1 -1
- package/apps/agents-server/src/tools/configureTimeoutToolRuntimeAdapterForServer.ts +0 -381
- package/apps/agents-server/src/utils/emails/extractUseEmailConfigurationFromAgentSource.ts +0 -42
- package/esm/scripts/run-agent-chat/runCoderPing.d.ts +0 -48
- package/esm/src/commitments/MEMORY/MEMORY.d.ts +0 -48
- package/esm/src/commitments/MEMORY/MemoryToolNames.d.ts +0 -11
- package/esm/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +0 -149
- package/esm/src/commitments/MEMORY/createMemorySystemMessage.d.ts +0 -6
- package/esm/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +0 -8
- package/esm/src/commitments/MEMORY/createMemoryTools.d.ts +0 -14
- package/esm/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +0 -6
- package/esm/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
- package/esm/src/commitments/MEMORY/getMemoryToolTitles.d.ts +0 -7
- package/esm/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +0 -61
- package/esm/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +0 -8
- package/esm/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +0 -13
- package/esm/src/commitments/META/META.d.ts +0 -65
- package/esm/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +0 -32
- package/esm/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -58
- package/esm/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.d.ts +0 -13
- package/esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +0 -10
- package/esm/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.d.ts +0 -47
- package/esm/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -38
- package/esm/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +0 -21
- package/esm/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +0 -11
- package/esm/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +0 -13
- package/esm/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -46
- package/esm/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -38
- package/esm/src/commitments/USE_SPAWN/USE_SPAWN.test.d.ts +0 -1
- package/esm/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +0 -9
- package/esm/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +0 -12
- package/esm/src/commitments/USE_TIME/USE_TIME.d.ts +0 -43
- package/esm/src/commitments/USE_TIME/USE_TIME.test.d.ts +0 -1
- package/esm/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +0 -11
- package/esm/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +0 -212
- package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -38
- package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts +0 -1
- package/esm/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +0 -6
- package/esm/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +0 -8
- package/esm/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +0 -7
- package/esm/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
- package/esm/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +0 -78
- package/esm/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +0 -8
- package/esm/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +0 -13
- package/esm/src/commitments/WALLET/WALLET.d.ts +0 -21
- package/esm/src/commitments/WALLET/WALLET.test.d.ts +0 -1
- package/esm/src/commitments/WALLET/WalletToolNames.d.ts +0 -12
- package/esm/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +0 -163
- package/esm/src/commitments/WALLET/createWalletSystemMessage.d.ts +0 -6
- package/esm/src/commitments/WALLET/createWalletToolFunctions.d.ts +0 -8
- package/esm/src/commitments/WALLET/createWalletTools.d.ts +0 -7
- package/esm/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +0 -6
- package/esm/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +0 -16
- package/esm/src/commitments/WALLET/getWalletToolTitles.d.ts +0 -7
- package/esm/src/commitments/WALLET/parseWalletToolArgs.d.ts +0 -51
- package/esm/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +0 -8
- package/esm/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +0 -13
- package/esm/src/commitments/_common/createSerpSearchToolFunction.d.ts +0 -12
- package/src/commitments/COMPONENT/COMPONENT.ts +0 -70
- package/src/commitments/MEMORY/MEMORY.ts +0 -94
- package/src/commitments/MEMORY/MemoryToolNames.ts +0 -13
- package/src/commitments/MEMORY/MemoryToolRuntimeAdapter.ts +0 -180
- package/src/commitments/MEMORY/createMemorySystemMessage.ts +0 -27
- package/src/commitments/MEMORY/createMemoryToolFunctions.ts +0 -134
- package/src/commitments/MEMORY/createMemoryTools.ts +0 -115
- package/src/commitments/MEMORY/getMemoryCommitmentDocumentation.ts +0 -47
- package/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.ts +0 -104
- package/src/commitments/MEMORY/getMemoryToolTitles.ts +0 -16
- package/src/commitments/MEMORY/parseMemoryToolArgs.ts +0 -126
- package/src/commitments/MEMORY/resolveMemoryRuntimeContext.ts +0 -23
- package/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.ts +0 -26
- package/src/commitments/META/META.ts +0 -168
- package/src/commitments/USE/TODO.txt +0 -1
- package/src/commitments/USE/aggregateUseCommitmentSystemMessages.ts +0 -219
- package/src/commitments/USE_BROWSER/TODO.txt +0 -1
- package/src/commitments/USE_BROWSER/USE_BROWSER.ts +0 -257
- package/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.ts +0 -45
- package/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.ts +0 -83
- package/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.ts +0 -146
- package/src/commitments/USE_EMAIL/USE_EMAIL.ts +0 -201
- package/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.ts +0 -75
- package/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.ts +0 -44
- package/src/commitments/USE_EMAIL/sendEmailViaBrowser.ts +0 -47
- package/src/commitments/USE_SEARCH_ENGINE/TODO.txt +0 -1
- package/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.ts +0 -171
- package/src/commitments/USE_SPAWN/USE_SPAWN.ts +0 -150
- package/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.ts +0 -42
- package/src/commitments/USE_SPAWN/spawnAgentViaBrowser.ts +0 -50
- package/src/commitments/USE_TIME/USE_TIME.ts +0 -177
- package/src/commitments/USE_TIMEOUT/TimeoutToolNames.ts +0 -13
- package/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.ts +0 -255
- package/src/commitments/USE_TIMEOUT/USE_TIMEOUT.ts +0 -117
- package/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.ts +0 -22
- package/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.ts +0 -361
- package/src/commitments/USE_TIMEOUT/createTimeoutTools.ts +0 -127
- package/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.ts +0 -67
- package/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.ts +0 -460
- package/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.ts +0 -36
- package/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.ts +0 -26
- package/src/commitments/WALLET/WALLET.ts +0 -71
- package/src/commitments/WALLET/WalletToolNames.ts +0 -14
- package/src/commitments/WALLET/WalletToolRuntimeAdapter.ts +0 -180
- package/src/commitments/WALLET/createWalletSystemMessage.ts +0 -22
- package/src/commitments/WALLET/createWalletToolFunctions.ts +0 -145
- package/src/commitments/WALLET/createWalletTools.ts +0 -129
- package/src/commitments/WALLET/getWalletCommitmentDocumentation.ts +0 -14
- package/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.ts +0 -64
- package/src/commitments/WALLET/getWalletToolTitles.ts +0 -17
- package/src/commitments/WALLET/parseWalletToolArgs.ts +0 -231
- package/src/commitments/WALLET/resolveWalletRuntimeContext.ts +0 -23
- package/src/commitments/WALLET/setWalletToolRuntimeAdapter.ts +0 -26
- package/src/commitments/_common/createSerpSearchToolFunction.ts +0 -46
- package/umd/scripts/run-agent-chat/runCoderPing.d.ts +0 -48
- package/umd/src/book-2.0/agent-source/createAgentModelRequirements.useCommitmentAggregation.test.d.ts +0 -1
- package/umd/src/commitments/MEMORY/MEMORY.d.ts +0 -48
- package/umd/src/commitments/MEMORY/MEMORY.test.d.ts +0 -1
- package/umd/src/commitments/MEMORY/MemoryToolNames.d.ts +0 -11
- package/umd/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +0 -149
- package/umd/src/commitments/MEMORY/createMemorySystemMessage.d.ts +0 -6
- package/umd/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +0 -8
- package/umd/src/commitments/MEMORY/createMemoryTools.d.ts +0 -14
- package/umd/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +0 -6
- package/umd/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
- package/umd/src/commitments/MEMORY/getMemoryToolTitles.d.ts +0 -7
- package/umd/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +0 -61
- package/umd/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +0 -8
- package/umd/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +0 -13
- package/umd/src/commitments/META/META.d.ts +0 -65
- package/umd/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +0 -32
- package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -58
- package/umd/src/commitments/USE_BROWSER/USE_BROWSER.test.d.ts +0 -1
- package/umd/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.d.ts +0 -13
- package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +0 -10
- package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts +0 -1
- package/umd/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.d.ts +0 -47
- package/umd/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.test.d.ts +0 -1
- package/umd/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -38
- package/umd/src/commitments/USE_EMAIL/USE_EMAIL.test.d.ts +0 -1
- package/umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +0 -21
- package/umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts +0 -1
- package/umd/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +0 -11
- package/umd/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +0 -13
- package/umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -46
- package/umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts +0 -1
- package/umd/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -38
- package/umd/src/commitments/USE_SPAWN/USE_SPAWN.test.d.ts +0 -1
- package/umd/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +0 -9
- package/umd/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +0 -12
- package/umd/src/commitments/USE_TIME/USE_TIME.d.ts +0 -43
- package/umd/src/commitments/USE_TIME/USE_TIME.test.d.ts +0 -1
- package/umd/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +0 -11
- package/umd/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +0 -212
- package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -38
- package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts +0 -1
- package/umd/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +0 -6
- package/umd/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +0 -8
- package/umd/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +0 -7
- package/umd/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
- package/umd/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +0 -78
- package/umd/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +0 -8
- package/umd/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +0 -13
- package/umd/src/commitments/WALLET/WALLET.d.ts +0 -21
- package/umd/src/commitments/WALLET/WALLET.test.d.ts +0 -1
- package/umd/src/commitments/WALLET/WalletToolNames.d.ts +0 -12
- package/umd/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +0 -163
- package/umd/src/commitments/WALLET/createWalletSystemMessage.d.ts +0 -6
- package/umd/src/commitments/WALLET/createWalletToolFunctions.d.ts +0 -8
- package/umd/src/commitments/WALLET/createWalletTools.d.ts +0 -7
- package/umd/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +0 -6
- package/umd/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +0 -16
- package/umd/src/commitments/WALLET/getWalletToolTitles.d.ts +0 -7
- package/umd/src/commitments/WALLET/parseWalletToolArgs.d.ts +0 -51
- package/umd/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +0 -8
- package/umd/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +0 -13
- package/umd/src/commitments/_common/createSerpSearchToolFunction.d.ts +0 -12
- /package/esm/src/book-2.0/agent-source/{createAgentModelRequirements.useCommitmentAggregation.test.d.ts → createAgentModelRequirements.commitmentAggregation.test.d.ts} +0 -0
- /package/esm/src/{commitments/MEMORY/MEMORY.test.d.ts → cli/cli-commands/coder/boilerplateCount.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_BROWSER/USE_BROWSER.test.d.ts → cli/cli-commands/coder/generate-boilerplates.test.d.ts} +0 -0
- /package/esm/src/{commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts → cli/cli-commands/common/coderGitSyncCliOptions.test.d.ts} +0 -0
- /package/esm/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.d.ts +0 -0
- /package/{esm/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.test.d.ts → umd/src/book-2.0/agent-source/createAgentModelRequirements.commitmentAggregation.test.d.ts} +0 -0
- /package/{esm/src/commitments/USE_EMAIL/USE_EMAIL.test.d.ts → umd/src/cli/cli-commands/coder/boilerplateCount.test.d.ts} +0 -0
- /package/{esm/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts → umd/src/cli/cli-commands/coder/generate-boilerplates.test.d.ts} +0 -0
- /package/{esm/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts → umd/src/cli/cli-commands/common/coderGitSyncCliOptions.test.d.ts} +0 -0
- /package/umd/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.d.ts +0 -0
|
@@ -6,7 +6,20 @@ import { mkdirSync, writeFileSync } from 'fs';
|
|
|
6
6
|
import { join } from 'path';
|
|
7
7
|
import { spaceTrim } from 'spacetrim';
|
|
8
8
|
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
9
|
+
import type { CoderGitSyncCliOptions } from '../common/coderGitSyncCliOptions';
|
|
10
|
+
import {
|
|
11
|
+
addCoderGitSyncOptions,
|
|
12
|
+
CODER_GIT_SYNC_DESCRIPTION,
|
|
13
|
+
normalizeCoderGitSyncCliOptions,
|
|
14
|
+
} from '../common/coderGitSyncCliOptions';
|
|
9
15
|
import { handleActionErrors } from '../common/handleActionErrors';
|
|
16
|
+
import type { BoilerplateCount } from './boilerplateCount';
|
|
17
|
+
import {
|
|
18
|
+
BOILERPLATE_COUNT_OPTION_DESCRIPTION,
|
|
19
|
+
DEFAULT_BOILERPLATE_COUNT_OPTION_VALUE,
|
|
20
|
+
formatBoilerplateCount,
|
|
21
|
+
parseBoilerplateCount,
|
|
22
|
+
} from './boilerplateCount';
|
|
10
23
|
import {
|
|
11
24
|
buildCoderPromptSection,
|
|
12
25
|
getDefaultCoderPromptTemplateDefinitions,
|
|
@@ -24,12 +37,16 @@ import {
|
|
|
24
37
|
export function $initializeCoderGenerateBoilerplatesCommand(program: Program): $side_effect {
|
|
25
38
|
const command = program.command('generate-boilerplates');
|
|
26
39
|
command.description(
|
|
27
|
-
spaceTrim(
|
|
28
|
-
|
|
29
|
-
|
|
40
|
+
spaceTrim(
|
|
41
|
+
(block) => `
|
|
42
|
+
Generate prompt boilerplate files with unique emoji tags
|
|
43
|
+
|
|
44
|
+
${block(CODER_GIT_SYNC_DESCRIPTION)}
|
|
45
|
+
`,
|
|
46
|
+
),
|
|
30
47
|
);
|
|
31
48
|
|
|
32
|
-
command.option('--count <count>',
|
|
49
|
+
command.option('--count <count>', BOILERPLATE_COUNT_OPTION_DESCRIPTION, DEFAULT_BOILERPLATE_COUNT_OPTION_VALUE);
|
|
33
50
|
command.option(
|
|
34
51
|
'--template <template>',
|
|
35
52
|
spaceTrim(`
|
|
@@ -40,22 +57,38 @@ export function $initializeCoderGenerateBoilerplatesCommand(program: Program): $
|
|
|
40
57
|
.join(', ')}) or a markdown file path relative to the current project root.
|
|
41
58
|
`),
|
|
42
59
|
);
|
|
60
|
+
addCoderGitSyncOptions(command);
|
|
43
61
|
|
|
44
62
|
command.action(
|
|
45
63
|
handleActionErrors(async (cliOptions) => {
|
|
46
64
|
const { count: countOption, template: templateOption } = cliOptions as {
|
|
47
65
|
readonly count: string;
|
|
48
66
|
readonly template?: string;
|
|
49
|
-
};
|
|
67
|
+
} & CoderGitSyncCliOptions;
|
|
68
|
+
|
|
69
|
+
const boilerplateCount = parseBoilerplateCount(countOption);
|
|
70
|
+
const gitSync = normalizeCoderGitSyncCliOptions(cliOptions as CoderGitSyncCliOptions);
|
|
71
|
+
const projectPath = process.cwd();
|
|
50
72
|
|
|
51
|
-
|
|
73
|
+
// Note: Import the git synchronization dynamically to keep the CLI fast for runs without `--commit`
|
|
74
|
+
const { $commitCoderChanges, $pullCoderChanges } = await import(
|
|
75
|
+
'../../../../scripts/run-codex-prompts/git/coderGitSync'
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
await $pullCoderChanges({ gitSync, projectPath });
|
|
52
79
|
|
|
53
80
|
await generatePromptBoilerplate({
|
|
54
|
-
projectPath
|
|
55
|
-
|
|
81
|
+
projectPath,
|
|
82
|
+
boilerplateCount,
|
|
56
83
|
templateOption,
|
|
57
84
|
});
|
|
58
85
|
|
|
86
|
+
await $commitCoderChanges({
|
|
87
|
+
gitSync,
|
|
88
|
+
projectPath,
|
|
89
|
+
commitMessage: `Prompts ${formatBoilerplateCount(boilerplateCount)}`,
|
|
90
|
+
});
|
|
91
|
+
|
|
59
92
|
return process.exit(0);
|
|
60
93
|
}),
|
|
61
94
|
);
|
|
@@ -68,13 +101,15 @@ export function $initializeCoderGenerateBoilerplatesCommand(program: Program): $
|
|
|
68
101
|
*/
|
|
69
102
|
export async function generatePromptBoilerplate({
|
|
70
103
|
projectPath,
|
|
71
|
-
|
|
104
|
+
boilerplateCount,
|
|
72
105
|
templateOption,
|
|
73
106
|
}: {
|
|
74
107
|
readonly projectPath: string;
|
|
75
|
-
readonly
|
|
108
|
+
readonly boilerplateCount: BoilerplateCount;
|
|
76
109
|
readonly templateOption?: string;
|
|
77
110
|
}): Promise<void> {
|
|
111
|
+
const { filesCount, promptsPerFileCount } = boilerplateCount;
|
|
112
|
+
|
|
78
113
|
// Note: Import these dynamically to avoid circular dependencies and keep CLI fast
|
|
79
114
|
const { buildPromptFilename, getPromptNumbering } = await import(
|
|
80
115
|
'../../../../scripts/utils/prompts/getPromptNumbering'
|
|
@@ -99,8 +134,10 @@ export async function generatePromptBoilerplate({
|
|
|
99
134
|
colors.blue(`Highest existing number for ${promptNumbering.datePrefix} found: ${highestNumberFormatted}`),
|
|
100
135
|
);
|
|
101
136
|
|
|
137
|
+
// Note: Every single generated prompt is one separate coding task, so each of them reserves its own fresh emoji tag
|
|
138
|
+
const promptsCount = filesCount * promptsPerFileCount;
|
|
102
139
|
const { availableCount, selectedEmojis } = await getFreshPromptEmojiTags({
|
|
103
|
-
count:
|
|
140
|
+
count: promptsCount,
|
|
104
141
|
rootDir: projectPath,
|
|
105
142
|
});
|
|
106
143
|
|
|
@@ -117,7 +154,9 @@ export async function generatePromptBoilerplate({
|
|
|
117
154
|
for (let i = 0; i < filesCount; i++) {
|
|
118
155
|
const number = promptNumbering.startNumber + i * promptNumbering.step;
|
|
119
156
|
const title = titles[i % titles.length]!;
|
|
120
|
-
const
|
|
157
|
+
const emojiTags = selectedEmojis
|
|
158
|
+
.slice(i * promptsPerFileCount, (i + 1) * promptsPerFileCount)
|
|
159
|
+
.map((emoji) => formatPromptEmojiTag(emoji));
|
|
121
160
|
const filename = buildPromptFilename(
|
|
122
161
|
promptNumbering.datePrefix,
|
|
123
162
|
number,
|
|
@@ -125,39 +164,18 @@ export async function generatePromptBoilerplate({
|
|
|
125
164
|
);
|
|
126
165
|
const filepath = join(PROMPTS_DIRECTORY_PATH, filename);
|
|
127
166
|
const absoluteFilepath = join(projectPath, filepath);
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
statusLine: '[-]',
|
|
131
|
-
emojiTag,
|
|
167
|
+
const content = buildBoilerplatePromptFileContent({
|
|
168
|
+
emojiTags,
|
|
132
169
|
title,
|
|
133
170
|
body: promptTemplate.content,
|
|
134
171
|
});
|
|
135
|
-
const content = spaceTrim(
|
|
136
|
-
(block) => `
|
|
137
|
-
|
|
138
|
-
${block(one)}
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
${block(one)}
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
${block(one)}
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
${block(one)}
|
|
151
|
-
|
|
152
|
-
`,
|
|
153
|
-
);
|
|
154
172
|
|
|
155
173
|
filesToCreate.push({
|
|
156
174
|
filepath,
|
|
157
175
|
absoluteFilepath,
|
|
158
176
|
filename,
|
|
159
177
|
content,
|
|
160
|
-
|
|
178
|
+
emojiTags,
|
|
161
179
|
number,
|
|
162
180
|
});
|
|
163
181
|
}
|
|
@@ -167,26 +185,42 @@ export async function generatePromptBoilerplate({
|
|
|
167
185
|
|
|
168
186
|
for (const file of filesToCreate) {
|
|
169
187
|
writeFileSync(file.absoluteFilepath, file.content, 'utf-8');
|
|
170
|
-
console.info(colors.green(`✓ Created: ${file.filename} with ${
|
|
188
|
+
console.info(colors.green(`✓ Created: ${file.filename} with ${file.emojiTags.join(' ')}`));
|
|
171
189
|
}
|
|
172
190
|
|
|
173
|
-
console.info(
|
|
191
|
+
console.info(
|
|
192
|
+
colors.bgGreen(
|
|
193
|
+
` Successfully created ${promptsCount} prompts in ${filesToCreate.length} prompt boilerplate files! `,
|
|
194
|
+
),
|
|
195
|
+
);
|
|
174
196
|
}
|
|
175
197
|
|
|
176
198
|
/**
|
|
177
|
-
*
|
|
199
|
+
* Builds the markdown content of one generated prompt file with one prompt section per emoji tag.
|
|
200
|
+
*
|
|
201
|
+
* Multiple prompts in one file are separated by the `---` separator, exactly like the prompt runner expects them.
|
|
178
202
|
*
|
|
179
203
|
* @private internal utility of `generatePromptBoilerplate` command
|
|
180
204
|
*/
|
|
181
|
-
function
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
205
|
+
function buildBoilerplatePromptFileContent({
|
|
206
|
+
emojiTags,
|
|
207
|
+
title,
|
|
208
|
+
body,
|
|
209
|
+
}: {
|
|
210
|
+
readonly emojiTags: ReadonlyArray<string>;
|
|
211
|
+
readonly title: string;
|
|
212
|
+
readonly body: string;
|
|
213
|
+
}): string {
|
|
214
|
+
return emojiTags
|
|
215
|
+
.map((emojiTag) =>
|
|
216
|
+
buildCoderPromptSection({
|
|
217
|
+
statusLine: '[-]',
|
|
218
|
+
emojiTag,
|
|
219
|
+
title,
|
|
220
|
+
body,
|
|
221
|
+
}),
|
|
222
|
+
)
|
|
223
|
+
.join('\n\n---\n\n');
|
|
190
224
|
}
|
|
191
225
|
|
|
192
226
|
/**
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { DEFAULT_BOILERPLATE_COUNT_OPTION_VALUE } from './boilerplateCount';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Default npm scripts initialized by `ptbk coder init`.
|
|
3
5
|
*/
|
|
4
6
|
const DEFAULT_CODER_PACKAGE_JSON_SCRIPTS = {
|
|
5
|
-
'coder:generate-boilerplates':
|
|
7
|
+
'coder:generate-boilerplates': `ptbk coder generate-boilerplates --count ${DEFAULT_BOILERPLATE_COUNT_OPTION_VALUE} --template ./prompts/templates/common.md`,
|
|
6
8
|
'coder:add': 'ptbk coder add --template ./prompts/templates/common.md',
|
|
7
9
|
'coder:run':
|
|
8
10
|
'ptbk coder run --harness openai-codex --model gpt-5.6-terra --thinking-level max --agent agents/developer.book --context AGENTS.md --test-before yes-and-fix',
|
|
@@ -3,12 +3,19 @@ import type {
|
|
|
3
3
|
} from 'commander';
|
|
4
4
|
import { spaceTrim } from 'spacetrim';
|
|
5
5
|
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
6
|
+
import type { CoderGitSyncCliOptions } from '../common/coderGitSyncCliOptions';
|
|
7
|
+
import {
|
|
8
|
+
addCoderGitSyncOptions,
|
|
9
|
+
CODER_GIT_SYNC_DESCRIPTION,
|
|
10
|
+
normalizeCoderGitSyncCliOptions,
|
|
11
|
+
} from '../common/coderGitSyncCliOptions';
|
|
6
12
|
import { handleActionErrors } from '../common/handleActionErrors';
|
|
7
13
|
import { $ensureHarnessInstallations } from '../common/harness/$ensureHarnessInstallations';
|
|
8
14
|
import { getHarnessDefinition } from '../common/harness/HarnessDefinition';
|
|
9
15
|
import type { PromptRunnerHarnessName } from '../common/promptRunnerCliOptions';
|
|
10
16
|
import { AGENT_CODING_FILE_PATH } from './agentCodingFile';
|
|
11
17
|
import { AGENTS_FILE_PATH } from './agentsFile';
|
|
18
|
+
import { DEFAULT_BOILERPLATE_COUNT } from './boilerplateCount';
|
|
12
19
|
import { getDefaultCoderProjectPromptTemplateDefinitions } from './boilerplateTemplates';
|
|
13
20
|
import { CODER_DEVELOPER_AGENT_FILE_PATH } from './ensureCoderDeveloperAgentFile';
|
|
14
21
|
import { formatDisplayPath } from './formatDisplayPath';
|
|
@@ -61,16 +68,36 @@ export function $initializeCoderInitCommand(program: Program): $side_effect {
|
|
|
61
68
|
|
|
62
69
|
Checks that the coding harnesses are installed globally and up to date:
|
|
63
70
|
${block(listCheckedHarnessLabels())}
|
|
71
|
+
|
|
72
|
+
${block(CODER_GIT_SYNC_DESCRIPTION)}
|
|
64
73
|
`,
|
|
65
74
|
),
|
|
66
75
|
);
|
|
67
76
|
|
|
77
|
+
addCoderGitSyncOptions(command);
|
|
78
|
+
|
|
68
79
|
command.action(
|
|
69
|
-
handleActionErrors(async () => {
|
|
80
|
+
handleActionErrors(async (cliOptions) => {
|
|
81
|
+
const gitSync = normalizeCoderGitSyncCliOptions(cliOptions as CoderGitSyncCliOptions);
|
|
70
82
|
const projectPath = process.cwd();
|
|
83
|
+
|
|
84
|
+
// Note: Import the git synchronization dynamically to keep the CLI fast for runs without `--commit`
|
|
85
|
+
const { $commitCoderChanges, $pullCoderChanges } = await import(
|
|
86
|
+
'../../../../scripts/run-codex-prompts/git/coderGitSync'
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
await $pullCoderChanges({ gitSync, projectPath });
|
|
90
|
+
|
|
71
91
|
const summary = await initializeCoderProjectConfiguration(projectPath);
|
|
72
92
|
printInitializationSummary(summary);
|
|
73
|
-
await generatePromptBoilerplate({ projectPath,
|
|
93
|
+
await generatePromptBoilerplate({ projectPath, boilerplateCount: DEFAULT_BOILERPLATE_COUNT });
|
|
94
|
+
|
|
95
|
+
await $commitCoderChanges({
|
|
96
|
+
gitSync,
|
|
97
|
+
projectPath,
|
|
98
|
+
commitMessage: 'Initialize Promptbook Coder',
|
|
99
|
+
});
|
|
100
|
+
|
|
74
101
|
await $ensureHarnessInstallations(CODER_INIT_CHECKED_HARNESS_NAMES);
|
|
75
102
|
}),
|
|
76
103
|
);
|
|
@@ -2,10 +2,9 @@ import type {
|
|
|
2
2
|
Command as Program /* <- Note: [🔸] Using Program because Command is misleading name */,
|
|
3
3
|
} from 'commander';
|
|
4
4
|
import { spaceTrim } from 'spacetrim';
|
|
5
|
-
import { NotAllowed } from '../../../errors/NotAllowed';
|
|
6
5
|
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
7
|
-
import { $ensureHarnessInstallations } from '../common/harness/$ensureHarnessInstallations';
|
|
8
6
|
import { handleActionErrors } from '../common/handleActionErrors';
|
|
7
|
+
import { $ensureHarnessInstallations } from '../common/harness/$ensureHarnessInstallations';
|
|
9
8
|
import type { PromptRunnerSelectionCliOptions } from '../common/promptRunnerCliOptions';
|
|
10
9
|
import {
|
|
11
10
|
addPromptRunnerRuntimeOptions,
|
|
@@ -15,12 +14,9 @@ import {
|
|
|
15
14
|
} from '../common/promptRunnerCliOptions';
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
|
-
* Initializes `coder ping` command for Promptbook CLI utilities
|
|
19
|
-
*
|
|
20
|
-
* The command makes one small, isolated harness/model call, prints its result
|
|
21
|
-
* and reports how long the harness/model turn took.
|
|
17
|
+
* Initializes `coder ping` command for Promptbook CLI utilities
|
|
22
18
|
*
|
|
23
|
-
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
19
|
+
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
24
20
|
*
|
|
25
21
|
* @private internal function of `promptbookCli`
|
|
26
22
|
*/
|
|
@@ -28,15 +24,16 @@ export function $initializeCoderPingCommand(program: Program): $side_effect {
|
|
|
28
24
|
const command = program.command('ping');
|
|
29
25
|
command.description(
|
|
30
26
|
spaceTrim(`
|
|
31
|
-
|
|
27
|
+
Send one tiny dummy prompt to a harness and model to measure and warm them up
|
|
32
28
|
|
|
33
29
|
${PROMPT_RUNNER_DESCRIPTION}
|
|
34
30
|
|
|
35
31
|
Features:
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
32
|
+
- Verifies that the selected harness, model, thinking level and authentication really work
|
|
33
|
+
- Reports the answer of the harness, the response time and the reported usage
|
|
34
|
+
- Starts the hourly/weekly quota window before you need it, so it is already refreshing when you do
|
|
35
|
+
- Leaves the project exactly as it was — nothing is read, written, changed or committed
|
|
36
|
+
- Use --no-ui to stream the raw harness output instead of only the compact result
|
|
40
37
|
`),
|
|
41
38
|
);
|
|
42
39
|
|
|
@@ -45,50 +42,31 @@ export function $initializeCoderPingCommand(program: Program): $side_effect {
|
|
|
45
42
|
|
|
46
43
|
command.action(
|
|
47
44
|
handleActionErrors(async (cliOptions) => {
|
|
48
|
-
const
|
|
45
|
+
const runnerOptions = normalizePromptRunnerSelectionCliOptions(
|
|
49
46
|
cliOptions as PromptRunnerSelectionCliOptions,
|
|
50
47
|
{ isAgentRequired: true },
|
|
51
48
|
);
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
if (!agentName) {
|
|
55
|
-
throw new NotAllowed(
|
|
56
|
-
spaceTrim(`
|
|
57
|
-
A harness is required for \`ptbk coder ping\`.
|
|
50
|
+
await $ensureHarnessInstallations([runnerOptions.agentName]);
|
|
58
51
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
await $ensureHarnessInstallations([agentName]);
|
|
52
|
+
// Note: Import the ping dynamically to avoid loading heavy dependencies until needed
|
|
53
|
+
const { pingCoderHarness } = await import('../../../../scripts/run-codex-prompts/ping/pingCoderHarness');
|
|
54
|
+
const { printCoderPingResult } = await import(
|
|
55
|
+
'../../../../scripts/run-codex-prompts/ping/printCoderPingResult'
|
|
56
|
+
);
|
|
65
57
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
isUiDisabled: normalizedOptions.noUi,
|
|
73
|
-
isCreditsAllowed: normalizedOptions.allowCredits,
|
|
58
|
+
const result = await pingCoderHarness({
|
|
59
|
+
agentName: runnerOptions.agentName,
|
|
60
|
+
model: runnerOptions.model,
|
|
61
|
+
thinkingLevel: runnerOptions.thinkingLevel,
|
|
62
|
+
allowCredits: runnerOptions.allowCredits,
|
|
63
|
+
shouldPrintLiveOutput: runnerOptions.noUi,
|
|
74
64
|
});
|
|
75
65
|
|
|
76
|
-
printCoderPingResult(
|
|
66
|
+
printCoderPingResult(result);
|
|
77
67
|
}),
|
|
78
68
|
);
|
|
79
69
|
}
|
|
80
70
|
|
|
81
|
-
/**
|
|
82
|
-
* Prints the result and duration of one completed coder ping.
|
|
83
|
-
*/
|
|
84
|
-
function printCoderPingResult(pingResult: { readonly result: string; readonly elapsedTimeMs: number }): void {
|
|
85
|
-
console.info(
|
|
86
|
-
spaceTrim(`
|
|
87
|
-
Result: ${pingResult.result}
|
|
88
|
-
Time: ${pingResult.elapsedTimeMs.toFixed(0)} ms
|
|
89
|
-
`),
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
71
|
// Note: [🟡] Code for CLI command [ping](src/cli/cli-commands/coder/ping.ts) should never be published outside of `@promptbook/cli`
|
|
94
72
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -4,6 +4,12 @@ import type {
|
|
|
4
4
|
} from 'commander';
|
|
5
5
|
import { spaceTrim } from 'spacetrim';
|
|
6
6
|
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
7
|
+
import type { CoderGitSyncCliOptions } from '../common/coderGitSyncCliOptions';
|
|
8
|
+
import {
|
|
9
|
+
addCoderGitSyncOptions,
|
|
10
|
+
CODER_GIT_SYNC_DESCRIPTION,
|
|
11
|
+
normalizeCoderGitSyncCliOptions,
|
|
12
|
+
} from '../common/coderGitSyncCliOptions';
|
|
7
13
|
import { handleActionErrors } from '../common/handleActionErrors';
|
|
8
14
|
|
|
9
15
|
/**
|
|
@@ -16,17 +22,23 @@ import { handleActionErrors } from '../common/handleActionErrors';
|
|
|
16
22
|
export function $initializeCoderVerifyCommand(program: Program): $side_effect {
|
|
17
23
|
const command = program.command('verify');
|
|
18
24
|
command.description(
|
|
19
|
-
spaceTrim(
|
|
20
|
-
|
|
25
|
+
spaceTrim(
|
|
26
|
+
(block) => `
|
|
27
|
+
Interactive verification helper for completed prompts
|
|
21
28
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
Features:
|
|
30
|
+
- Displays list of prompt files with status counts
|
|
31
|
+
- Guides through verification of completed prompts marked [x]
|
|
32
|
+
- Archives verified prompt files to prompts/done/ directory
|
|
33
|
+
- Auto-appends repair prompts for incomplete work
|
|
34
|
+
- Processes files with all-done prompts first
|
|
35
|
+
- Supports ignoring matching prompt candidates for one verification run
|
|
36
|
+
|
|
37
|
+
${block(CODER_GIT_SYNC_DESCRIPTION)}
|
|
38
|
+
|
|
39
|
+
Note: The git synchronization is applied around each single verification, not once per run.
|
|
40
|
+
`,
|
|
41
|
+
),
|
|
30
42
|
);
|
|
31
43
|
|
|
32
44
|
command.option('--reverse', 'Process prompt files in reverse order', false);
|
|
@@ -36,19 +48,22 @@ export function $initializeCoderVerifyCommand(program: Program): $side_effect {
|
|
|
36
48
|
collectStringOption,
|
|
37
49
|
[],
|
|
38
50
|
);
|
|
51
|
+
addCoderGitSyncOptions(command);
|
|
39
52
|
|
|
40
53
|
command.action(
|
|
41
54
|
handleActionErrors(async (cliOptions) => {
|
|
42
55
|
const { reverse, ignore } = cliOptions as {
|
|
43
56
|
readonly reverse: boolean;
|
|
44
57
|
readonly ignore: ReadonlyArray<string>;
|
|
45
|
-
};
|
|
58
|
+
} & CoderGitSyncCliOptions;
|
|
59
|
+
|
|
60
|
+
const gitSync = normalizeCoderGitSyncCliOptions(cliOptions as CoderGitSyncCliOptions);
|
|
46
61
|
|
|
47
62
|
// Note: Import the main function dynamically to avoid loading heavy dependencies until needed
|
|
48
63
|
const { verifyPrompts } = await import('../../../../scripts/verify-prompts/verify-prompts');
|
|
49
64
|
|
|
50
65
|
try {
|
|
51
|
-
await verifyPrompts({ reverse, ignore });
|
|
66
|
+
await verifyPrompts({ reverse, ignore, gitSync });
|
|
52
67
|
} catch (error) {
|
|
53
68
|
console.error(colors.bgRed('Prompt verification failed:'), error);
|
|
54
69
|
return process.exit(1);
|
|
@@ -23,8 +23,8 @@ import { $initializeCoderVerifyCommand } from './coder/verify';
|
|
|
23
23
|
* - add: Add one ready-to-run prompt file to the queue
|
|
24
24
|
* - generate-boilerplates: Generate prompt boilerplate files
|
|
25
25
|
* - find-refactor-candidates: Find files that need refactoring
|
|
26
|
-
* - ping: Test one harness and model connection with a disposable task
|
|
27
26
|
* - run: Run coding prompts with AI agents
|
|
27
|
+
* - ping: Test one harness and model with a tiny dummy prompt
|
|
28
28
|
* - verify: Verify completed prompts
|
|
29
29
|
* - find-fresh-emoji-tags: Find unused emoji tags
|
|
30
30
|
*
|
|
@@ -44,8 +44,8 @@ export function $initializeCoderCommand(program: Program): $side_effect {
|
|
|
44
44
|
- generate-boilerplates: Generate prompt boilerplate files
|
|
45
45
|
- find-refactor-candidates: Find files that need refactoring
|
|
46
46
|
- find-unwritten: List prompt sections that still need to be authored
|
|
47
|
-
- ping: Test one harness and model connection with a disposable task
|
|
48
47
|
- run: Run coding prompts with AI agents
|
|
48
|
+
- ping: Test the connection, response time and quota of one harness and model
|
|
49
49
|
- server: Start a long-running coder server with a kanban web UI
|
|
50
50
|
- verify: Verify completed prompts
|
|
51
51
|
- find-fresh-emoji-tags: Find unused emoji tags
|
|
@@ -58,8 +58,8 @@ export function $initializeCoderCommand(program: Program): $side_effect {
|
|
|
58
58
|
$initializeCoderGenerateBoilerplatesCommand(coderCommand);
|
|
59
59
|
$initializeCoderFindRefactorCandidatesCommand(coderCommand);
|
|
60
60
|
$initializeCoderFindUnwrittenCommand(coderCommand);
|
|
61
|
-
$initializeCoderPingCommand(coderCommand);
|
|
62
61
|
$initializeCoderRunCommand(coderCommand);
|
|
62
|
+
$initializeCoderPingCommand(coderCommand);
|
|
63
63
|
$initializeCoderServerCommand(coderCommand);
|
|
64
64
|
$initializeCoderVerifyCommand(coderCommand);
|
|
65
65
|
$initializeCoderFindFreshEmojiTagCommand(coderCommand);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Command as Program /* <- Note: [🔸] Using Program because Command is misleading name */,
|
|
3
|
+
} from 'commander';
|
|
4
|
+
import { spaceTrim } from 'spacetrim';
|
|
5
|
+
import type { CoderGitSyncOptions } from '../../../../scripts/run-codex-prompts/git/coderGitSync';
|
|
6
|
+
import { NotAllowed } from '../../../errors/NotAllowed';
|
|
7
|
+
|
|
8
|
+
export type { CoderGitSyncOptions };
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Commander option bag for the shared `ptbk coder` git synchronization flags.
|
|
12
|
+
*
|
|
13
|
+
* @private internal utility of `promptbookCli`
|
|
14
|
+
*/
|
|
15
|
+
export type CoderGitSyncCliOptions = {
|
|
16
|
+
readonly commit: boolean;
|
|
17
|
+
readonly autoPush: boolean;
|
|
18
|
+
readonly autoPull: boolean;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Description block shared by the `ptbk coder` commands which can synchronize their changes with git.
|
|
23
|
+
*
|
|
24
|
+
* @private internal utility of `promptbookCli`
|
|
25
|
+
*/
|
|
26
|
+
export const CODER_GIT_SYNC_DESCRIPTION = spaceTrim(`
|
|
27
|
+
Git synchronization:
|
|
28
|
+
- --auto-pull pulls the latest changes before this command changes anything
|
|
29
|
+
- --commit commits the changes made by this command
|
|
30
|
+
- --auto-push pushes the created commit to the remote repository
|
|
31
|
+
`);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Registers the shared `--commit`, `--auto-push` and `--auto-pull` flags on a `ptbk coder` command.
|
|
35
|
+
*
|
|
36
|
+
* Note: Unlike `ptbk coder run`, which commits by default and opts out through `--no-commit`,
|
|
37
|
+
* these commands never touch git unless the flags are used explicitly.
|
|
38
|
+
*
|
|
39
|
+
* @private internal utility of `promptbookCli`
|
|
40
|
+
*/
|
|
41
|
+
export function addCoderGitSyncOptions(command: Program): void {
|
|
42
|
+
command.option('--commit', 'Commit the changes made by this command with the coding-agent git identity', false);
|
|
43
|
+
command.option('--auto-push', 'Automatically git push the created commit, requires --commit', false);
|
|
44
|
+
command.option(
|
|
45
|
+
'--auto-pull',
|
|
46
|
+
'Automatically git pull the latest changes before this command changes anything',
|
|
47
|
+
false,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Converts the Commander git synchronization flags into normalized git synchronization options.
|
|
53
|
+
*
|
|
54
|
+
* @private internal utility of `promptbookCli`
|
|
55
|
+
*/
|
|
56
|
+
export function normalizeCoderGitSyncCliOptions(cliOptions: CoderGitSyncCliOptions): CoderGitSyncOptions {
|
|
57
|
+
if (cliOptions.autoPush && !cliOptions.commit) {
|
|
58
|
+
throw new NotAllowed(
|
|
59
|
+
spaceTrim(`
|
|
60
|
+
Flag \`--auto-push\` can be used only together with \`--commit\`.
|
|
61
|
+
|
|
62
|
+
**There is nothing to push when the changes are not committed.**
|
|
63
|
+
|
|
64
|
+
Actionable hint:
|
|
65
|
+
- Add \`--commit\`, for example \`ptbk coder init --commit --auto-push\`.
|
|
66
|
+
`),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
isCommitEnabled: cliOptions.commit,
|
|
72
|
+
isAutoPushEnabled: cliOptions.autoPush,
|
|
73
|
+
isAutoPullEnabled: cliOptions.autoPull,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Note: [🟡] Code for CLI git synchronization options [coderGitSyncCliOptions](src/cli/cli-commands/common/coderGitSyncCliOptions.ts) should never be published outside of `@promptbook/cli`
|
|
78
|
+
// Note: [💞] Ignore a discrepancy between file name and exported helper names
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import colors from 'colors';
|
|
2
2
|
import { writeFile } from 'fs/promises';
|
|
3
3
|
import { join } from 'path';
|
|
4
|
-
import prompts from 'prompts';
|
|
5
4
|
import { spaceTrim } from 'spacetrim';
|
|
6
5
|
import { getAllCommitmentsToolFunctionsForNode } from '../../../commitments/_common/getAllCommitmentsToolFunctionsForNode';
|
|
7
6
|
import { DEFAULT_MAX_EXECUTION_ATTEMPTS } from '../../../config';
|
|
@@ -24,6 +23,7 @@ import { JavascriptExecutionTools } from '../../../scripting/javascript/Javascri
|
|
|
24
23
|
import { isFileExisting } from '../../../utils/files/isFileExisting';
|
|
25
24
|
import { $getCompiledBook } from '../../../wizard/$getCompiledBook';
|
|
26
25
|
import { $provideLlmToolsForCli } from '../../common/$provideLlmToolsForCli';
|
|
26
|
+
import { loadPromptsModule } from '../../common/loadPromptsModule';
|
|
27
27
|
import type { RunCommandCliOptions } from './runCommandAction';
|
|
28
28
|
|
|
29
29
|
/**
|
|
@@ -156,6 +156,7 @@ async function resolveRunPipelineSource(pipelineSource?: string): Promise<string
|
|
|
156
156
|
return pipelineSource;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
+
const { default: prompts } = await loadPromptsModule();
|
|
159
160
|
const response = await prompts({
|
|
160
161
|
type: 'text',
|
|
161
162
|
name: 'pipelineSource',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import colors from 'colors';
|
|
2
|
-
import prompts from 'prompts';
|
|
3
2
|
import { spaceTrim } from 'spacetrim';
|
|
4
3
|
import type { PipelineJson } from '../../../pipeline/PipelineJson/PipelineJson';
|
|
5
4
|
import type { string_parameter_name, string_parameter_value } from '../../../types/string_name';
|
|
6
5
|
import { countLines } from '../../../utils/expectation-counters/countLines';
|
|
7
6
|
import type { TODO_any } from '../../../utils/organization/TODO_any';
|
|
7
|
+
import { loadPromptsModule } from '../../common/loadPromptsModule';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Resolves all missing input parameters while keeping the current interactive and non-interactive behavior.
|
|
@@ -24,6 +24,7 @@ export async function resolveRunInputParameters(options: {
|
|
|
24
24
|
return process.exit(1);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
const { default: prompts } = await loadPromptsModule();
|
|
27
28
|
const response = await prompts(questions as TODO_any);
|
|
28
29
|
// <- TODO: [🧠][🍼] Change behavior according to the formfactor
|
|
29
30
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import colors from 'colors';
|
|
2
|
-
import prompts from 'prompts';
|
|
3
2
|
import { spaceTrim } from 'spacetrim';
|
|
4
3
|
import { forTime } from 'waitasecond';
|
|
5
4
|
import { assertsError } from '../../errors/assertsError';
|
|
6
5
|
import type { PipelineExecutor } from '../../execution/PipelineExecutor';
|
|
7
6
|
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
8
7
|
import { just } from '../../utils/organization/just';
|
|
8
|
+
import { loadPromptsModule } from '../common/loadPromptsModule';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Options for running the interactive chatbot
|
|
@@ -90,6 +90,7 @@ export async function runInteractiveChatbot(options: RunInteractiveChatbotOption
|
|
|
90
90
|
console.info(colors.gray(`---`));
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
const { default: prompts } = await loadPromptsModule();
|
|
93
94
|
const response = await prompts({
|
|
94
95
|
type: 'text',
|
|
95
96
|
name: 'userMessage',
|