refactor: remove turn tools, rename discord tools, rewrite installer

- Remove turn management tools (turn-status/advance/reset) — internal only,
  accessible via /dirigent slash commands
- Rename discord tools: dirigent_discord_channel_create,
  dirigent_discord_channel_update, dirigent_discord_member_list
- Rewrite install script:
  - Dynamic OpenClaw dir resolution (OPENCLAW_DIR env → openclaw CLI → ~/.openclaw)
  - Plugin installed to $(openclaw_dir)/plugins/dirigent
  - New --update mode: git pull from latest branch + reinstall
  - Cleaner uninstall: removes installed plugin files
- Update docs (FEAT.md, README.md, CHANGELOG.md, TASKLIST.md)
This commit is contained in:
zhi
2026-03-07 17:24:36 +00:00
parent 7b93db3ed9
commit e4454bfc1a
7 changed files with 214 additions and 168 deletions

View File

@@ -625,7 +625,7 @@ export default {
api.registerTool(
{
name: "dirigent_channel_create",
name: "dirigent_discord_channel_create",
description: "Create a private Discord channel with specific user/role permissions.",
parameters: {
type: "object",
@@ -654,7 +654,7 @@ export default {
api.registerTool(
{
name: "dirigent_channel_update",
name: "dirigent_discord_channel_update",
description: "Update permissions on an existing private Discord channel.",
parameters: {
type: "object",
@@ -679,7 +679,7 @@ export default {
api.registerTool(
{
name: "dirigent_member_list",
name: "dirigent_discord_member_list",
description: "List members of a Discord guild.",
parameters: {
type: "object",
@@ -798,72 +798,8 @@ export default {
{ optional: false },
);
// ── Turn management tools ──
api.registerTool(
{
name: "dirigent_turn_status",
description: "Show turn-based speaking status for a channel.",
parameters: {
type: "object",
additionalProperties: false,
properties: {
channelId: { type: "string" },
},
required: ["channelId"],
},
async execute(_id: string, params: Record<string, unknown>) {
const channelId = String(params.channelId || "").trim();
if (!channelId) return { content: [{ type: "text", text: "channelId is required" }], isError: true };
return { content: [{ type: "text", text: JSON.stringify(getTurnDebugInfo(channelId), null, 2) }] };
},
},
{ optional: false },
);
api.registerTool(
{
name: "dirigent_turn_advance",
description: "Manually advance the speaking turn in a channel.",
parameters: {
type: "object",
additionalProperties: false,
properties: {
channelId: { type: "string" },
},
required: ["channelId"],
},
async execute(_id: string, params: Record<string, unknown>) {
const channelId = String(params.channelId || "").trim();
if (!channelId) return { content: [{ type: "text", text: "channelId is required" }], isError: true };
const next = advanceTurn(channelId);
return { content: [{ type: "text", text: JSON.stringify({ ok: true, channelId, nextSpeaker: next, ...getTurnDebugInfo(channelId) }) }] };
},
},
{ optional: false },
);
api.registerTool(
{
name: "dirigent_turn_reset",
description: "Reset turn order for a channel (go dormant).",
parameters: {
type: "object",
additionalProperties: false,
properties: {
channelId: { type: "string" },
},
required: ["channelId"],
},
async execute(_id: string, params: Record<string, unknown>) {
const channelId = String(params.channelId || "").trim();
if (!channelId) return { content: [{ type: "text", text: "channelId is required" }], isError: true };
resetTurn(channelId);
return { content: [{ type: "text", text: JSON.stringify({ ok: true, channelId, ...getTurnDebugInfo(channelId) }) }] };
},
},
{ optional: false },
);
// Turn management is handled internally by the plugin (not exposed as tools).
// Use `/dirigent turn-status`, `/dirigent turn-advance`, `/dirigent turn-reset` for manual control.
api.on("message_received", async (event, ctx) => {
try {