23#include <unordered_map>
101 std::string resume_id =
"")
103 task(std::move(tsk)),
191 std::string r =
"user")
249 :
phase(std::move(p)) {
332 const std::vector<const Directive*>& directives);
340 void set_hooks(
const HookInterface& hooks) { hooks_ = hooks; }
350 bool fire_directive_hook(
const Directive* directive,
353 std::unordered_map<int, DirectiveHandler> handlers_;
354 HookInterface hooks_;
Processes tool directives via registry-based dispatch.
void register_handler(entropic_directive_type_t dtype, DirectiveHandler handler)
Register a handler for a directive type.
DirectiveResult process(LoopContext &ctx, const std::vector< const Directive * > &directives)
Process a list of directives.
void set_hooks(const HookInterface &hooks)
Set the hook dispatch interface.
Shared enumerations used across .so boundaries.
entropic_directive_type_t
Directive types emitted by MCP tool results.
@ ENTROPIC_DIRECTIVE_TIER_CHANGE
Switch active tier.
@ ENTROPIC_DIRECTIVE_STOP_PROCESSING
Halt directive processing.
@ ENTROPIC_DIRECTIVE_PRUNE_MESSAGES
Prune old tool results.
@ ENTROPIC_DIRECTIVE_INJECT_CONTEXT
Inject message into context.
@ ENTROPIC_DIRECTIVE_COMPLETE
Mark task complete.
@ ENTROPIC_DIRECTIVE_NOTIFY_PRESENTER
Generic UI notification passthrough.
@ ENTROPIC_DIRECTIVE_CLEAR_SELF_TODOS
Clear self-directed todos (engine no-op)
@ ENTROPIC_DIRECTIVE_PHASE_CHANGE
Switch active inference phase.
@ ENTROPIC_DIRECTIVE_PIPELINE
Multi-stage sequential execution.
@ ENTROPIC_DIRECTIVE_CONTEXT_ANCHOR
Replace context anchor.
@ ENTROPIC_DIRECTIVE_DELEGATE
Route to another identity.
Hook dispatch interface injected into engine subsystems.
Message struct for conversation history.
Activate model on GPU (WARM → ACTIVE).
std::function< void(LoopContext &ctx, const Directive &directive, DirectiveResult &result)> DirectiveHandler
Directive handler function type.
Clear self-directed todos (engine no-op).
ClearSelfTodosDirective()
Construct a ClearSelfTodos directive.
Signal explicit completion.
std::string summary
Completion summary.
bool coverage_gap
Suppresses auto-relay (#10, v2.1.4)
std::string gap_description
What the gap IS (#10, v2.1.4)
CompleteDirective(std::string s="")
Construct a Complete directive.
std::vector< std::string > suggested_files
Files for lead to inspect (#10, v2.1.4)
Update a keyed persistent context anchor.
std::string content
Anchor content (empty = remove)
ContextAnchorDirective(std::string k="", std::string c="")
Construct a ContextAnchor directive.
std::string key
Anchor key (unique, update-in-place)
Delegate a task to a child inference loop.
int max_turns
Max turns (-1 = default)
std::string target
Target tier for delegation.
std::string task
Task description.
std::string resume_from_delegation_id
gh#32 (v2.1.6): empty = fresh delegate
DelegateDirective(std::string tgt="", std::string tsk="", int mt=-1, std::string resume_id="")
Construct a Delegate directive.
Aggregate result of processing a batch of directives.
std::vector< Message > injected_messages
Messages to inject.
bool stop_processing
Halt further processing.
bool tier_changed
Tier was switched.
Base directive — all directives carry a type tag.
entropic_directive_type_t type
Discriminant for dispatch.
Inject a message into the conversation context.
std::string content
Content to inject.
std::string role
Message role.
InjectContextDirective(std::string c="", std::string r="user")
Construct an InjectContext directive.
Mutable state carried through the agentic loop.
Generic UI notification passthrough.
std::string key
Notification key.
NotifyPresenterDirective(std::string k="", std::string d="")
Construct a NotifyPresenter directive.
std::string data_json
Arbitrary JSON payload.
Switch the active inference phase.
std::string phase
Target phase name.
PhaseChangeDirective(std::string p="")
Construct a PhaseChange directive.
Execute a multi-stage delegation pipeline.
std::string task
Task description.
std::vector< std::string > stages
Tier names in order.
PipelineDirective(std::vector< std::string > s={}, std::string t="")
Construct a Pipeline directive.
Prune old tool results from context.
PruneMessagesDirective(int k=2)
Construct a PruneMessages directive.
int keep_recent
How many recent results to keep.
Stop processing remaining tool calls.
StopProcessingDirective()
Construct a StopProcessing directive.
std::string reason
Why the change was requested.
std::string tier
Target tier name.
TierChangeDirective(std::string t="", std::string r="")
Construct a TierChange directive.