Entropic 2.14.3
Local-first agentic inference engine
Loading...
Searching...
No Matches
manager.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
12#pragma once
13
16
17#include <filesystem>
18#include <optional>
19#include <string>
20#include <unordered_map>
21#include <vector>
22
23namespace entropic::prompts {
24
28
33enum class PromptType {
36 IDENTITY,
37};
38
44 std::string prompt;
45 std::vector<std::string> checks_yaml;
46};
47
53 std::vector<BenchmarkPrompt> prompts;
54};
55
66 PromptType type = PromptType::IDENTITY;
67 int version = 1;
68
69 std::string name;
70 std::vector<std::string> focus;
71 std::vector<std::string> examples;
72 std::optional<std::string> grammar;
73 std::optional<std::string> auto_chain;
74 std::optional<std::vector<std::string>> allowed_tools;
75 std::optional<std::vector<std::string>> bash_commands;
76 std::optional<int> max_output_tokens;
77 std::optional<float> temperature;
78 std::optional<float> top_p;
79 std::optional<int> top_k;
80 std::optional<float> min_p;
81 std::optional<float> presence_penalty;
82 std::optional<float> frequency_penalty;
83 std::optional<float> repeat_penalty;
84 std::optional<bool> enable_thinking;
85 bool interstitial = false;
86 bool routable = true;
87 std::optional<bool> explicit_completion;
88 std::vector<std::string> validation_rules;
89 bool relay_single_delegate = false;
90 int max_iterations = -1;
93 std::optional<std::unordered_map<std::string, PhaseConfig>> phases;
94 std::optional<BenchmarkSpec> benchmark;
95};
96
103 int version = 1;
104 std::string body;
105};
106
115
122ENTROPIC_EXPORT const char* prompt_type_to_string(PromptType type);
123
136ENTROPIC_EXPORT std::string parse_prompt_file(
137 const std::filesystem::path& path,
139 ParsedPrompt& result);
140
152ENTROPIC_EXPORT std::string load_identity(
153 const std::filesystem::path& path,
154 ParsedIdentity& identity);
155
167enum class AppContextState {
169 DISABLED,
170 INLINE,
171 FROM_PATH,
172};
173
186ENTROPIC_EXPORT AppContextState classify_app_context(
187 const std::optional<std::filesystem::path>& app_context_path,
188 const std::optional<std::string>& app_context_content,
189 bool disabled);
190
202ENTROPIC_EXPORT const char* app_context_state_message(AppContextState state);
203
214ENTROPIC_EXPORT std::string load_constitution(
215 const std::optional<std::filesystem::path>& constitution_path,
216 bool disabled,
217 const std::filesystem::path& data_dir,
218 std::string& body);
219
236ENTROPIC_EXPORT std::string load_app_context(
237 const std::optional<std::filesystem::path>& app_context_path,
238 const std::optional<std::string>& app_context_content,
239 bool disabled,
240 const std::filesystem::path& data_dir,
241 std::string& body);
242
263ENTROPIC_EXPORT void load_shared_prompt_sources(
264 const entropic::ParsedConfig& config,
265 const std::filesystem::path& data_dir,
266 std::string& constitution,
267 std::string& app_context);
268
285ENTROPIC_EXPORT std::string validate_configured_prompts(
286 const entropic::ParsedConfig& config,
287 const std::filesystem::path& data_dir);
288
303ENTROPIC_EXPORT std::string resolve_tier_identity(
305 const std::string& tier_name,
306 const std::filesystem::path& data_dir);
307
323ENTROPIC_EXPORT ParsedIdentity resolve_tier_identity_full(
325 const std::string& tier_name,
326 const std::filesystem::path& data_dir);
327
339ENTROPIC_EXPORT std::string assemble(
340 const entropic::ParsedConfig& config,
341 const std::filesystem::path& data_dir);
342
343} // namespace entropic::prompts
Configuration structs with defaults.
Symbol visibility macro for all exported symbols.
ENTROPIC_EXPORT const char * prompt_type_to_string(PromptType type)
Convert PromptType to string.
Definition manager.cpp:92
AppContextState
Which app_context spelling a config is using (gh#163).
Definition manager.h:167
@ DISABLED
app_context: false — an explicit opt-out.
@ FROM_PATH
app_context: <path>.
@ NOT_CONFIGURED
No app_context key at all.
@ INLINE
app_context: {content: ...} (gh#141).
ENTROPIC_EXPORT std::string load_identity(const std::filesystem::path &path, ParsedIdentity &identity)
Load an identity file: parse frontmatter + body.
Definition manager.cpp:340
PromptType
Prompt file type (frontmatter "type" field).
Definition manager.h:33
@ APP_CONTEXT
Application context prompt.
@ IDENTITY
Tier identity prompt.
@ CONSTITUTION
Constitution prompt.
ENTROPIC_EXPORT std::string parse_prompt_file(const std::filesystem::path &path, PromptType expected_type, ParsedPrompt &result)
Parse a prompt file: validate frontmatter, return body.
Definition manager.cpp:134
@ disabled
Named in disabled_mcpjson_servers — never connect.
@ optional
optional: every escape asks the host's path approver
Full parsed configuration.
Definition config.h:1338
Inference parameters for a single identity phase.
Definition config.h:1456
Tier-specific model configuration.
Definition config.h:547
A single benchmark prompt with quality checks.
Definition manager.h:43
std::vector< std::string > checks_yaml
Check defs as YAML strings.
Definition manager.h:45
std::string prompt
Prompt text.
Definition manager.h:44
Benchmark definition for an identity.
Definition manager.h:52
std::vector< BenchmarkPrompt > prompts
Benchmark prompts.
Definition manager.h:53
Identity frontmatter — full tier identity metadata.
Definition manager.h:65
std::vector< std::string > validation_rules
Per-identity constitutional rules (v2.0.6)
Definition manager.h:88
std::optional< std::vector< std::string > > allowed_tools
Tool filter.
Definition manager.h:74
std::optional< float > top_p
Per-tier top_p (gh#85); nullopt = use param default.
Definition manager.h:78
std::optional< float > repeat_penalty
Per-tier repeat_penalty (gh#86); nullopt = use param default.
Definition manager.h:83
std::optional< std::string > auto_chain
Auto-chain target tier.
Definition manager.h:73
int max_iterations
Per-identity loop iteration cap; -1 = use global (E6)
Definition manager.h:90
std::optional< float > min_p
Per-tier min_p (gh#85); nullopt = use param default.
Definition manager.h:80
std::vector< std::string > focus
Focus areas (min 1)
Definition manager.h:70
std::optional< float > presence_penalty
Per-tier presence_penalty (gh#85); nullopt = use param default.
Definition manager.h:81
PromptType type
Always IDENTITY.
Definition manager.h:66
std::optional< bool > enable_thinking
Per-tier thinking mode (gh#86); nullopt = use param default.
Definition manager.h:84
std::optional< int > max_output_tokens
Per-tier max output tokens (gh#82); nullopt = use param default.
Definition manager.h:76
std::string name
Tier name (e.g., "lead")
Definition manager.h:69
bool routable
Visible to router.
Definition manager.h:86
std::optional< int > top_k
Per-tier top_k (gh#85); nullopt = use param default.
Definition manager.h:79
bool relay_single_delegate
Skip re-synthesis when single delegate returns (v2.0.11)
Definition manager.h:89
std::optional< std::vector< std::string > > bash_commands
Allowed bash commands.
Definition manager.h:75
std::optional< float > frequency_penalty
Per-tier frequency_penalty (gh#85); nullopt = use param default.
Definition manager.h:82
int max_tool_calls_per_turn
Per-identity tool call cap; -1 = use global (E6)
Definition manager.h:91
bool interstitial
Interstitial role.
Definition manager.h:85
int max_consecutive_empty_turns
Per-identity empty-turn allowance; -1 = use global default (gh#123)
Definition manager.h:92
std::optional< std::unordered_map< std::string, PhaseConfig > > phases
Named phases.
Definition manager.h:93
std::vector< std::string > examples
Few-shot examples.
Definition manager.h:71
std::optional< BenchmarkSpec > benchmark
Benchmark definition.
Definition manager.h:94
std::optional< std::string > grammar
Grammar file reference.
Definition manager.h:72
std::optional< bool > explicit_completion
Requires explicit completion; nullopt = derive from auto_chain (gh#117)
Definition manager.h:87
std::optional< float > temperature
Per-tier sampling temperature (gh#82); nullopt = use param default.
Definition manager.h:77
Parsed identity file: frontmatter + body.
Definition manager.h:111
IdentityFrontmatter frontmatter
Full identity metadata.
Definition manager.h:112
std::string body
Markdown system prompt body.
Definition manager.h:113
Parsed prompt file result: type + version + body.
Definition manager.h:101
PromptType type
Prompt type.
Definition manager.h:102
std::string body
Markdown body after frontmatter.
Definition manager.h:104
int version
Schema version.
Definition manager.h:103