|
Entropic 2.3.8
Local-first agentic inference engine
|
Prompt manager — frontmatter parsing, identity loading, assembly. More...
#include <entropic/entropic_export.h>#include <entropic/types/config.h>#include <filesystem>#include <optional>#include <string>#include <unordered_map>#include <vector>

Go to the source code of this file.
Classes | |
| struct | entropic::prompts::BenchmarkPrompt |
| A single benchmark prompt with quality checks. More... | |
| struct | entropic::prompts::BenchmarkSpec |
| Benchmark definition for an identity. More... | |
| struct | entropic::prompts::IdentityFrontmatter |
| Identity frontmatter — full tier identity metadata. More... | |
| struct | entropic::prompts::ParsedPrompt |
| Parsed prompt file result: type + version + body. More... | |
| struct | entropic::prompts::ParsedIdentity |
| Parsed identity file: frontmatter + body. More... | |
Namespaces | |
| namespace | entropic |
| Activate model on GPU (WARM → ACTIVE). | |
Typedefs | |
| using | entropic::prompts::PhaseConfig = entropic::PhaseConfig |
| Alias for PhaseConfig from types/ (canonical location). | |
Enumerations | |
| enum class | entropic::prompts::PromptType { CONSTITUTION , APP_CONTEXT , IDENTITY } |
| Prompt file type (frontmatter "type" field). More... | |
Functions | |
| ENTROPIC_EXPORT const char * | entropic::prompts::prompt_type_to_string (PromptType type) |
| Convert PromptType to string. | |
| ENTROPIC_EXPORT std::string | entropic::prompts::parse_prompt_file (const std::filesystem::path &path, PromptType expected_type, ParsedPrompt &result) |
| Parse a prompt file: validate frontmatter, return body. | |
| ENTROPIC_EXPORT std::string | entropic::prompts::load_identity (const std::filesystem::path &path, ParsedIdentity &identity) |
| Load an identity file: parse frontmatter + body. | |
| ENTROPIC_EXPORT std::string | entropic::prompts::load_constitution (const std::optional< std::filesystem::path > &constitution_path, bool disabled, const std::filesystem::path &data_dir, std::string &body) |
| Load constitution prompt with tri-state resolution. | |
| ENTROPIC_EXPORT std::string | entropic::prompts::load_app_context (const std::optional< std::filesystem::path > &app_context_path, bool disabled, const std::filesystem::path &data_dir, std::string &body) |
| Load app_context prompt with tri-state resolution. | |
| ENTROPIC_EXPORT std::string | entropic::prompts::resolve_tier_identity (const entropic::TierConfig &tier_config, const std::string &tier_name, const std::filesystem::path &data_dir) |
| Resolve the system prompt body for a named tier. | |
| ENTROPIC_EXPORT ParsedIdentity | entropic::prompts::resolve_tier_identity_full (const entropic::TierConfig &tier_config, const std::string &tier_name, const std::filesystem::path &data_dir) |
| Resolve full parsed identity (body + frontmatter) for a tier. | |
| ENTROPIC_EXPORT std::string | entropic::prompts::assemble (const entropic::ParsedConfig &config, const std::filesystem::path &data_dir) |
| Assemble the full system prompt from config. | |
Prompt manager — frontmatter parsing, identity loading, assembly.
Ports Python's PromptManager and parse_prompt_file(). Handles constitution, app_context, and per-tier identity prompt files.
Definition in file manager.h.
| using entropic::prompts::PhaseConfig = typedef entropic::PhaseConfig |
|
strong |
| std::string entropic::prompts::assemble | ( | const entropic::ParsedConfig & | config, |
| const std::filesystem::path & | data_dir | ||
| ) |
Assemble the full system prompt from config.
Loads constitution, app_context, and default tier identity, then concatenates them. Used by the facade during configure.
| config | Parsed engine config. |
| data_dir | Bundled data directory. |
Loads constitution, app_context, and default tier identity, then concatenates. The data_dir is used for bundled fallback paths.
| config | Parsed engine config. |
| data_dir | Bundled data directory. |
Definition at line 515 of file manager.cpp.
| std::string entropic::prompts::load_app_context | ( | const std::optional< std::filesystem::path > & | app_context_path, |
| bool | disabled, | ||
| const std::filesystem::path & | data_dir, | ||
| std::string & | body | ||
| ) |
Load app_context prompt with tri-state resolution.
Resolution order: if disabled or app_context_path is nullopt, body is left empty (no bundled fallback — app_context is opt-in). If a path is provided and is a bare filename, it is resolved relative to data_dir/prompts/. Absolute paths and paths with directory components are used as-is.
| app_context_path | Custom path (nullopt = disabled by default). | |
| disabled | true if app_context explicitly disabled. | |
| data_dir | Bundled data directory used to resolve bare filenames. | |
| [out] | body | Output app_context text (empty if disabled or nullopt). |
| app_context_path | Custom path (nullopt = disabled). | |
| disabled | true if app_context explicitly disabled. | |
| data_dir | Bundled data directory. | |
| [out] | body | Output app_context text. |
Definition at line 406 of file manager.cpp.
| std::string entropic::prompts::load_constitution | ( | const std::optional< std::filesystem::path > & | constitution_path, |
| bool | disabled, | ||
| const std::filesystem::path & | data_dir, | ||
| std::string & | body | ||
| ) |
Load constitution prompt with tri-state resolution.
| constitution_path | Custom path (nullopt = bundled). | |
| disabled | true if constitution explicitly disabled. | |
| data_dir | Bundled data directory for fallback. | |
| [out] | body | Output constitution text (empty if disabled). |
| constitution_path | Custom path (nullopt = bundled). | |
| disabled | true if constitution explicitly disabled. | |
| data_dir | Bundled data directory. | |
| [out] | body | Output constitution text. |
Definition at line 362 of file manager.cpp.
| std::string entropic::prompts::load_identity | ( | const std::filesystem::path & | path, |
| ParsedIdentity & | identity | ||
| ) |
Load an identity file: parse frontmatter + body.
Convenience wrapper that additionally parses all IdentityFrontmatter fields.
| path | Path to identity .md file. | |
| [out] | identity | Output parsed identity. |
| path | Path to identity .md file. | |
| [out] | identity | Output parsed identity. |
Definition at line 308 of file manager.cpp.
| std::string entropic::prompts::parse_prompt_file | ( | const std::filesystem::path & | path, |
| PromptType | expected_type, | ||
| ParsedPrompt & | result | ||
| ) |
Parse a prompt file: validate frontmatter, return body.
File format: YAML frontmatter between — delimiters, followed by markdown body.
| path | Path to .md prompt file. | |
| expected_type | Expected frontmatter type. | |
| [out] | result | Output: type, version, body. |
| path | Path to .md prompt file. | |
| expected_type | Expected frontmatter type. | |
| [out] | result | Output: type, version, body. |
Definition at line 134 of file manager.cpp.
| const char * entropic::prompts::prompt_type_to_string | ( | PromptType | type | ) |
Convert PromptType to string.
| type | Prompt type. |
| type | Prompt type. |
Definition at line 92 of file manager.cpp.
| std::string entropic::prompts::resolve_tier_identity | ( | const entropic::TierConfig & | tier_config, |
| const std::string & | tier_name, | ||
| const std::filesystem::path & | data_dir | ||
| ) |
Resolve the system prompt body for a named tier.
Body-only wrapper around resolve_tier_identity_full.
Looks up the tier in config, resolves the identity file path (explicit, bundled convention, or disabled), loads it, and returns the markdown body. Encapsulates the path convention "identity_{tier_name}.md" in one place.
| tier_config | Tier configuration. |
| tier_name | Tier name (for default path convention). |
| data_dir | Bundled data directory. |
| tier_config | Tier configuration. |
| tier_name | Tier name (for default path convention). |
| data_dir | Bundled data directory. |
Definition at line 494 of file manager.cpp.
| ParsedIdentity entropic::prompts::resolve_tier_identity_full | ( | const entropic::TierConfig & | tier_config, |
| const std::string & | tier_name, | ||
| const std::filesystem::path & | data_dir | ||
| ) |
Resolve full parsed identity (body + frontmatter) for a tier.
Resolve a full parsed identity (body + frontmatter) for a tier.
Same resolution rules as resolve_tier_identity() but returns the full ParsedIdentity so callers can read frontmatter fields (max_iterations, max_tool_calls_per_turn, etc.) that are discarded by the body-only variant. Returns an empty-body ParsedIdentity if no identity file is found. (E6, 2.0.6-rc18)
| tier_config | Tier configuration. |
| tier_name | Tier name (for default path convention). |
| data_dir | Bundled data directory. |
Path convention:
| tier_config | Tier configuration. |
| tier_name | Tier name (for default path convention). |
| data_dir | Bundled data directory. |
Definition at line 458 of file manager.cpp.