@promptbook/cli 0.114.0-42 → 0.114.0-47
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/agents/default/copywriter.book +15 -0
- package/agents/default/developer.book +3 -0
- package/agents/default/lawyer.book +14 -0
- package/agents/default/planner.book +16 -0
- package/esm/index.es.js +4769 -809
- 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-codex-prompts/common/CoderRunControlFeedback.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/common/buildCoderRunControlKeyBadge.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/common/listenForCoderRunControls.d.ts +3 -2
- package/esm/scripts/run-codex-prompts/common/resolveCoderAgent.d.ts +15 -5
- package/esm/scripts/run-codex-prompts/common/runGoScript/$spawnLoggedBashScript.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 +4 -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 +2 -0
- package/esm/scripts/run-codex-prompts/git/coderCommitScope.d.ts +4 -1
- package/esm/scripts/run-codex-prompts/git/coderGitSync.d.ts +5 -0
- package/esm/scripts/run-codex-prompts/git/commitInitializedAgentBooks.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/git/ensureWorkingTreeClean.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/isolation/copyCoderIsolationEnvironment.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/isolation/createCoderIsolationWorktree.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/main/findUnwrittenPrompts.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/main/listCoderPrompts.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/main/resolvePromptRunner.d.ts +11 -0
- package/esm/scripts/run-codex-prompts/prompts/loadPromptFiles.d.ts +10 -2
- package/esm/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/runners/cline/ClineRunner.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/runners/gemini/GeminiRunner.d.ts +2 -0
- 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 +2 -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 +2 -0
- 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 +16 -1
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiViewport.d.ts +5 -0
- package/esm/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +4 -1
- 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/utils/emojiTags/scanEmojiTagUsage.d.ts +2 -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/book-2.0/agent-source/CreateAgentModelRequirementsOptions.d.ts +2 -0
- package/esm/src/cli/cli-commands/coder/add.d.ts +16 -0
- package/esm/src/cli/cli-commands/coder/agentCliOptions.d.ts +3 -2
- package/esm/src/cli/cli-commands/coder/augmentCoderAgentTeam.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/coderAgentRole.d.ts +16 -0
- package/esm/src/cli/cli-commands/coder/coderReferencedArtifacts.d.ts +8 -7
- 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/ensureCoderRoleAgentFile.d.ts +12 -0
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/getCoderInitializationCommitPaths.d.ts +9 -0
- package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +7 -5
- 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 +21 -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/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/workspacePreflight.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/LocalAgentBookCollection.d.ts +4 -2
- package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/resolveLocalAgentSource.d.ts +8 -1
- package/esm/src/cli/cli-commands/common/validateCoderRunOptions.d.ts +6 -0
- package/esm/src/cli/cli-commands/common/workspaceRepository.d.ts +36 -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/commitments/TEAM/TEAM.test.d.ts +1 -0
- package/esm/src/conversion/archive/loadJsZipModule.d.ts +10 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +4 -3
- package/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.ts +2 -0
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/applyCommitmentsToAgentModelRequirements.ts +8 -3
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.ts +6 -0
- package/src/cli/$initializePromptbookCliProgram.ts +2 -0
- package/src/cli/cli-commands/coder/add.ts +44 -14
- package/src/cli/cli-commands/coder/agentCliOptions.ts +9 -3
- package/src/cli/cli-commands/coder/augmentCoderAgentTeam.ts +152 -0
- package/src/cli/cli-commands/coder/coderAgentRole.ts +22 -0
- package/src/cli/cli-commands/coder/coderReferencedArtifacts.ts +9 -12
- package/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.ts +90 -0
- package/src/cli/cli-commands/coder/ensureCoderDeveloperAgentFile.ts +2 -21
- package/src/cli/cli-commands/coder/ensureCoderRoleAgentFile.ts +36 -0
- package/src/cli/cli-commands/coder/find-fresh-emoji-tags.ts +11 -2
- package/src/cli/cli-commands/coder/find-refactor-candidates.ts +10 -1
- package/src/cli/cli-commands/coder/find-unwritten.ts +10 -1
- package/src/cli/cli-commands/coder/generate-boilerplates.ts +12 -3
- package/src/cli/cli-commands/coder/getCoderInitializationCommitPaths.ts +42 -0
- package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +7 -2
- package/src/cli/cli-commands/coder/init.ts +88 -26
- package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +67 -21
- package/src/cli/cli-commands/coder/list.ts +7 -1
- package/src/cli/cli-commands/coder/ping.ts +8 -1
- package/src/cli/cli-commands/coder/plan.ts +127 -0
- package/src/cli/cli-commands/coder/planning/README.md +37 -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/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 +243 -0
- package/src/cli/cli-commands/coder/planning/savePlanningChanges.ts +107 -0
- package/src/cli/cli-commands/coder/printInitializationSummary.ts +26 -3
- package/src/cli/cli-commands/coder/promptsReadmeTemplate.ts +358 -0
- package/src/cli/cli-commands/coder/readCoderAgentBook.ts +62 -0
- package/src/cli/cli-commands/coder/run.ts +37 -15
- package/src/cli/cli-commands/coder/server.ts +31 -10
- package/src/cli/cli-commands/coder/verify.ts +18 -1
- package/src/cli/cli-commands/coder.ts +7 -0
- package/src/cli/cli-commands/common/LocalAgentBookCollection.ts +56 -18
- package/src/cli/cli-commands/common/coderGitSyncCliOptions.ts +1 -1
- package/src/cli/cli-commands/common/createLocalAgentReferenceResolver.ts +7 -0
- package/src/cli/cli-commands/common/resolveLocalAgentSource.ts +39 -19
- package/src/cli/cli-commands/common/validateCoderRunOptions.ts +91 -0
- package/src/cli/cli-commands/common/workspaceRepository.md +46 -0
- package/src/cli/cli-commands/common/workspaceRepository.ts +265 -0
- package/src/cli/cli-commands/common/workspaceRepositoryCliOptions.ts +29 -0
- package/src/commitments/TEAM/TEAM.ts +26 -4
- package/src/conversion/archive/loadJsZipModule.ts +3 -1
- package/src/other/templates/getTemplatesPipelineCollection.ts +959 -915
- package/src/version.ts +2 -2
- package/src/versions.txt +6 -0
- package/umd/index.umd.js +4767 -809
- 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-codex-prompts/common/CoderRunControlFeedback.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/common/buildCoderRunControlKeyBadge.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/common/listenForCoderRunControls.d.ts +3 -2
- package/umd/scripts/run-codex-prompts/common/resolveCoderAgent.d.ts +15 -5
- package/umd/scripts/run-codex-prompts/common/runGoScript/$spawnLoggedBashScript.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 +4 -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 +2 -0
- package/umd/scripts/run-codex-prompts/git/coderCommitScope.d.ts +4 -1
- package/umd/scripts/run-codex-prompts/git/coderGitSync.d.ts +5 -0
- package/umd/scripts/run-codex-prompts/git/commitInitializedAgentBooks.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/git/ensureWorkingTreeClean.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/isolation/copyCoderIsolationEnvironment.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/isolation/createCoderIsolationWorktree.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/main/findUnwrittenPrompts.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/main/listCoderPrompts.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/main/resolvePromptRunner.d.ts +11 -0
- package/umd/scripts/run-codex-prompts/prompts/loadPromptFiles.d.ts +10 -2
- package/umd/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/runners/cline/ClineRunner.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/runners/gemini/GeminiRunner.d.ts +2 -0
- 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 +2 -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 +2 -0
- 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 +16 -1
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiViewport.d.ts +5 -0
- package/umd/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +4 -1
- 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/utils/emojiTags/scanEmojiTagUsage.d.ts +2 -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/book-2.0/agent-source/CreateAgentModelRequirementsOptions.d.ts +2 -0
- package/umd/src/cli/cli-commands/coder/add.d.ts +16 -0
- package/umd/src/cli/cli-commands/coder/agentCliOptions.d.ts +3 -2
- package/umd/src/cli/cli-commands/coder/augmentCoderAgentTeam.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/coderAgentRole.d.ts +16 -0
- package/umd/src/cli/cli-commands/coder/coderReferencedArtifacts.d.ts +8 -7
- 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/ensureCoderRoleAgentFile.d.ts +12 -0
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/getCoderInitializationCommitPaths.d.ts +9 -0
- package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +7 -5
- 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 +21 -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/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/workspacePreflight.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/LocalAgentBookCollection.d.ts +4 -2
- package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +1 -1
- package/umd/src/cli/cli-commands/common/resolveLocalAgentSource.d.ts +8 -1
- package/umd/src/cli/cli-commands/common/validateCoderRunOptions.d.ts +6 -0
- package/umd/src/cli/cli-commands/common/workspaceRepository.d.ts +36 -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/commitments/TEAM/TEAM.test.d.ts +1 -0
- package/umd/src/conversion/archive/loadJsZipModule.d.ts +10 -0
- package/umd/src/version.d.ts +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Usage } from '../../../../execution/Usage';
|
|
2
|
+
import type { NormalizedPromptRunnerSelectionCliOptions } from '../../common/promptRunnerCliOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for one tool-restricted inference. Repository reads and PRD writes are host operations.
|
|
5
|
+
* @private internal type of `coder plan`
|
|
6
|
+
*/
|
|
7
|
+
export type PlanningHarnessOptions = NormalizedPromptRunnerSelectionCliOptions & {
|
|
8
|
+
readonly workspacePath: string;
|
|
9
|
+
readonly prompt: string;
|
|
10
|
+
readonly signal: AbortSignal;
|
|
11
|
+
/** Reports available usage from this inference once, including turns whose final answer is malformed. */
|
|
12
|
+
readonly onUsage?: (usage: Usage) => void;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Rejects harnesses without a planning execution policy before any Git sync or process launch.
|
|
16
|
+
* @private internal utility of `coder plan`
|
|
17
|
+
*/
|
|
18
|
+
export declare function assertPlanningHarnessSupported(harness: string | undefined): void;
|
|
19
|
+
/**
|
|
20
|
+
* Constructs a fail-closed Codex invocation. User config, rules, project config discovery, native shell,
|
|
21
|
+
* connectors, hooks and delegation cannot expand the planning tool set. Read-only sandboxing also denies patches.
|
|
22
|
+
* Older Codex versions that do not support these switches fail instead of using the implementation runner.
|
|
23
|
+
* @private internal utility of `coder plan`
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildPlanningHarnessArguments(options: PlanningHarnessOptions): string[];
|
|
26
|
+
/**
|
|
27
|
+
* Runs a bounded inference with no shell interpolation and consumes only its final JSON answer.
|
|
28
|
+
* @private internal utility of `coder plan`
|
|
29
|
+
*/
|
|
30
|
+
export declare function runPlanningHarness(options: PlanningHarnessOptions): Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { NormalizedPromptRunnerSelectionCliOptions } from '../../common/promptRunnerCliOptions';
|
|
2
|
+
import { runPlanningHarness } from './runPlanningHarness';
|
|
3
|
+
/**
|
|
4
|
+
* Terminal interface also used by deterministic conversation fixtures.
|
|
5
|
+
* @private internal type of `coder plan`
|
|
6
|
+
*/
|
|
7
|
+
export type PlanningSessionIo = {
|
|
8
|
+
readonly readMessage: () => Promise<string | undefined>;
|
|
9
|
+
readonly write: (message: string) => void;
|
|
10
|
+
readonly signal: AbortSignal;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Runs one multi-topic planning conversation; only explicit save commands cross the PRD write boundary.
|
|
14
|
+
* @private internal utility of `coder plan`
|
|
15
|
+
*/
|
|
16
|
+
export declare function runPlanningSession(options: NormalizedPromptRunnerSelectionCliOptions & {
|
|
17
|
+
readonly projectPath: string;
|
|
18
|
+
readonly agent?: string;
|
|
19
|
+
readonly template?: string;
|
|
20
|
+
readonly preexistingChangedPaths?: ReadonlySet<string>;
|
|
21
|
+
}, io: PlanningSessionIo, harness?: typeof runPlanningHarness): Promise<ReadonlyMap<string, string>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PlanningChange } from './preparePlanningChanges';
|
|
2
|
+
/**
|
|
3
|
+
* Validates the entire batch before writing, stages outside the queue, then atomically replaces each file.
|
|
4
|
+
* The synchronous commit region cannot be interrupted by a SIGINT callback halfway through a save.
|
|
5
|
+
* @private internal execution boundary of `coder plan`
|
|
6
|
+
*/
|
|
7
|
+
export declare function savePlanningChanges(projectPath: string, workspacePath: string, changes: ReadonlyArray<PlanningChange>, isDraft: boolean): string[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { WorkspaceRepositoryContext } from '../common/workspaceRepository';
|
|
1
2
|
import type { CoderInitializationSummary } from './initializeCoderProjectConfiguration';
|
|
2
3
|
/**
|
|
3
4
|
* Prints a readable summary of what was initialized for the user.
|
|
4
5
|
*
|
|
5
6
|
* @private function of `coder init` command
|
|
6
7
|
*/
|
|
7
|
-
export declare function printInitializationSummary(summary: CoderInitializationSummary): void;
|
|
8
|
+
export declare function printInitializationSummary(summary: CoderInitializationSummary, workspace?: WorkspaceRepositoryContext): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project-relative location of the offline guide, reserved from prompt discovery.
|
|
3
|
+
*
|
|
4
|
+
* @private internal constant of `coder init`
|
|
5
|
+
*/
|
|
6
|
+
export declare const PROMPTS_README_FILE_PATH: string;
|
|
7
|
+
/**
|
|
8
|
+
* Maintained project-independent guide, bundled as text in the published CLI.
|
|
9
|
+
* Keep examples executable against the parser and command registry in the accompanying tests.
|
|
10
|
+
*
|
|
11
|
+
* @private internal template of `coder init`
|
|
12
|
+
*/
|
|
13
|
+
export declare const PROMPTS_README_TEMPLATE: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { string_book } from '../../../book-2.0/agent-source/string_book';
|
|
2
|
+
/**
|
|
3
|
+
* Reads a project-owned Book before initialization, refusing unsafe edits while preserving its original bytes.
|
|
4
|
+
* Unknown commitments remain supported, as in the normal Book parser.
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `coder init`
|
|
7
|
+
*/
|
|
8
|
+
export declare function readCoderAgentBook(filePath: string): Promise<string_book>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,6 +6,7 @@ import type { $side_effect } from '../../utils/organization/$side_effect';
|
|
|
6
6
|
* The coder command provides utilities for automated coding:
|
|
7
7
|
* - init: Initialize coder configuration in current project
|
|
8
8
|
* - add: Add one ready-to-run prompt file to the queue
|
|
9
|
+
* - plan: Discuss features with Planner and author reviewed PRDs
|
|
9
10
|
* - generate-boilerplates: Generate prompt boilerplate files
|
|
10
11
|
* - find-refactor-candidates: Find files that need refactoring
|
|
11
12
|
* - list: List ready prompts in priority order without running them
|
|
@@ -19,6 +19,8 @@ export type LocalAgentBook = {
|
|
|
19
19
|
export declare class LocalAgentBookCollection {
|
|
20
20
|
private readonly agentDirectoryPath;
|
|
21
21
|
private readonly currentWorkingDirectory;
|
|
22
|
+
private readonly isInitializationAllowed;
|
|
23
|
+
private readonly signal?;
|
|
22
24
|
private readonly booksByUrl;
|
|
23
25
|
private readonly booksByName;
|
|
24
26
|
/** Stable default ancestor selected from the initial repository scan. */
|
|
@@ -26,7 +28,7 @@ export declare class LocalAgentBookCollection {
|
|
|
26
28
|
/** Files initialized by this collection, for the coder's normal commit handling. */
|
|
27
29
|
readonly createdAgentBookPaths: string[];
|
|
28
30
|
/** Creates a collection rooted at the primary book's directory. */
|
|
29
|
-
constructor(agentDirectoryPath: string, currentWorkingDirectory: string);
|
|
31
|
+
constructor(agentDirectoryPath: string, currentWorkingDirectory: string, isInitializationAllowed?: boolean, signal?: AbortSignal | undefined);
|
|
30
32
|
/** Discovers nested books, including the hidden `.core` directory. */
|
|
31
33
|
initialize(): Promise<void>;
|
|
32
34
|
/** Identifies the default ancestor without creating an unused book for FROM null/void. */
|
|
@@ -38,7 +40,7 @@ export declare class LocalAgentBookCollection {
|
|
|
38
40
|
/** Reads a local book once, canonicalizing symlinks so aliases cannot bypass cycle detection. */
|
|
39
41
|
readBook(filePath: string): Promise<LocalAgentBook>;
|
|
40
42
|
/** Loads a referenced remote book, while keeping local identifiers entirely inside the collection. */
|
|
41
|
-
getBook(url: string): Promise<LocalAgentBook>;
|
|
43
|
+
getBook(url: string, signal?: AbortSignal | undefined): Promise<LocalAgentBook>;
|
|
42
44
|
/** Adds a book under its normalized first-line name and preserves the display name for TEAM. */
|
|
43
45
|
private registerBook;
|
|
44
46
|
/** Walks real directories in deterministic order without following directory symlink loops. */
|
|
@@ -21,7 +21,7 @@ export declare const CODER_GIT_SYNC_DESCRIPTION: string;
|
|
|
21
21
|
* Registers the shared `--commit`, `--auto-push` and `--auto-pull` flags on a `ptbk coder` command.
|
|
22
22
|
*
|
|
23
23
|
* Note: Unlike `ptbk coder run`, which commits by default and opts out through `--no-commit`,
|
|
24
|
-
* these commands
|
|
24
|
+
* these commands only mutate Git when the flags are used explicitly. Workspace detection always runs.
|
|
25
25
|
*
|
|
26
26
|
* @private internal utility of `promptbookCli`
|
|
27
27
|
*/
|
|
@@ -6,8 +6,12 @@ import type { string_book } from '../../../book-2.0/agent-source/string_book';
|
|
|
6
6
|
* @private internal type of CLI agent resolution
|
|
7
7
|
*/
|
|
8
8
|
export type ResolvedLocalAgentSource = {
|
|
9
|
+
/** Canonical identity used to bound recursive TEAM consultations. */
|
|
10
|
+
readonly agentUrl: string;
|
|
9
11
|
readonly agentSource: string_book;
|
|
10
12
|
readonly agentReferenceResolver: AgentReferenceResolver;
|
|
13
|
+
/** Resolves another Book in this collection, retaining its own inheritance and reference locations. */
|
|
14
|
+
readonly resolveAgentSource: (url: string, signal?: AbortSignal) => Promise<ResolvedLocalAgentSource>;
|
|
11
15
|
/** Newly created books which the coder may include in its initialization commit. */
|
|
12
16
|
readonly createdAgentBookPaths: ReadonlyArray<string>;
|
|
13
17
|
};
|
|
@@ -16,4 +20,7 @@ export type ResolvedLocalAgentSource = {
|
|
|
16
20
|
*
|
|
17
21
|
* @private internal utility of CLI agent resolution
|
|
18
22
|
*/
|
|
19
|
-
export declare function resolveLocalAgentSource(agentBookPath: string, currentWorkingDirectory: string
|
|
23
|
+
export declare function resolveLocalAgentSource(agentBookPath: string, currentWorkingDirectory: string, options?: {
|
|
24
|
+
readonly isInitializationAllowed?: boolean;
|
|
25
|
+
readonly signal?: AbortSignal;
|
|
26
|
+
}): Promise<ResolvedLocalAgentSource>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RunOptions } from '../../../../scripts/run-codex-prompts/cli/RunOptions';
|
|
2
|
+
/**
|
|
3
|
+
* Validates cross-flag constraints before workspace setup or the run starts.
|
|
4
|
+
* @private shared validation for Coder execution commands
|
|
5
|
+
*/
|
|
6
|
+
export declare function validateCoderRunOptions(options: RunOptions): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { NormalizedQuestionsCliOptions } from './questionsCliOptions';
|
|
2
|
+
/**
|
|
3
|
+
* Resolved project directory and its enclosing working tree. Project artifacts belong to `projectPath`;
|
|
4
|
+
* Git paths and synchronization belong to `repositoryRoot`, which may be an enclosing monorepo.
|
|
5
|
+
*
|
|
6
|
+
* @private shared workspace context for Coder and workspace server commands
|
|
7
|
+
*/
|
|
8
|
+
export type WorkspaceRepositoryContext = {
|
|
9
|
+
readonly projectPath: string;
|
|
10
|
+
readonly repositoryRoot?: string;
|
|
11
|
+
readonly gitDirectory?: string;
|
|
12
|
+
readonly repositoryStatus: 'missing' | 'reused' | 'initialized';
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Command policy is separate from discovery: previews never initialize; explicit init needs no confirmation.
|
|
16
|
+
*
|
|
17
|
+
* @private shared workspace policy for Coder and workspace server commands
|
|
18
|
+
*/
|
|
19
|
+
export type WorkspaceRepositoryPolicy = 'initialize' | 'mutate' | 'read-only';
|
|
20
|
+
/**
|
|
21
|
+
* Resolves the requested project once and discovers Git using Git itself, without requiring `HEAD`.
|
|
22
|
+
* Broken metadata, bare repositories, ownership errors and unavailable Git are failures, not missing repositories.
|
|
23
|
+
*
|
|
24
|
+
* @private shared workspace discovery for CLI commands
|
|
25
|
+
*/
|
|
26
|
+
export declare function $resolveWorkspaceRepository(projectDirectory?: string): Promise<WorkspaceRepositoryContext>;
|
|
27
|
+
/**
|
|
28
|
+
* Checks the shared prerequisite before any project writes, Git synchronization, installation or startup.
|
|
29
|
+
* Only an affirmative interactive answer or an explicit initializer authorizes `git init`.
|
|
30
|
+
*
|
|
31
|
+
* @private shared workspace preflight for Coder and workspace server commands
|
|
32
|
+
*/
|
|
33
|
+
export declare function $preflightWorkspaceRepository(options: {
|
|
34
|
+
readonly projectDirectory?: string;
|
|
35
|
+
readonly policy: WorkspaceRepositoryPolicy;
|
|
36
|
+
} & Partial<NormalizedQuestionsCliOptions>): Promise<WorkspaceRepositoryContext>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* Shared explanation of the workspace prerequisite, independent of commit and synchronization settings.
|
|
4
|
+
* @private internal CLI help text
|
|
5
|
+
*/
|
|
6
|
+
export declare const WORKSPACE_REPOSITORY_DESCRIPTION: string;
|
|
7
|
+
/**
|
|
8
|
+
* Adds shared Git help and the questions switch to every workspace command without duplicating existing options.
|
|
9
|
+
* @private internal registration helper for workspace CLI commands
|
|
10
|
+
*/
|
|
11
|
+
export declare function addWorkspaceRepositoryOptions(command: Command): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads the ZIP archive library (`jszip`) on demand
|
|
3
|
+
*
|
|
4
|
+
* Note: [🐌] Loaded lazily to keep the startup of the `ptbk` CLI utility fast
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `loadArchive` and `saveArchive`
|
|
7
|
+
*/
|
|
8
|
+
export declare const loadJsZipModule: () => Promise<{
|
|
9
|
+
default: typeof import('jszip');
|
|
10
|
+
}>;
|
package/esm/src/version.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
|
|
|
15
15
|
export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
|
|
16
16
|
/**
|
|
17
17
|
* Represents the version string of the Promptbook engine.
|
|
18
|
-
* It follows semantic versioning (e.g., `0.114.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.114.0-47`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/cli",
|
|
3
|
-
"version": "0.114.0-
|
|
3
|
+
"version": "0.114.0-47",
|
|
4
4
|
"description": "Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -124,9 +124,11 @@
|
|
|
124
124
|
"socket.io": "4.8.3",
|
|
125
125
|
"socket.io-client": "4.8.3",
|
|
126
126
|
"spacetrim": "0.11.60",
|
|
127
|
+
"string-width": "4.2.3",
|
|
127
128
|
"swagger-ui-express": "5.0.1",
|
|
128
129
|
"userhome": "1.0.1",
|
|
129
130
|
"waitasecond": "1.11.164",
|
|
131
|
+
"zod": "4.3.6",
|
|
130
132
|
"typescript": "5.2.2",
|
|
131
133
|
"ts-node": "10.9.2",
|
|
132
134
|
"next": "15.5.25",
|
|
@@ -181,8 +183,7 @@
|
|
|
181
183
|
"y-protocols": "1.0.7",
|
|
182
184
|
"y-websocket": "3.0.0",
|
|
183
185
|
"yjs": "13.6.30",
|
|
184
|
-
"zeptomail": "7.0.2"
|
|
185
|
-
"zod": "4.3.6"
|
|
186
|
+
"zeptomail": "7.0.2"
|
|
186
187
|
},
|
|
187
188
|
"bin": {
|
|
188
189
|
"promptbook": "bin/promptbook-cli.js",
|
|
@@ -8,6 +8,8 @@ import type { TeammateProfileResolver } from './TeammateProfileResolver';
|
|
|
8
8
|
* @public exported from `@promptbook/core`
|
|
9
9
|
*/
|
|
10
10
|
export type CreateAgentModelRequirementsOptions = {
|
|
11
|
+
/** A host supplying its own scoped TEAM runtime only needs the tool definitions, not global executors. */
|
|
12
|
+
readonly isTeamToolRegistrationDisabled?: boolean;
|
|
11
13
|
/**
|
|
12
14
|
* Resolver that transforms compact agent references (FROM, IMPORT, TEAM) into concrete URLs.
|
|
13
15
|
*/
|
|
@@ -157,9 +157,14 @@ async function preResolveTeammateProfilesForTeamCommitment(
|
|
|
157
157
|
continue;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
try {
|
|
161
|
+
const profile = await profileResolver.resolveTeammateProfile(teammate.url);
|
|
162
|
+
if (profile) {
|
|
163
|
+
preResolvedTeammateProfiles[teammate.url] = profile;
|
|
164
|
+
}
|
|
165
|
+
} catch (error) {
|
|
166
|
+
// One inaccessible adviser must not erase the names and roles of other callable teammates.
|
|
167
|
+
console.warn(`Failed to resolve TEAM profile for ${teammate.url}:`, error);
|
|
163
168
|
}
|
|
164
169
|
}
|
|
165
170
|
|
|
@@ -31,6 +31,12 @@ export async function createAgentModelRequirementsWithCommitments(
|
|
|
31
31
|
const filteredCommitments = filterCommitmentsForAgentModelRequirements(parseResult.commitments);
|
|
32
32
|
|
|
33
33
|
let requirements = createInitialAgentModelRequirements(parseResult.agentName, modelName);
|
|
34
|
+
if (options?.isTeamToolRegistrationDisabled) {
|
|
35
|
+
requirements = {
|
|
36
|
+
...requirements,
|
|
37
|
+
_metadata: { ...requirements._metadata, isTeamToolRegistrationDisabled: true },
|
|
38
|
+
};
|
|
39
|
+
}
|
|
34
40
|
requirements = await applyCommitmentsToAgentModelRequirements(requirements, filteredCommitments, options);
|
|
35
41
|
requirements = await augmentAgentModelRequirementsFromSource(requirements, parseResult, agentSource);
|
|
36
42
|
requirements = await materializeInlineKnowledgeSources(requirements, options?.inlineKnowledgeSourceUploader);
|
|
@@ -6,6 +6,7 @@ import { $initializeAgentCommand } from './cli-commands/agent';
|
|
|
6
6
|
import { $initializeAgentFolderCommand } from './cli-commands/agent-folder';
|
|
7
7
|
import { $initializeAgentsServerCommand } from './cli-commands/agents-server';
|
|
8
8
|
import { $initializeCoderCommand } from './cli-commands/coder';
|
|
9
|
+
import { $initializeCoderInitCommand } from './cli-commands/coder/init';
|
|
9
10
|
import { $initializeHelloCommand } from './cli-commands/hello';
|
|
10
11
|
import { $initializeListModelsCommand } from './cli-commands/list-models';
|
|
11
12
|
import { $initializeListScrapersCommand } from './cli-commands/list-scrapers';
|
|
@@ -58,6 +59,7 @@ export function $initializePromptbookCliProgram(program: Command): void {
|
|
|
58
59
|
|
|
59
60
|
// Commands are listed in registration order. Keep `coder` first and hide deprecated commands below.
|
|
60
61
|
$initializeCoderCommand(program);
|
|
62
|
+
$initializeCoderInitCommand(program);
|
|
61
63
|
$initializeAgentCommand(program);
|
|
62
64
|
$initializeAgentFolderCommand(program);
|
|
63
65
|
$initializeAgentsServerCommand(program);
|
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
CODER_GIT_SYNC_DESCRIPTION,
|
|
17
17
|
normalizeCoderGitSyncCliOptions,
|
|
18
18
|
} from '../common/coderGitSyncCliOptions';
|
|
19
|
+
import { $preflightWorkspaceRepository } from '../common/workspaceRepository';
|
|
20
|
+
import { addWorkspaceRepositoryOptions } from '../common/workspaceRepositoryCliOptions';
|
|
19
21
|
import { handleActionErrors } from '../common/handleActionErrors';
|
|
20
22
|
import {
|
|
21
23
|
addQuestionsOption,
|
|
@@ -99,6 +101,8 @@ export function $initializeCoderAddCommand(program: Program): $side_effect {
|
|
|
99
101
|
addCoderGitSyncOptions(command);
|
|
100
102
|
addQuestionsOption(command);
|
|
101
103
|
|
|
104
|
+
addWorkspaceRepositoryOptions(command);
|
|
105
|
+
|
|
102
106
|
command.action(
|
|
103
107
|
handleActionErrors(async (descriptionArgument: string | undefined, cliOptions) => {
|
|
104
108
|
const { priority, template: templateOption } = cliOptions as {
|
|
@@ -108,7 +112,8 @@ export function $initializeCoderAddCommand(program: Program): $side_effect {
|
|
|
108
112
|
|
|
109
113
|
const gitSync = normalizeCoderGitSyncCliOptions(cliOptions as CoderGitSyncCliOptions);
|
|
110
114
|
const questionsOptions = normalizeQuestionsCliOptions(cliOptions as QuestionsCliOptions);
|
|
111
|
-
const
|
|
115
|
+
const workspace = await $preflightWorkspaceRepository({ policy: 'mutate', ...questionsOptions });
|
|
116
|
+
const { projectPath } = workspace;
|
|
112
117
|
|
|
113
118
|
const description = await resolveCoderPromptDescription(descriptionArgument, questionsOptions);
|
|
114
119
|
|
|
@@ -117,7 +122,7 @@ export function $initializeCoderAddCommand(program: Program): $side_effect {
|
|
|
117
122
|
'../../../../scripts/run-codex-prompts/git/coderGitSync'
|
|
118
123
|
);
|
|
119
124
|
|
|
120
|
-
const commitScope = await $startCoderGitSync({ gitSync,
|
|
125
|
+
const commitScope = await $startCoderGitSync({ gitSync, workspace });
|
|
121
126
|
|
|
122
127
|
const { /* filePath,*/ emojiTag } = await addCoderPrompt({
|
|
123
128
|
projectPath,
|
|
@@ -167,6 +172,34 @@ export async function addCoderPrompt({
|
|
|
167
172
|
readonly priority: number;
|
|
168
173
|
readonly templateOption?: string;
|
|
169
174
|
}): Promise<AddCoderPromptResult> {
|
|
175
|
+
mkdirSync(join(projectPath, PROMPTS_DIRECTORY_PATH), { recursive: true });
|
|
176
|
+
const prepared = await prepareCoderPrompt({ projectPath, description, priority, templateOption });
|
|
177
|
+
writeFileSync(join(projectPath, prepared.filePath), prepared.content, { encoding: 'utf-8', flag: 'wx' });
|
|
178
|
+
console.info(colors.green(`✓ Added prompt ${prepared.emojiTag} in ${prepared.filePath}`));
|
|
179
|
+
return { filePath: prepared.filePath, emojiTag: prepared.emojiTag };
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Prepares a numbered, emoji-tagged prompt for preview without writing the prompt file.
|
|
184
|
+
* The offset reserves consecutive identities when a planning turn proposes several files.
|
|
185
|
+
*
|
|
186
|
+
* @private internal utility shared by `coder add` and `coder plan`
|
|
187
|
+
*/
|
|
188
|
+
export async function prepareCoderPrompt({
|
|
189
|
+
projectPath,
|
|
190
|
+
description,
|
|
191
|
+
priority,
|
|
192
|
+
templateOption,
|
|
193
|
+
numberOffset = 0,
|
|
194
|
+
reservedEmojiTag,
|
|
195
|
+
}: {
|
|
196
|
+
readonly projectPath: string;
|
|
197
|
+
readonly description: string;
|
|
198
|
+
readonly priority: number;
|
|
199
|
+
readonly templateOption?: string;
|
|
200
|
+
readonly numberOffset?: number;
|
|
201
|
+
readonly reservedEmojiTag?: string;
|
|
202
|
+
}): Promise<AddCoderPromptResult & { readonly content: string }> {
|
|
170
203
|
const normalizedDescription = description.trim();
|
|
171
204
|
if (normalizedDescription === '') {
|
|
172
205
|
throw new ParseError(
|
|
@@ -188,7 +221,6 @@ export async function addCoderPrompt({
|
|
|
188
221
|
);
|
|
189
222
|
|
|
190
223
|
const promptsDirectory = join(projectPath, PROMPTS_DIRECTORY_PATH);
|
|
191
|
-
mkdirSync(promptsDirectory, { recursive: true });
|
|
192
224
|
|
|
193
225
|
const promptTemplate = await resolveCoderPromptTemplate({ projectPath, templateOption });
|
|
194
226
|
|
|
@@ -198,9 +230,9 @@ export async function addCoderPrompt({
|
|
|
198
230
|
ignoreGlobs: ['**/node_modules/**'],
|
|
199
231
|
});
|
|
200
232
|
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
233
|
+
const emojiTag =
|
|
234
|
+
reservedEmojiTag ||
|
|
235
|
+
formatPromptEmojiTag((await getFreshPromptEmojiTags({ count: 1, rootDir: projectPath })).selectedEmojis[0]!);
|
|
204
236
|
|
|
205
237
|
const [firstDescriptionLine, ...remainingDescriptionLines] = normalizedDescription.split('\n');
|
|
206
238
|
const title = (firstDescriptionLine ?? '').trim();
|
|
@@ -216,15 +248,13 @@ export async function addCoderPrompt({
|
|
|
216
248
|
});
|
|
217
249
|
|
|
218
250
|
const slug = buildAddPromptSlug(promptTemplate.slugPrefix, title);
|
|
219
|
-
const filename = buildPromptFilename(
|
|
251
|
+
const filename = buildPromptFilename(
|
|
252
|
+
promptNumbering.datePrefix,
|
|
253
|
+
promptNumbering.startNumber + numberOffset * promptNumbering.step,
|
|
254
|
+
slug,
|
|
255
|
+
);
|
|
220
256
|
const filePath = join(PROMPTS_DIRECTORY_PATH, filename);
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
writeFileSync(absoluteFilePath, `${section}\n`, 'utf-8');
|
|
224
|
-
|
|
225
|
-
console.info(colors.green(`✓ Added prompt ${emojiTag} in ${filePath}`));
|
|
226
|
-
|
|
227
|
-
return { filePath, emojiTag };
|
|
257
|
+
return { filePath, emojiTag, content: `${section}\n` };
|
|
228
258
|
}
|
|
229
259
|
|
|
230
260
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
Command as Program /* <- Note: [🔸] Using Program because Command is misleading name */,
|
|
3
3
|
} from 'commander';
|
|
4
|
+
import { CODER_DEFAULT_AGENT_BOOK_PATHS, type CoderAgentRole } from './coderAgentRole';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Commander option bag for an optional Book agent used by coder commands.
|
|
@@ -17,15 +18,20 @@ export type CoderAgentCliOptions = {
|
|
|
17
18
|
* @private internal utility of `ptbk coder`
|
|
18
19
|
*/
|
|
19
20
|
export const CODER_AGENT_OPTION_DESCRIPTION =
|
|
20
|
-
'
|
|
21
|
+
'Book agent providing persona, instructions, identity and task routing; --harness selects the coding tool and --model selects its model';
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Registers the shared `--agent` option for coder commands.
|
|
24
25
|
*
|
|
25
26
|
* @private internal utility of `ptbk coder`
|
|
26
27
|
*/
|
|
27
|
-
export function addCoderAgentOption(command: Program): void {
|
|
28
|
-
|
|
28
|
+
export function addCoderAgentOption(command: Program, defaultRole?: CoderAgentRole): void {
|
|
29
|
+
const defaultDescription = defaultRole
|
|
30
|
+
? `Defaults to the project's ${defaultRole === 'developer' ? 'Developer' : 'Planner'} (${
|
|
31
|
+
CODER_DEFAULT_AGENT_BOOK_PATHS[defaultRole]
|
|
32
|
+
}); --agent overrides this Book`
|
|
33
|
+
: 'No default Book filter; omitting --agent includes tasks for all agents';
|
|
34
|
+
command.option('--agent <agent-book-path>', `${CODER_AGENT_OPTION_DESCRIPTION}. ${defaultDescription}`);
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
// Note: [🟡] Code for CLI coder agent options should never be published outside of `@promptbook/cli`
|