Files
CST-agent/include/cst_plugins.h
WHC 7d3ec9fcb9 Extensions: skills, plugins, MCP, sub-agents; configurable keys
- Skills (SKILL.md discovery, skill tool, /skills /skill)
- plugin.json exec tools with permission prompts, timeouts and workspace trust (/plugins)
- MCP stdio client: JSON-RPC initialize/tools/list/tools/call, mcp__server__tool, /mcp and sidebar status
- task tool with general/explore/plan and .agent/agents/*.md roles, parallel read-only runs, cancel propagation, /agents
- Keymap with Ctrl+X leader, keybinds.json overrides and /keys panel
- Collapsed thinking, throttled streaming Markdown, leaner tool output, parallel read-only tools
- Spawn: close-on-exec pipes and a process-wide fork lock
- Tests for keymap, skills, plugins, MCP, sub-agents, shell compaction; docs/plugins.md
2026-10-05 14:55:31 +08:00

52 lines
1.6 KiB
C

#ifndef CST_PLUGINS_H
#define CST_PLUGINS_H
/*
* Plugins: <config>/plugins/<dir>/plugin.json (always loaded) and
* <ws>/.agent/plugins/<dir>/plugin.json (only for trusted workspaces).
*
* {"name": "jira", "description": "...",
* "tools": [{"name": "jira_search", "description": "...",
* "parameters": {JSON Schema},
* "command": ["python3", "search.py"], (or a shell string)
* "perm": "read|write|shell|net", "timeout": 60}],
* "skills": "skills",
* "mcpServers": {"name": {"command": "...", "args": [], "env": {}}}}
*
* A tool call runs the command in the workspace with the arguments as JSON
* on stdin (CST_PLUGIN_DIR / CST_WORKSPACE in the environment); stdout +
* stderr is the result and the exit status its exit code. Relative argv
* entries that exist in the plugin directory are made absolute.
*/
#include "os_compat.h"
#ifdef __cplusplus
extern "C" {
#endif
#define CST_PLUGINS_MAX 32
typedef struct {
char name[64];
char dir[OS_PATH_MAX];
char source[16]; /* "user" | "workspace" */
char desc[200];
int ntools;
int nmcp;
int nskills_root; /* 1 when it adds a skills directory */
char error[200]; /* load problem, "" when fine */
} cst_plugin_info_t;
/* Load plugins; workspace ones only when ws_trusted. Returns the number of
* plugins loaded; *untrusted (optional) counts skipped workspace plugins. */
int cst_plugins_load(const char *workspace, int ws_trusted, int *untrusted);
void cst_plugins_unload(void);
int cst_plugins_info(cst_plugin_info_t *out, int max);
#ifdef __cplusplus
}
#endif
#endif