feat(tools): propose_topic gains announce_guild_base_url + announce_channel_id
Operator decision: backend env hard-coding a single guild/channel was wrong. Center can host multiple guilds, each can have multiple announce channels for different purposes. The proposing agent picks which one this topic broadcasts to. dialectic_propose_topic tool schema adds: - announce_guild_base_url (string, optional) - announce_channel_id (string, optional) - both or neither - one-of-two rejected at backend POST time - omit both - topic has no broadcasts (agents must poll detail) Tool description points agents at "Fabric channel-list tools" for candidate discovery. Workflow docs spell out the discovery pattern.
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
*
|
||||
* Tools: dialectic_list_topics, dialectic_topic_detail,
|
||||
* dialectic_propose_topic, dialectic_signup,
|
||||
* dialectic_post_argument, dialectic_view_verdict
|
||||
* dialectic_post_argument, dialectic_submit_verdict,
|
||||
* dialectic_view_verdict
|
||||
*
|
||||
* Loader gotchas (per [[reference-meridian-plugin-contract]]):
|
||||
* - openclaw.plugin.json MUST declare `activation.onStartup: true`
|
||||
|
||||
@@ -76,7 +76,12 @@ export function registerDialecticTools(api) {
|
||||
description: 'Create a new Dialectic debate topic. Provide the title, summary, the 4 lifecycle ' +
|
||||
'timestamps (RFC3339, signup_open < signup_close <= debate_start < debate_end), and the ' +
|
||||
"verdict_schema_id ('binary' | 'claim-resolution' | 'policy-recommendation' | 'free-form'). " +
|
||||
'visibility defaults to private — flip to public via UI after creation if appropriate.',
|
||||
'visibility defaults to private — flip to public via UI after creation if appropriate. ' +
|
||||
'announce_guild_base_url + announce_channel_id (BOTH or NEITHER) pick a Fabric announce ' +
|
||||
'channel for backend-driven lifecycle broadcasts (signup_open / signup_closed / debating / ' +
|
||||
'completed / cancelled). Discover candidates via the Fabric channel-list tools — pick the ' +
|
||||
"guild whose audience matches your topic's purpose and a channel of xType=announce. Omit " +
|
||||
'both → no broadcasts for this topic (agents must poll detail to track state).',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
additionalProperties: false,
|
||||
@@ -89,6 +94,16 @@ export function registerDialecticTools(api) {
|
||||
signup_close_at: { type: 'string' },
|
||||
debate_start_at: { type: 'string' },
|
||||
debate_end_at: { type: 'string' },
|
||||
announce_guild_base_url: {
|
||||
type: 'string',
|
||||
description: "Fabric guild HTTP base URL for the broadcast target (e.g. https://fabric-api.hangman-lab.top). " +
|
||||
"Required if announce_channel_id is set, must be omitted otherwise.",
|
||||
},
|
||||
announce_channel_id: {
|
||||
type: 'string',
|
||||
description: "Fabric channel UUID of an xType=announce channel in the chosen guild. " +
|
||||
"Required if announce_guild_base_url is set, must be omitted otherwise.",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
'title', 'summary', 'verdict_schema_id',
|
||||
@@ -108,6 +123,10 @@ export function registerDialecticTools(api) {
|
||||
};
|
||||
if (params.visibility)
|
||||
body.visibility = params.visibility;
|
||||
if (params.announce_guild_base_url)
|
||||
body.announce_guild_base_url = params.announce_guild_base_url;
|
||||
if (params.announce_channel_id)
|
||||
body.announce_channel_id = params.announce_channel_id;
|
||||
return await client.post(`/api/topics`, body);
|
||||
}),
|
||||
}));
|
||||
|
||||
@@ -94,7 +94,12 @@ export function registerDialecticTools(api: ToolApi): void {
|
||||
'Create a new Dialectic debate topic. Provide the title, summary, the 4 lifecycle ' +
|
||||
'timestamps (RFC3339, signup_open < signup_close <= debate_start < debate_end), and the ' +
|
||||
"verdict_schema_id ('binary' | 'claim-resolution' | 'policy-recommendation' | 'free-form'). " +
|
||||
'visibility defaults to private — flip to public via UI after creation if appropriate.',
|
||||
'visibility defaults to private — flip to public via UI after creation if appropriate. ' +
|
||||
'announce_guild_base_url + announce_channel_id (BOTH or NEITHER) pick a Fabric announce ' +
|
||||
'channel for backend-driven lifecycle broadcasts (signup_open / signup_closed / debating / ' +
|
||||
'completed / cancelled). Discover candidates via the Fabric channel-list tools — pick the ' +
|
||||
"guild whose audience matches your topic's purpose and a channel of xType=announce. Omit " +
|
||||
'both → no broadcasts for this topic (agents must poll detail to track state).',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
additionalProperties: false,
|
||||
@@ -107,6 +112,18 @@ export function registerDialecticTools(api: ToolApi): void {
|
||||
signup_close_at: { type: 'string' },
|
||||
debate_start_at: { type: 'string' },
|
||||
debate_end_at: { type: 'string' },
|
||||
announce_guild_base_url: {
|
||||
type: 'string',
|
||||
description:
|
||||
"Fabric guild HTTP base URL for the broadcast target (e.g. https://fabric-api.hangman-lab.top). " +
|
||||
"Required if announce_channel_id is set, must be omitted otherwise.",
|
||||
},
|
||||
announce_channel_id: {
|
||||
type: 'string',
|
||||
description:
|
||||
"Fabric channel UUID of an xType=announce channel in the chosen guild. " +
|
||||
"Required if announce_guild_base_url is set, must be omitted otherwise.",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
'title', 'summary', 'verdict_schema_id',
|
||||
@@ -126,6 +143,8 @@ export function registerDialecticTools(api: ToolApi): void {
|
||||
debate_end_at: params.debate_end_at,
|
||||
};
|
||||
if (params.visibility) body.visibility = params.visibility;
|
||||
if (params.announce_guild_base_url) body.announce_guild_base_url = params.announce_guild_base_url;
|
||||
if (params.announce_channel_id) body.announce_channel_id = params.announce_channel_id;
|
||||
return await client.post(`/api/topics`, body);
|
||||
}),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user