|
Entropic 2.14.3
Local-first agentic inference engine
|
gh#145: the bridge's tool namespace, as a pure pair of functions. More...
#include <string>

Go to the source code of this file.
Namespaces | |
| namespace | entropic |
| Activate model on GPU (WARM → ACTIVE). | |
Functions | |
| std::string | entropic::facade::qualify_tool_name (const std::string &prefix, const std::string &suffix) |
| Qualify a bare tool suffix with the configured namespace. | |
| std::string | entropic::facade::strip_tool_prefix (const std::string &prefix, const std::string &name) |
| Recover the bare suffix from a wire name. | |
gh#145: the bridge's tool namespace, as a pure pair of functions.
A consumer app hosting this engine presents its OWN tools. The engine is a substrate, not the product — librentropic.so is deliberately consumable by more than one app, so the tools a given host exposes are properly that host's identity, not entropic's.
Extracted to a private facade header for the same reason final_text.h was (gh#130, v2.10.2): ExternalBridge::dispatch is private and the tools/list payload is only reachable over a real unix socket, so the naming rule would otherwise be testable only through an integration path. The rule is pure — two strings in, one string out — and belongs where a CPU unit test can reach it.
qualify and strip_tool_prefix are inverses. That property is asserted directly in tool_namespace_test.cpp, because the defect this replaces was exactly a build-name and a match-name drifting apart: before v2.12.0 the five tool names were written out twice, ~470 lines apart in external_bridge.cpp, with nothing tying them together.
Definition in file tool_namespace.h.
|
inline |
Qualify a bare tool suffix with the configured namespace.
| prefix | Configured mcp.external.tool_prefix. Empty means "no
namespace" and yields the bare suffix — a deliberate escape hatch for a host that wants unqualified tool names. |
| suffix | Bare tool suffix ("ask", "status", ...). |
suffix when prefix is empty. @req REQ-BRIDGE-001 Definition at line 45 of file tool_namespace.h.
|
inline |
Recover the bare suffix from a wire name.
Inverse of qualify.
Matches the WHOLE configured prefix rather than stripping up to the first dot, and both halves of that matter:
| prefix | Configured mcp.external.tool_prefix. |
| name | Fully-qualified tool name as received on the wire. |
name unchanged when the prefix does not match. @req REQ-BRIDGE-001 Definition at line 70 of file tool_namespace.h.