include/entropic/core/directives.h¶
include/entropic/core/directives.h
Types
using entropic::DirectiveHandler = typedef std::function<void( LoopContext& ctx, const Directive& directive, DirectiveResult& result)>
Directive handler function type.
- Parameters
ctx— Current loop context (mutable).directive— The directive to process.result— Aggregate result (accumulator).
entropic::ClearSelfTodosDirective
Clear self-directed todos (engine no-op).
Inherits from entropic::Directive.
entropic::ClearSelfTodosDirective::ClearSelfTodosDirective()
Construct a ClearSelfTodos directive.
entropic::CompleteDirective
Signal explicit completion.
Inherits from entropic::Directive.
std::string entropic::CompleteDirective::summary
Completion summary.
bool entropic::CompleteDirective::coverage_gap
Suppresses auto-relay (#10, v2.1.4)
std::string entropic::CompleteDirective::gap_description
What the gap IS (#10, v2.1.4)
std::vector<std::string> entropic::CompleteDirective::suggested_files
Files for lead to inspect (#10, v2.1.4)
entropic::CompleteDirective::CompleteDirective(std::string s="")
Construct a Complete directive.
- Parameters
s— Summary.
entropic::ContextAnchorDirective
Update a keyed persistent context anchor.
Inherits from entropic::Directive.
std::string entropic::ContextAnchorDirective::key
Anchor key (unique, update-in-place)
std::string entropic::ContextAnchorDirective::content
Anchor content (empty = remove)
entropic::ContextAnchorDirective::ContextAnchorDirective(std::string k="", std::string c="")
Construct a ContextAnchor directive.
- Parameters
k— Key.c— Content.
entropic::ContextRef
One file the lead already paid to find (gh#162, v2.13.0).
std::string entropic::ContextRef::path
Repo-relative (or absolute) file path.
std::string entropic::ContextRef::lines
Optional line range, e.g. "40-95" ("" = whole file)
std::string entropic::ContextRef::note
Optional one-line reason this file matters.
entropic::DelegateDirective
Delegate a task to a child inference loop.
Inherits from entropic::Directive.
std::string entropic::DelegateDirective::target
Target tier for delegation.
std::string entropic::DelegateDirective::task
Task description.
int entropic::DelegateDirective::max_turns
Max turns (-1 = default)
std::string entropic::DelegateDirective::resume_from_delegation_id
gh#32 (v2.1.6): empty = fresh delegate
std::vector<ContextRef> entropic::DelegateDirective::context
gh#162 (v2.13.0): seeded file references
bool entropic::DelegateDirective::resume_by_target
gh#162 (v2.13.0): resume the most recent delegation to target instead of naming a storage id.
The id is resolved by the engine at admission, because the tool cannot see storage.
entropic::DelegateDirective::DelegateDirective(std::string tgt="", std::string tsk="", int mt=-1, std::string resume_id="")
Construct a Delegate directive.
- Parameters
tgt— Target tier.tsk— Task description.mt— Max turns.resume_id— Optional delegation id to resume from (gh#32).
entropic::Directive
Base directive — all directives carry a type tag.
Derived by entropic::ClearSelfTodosDirective, entropic::CompleteDirective, entropic::ContextAnchorDirective, entropic::DelegateDirective, entropic::InjectContextDirective, entropic::NotifyPresenterDirective, entropic::PhaseChangeDirective, entropic::PipelineDirective, entropic::PruneMessagesDirective, entropic::StopProcessingDirective, entropic::TierChangeDirective.
entropic_directive_type_t entropic::Directive::type
Discriminant for dispatch.
entropic::DirectiveProcessor
Processes tool directives via registry-based dispatch.
void entropic::DirectiveProcessor::register_handler(entropic_directive_type_t dtype, DirectiveHandler handler)
Register a handler for a directive type.
- Parameters
dtype— Directive type enum value.handler— Handler function.
DirectiveResult entropic::DirectiveProcessor::process(LoopContext &ctx, const std::vector< const Directive * > &directives)
Process a list of directives.
Process a list of directives, dispatching to handlers.
- Parameters
ctx— Current loop context.directives— Typed directive list.
- Returns
- Aggregate result.
void entropic::DirectiveProcessor::set_hooks(const HookInterface &hooks)
Set the hook dispatch interface.
- Parameters
hooks— Hook dispatch interface.
entropic::DirectiveResult
Aggregate result of processing a batch of directives.
bool entropic::DirectiveResult::stop_processing
Halt further processing.
bool entropic::DirectiveResult::tier_changed
Tier was switched.
std::vector<Message> entropic::DirectiveResult::injected_messages
Messages to inject.
entropic::InjectContextDirective
Inject a message into the conversation context.
Inherits from entropic::Directive.
std::string entropic::InjectContextDirective::content
Content to inject.
std::string entropic::InjectContextDirective::role
Message role.
entropic::InjectContextDirective::InjectContextDirective(std::string c="", std::string r="user")
Construct an InjectContext directive.
- Parameters
c— Content.r— Role.
entropic::NotifyPresenterDirective
Generic UI notification passthrough.
Inherits from entropic::Directive.
std::string entropic::NotifyPresenterDirective::key
Notification key.
std::string entropic::NotifyPresenterDirective::data_json
Arbitrary JSON payload.
entropic::NotifyPresenterDirective::NotifyPresenterDirective(std::string k="", std::string d="")
Construct a NotifyPresenter directive.
- Parameters
k— Key.d— Data JSON.
entropic::PhaseChangeDirective
Switch the active inference phase.
Inherits from entropic::Directive.
std::string entropic::PhaseChangeDirective::phase
Target phase name.
entropic::PhaseChangeDirective::PhaseChangeDirective(std::string p="")
Construct a PhaseChange directive.
- Parameters
p— Phase name.
entropic::PipelineDirective
Execute a multi-stage delegation pipeline.
Inherits from entropic::Directive.
std::vector<std::string> entropic::PipelineDirective::stages
Tier names in order.
std::string entropic::PipelineDirective::task
Task description.
std::vector<ContextRef> entropic::PipelineDirective::context
gh#162 (v2.13.0): seeded file references
entropic::PipelineDirective::PipelineDirective(std::vector< std::string > s={}, std::string t="")
Construct a Pipeline directive.
- Parameters
s— Stages.t— Task.
entropic::PruneMessagesDirective
Prune old tool results from context.
Inherits from entropic::Directive.
int entropic::PruneMessagesDirective::keep_recent
How many recent results to keep.
entropic::PruneMessagesDirective::PruneMessagesDirective(int k=2)
Construct a PruneMessages directive.
- Parameters
k— Keep recent count.
entropic::StopProcessingDirective
Stop processing remaining tool calls.
Inherits from entropic::Directive.
entropic::StopProcessingDirective::StopProcessingDirective()
Construct a StopProcessing directive.
entropic::TierChangeDirective
Request a tier change.
Inherits from entropic::Directive.
std::string entropic::TierChangeDirective::tier
Target tier name.
std::string entropic::TierChangeDirective::reason
Why the change was requested.
entropic::TierChangeDirective::TierChangeDirective(std::string t="", std::string r="")
Construct a TierChange directive.
- Parameters
t— Target tier.r— Reason.