@promptbook/types 0.114.0-41 → 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/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/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
|
@@ -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/types",
|
|
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,
|
|
@@ -93,6 +93,6 @@
|
|
|
93
93
|
"types": "./esm/src/_packages/types.index.d.ts",
|
|
94
94
|
"typings": "./esm/src/_packages/types.index.d.ts",
|
|
95
95
|
"peerDependencies": {
|
|
96
|
-
"@promptbook/core": "0.114.0-
|
|
96
|
+
"@promptbook/core": "0.114.0-47"
|
|
97
97
|
}
|
|
98
98
|
}
|
|
@@ -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;
|