feat: parliament seat collaboration loop (0.9.19)
Seats publish via parliament_note, sync pushes on write, member join without stealing the chair, and worker tools are hard-gated when parliament is active. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "cJSON.h"
|
||||
#include "cst_clipboard.h"
|
||||
#include "cst_parliament.h"
|
||||
#include "cst_runtime.h"
|
||||
#include "cst_tools.h"
|
||||
#include "cst_util.h"
|
||||
@@ -166,6 +167,15 @@ static const cst_tool_def_t TOOLS[] = {
|
||||
NULL,
|
||||
{{"todos", S, 1, "the whole list, one item per line"}},
|
||||
CST_TP_META, 0, cst_tool_todo_write, NULL, NO_DYN, NO_META},
|
||||
{"parliament_note",
|
||||
"Publish a short note into the shared parliament context so other seats "
|
||||
"see progress (synced over the sealed peer channel). Use after finishing "
|
||||
"a block of cross-seat work, when posting agenda, or when handing over. "
|
||||
"kind: status | agenda | result | handover | note.",
|
||||
NULL,
|
||||
{{"note", S, 1, "short note body for other seats"},
|
||||
{"kind", S, 0, "status|agenda|result|handover|note (default status)"}},
|
||||
CST_TP_META, 0, cst_tool_parliament_note, NULL, NO_DYN, NO_META},
|
||||
{"web_search",
|
||||
"Search the live web through the current Kimi or DeepSeek provider and "
|
||||
"return titles, URLs and snippets. Use web_fetch to read a result.",
|
||||
@@ -580,6 +590,15 @@ int cst_tool_active(const cst_agent_config_t *cfg, const cst_tool_def_t *t) {
|
||||
return 0;
|
||||
if (cfg->depth > 0 && (!strcmp(t->owner ? t->owner : "", "builtin:runtime") ||
|
||||
!strncmp(t->name, "worker_", 7))) return 0;
|
||||
/* Parliament seats coordinate via sealed peer sync, not in-process workers. */
|
||||
if (cst_parliament_is_active()) {
|
||||
if (!strcmp(t->name, "task") || !strncmp(t->name, "worker_", 7))
|
||||
return 0;
|
||||
if (t->owner && !strcmp(t->owner, "builtin:runtime"))
|
||||
return 0;
|
||||
} else if (!strcmp(t->name, "parliament_note")) {
|
||||
return 0;
|
||||
}
|
||||
if (cfg->tools_only[0]) {
|
||||
char key[CTL_MAX_NAME + 2];
|
||||
snprintf(key, sizeof(key), ",%s,", t->name);
|
||||
|
||||
Reference in New Issue
Block a user