@promptbook/cli 0.112.0-35 → 0.112.0-36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -18
- package/esm/index.es.js +525 -85
- package/esm/index.es.js.map +1 -1
- package/esm/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +127 -0
- package/esm/src/cli/cli-commands/coder/boilerplateTemplates.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/init.d.ts +38 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +523 -83
- package/umd/index.umd.js.map +1 -1
- package/umd/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +127 -0
- package/umd/src/cli/cli-commands/coder/boilerplateTemplates.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +10 -0
- package/umd/src/cli/cli-commands/coder/init.d.ts +38 -0
- package/umd/src/version.d.ts +1 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relative path to the root prompts directory used by Promptbook coder utilities.
|
|
3
|
+
*
|
|
4
|
+
* @private internal utility of `ptbk coder`
|
|
5
|
+
*/
|
|
6
|
+
export declare const PROMPTS_DIRECTORY_PATH = "prompts";
|
|
7
|
+
/**
|
|
8
|
+
* Relative path to the archive directory used by `coder verify`.
|
|
9
|
+
*
|
|
10
|
+
* @private internal utility of `ptbk coder`
|
|
11
|
+
*/
|
|
12
|
+
export declare const PROMPTS_DONE_DIRECTORY_PATH: string;
|
|
13
|
+
/**
|
|
14
|
+
* Relative path to the project-owned boilerplate templates directory.
|
|
15
|
+
*
|
|
16
|
+
* @private internal utility of `ptbk coder`
|
|
17
|
+
*/
|
|
18
|
+
export declare const PROMPTS_TEMPLATES_DIRECTORY_PATH: string;
|
|
19
|
+
/**
|
|
20
|
+
* Initialization statuses used when creating or updating coder configuration artifacts.
|
|
21
|
+
*
|
|
22
|
+
* @private internal utility of `ptbk coder`
|
|
23
|
+
*/
|
|
24
|
+
export type InitializationStatus = 'created' | 'updated' | 'unchanged';
|
|
25
|
+
/**
|
|
26
|
+
* Identifiers of built-in coder boilerplate templates.
|
|
27
|
+
*
|
|
28
|
+
* @private internal utility of `ptbk coder`
|
|
29
|
+
*/
|
|
30
|
+
export type BuiltInCoderPromptTemplate = 'common' | 'agents-server';
|
|
31
|
+
/**
|
|
32
|
+
* One built-in coder boilerplate template definition.
|
|
33
|
+
*
|
|
34
|
+
* @private internal utility of `ptbk coder`
|
|
35
|
+
*/
|
|
36
|
+
export type CoderPromptTemplateDefinition = {
|
|
37
|
+
/**
|
|
38
|
+
* Stable built-in identifier that can also be used as a CLI shorthand.
|
|
39
|
+
*/
|
|
40
|
+
readonly id: BuiltInCoderPromptTemplate;
|
|
41
|
+
/**
|
|
42
|
+
* Project-relative path where `ptbk coder init` materializes the template file.
|
|
43
|
+
*/
|
|
44
|
+
readonly relativeFilePath: string;
|
|
45
|
+
/**
|
|
46
|
+
* Prefix inserted into generated prompt file slugs.
|
|
47
|
+
*/
|
|
48
|
+
readonly slugPrefix: string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Markdown content of the template.
|
|
51
|
+
*/
|
|
52
|
+
readonly content: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Result of ensuring one default coder template file exists inside a project.
|
|
56
|
+
*
|
|
57
|
+
* @private internal utility of `ptbk coder`
|
|
58
|
+
*/
|
|
59
|
+
export type EnsuredCoderPromptTemplateFile = {
|
|
60
|
+
/**
|
|
61
|
+
* Stable built-in identifier of the template.
|
|
62
|
+
*/
|
|
63
|
+
readonly id: BuiltInCoderPromptTemplate;
|
|
64
|
+
/**
|
|
65
|
+
* Project-relative path of the materialized template file.
|
|
66
|
+
*/
|
|
67
|
+
readonly relativeFilePath: string;
|
|
68
|
+
/**
|
|
69
|
+
* Status describing whether the file had to be created.
|
|
70
|
+
*/
|
|
71
|
+
readonly status: InitializationStatus;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Fully resolved boilerplate template used by `coder generate-boilerplates`.
|
|
75
|
+
*
|
|
76
|
+
* @private internal utility of `ptbk coder`
|
|
77
|
+
*/
|
|
78
|
+
export type ResolvedCoderPromptTemplate = {
|
|
79
|
+
/**
|
|
80
|
+
* Identifier or relative file path that was resolved.
|
|
81
|
+
*/
|
|
82
|
+
readonly identifier: string;
|
|
83
|
+
/**
|
|
84
|
+
* Project-relative path when the template corresponds to a project file.
|
|
85
|
+
*/
|
|
86
|
+
readonly relativeFilePath?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Markdown content of the resolved template.
|
|
89
|
+
*/
|
|
90
|
+
readonly content: string;
|
|
91
|
+
/**
|
|
92
|
+
* Prefix inserted into generated prompt file slugs.
|
|
93
|
+
*/
|
|
94
|
+
readonly slugPrefix: string | null;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Lists the built-in coder boilerplate templates.
|
|
98
|
+
*
|
|
99
|
+
* @private internal utility of `ptbk coder`
|
|
100
|
+
*/
|
|
101
|
+
export declare function getDefaultCoderPromptTemplateDefinitions(): ReadonlyArray<CoderPromptTemplateDefinition>;
|
|
102
|
+
/**
|
|
103
|
+
* Resolves one built-in coder boilerplate template definition by its stable identifier.
|
|
104
|
+
*
|
|
105
|
+
* @private internal utility of `ptbk coder`
|
|
106
|
+
*/
|
|
107
|
+
export declare function getDefaultCoderPromptTemplateDefinition(template: BuiltInCoderPromptTemplate): CoderPromptTemplateDefinition;
|
|
108
|
+
/**
|
|
109
|
+
* Ensures the default project-owned coder template files exist without overwriting user customizations.
|
|
110
|
+
*
|
|
111
|
+
* @private internal utility of `ptbk coder`
|
|
112
|
+
*/
|
|
113
|
+
export declare function ensureDefaultCoderPromptTemplateFiles(projectPath: string): Promise<ReadonlyArray<EnsuredCoderPromptTemplateFile>>;
|
|
114
|
+
/**
|
|
115
|
+
* Resolves the template requested by `coder generate-boilerplates`.
|
|
116
|
+
*
|
|
117
|
+
* Supports three modes:
|
|
118
|
+
* - omitted option => built-in `common`
|
|
119
|
+
* - built-in alias => one of the shared default templates
|
|
120
|
+
* - relative path => markdown template file resolved from the project root
|
|
121
|
+
*
|
|
122
|
+
* @private internal utility of `ptbk coder`
|
|
123
|
+
*/
|
|
124
|
+
export declare function resolveCoderPromptTemplate({ projectPath, templateOption, }: {
|
|
125
|
+
readonly projectPath: string;
|
|
126
|
+
readonly templateOption?: string;
|
|
127
|
+
}): Promise<ResolvedCoderPromptTemplate>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,3 +8,13 @@ import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
|
8
8
|
* @private internal function of `promptbookCli`
|
|
9
9
|
*/
|
|
10
10
|
export declare function $initializeCoderGenerateBoilerplatesCommand(program: Program): $side_effect;
|
|
11
|
+
/**
|
|
12
|
+
* Generates boilerplate prompt files with unique emoji tags.
|
|
13
|
+
*
|
|
14
|
+
* @private internal function of `generatePromptBoilerplate` command
|
|
15
|
+
*/
|
|
16
|
+
export declare function generatePromptBoilerplate({ projectPath, filesCount, templateOption, }: {
|
|
17
|
+
readonly projectPath: string;
|
|
18
|
+
readonly filesCount: number;
|
|
19
|
+
readonly templateOption?: string;
|
|
20
|
+
}): Promise<void>;
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import type { Command as Program } from 'commander';
|
|
2
2
|
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
3
|
+
import { type EnsuredCoderPromptTemplateFile, type InitializationStatus } from './boilerplateTemplates';
|
|
4
|
+
/**
|
|
5
|
+
* Generic JSON object used for standalone coder configuration files.
|
|
6
|
+
*/
|
|
7
|
+
type JsonObject = Record<string, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* Result summary returned after coder configuration initialization.
|
|
10
|
+
*/
|
|
11
|
+
type CoderInitializationSummary = {
|
|
12
|
+
readonly promptsDirectoryStatus: InitializationStatus;
|
|
13
|
+
readonly promptsDoneDirectoryStatus: InitializationStatus;
|
|
14
|
+
readonly promptsTemplatesDirectoryStatus: InitializationStatus;
|
|
15
|
+
readonly promptTemplateFileStatuses: ReadonlyArray<EnsuredCoderPromptTemplateFile>;
|
|
16
|
+
readonly envFileStatus: InitializationStatus;
|
|
17
|
+
readonly gitignoreFileStatus: InitializationStatus;
|
|
18
|
+
readonly packageJsonFileStatus: InitializationStatus;
|
|
19
|
+
readonly vscodeSettingsFileStatus: InitializationStatus;
|
|
20
|
+
readonly initializedEnvVariableNames: ReadonlyArray<string>;
|
|
21
|
+
};
|
|
3
22
|
/**
|
|
4
23
|
* Initializes `coder init` command for Promptbook CLI utilities.
|
|
5
24
|
*
|
|
@@ -8,3 +27,22 @@ import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
|
8
27
|
* @private internal function of `promptbookCli`
|
|
9
28
|
*/
|
|
10
29
|
export declare function $initializeCoderInitCommand(program: Program): $side_effect;
|
|
30
|
+
/**
|
|
31
|
+
* Lists the default npm scripts initialized by `ptbk coder init`.
|
|
32
|
+
*
|
|
33
|
+
* @private internal utility of `coder init` command
|
|
34
|
+
*/
|
|
35
|
+
export declare function getDefaultCoderPackageJsonScripts(): Readonly<Record<string, string>>;
|
|
36
|
+
/**
|
|
37
|
+
* Lists the default VS Code settings initialized by `ptbk coder init`.
|
|
38
|
+
*
|
|
39
|
+
* @private internal utility of `coder init` command
|
|
40
|
+
*/
|
|
41
|
+
export declare function getDefaultCoderVscodeSettings(): Readonly<JsonObject>;
|
|
42
|
+
/**
|
|
43
|
+
* Creates or updates all coder configuration artifacts required in the current project.
|
|
44
|
+
*
|
|
45
|
+
* @private internal utility of `coder init` command
|
|
46
|
+
*/
|
|
47
|
+
export declare function initializeCoderProjectConfiguration(projectPath: string): Promise<CoderInitializationSummary>;
|
|
48
|
+
export {};
|
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.112.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.112.0-35`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|