@promptbook/google
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
149 lines (148 loc) • 4.96 kB
TypeScript
/**
* Relative path to the root prompts directory used by Promptbook coder utilities.
*
* @private internal utility of `ptbk coder`
*/
export declare const PROMPTS_DIRECTORY_PATH = "prompts";
/**
* Relative path to the archive directory used by `coder verify`.
*
* @private internal utility of `ptbk coder`
*/
export declare const PROMPTS_DONE_DIRECTORY_PATH: string;
/**
* Relative path to the project-owned boilerplate templates directory.
*
* @private internal utility of `ptbk coder`
*/
export declare const PROMPTS_TEMPLATES_DIRECTORY_PATH: string;
/**
* Relative path to the project-agnostic `common` boilerplate template referenced by the default coder scripts.
*
* @private internal utility of `ptbk coder`
*/
export declare const COMMON_PROMPT_TEMPLATE_FILE_PATH: string;
/**
* Initialization statuses used when creating or updating coder configuration artifacts.
*
* @private internal utility of `ptbk coder`
*/
export type InitializationStatus = 'created' | 'updated' | 'unchanged';
/**
* Identifiers of built-in coder boilerplate templates.
*
* @private internal utility of `ptbk coder`
*/
export type BuiltInCoderPromptTemplate = 'common' | 'agents-server';
/**
* One built-in coder boilerplate template definition.
*
* @private internal utility of `ptbk coder`
*/
export type CoderPromptTemplateDefinition = {
/**
* Stable built-in identifier that can also be used as a CLI shorthand.
*/
readonly id: BuiltInCoderPromptTemplate;
/**
* Project-relative path where `ptbk coder init` materializes the template file.
*/
readonly relativeFilePath: string;
/**
* Prefix inserted into generated prompt file slugs.
*/
readonly slugPrefix: string | null;
/**
* Markdown content of the template.
*/
readonly content: string;
/**
* Whether `ptbk coder init` should materialize this template into project-owned files.
*/
readonly isDefaultProjectTemplate: boolean;
};
/**
* Fully resolved boilerplate template used by `coder generate-boilerplates`.
*
* @private internal utility of `ptbk coder`
*/
export type ResolvedCoderPromptTemplate = {
/**
* Identifier or relative file path that was resolved.
*/
readonly identifier: string;
/**
* Project-relative path when the template corresponds to a project file.
*/
readonly relativeFilePath?: string;
/**
* Markdown content of the resolved template.
*/
readonly content: string;
/**
* Prefix inserted into generated prompt file slugs.
*/
readonly slugPrefix: string | null;
};
/**
* Lists the built-in coder boilerplate templates.
*
* @private internal utility of `ptbk coder`
*/
export declare function getDefaultCoderPromptTemplateDefinitions(): ReadonlyArray<CoderPromptTemplateDefinition>;
/**
* Lists the built-in coder prompt templates that are safe to initialize in any project.
*
* @private internal utility of `ptbk coder`
*/
export declare function getDefaultCoderProjectPromptTemplateDefinitions(): ReadonlyArray<CoderPromptTemplateDefinition>;
/**
* Resolves one built-in coder boilerplate template definition by its stable identifier.
*
* @private internal utility of `ptbk coder`
*/
export declare function getDefaultCoderPromptTemplateDefinition(template: BuiltInCoderPromptTemplate): CoderPromptTemplateDefinition;
/**
* Ensures one project-owned coder template file exists without overwriting user customizations.
*
* @private internal utility of `ptbk coder`
*/
export declare function ensureDefaultCoderPromptTemplateFile(projectPath: string, definition: CoderPromptTemplateDefinition): Promise<InitializationStatus>;
/**
* Resolves the template requested by `coder generate-boilerplates`.
*
* Supports three modes:
* - omitted option => built-in `common`
* - built-in alias => one of the shared default templates
* - relative path => markdown template file resolved from the project root
*
* @private internal utility of `ptbk coder`
*/
export declare function resolveCoderPromptTemplate({ projectPath, templateOption, }: {
readonly projectPath: string;
readonly templateOption?: string;
}): Promise<ResolvedCoderPromptTemplate>;
/**
* Builds one prompt section (status line, emoji-tagged title, and body) shared by
* `coder generate-boilerplates` and `coder add`.
*
* @private internal utility of `ptbk coder`
*/
export declare function buildCoderPromptSection({ statusLine, emojiTag, title, body, }: {
/**
* Checklist status marker of the section, for example `[-]`, `[ ]`, or `[ ] !!`.
*/
readonly statusLine: string;
/**
* Emoji tag rendered before the title, for example `[✨🪴]`.
*/
readonly emojiTag: string;
/**
* Single-line title rendered right after the emoji tag.
*/
readonly title: string;
/**
* Markdown body rendered below the title.
*/
readonly body: string;
}): string;