|
Entropic 2.3.8
Local-first agentic inference engine
|
RAII directory swapper for sandbox-scoped tool execution. More...
#include <entropic/core/sandbox.h>
Public Types | |
| using | SwapDirFn = void(*)(const std::filesystem::path &path, void *user_data) |
| Callback type for directory swapping. | |
Public Member Functions | |
| ScopedSandbox (SwapDirFn swap_fn, void *user_data, const std::filesystem::path &sandbox_path, const std::filesystem::path &original_path) | |
| Construct and swap directories. | |
| ~ScopedSandbox () | |
| Restore the original directory. | |
| ScopedSandbox (const ScopedSandbox &)=delete | |
| ScopedSandbox & | operator= (const ScopedSandbox &)=delete |
RAII directory swapper for sandbox-scoped tool execution.
Swaps the engine's tool working directory to the sandbox path on construction and restores it on destruction. Used by DelegationManager to route MCP server (filesystem, bash, …) calls into the sandbox during a delegation.
| using entropic::ScopedSandbox::SwapDirFn = void (*)( const std::filesystem::path& path, void* user_data) |
Callback type for directory swapping.
The facade implements this to iterate registered servers and call entropic_mcp_server_set_working_dir() on each.
| path | New working directory. |
| user_data | Opaque pointer (facade context). |
| entropic::ScopedSandbox::ScopedSandbox | ( | SwapDirFn | swap_fn, |
| void * | user_data, | ||
| const std::filesystem::path & | sandbox_path, | ||
| const std::filesystem::path & | original_path | ||
| ) |
Construct and swap directories.
| swap_fn | Directory swap callback (may be null — no-op). |
| user_data | Opaque pointer for swap_fn. |
| sandbox_path | Target sandbox directory. |
| original_path | Original directory to restore on destruction. |
| swap_fn | Directory swap callback. |
| user_data | Opaque pointer for swap_fn. |
| sandbox_path | Target sandbox directory. |
| original_path | Original directory to restore. |
Definition at line 614 of file sandbox.cpp.
| entropic::ScopedSandbox::~ScopedSandbox | ( | ) |