41 const std::vector<const Directive*>& directives) {
42 logger->info(
"Processing {} directive(s)", directives.size());
45 for (
const auto*
directive : directives) {
50 auto it = handlers_.find(
static_cast<int>(
directive->type));
59 logger->info(
"Directive type={}, handler invoked",
68 logger->info(
"Directives: {}/{} processed",
processed,
81bool DirectiveProcessor::fire_directive_hook(
83 if (hooks_.fire_pre ==
nullptr) {
90 std::string json =
"{\"type\":"
91 + std::to_string(
static_cast<int>(
directive->type)) +
"}";
93 int rc = hooks_.fire_pre(hooks_.registry,
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.
Directive processing for tool-to-engine communication.
entropic_directive_type_t
Directive types emitted by MCP tool results.
@ ENTROPIC_HOOK_ON_CUSTOM_DIRECTIVE
19: Unrecognized directive type
@ ENTROPIC_HOOK_ON_DIRECTIVE
18: Before processing a directive
spdlog initialization and logger access.
ENTROPIC_EXPORT std::shared_ptr< spdlog::logger > get(const std::string &name)
Get or create a named logger.
Activate model on GPU (WARM → ACTIVE).
@ optional
optional: every escape asks the host's path approver
std::function< void(LoopContext &ctx, const Directive &directive, DirectiveResult &result)> DirectiveHandler
Directive handler function type.
Aggregate result of processing a batch of directives.
bool stop_processing
Halt further processing.
Base directive — all directives carry a type tag.
Mutable state carried through the agentic loop.