@promptbook/remote-client
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
138 lines (137 loc) • 4.52 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;
/**
* 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;
};
/**
* Result of ensuring one default coder template file exists inside a project.
*
* @private internal utility of `ptbk coder`
*/
export type EnsuredCoderPromptTemplateFile = {
/**
* Stable built-in identifier of the template.
*/
readonly id: BuiltInCoderPromptTemplate;
/**
* Project-relative path of the materialized template file.
*/
readonly relativeFilePath: string;
/**
* Status describing whether the file had to be created.
*/
readonly status: InitializationStatus;
};
/**
* 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 the default project-owned coder template files exist without overwriting user customizations.
*
* @private internal utility of `ptbk coder`
*/
export declare function ensureDefaultCoderPromptTemplateFiles(projectPath: string): Promise<ReadonlyArray<EnsuredCoderPromptTemplateFile>>;
/**
* 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>;