Files
sovereign_browser/src/agent_fs_tools.h
T

43 lines
1.2 KiB
C

/*
* agent_fs_tools.h — filesystem & shell tools for the embedded agent
*
* Provides tools that give the agent direct filesystem and shell access
* within the browser's qube. These tools work before login (they are
* system-level, not browser-level) and are dispatched early in
* agent_tools_dispatch().
*/
#ifndef AGENT_FS_TOOLS_H
#define AGENT_FS_TOOLS_H
#include "cjson/cJSON.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Dispatch a filesystem/shell tool request.
*
* tool_name: one of "fs_read", "fs_write", "fs_list", "fs_mkdir",
* "fs_delete", "shell_exec"
* params: cJSON object with the tool's parameters
*
* Returns a cJSON response in the same format as agent_tools_dispatch():
* {"success":true,"data":{...}} or
* {"success":false,"error":{"code":"...","message":"..."}}
*
* The caller frees the returned cJSON*. Returns NULL if tool_name is
* not recognized (so the caller can fall through to other handlers).
*/
cJSON *agent_fs_tools_dispatch(const char *tool_name, cJSON *params);
/* Returns TRUE if the given tool name is handled by this module. */
int agent_fs_is_tool(const char *tool_name);
#ifdef __cplusplus
}
#endif
#endif /* AGENT_FS_TOOLS_H */