Add module namespaces and harden L1/agent after the import redesign.
Bind imports to library names with bare path calls (and use), forward optional host args through mq wrappers, stabilize writeback replacement newlines, and document the M1/M2 decisions. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
99132ac8fc
commit
1f23e2ed93
108 files changed
+3228
-1023
No files matched your search
+14
-2
@@ -1,7 +1,10 @@
|
||||
/* Marqdo plugin ABI v1 — C contract (source of truth).
|
||||
/* Marqdo plugin ABI v2 — C contract (source of truth).
|
||||
*
|
||||
* Plugins are optional shared libraries (.dll / .so / .dylib), never linked
|
||||
* into the marqdo binary. Values cross the boundary as UTF-8 JSON.
|
||||
*
|
||||
* v1: register_fn, alloc, free
|
||||
* v2: + host_query (allowlisted host introspection for plugins)
|
||||
*/
|
||||
#ifndef MARQDO_ABI_H
|
||||
#define MARQDO_ABI_H
|
||||
@@ -13,7 +16,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MARQDO_ABI_VERSION 1u
|
||||
#define MARQDO_ABI_VERSION 2u
|
||||
#define MARQDO_ABI_VERSION_MIN 1u
|
||||
|
||||
/* Plugin function: args_json is a UTF-8 JSON object whose keys are param names.
|
||||
* On success: return 0, set *out_json to a heap string (host frees via free).
|
||||
@@ -22,6 +26,12 @@ extern "C" {
|
||||
*/
|
||||
typedef int (*MarqdoPluginFn)(const char *args_json, char **out_json, char **err_msg);
|
||||
|
||||
/* Host → plugin query (v2). `name` is an allowlisted query id.
|
||||
* Same success/failure convention as MarqdoPluginFn.
|
||||
*/
|
||||
typedef int (*MarqdoHostQueryFn)(void *userdata, const char *name, const char *args_json,
|
||||
char **out_json, char **err_msg);
|
||||
|
||||
typedef struct MarqdoHostApi {
|
||||
void *userdata;
|
||||
/* params: comma-separated param names in order, e.g. "a,b". May be "". */
|
||||
@@ -29,6 +39,8 @@ typedef struct MarqdoHostApi {
|
||||
MarqdoPluginFn fn);
|
||||
void *(*alloc)(size_t n);
|
||||
void (*free)(void *p);
|
||||
/* v2: NULL for hosts that only speak v1; required when plugin abi >= 2 */
|
||||
MarqdoHostQueryFn host_query;
|
||||
} MarqdoHostApi;
|
||||
|
||||
/* Required exports from every plugin shared library. */
|
||||
|
||||
Reference in new issue
Block a user