@promptbook/remote-client 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/esm/index.es.js +1 -1
- 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 +2 -2
- package/umd/index.umd.js +1 -1
- 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
package/esm/index.es.js
CHANGED
|
@@ -18,7 +18,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
18
18
|
* @generated
|
|
19
19
|
* @see https://github.com/webgptorg/promptbook
|
|
20
20
|
*/
|
|
21
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
21
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-47';
|
|
22
22
|
/**
|
|
23
23
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
24
24
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -7,6 +7,8 @@ import type { TeammateProfileResolver } from './TeammateProfileResolver';
|
|
|
7
7
|
* @public exported from `@promptbook/core`
|
|
8
8
|
*/
|
|
9
9
|
export type CreateAgentModelRequirementsOptions = {
|
|
10
|
+
/** A host supplying its own scoped TEAM runtime only needs the tool definitions, not global executors. */
|
|
11
|
+
readonly isTeamToolRegistrationDisabled?: boolean;
|
|
10
12
|
/**
|
|
11
13
|
* Resolver that transforms compact agent references (FROM, IMPORT, TEAM) into concrete URLs.
|
|
12
14
|
*/
|
|
@@ -34,3 +34,19 @@ export declare function addCoderPrompt({ projectPath, description, priority, tem
|
|
|
34
34
|
readonly priority: number;
|
|
35
35
|
readonly templateOption?: string;
|
|
36
36
|
}): Promise<AddCoderPromptResult>;
|
|
37
|
+
/**
|
|
38
|
+
* Prepares a numbered, emoji-tagged prompt for preview without writing the prompt file.
|
|
39
|
+
* The offset reserves consecutive identities when a planning turn proposes several files.
|
|
40
|
+
*
|
|
41
|
+
* @private internal utility shared by `coder add` and `coder plan`
|
|
42
|
+
*/
|
|
43
|
+
export declare function prepareCoderPrompt({ projectPath, description, priority, templateOption, numberOffset, reservedEmojiTag, }: {
|
|
44
|
+
readonly projectPath: string;
|
|
45
|
+
readonly description: string;
|
|
46
|
+
readonly priority: number;
|
|
47
|
+
readonly templateOption?: string;
|
|
48
|
+
readonly numberOffset?: number;
|
|
49
|
+
readonly reservedEmojiTag?: string;
|
|
50
|
+
}): Promise<AddCoderPromptResult & {
|
|
51
|
+
readonly content: string;
|
|
52
|
+
}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Command as Program } from 'commander';
|
|
2
|
+
import { type CoderAgentRole } from './coderAgentRole';
|
|
2
3
|
/**
|
|
3
4
|
* Commander option bag for an optional Book agent used by coder commands.
|
|
4
5
|
*
|
|
@@ -12,10 +13,10 @@ export type CoderAgentCliOptions = {
|
|
|
12
13
|
*
|
|
13
14
|
* @private internal utility of `ptbk coder`
|
|
14
15
|
*/
|
|
15
|
-
export declare const CODER_AGENT_OPTION_DESCRIPTION = "
|
|
16
|
+
export declare const CODER_AGENT_OPTION_DESCRIPTION = "Book agent providing persona, instructions, identity and task routing; --harness selects the coding tool and --model selects its model";
|
|
16
17
|
/**
|
|
17
18
|
* Registers the shared `--agent` option for coder commands.
|
|
18
19
|
*
|
|
19
20
|
* @private internal utility of `ptbk coder`
|
|
20
21
|
*/
|
|
21
|
-
export declare function addCoderAgentOption(command: Program): void;
|
|
22
|
+
export declare function addCoderAgentOption(command: Program, defaultRole?: CoderAgentRole): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds only missing bundled TEAM commitments using canonical local Book identities.
|
|
3
|
+
* Role instructions come from the bundled Book, not from a harness or a second template here.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `coder init`
|
|
6
|
+
*/
|
|
7
|
+
export declare function augmentCoderAgentTeam(projectPath: string, role: 'developer' | 'planner'): Promise<'augmented' | 'unchanged'>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project-owned Book defaults for execution roles, independent of harness and model selection.
|
|
3
|
+
* Commands without an execution role, such as `coder list`, have no default Book filter.
|
|
4
|
+
*
|
|
5
|
+
* @private internal constant of `ptbk coder`
|
|
6
|
+
*/
|
|
7
|
+
export declare const CODER_DEFAULT_AGENT_BOOK_PATHS: {
|
|
8
|
+
readonly developer: "agents/developer.book";
|
|
9
|
+
readonly planner: "agents/planner.book";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Execution role whose editable local Book is selected when `--agent` is omitted.
|
|
13
|
+
*
|
|
14
|
+
* @private internal type of `ptbk coder`
|
|
15
|
+
*/
|
|
16
|
+
export type CoderAgentRole = keyof typeof CODER_DEFAULT_AGENT_BOOK_PATHS;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { InitializationStatus } from './boilerplateTemplates';
|
|
2
2
|
/**
|
|
3
|
-
* Status of one artifact referenced by the default coder scripts.
|
|
3
|
+
* Status of one default Book or artifact referenced by the default coder scripts.
|
|
4
4
|
*
|
|
5
5
|
* `not-referenced` means that no newly added script points at the artifact, so `ptbk coder init` left it alone.
|
|
6
6
|
*
|
|
7
7
|
* @private internal utility of `coder init` command
|
|
8
8
|
*/
|
|
9
|
-
export type CoderReferencedArtifactStatus = InitializationStatus | 'not-referenced';
|
|
9
|
+
export type CoderReferencedArtifactStatus = InitializationStatus | 'augmented' | 'unresolved' | 'not-referenced';
|
|
10
10
|
/**
|
|
11
|
-
* Result of ensuring one artifact referenced by the default coder scripts.
|
|
11
|
+
* Result of ensuring one default Book or artifact referenced by the default coder scripts.
|
|
12
12
|
*
|
|
13
13
|
* @private internal utility of `coder init` command
|
|
14
14
|
*/
|
|
@@ -18,15 +18,16 @@ export type EnsuredCoderReferencedArtifact = {
|
|
|
18
18
|
*/
|
|
19
19
|
readonly relativeFilePath: string;
|
|
20
20
|
/**
|
|
21
|
-
* Status describing whether the artifact
|
|
21
|
+
* Status describing whether the artifact was created, augmented, preserved, or could not be resolved.
|
|
22
22
|
*/
|
|
23
23
|
readonly status: CoderReferencedArtifactStatus;
|
|
24
|
+
/** Explanation of an unresolved file or TEAM declaration, with the original content preserved. */
|
|
25
|
+
readonly diagnostic?: string;
|
|
24
26
|
};
|
|
25
27
|
/**
|
|
26
|
-
*
|
|
28
|
+
* Initializes artifacts referenced by freshly added scripts. Default Books are ensured separately.
|
|
27
29
|
*
|
|
28
|
-
*
|
|
29
|
-
* script is kept as is, so it does not reference the default artifact in the first place.
|
|
30
|
+
* For artifacts other than role Books, an existing project script does not cause default files to be created.
|
|
30
31
|
*
|
|
31
32
|
* @private function of `initializeCoderProjectConfiguration`
|
|
32
33
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EnsuredCoderReferencedArtifact } from './coderReferencedArtifacts';
|
|
2
|
+
/**
|
|
3
|
+
* Ensures every default Book independently, then adds missing helper declarations to the two primary roles.
|
|
4
|
+
* A failure leaves the affected Book intact and does not prevent the remaining files from being initialized.
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `coder init`
|
|
7
|
+
*/
|
|
8
|
+
export declare function ensureCoderDefaultAgentFiles(projectPath: string): Promise<EnsuredCoderReferencedArtifact[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { InitializationStatus } from './boilerplateTemplates';
|
|
2
|
+
/**
|
|
3
|
+
* Project-owned planning role selected when `coder plan` has no explicit Book override.
|
|
4
|
+
* @private internal constant of Coder role resolution
|
|
5
|
+
*/
|
|
6
|
+
export declare const CODER_PLANNER_AGENT_FILE_PATH = "agents/planner.book";
|
|
7
|
+
/**
|
|
8
|
+
* Copies a bundled role without overwriting an existing project-owned Book, including on repeated init.
|
|
9
|
+
*
|
|
10
|
+
* @private internal utility of `coder init`
|
|
11
|
+
*/
|
|
12
|
+
export declare function ensureCoderRoleAgentFile(projectPath: string, role: 'developer' | 'planner' | 'lawyer' | 'copywriter'): Promise<InitializationStatus>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WorkspaceRepositoryContext } from '../common/workspaceRepository';
|
|
2
|
+
import type { CoderInitializationSummary } from './initializeCoderProjectConfiguration';
|
|
3
|
+
/**
|
|
4
|
+
* Restricts an explicit initialization commit to the initializer's write set, in repository-relative paths.
|
|
5
|
+
* The shared snapshot still excludes pre-existing files that initialization did not actually change.
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of the shared project initializer
|
|
8
|
+
*/
|
|
9
|
+
export declare function getCoderInitializationCommitPaths(workspace: WorkspaceRepositoryContext, summary: CoderInitializationSummary, boilerplatePaths: ReadonlyArray<string>): ReadonlyArray<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InitializationStatus } from './boilerplateTemplates';
|
|
2
|
-
import type { EnsuredCoderReferencedArtifact } from './coderReferencedArtifacts';
|
|
2
|
+
import type { CoderReferencedArtifactStatus, EnsuredCoderReferencedArtifact } from './coderReferencedArtifacts';
|
|
3
3
|
/**
|
|
4
4
|
* Result summary returned after coder configuration initialization.
|
|
5
5
|
*
|
|
@@ -7,10 +7,12 @@ import type { EnsuredCoderReferencedArtifact } from './coderReferencedArtifacts'
|
|
|
7
7
|
*/
|
|
8
8
|
export type CoderInitializationSummary = {
|
|
9
9
|
readonly promptsDirectoryStatus: InitializationStatus;
|
|
10
|
+
readonly promptsReadmeFileStatus: InitializationStatus;
|
|
10
11
|
readonly promptsDoneDirectoryStatus: InitializationStatus;
|
|
11
12
|
readonly promptsTemplatesDirectoryStatus: InitializationStatus;
|
|
12
13
|
readonly agentsDirectoryStatus: InitializationStatus;
|
|
13
|
-
readonly adamAgentFileStatus:
|
|
14
|
+
readonly adamAgentFileStatus: CoderReferencedArtifactStatus;
|
|
15
|
+
readonly adamAgentFileDiagnostic?: string;
|
|
14
16
|
readonly envFileStatus: InitializationStatus;
|
|
15
17
|
readonly gitignoreFileStatus: InitializationStatus;
|
|
16
18
|
readonly packageJsonFileStatus: InitializationStatus;
|
|
@@ -22,9 +24,9 @@ export type CoderInitializationSummary = {
|
|
|
22
24
|
/**
|
|
23
25
|
* Creates or updates all coder configuration artifacts required in the current project.
|
|
24
26
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
+
* Existing scripts, settings and Books are preserved. Missing Books and helper TEAM declarations are added
|
|
28
|
+
* independently of package scripts, with unresolved artifacts reported without replacing project content.
|
|
27
29
|
*
|
|
28
30
|
* @private internal utility of `coder init` command
|
|
29
31
|
*/
|
|
30
|
-
export declare function initializeCoderProjectConfiguration(projectPath: string): Promise<CoderInitializationSummary>;
|
|
32
|
+
export declare function initializeCoderProjectConfiguration(projectPath: string, onStepCompleted?: (step: string) => void): Promise<CoderInitializationSummary>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Command as Program } from 'commander';
|
|
2
|
+
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
3
|
+
/**
|
|
4
|
+
* Registers the repository-aware, planning-only conversation under the existing coder command group.
|
|
5
|
+
* @private internal utility of `promptbookCli`
|
|
6
|
+
*/
|
|
7
|
+
export declare function $initializeCoderPlanCommand(program: Program): $side_effect;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protects the shared authoring Git helper's temporary directory and shell-quoted absolute message path.
|
|
3
|
+
* PRD paths themselves are checked separately by the write boundary before every save and commit.
|
|
4
|
+
* @private internal execution boundary of `coder plan`
|
|
5
|
+
*/
|
|
6
|
+
export declare function assertPlanningCommitSafe(projectPath: string): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PlanningChange } from './preparePlanningChanges';
|
|
2
|
+
/**
|
|
3
|
+
* Refuses to mix prior or concurrent user edits into a PRD that this session intends to commit.
|
|
4
|
+
* After the first save, the session's exact saved text is the baseline for subsequent revisions.
|
|
5
|
+
* @private internal execution boundary of `coder plan`
|
|
6
|
+
*/
|
|
7
|
+
export declare function assertPlanningPrdCommitScope(projectPath: string, changes: ReadonlyArray<PlanningChange>, savedContents: ReadonlyMap<string, string>, preexistingChangedPaths: ReadonlySet<string>): Promise<void>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps host-owned staging and Git runtime directories inside the ordinary Promptbook temporary tree.
|
|
3
|
+
* Missing directories are allowed, but no existing ancestor may redirect subsequent writes through a link.
|
|
4
|
+
* @private internal execution boundary of `coder plan`
|
|
5
|
+
*/
|
|
6
|
+
export declare function assertPlanningRuntimePath(projectPath: string, runtimePath: string): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PlanningSessionIo } from './runPlanningSession';
|
|
2
|
+
/**
|
|
3
|
+
* Builds an EOF-aware terminal. EOF or Ctrl+C also cancels an in-flight harness turn.
|
|
4
|
+
* @private internal utility of `coder plan`
|
|
5
|
+
*/
|
|
6
|
+
export declare function createPlanningTerminal(): PlanningSessionIo & {
|
|
7
|
+
readonly close: () => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host-owned structured output contract kept outside the PRD queue.
|
|
3
|
+
* @private internal constant of `coder plan`
|
|
4
|
+
*/
|
|
5
|
+
export declare const PLANNING_RESPONSE_SCHEMA_FILENAME = "response.schema.json";
|
|
6
|
+
/**
|
|
7
|
+
* Creates isolated runtime state in the already ignored Promptbook location, outside the PRD queue.
|
|
8
|
+
* An empty Git root prevents the harness from loading repository-local configuration and hooks.
|
|
9
|
+
* @private internal utility of `coder plan`
|
|
10
|
+
*/
|
|
11
|
+
export declare function createPlanningWorkspace(projectPath: string): Promise<string>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CoderTeamScope } from '../../../../../scripts/run-codex-prompts/team/CoderTeamRuntime';
|
|
2
|
+
import { type PlanningMessage, type PlanningReply } from './planningProtocol';
|
|
3
|
+
/**
|
|
4
|
+
* Runs the same read-only protocol throughout the delegation tree. Only the primary caller can receive proposals.
|
|
5
|
+
* @private internal utility of `coder plan`
|
|
6
|
+
*/
|
|
7
|
+
export declare function discussPlanningTurn(options: {
|
|
8
|
+
readonly projectPath: string;
|
|
9
|
+
readonly history: PlanningMessage[];
|
|
10
|
+
readonly signal: AbortSignal;
|
|
11
|
+
readonly infer: () => Promise<string>;
|
|
12
|
+
readonly team?: CoderTeamScope;
|
|
13
|
+
readonly isAdviser?: boolean;
|
|
14
|
+
readonly write?: (message: string) => void;
|
|
15
|
+
}): Promise<PlanningReply>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Captures project-owned fixture files while excluding the ignored planning runtime and linked test targets.
|
|
3
|
+
* @private test utility of `coder plan`
|
|
4
|
+
*/
|
|
5
|
+
export declare function snapshotPlanningProject(projectPath: string, directory?: string): Promise<Record<string, string>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { z as schema } from 'zod';
|
|
2
|
+
/** Read-only host requests and scoped TEAM consultations; there is deliberately no shell operation. */
|
|
3
|
+
declare const PLANNING_READ_SCHEMA: schema.ZodDiscriminatedUnion<[schema.ZodObject<{
|
|
4
|
+
kind: schema.ZodLiteral<"list">;
|
|
5
|
+
path: schema.ZodString;
|
|
6
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
7
|
+
kind: schema.ZodLiteral<"read">;
|
|
8
|
+
path: schema.ZodString;
|
|
9
|
+
startLine: schema.ZodNumber;
|
|
10
|
+
lineCount: schema.ZodNumber;
|
|
11
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
12
|
+
kind: schema.ZodLiteral<"search">;
|
|
13
|
+
path: schema.ZodString;
|
|
14
|
+
query: schema.ZodString;
|
|
15
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
16
|
+
kind: schema.ZodLiteral<"git">;
|
|
17
|
+
operation: schema.ZodEnum<{
|
|
18
|
+
status: "status";
|
|
19
|
+
diff: "diff";
|
|
20
|
+
log: "log";
|
|
21
|
+
}>;
|
|
22
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
23
|
+
message: schema.ZodString;
|
|
24
|
+
context: schema.ZodNonOptional<schema.ZodOptional<schema.ZodString>>;
|
|
25
|
+
kind: schema.ZodLiteral<"team">;
|
|
26
|
+
toolName: schema.ZodString;
|
|
27
|
+
}, schema.core.$strict>], "kind">;
|
|
28
|
+
/** Proposed changes are data, never instructions executed by a harness. */
|
|
29
|
+
declare const PLANNING_PROPOSAL_SCHEMA: schema.ZodDiscriminatedUnion<[schema.ZodObject<{
|
|
30
|
+
kind: schema.ZodLiteral<"create">;
|
|
31
|
+
title: schema.ZodString;
|
|
32
|
+
body: schema.ZodString;
|
|
33
|
+
priority: schema.ZodNumber;
|
|
34
|
+
isReady: schema.ZodBoolean;
|
|
35
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
36
|
+
kind: schema.ZodLiteral<"edit">;
|
|
37
|
+
path: schema.ZodString;
|
|
38
|
+
find: schema.ZodString;
|
|
39
|
+
replace: schema.ZodString;
|
|
40
|
+
isReady: schema.ZodBoolean;
|
|
41
|
+
}, schema.core.$strict>], "kind">;
|
|
42
|
+
/** Strict validation prevents unsupported operations from reaching any filesystem code. */
|
|
43
|
+
declare const PLANNING_REPLY_SCHEMA: schema.ZodObject<{
|
|
44
|
+
message: schema.ZodString;
|
|
45
|
+
reads: schema.ZodArray<schema.ZodDiscriminatedUnion<[schema.ZodObject<{
|
|
46
|
+
kind: schema.ZodLiteral<"list">;
|
|
47
|
+
path: schema.ZodString;
|
|
48
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
49
|
+
kind: schema.ZodLiteral<"read">;
|
|
50
|
+
path: schema.ZodString;
|
|
51
|
+
startLine: schema.ZodNumber;
|
|
52
|
+
lineCount: schema.ZodNumber;
|
|
53
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
54
|
+
kind: schema.ZodLiteral<"search">;
|
|
55
|
+
path: schema.ZodString;
|
|
56
|
+
query: schema.ZodString;
|
|
57
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
58
|
+
kind: schema.ZodLiteral<"git">;
|
|
59
|
+
operation: schema.ZodEnum<{
|
|
60
|
+
status: "status";
|
|
61
|
+
diff: "diff";
|
|
62
|
+
log: "log";
|
|
63
|
+
}>;
|
|
64
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
65
|
+
message: schema.ZodString;
|
|
66
|
+
context: schema.ZodNonOptional<schema.ZodOptional<schema.ZodString>>;
|
|
67
|
+
kind: schema.ZodLiteral<"team">;
|
|
68
|
+
toolName: schema.ZodString;
|
|
69
|
+
}, schema.core.$strict>], "kind">>;
|
|
70
|
+
proposals: schema.ZodArray<schema.ZodDiscriminatedUnion<[schema.ZodObject<{
|
|
71
|
+
kind: schema.ZodLiteral<"create">;
|
|
72
|
+
title: schema.ZodString;
|
|
73
|
+
body: schema.ZodString;
|
|
74
|
+
priority: schema.ZodNumber;
|
|
75
|
+
isReady: schema.ZodBoolean;
|
|
76
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
77
|
+
kind: schema.ZodLiteral<"edit">;
|
|
78
|
+
path: schema.ZodString;
|
|
79
|
+
find: schema.ZodString;
|
|
80
|
+
replace: schema.ZodString;
|
|
81
|
+
isReady: schema.ZodBoolean;
|
|
82
|
+
}, schema.core.$strict>], "kind">>;
|
|
83
|
+
}, schema.core.$strict>;
|
|
84
|
+
/**
|
|
85
|
+
* The same response contract constrains Codex output and validates it at the host boundary.
|
|
86
|
+
* @private internal constant of `coder plan`
|
|
87
|
+
*/
|
|
88
|
+
export declare const PLANNING_RESPONSE_SCHEMA: schema.core.ZodStandardJSONSchemaPayload<schema.ZodObject<{
|
|
89
|
+
message: schema.ZodString;
|
|
90
|
+
reads: schema.ZodArray<schema.ZodDiscriminatedUnion<[schema.ZodObject<{
|
|
91
|
+
kind: schema.ZodLiteral<"list">;
|
|
92
|
+
path: schema.ZodString;
|
|
93
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
94
|
+
kind: schema.ZodLiteral<"read">;
|
|
95
|
+
path: schema.ZodString;
|
|
96
|
+
startLine: schema.ZodNumber;
|
|
97
|
+
lineCount: schema.ZodNumber;
|
|
98
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
99
|
+
kind: schema.ZodLiteral<"search">;
|
|
100
|
+
path: schema.ZodString;
|
|
101
|
+
query: schema.ZodString;
|
|
102
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
103
|
+
kind: schema.ZodLiteral<"git">;
|
|
104
|
+
operation: schema.ZodEnum<{
|
|
105
|
+
status: "status";
|
|
106
|
+
diff: "diff";
|
|
107
|
+
log: "log";
|
|
108
|
+
}>;
|
|
109
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
110
|
+
message: schema.ZodString;
|
|
111
|
+
context: schema.ZodNonOptional<schema.ZodOptional<schema.ZodString>>;
|
|
112
|
+
kind: schema.ZodLiteral<"team">;
|
|
113
|
+
toolName: schema.ZodString;
|
|
114
|
+
}, schema.core.$strict>], "kind">>;
|
|
115
|
+
proposals: schema.ZodArray<schema.ZodDiscriminatedUnion<[schema.ZodObject<{
|
|
116
|
+
kind: schema.ZodLiteral<"create">;
|
|
117
|
+
title: schema.ZodString;
|
|
118
|
+
body: schema.ZodString;
|
|
119
|
+
priority: schema.ZodNumber;
|
|
120
|
+
isReady: schema.ZodBoolean;
|
|
121
|
+
}, schema.core.$strict>, schema.ZodObject<{
|
|
122
|
+
kind: schema.ZodLiteral<"edit">;
|
|
123
|
+
path: schema.ZodString;
|
|
124
|
+
find: schema.ZodString;
|
|
125
|
+
replace: schema.ZodString;
|
|
126
|
+
isReady: schema.ZodBoolean;
|
|
127
|
+
}, schema.core.$strict>], "kind">>;
|
|
128
|
+
}, schema.core.$strict>>;
|
|
129
|
+
/** @private internal type of `coder plan` */
|
|
130
|
+
export type PlanningRead = Exclude<schema.infer<typeof PLANNING_READ_SCHEMA>, {
|
|
131
|
+
kind: 'team';
|
|
132
|
+
}>;
|
|
133
|
+
/** @private internal type of `coder plan` */
|
|
134
|
+
export type PlanningProposal = schema.infer<typeof PLANNING_PROPOSAL_SCHEMA>;
|
|
135
|
+
/** @private internal type of `coder plan` */
|
|
136
|
+
export type PlanningReply = schema.infer<typeof PLANNING_REPLY_SCHEMA>;
|
|
137
|
+
/** @private internal type of `coder plan` */
|
|
138
|
+
export type PlanningMessage = {
|
|
139
|
+
readonly role: 'user' | 'planner' | 'context';
|
|
140
|
+
readonly content: string;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Rejects malformed or unsupported harness output before processing reads or proposed writes.
|
|
144
|
+
* @private internal utility of `coder plan`
|
|
145
|
+
*/
|
|
146
|
+
export declare function parsePlanningReply(output: string): PlanningReply;
|
|
147
|
+
/**
|
|
148
|
+
* Describes the host-mediated planning protocol, independent of the selected Book's instructions.
|
|
149
|
+
* @private internal constant of `coder plan`
|
|
150
|
+
*/
|
|
151
|
+
export declare const PLANNING_PROTOCOL: string;
|
|
152
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PlanningProposal } from './planningProtocol';
|
|
2
|
+
/**
|
|
3
|
+
* A fully rendered change retained in memory until the user explicitly saves it.
|
|
4
|
+
* @private internal type of `coder plan`
|
|
5
|
+
*/
|
|
6
|
+
export type PlanningChange = {
|
|
7
|
+
readonly path: string;
|
|
8
|
+
readonly before: string | null;
|
|
9
|
+
readonly after: string;
|
|
10
|
+
readonly draft: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Prepares an entire proposal set without writing. Exact replacements preserve unrelated content and line endings.
|
|
14
|
+
* @private internal utility of `coder plan`
|
|
15
|
+
*/
|
|
16
|
+
export declare function preparePlanningChanges(projectPath: string, proposals: ReadonlyArray<PlanningProposal>, templateOption: string | undefined): Promise<PlanningChange[]>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PlanningRead } from './planningProtocol';
|
|
2
|
+
/**
|
|
3
|
+
* Executes only the read operations in the planning protocol. Never evaluates a command from the model.
|
|
4
|
+
* @private internal utility of `coder plan`
|
|
5
|
+
*/
|
|
6
|
+
export declare function readPlanningContext(projectPath: string, request: PlanningRead): Promise<string>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves a repository path without traversing symlinks, junctions, device paths, or parent escapes.
|
|
3
|
+
* Writes additionally require an ordinary, singly linked PRD Markdown file in the active prompts directory.
|
|
4
|
+
* The queue loader reads only this directory; archives, templates and reusable context remain read-only.
|
|
5
|
+
* @private internal execution boundary of `coder plan`
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolvePlanningPath(projectPath: string, path: string, isWriting?: boolean): string;
|
|
@@ -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
|