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:
h z
2026-05-23 17:54:12 +01:00
parent 119d79ada3
commit f6c1f392f6
3 changed files with 42 additions and 3 deletions

View File

@@ -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);
}),
}));