Compare commits
2 Commits
4cc787ad90
...
zhi-2026-0
| Author | SHA1 | Date | |
|---|---|---|---|
| 18b0180429 | |||
| ca7b47e683 |
@@ -252,8 +252,13 @@ export default {
|
|||||||
await sendModeratorMessage(live.moderatorBotToken, channelId, discussionGuide, api.logger)
|
await sendModeratorMessage(live.moderatorBotToken, channelId, discussionGuide, api.logger)
|
||||||
.catch(() => undefined);
|
.catch(() => undefined);
|
||||||
|
|
||||||
// Initialize speaker list
|
// Initialize speaker list (initiator first)
|
||||||
const agentIds = await fetchVisibleChannelBotAccountIds(api, channelId, identityRegistry);
|
const agentIds = await fetchVisibleChannelBotAccountIds(api, channelId, identityRegistry);
|
||||||
|
const initiatorIdx = agentIds.indexOf(initiatorAgentId);
|
||||||
|
if (initiatorIdx > 0) {
|
||||||
|
agentIds.splice(initiatorIdx, 1);
|
||||||
|
agentIds.unshift(initiatorAgentId);
|
||||||
|
}
|
||||||
const speakers = agentIds
|
const speakers = agentIds
|
||||||
.map((aid) => {
|
.map((aid) => {
|
||||||
const entry = identityRegistry.findByAgentId(aid);
|
const entry = identityRegistry.findByAgentId(aid);
|
||||||
|
|||||||
@@ -224,19 +224,35 @@ export function registerDirigentTools(deps: ToolDeps): void {
|
|||||||
callbackGuildId: { type: "string", description: "Guild ID of your current channel (for callback after discussion)" },
|
callbackGuildId: { type: "string", description: "Guild ID of your current channel (for callback after discussion)" },
|
||||||
callbackChannelId: { type: "string", description: "Channel ID to post the summary to after discussion completes" },
|
callbackChannelId: { type: "string", description: "Channel ID to post the summary to after discussion completes" },
|
||||||
name: { type: "string", description: "Discussion channel name" },
|
name: { type: "string", description: "Discussion channel name" },
|
||||||
discussionGuide: { type: "string", description: "Topic, goals, and completion criteria for the discussion" },
|
discussionGuide: { type: "string", description: "Topic, goals, and completion criteria for the discussion (inline text)" },
|
||||||
|
discussionGuidePath: { type: "string", description: "Path to a file containing the discussion guide (alternative to inline discussionGuide)" },
|
||||||
participants: { type: "array", items: { type: "string" }, description: "Discord user IDs of participating agents" },
|
participants: { type: "array", items: { type: "string" }, description: "Discord user IDs of participating agents" },
|
||||||
},
|
},
|
||||||
required: ["callbackGuildId", "callbackChannelId", "name", "discussionGuide", "participants"],
|
required: ["callbackGuildId", "callbackChannelId", "name", "participants"],
|
||||||
},
|
},
|
||||||
execute: async (_toolCallId: string, params: unknown) => {
|
execute: async (_toolCallId: string, params: unknown) => {
|
||||||
const p = params as {
|
const p = params as {
|
||||||
callbackGuildId: string;
|
callbackGuildId: string;
|
||||||
callbackChannelId: string;
|
callbackChannelId: string;
|
||||||
name: string;
|
name: string;
|
||||||
discussionGuide: string;
|
discussionGuide?: string;
|
||||||
|
discussionGuidePath?: string;
|
||||||
participants: string[];
|
participants: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Resolve discussion guide: inline text or file path
|
||||||
|
let resolvedGuide = p.discussionGuide || "";
|
||||||
|
if (!resolvedGuide && p.discussionGuidePath) {
|
||||||
|
try {
|
||||||
|
const { readFileSync } = await import("node:fs");
|
||||||
|
resolvedGuide = readFileSync(p.discussionGuidePath, "utf8").trim();
|
||||||
|
} catch (err) {
|
||||||
|
return errorResult(`Failed to read discussion guide file: ${String(err)}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!resolvedGuide) {
|
||||||
|
return errorResult("Either discussionGuide or discussionGuidePath is required");
|
||||||
|
}
|
||||||
const initiatorAgentId = ctx?.agentId;
|
const initiatorAgentId = ctx?.agentId;
|
||||||
if (!initiatorAgentId) {
|
if (!initiatorAgentId) {
|
||||||
return errorResult("Cannot resolve initiator agentId from session");
|
return errorResult("Cannot resolve initiator agentId from session");
|
||||||
@@ -291,7 +307,7 @@ export function registerDirigentTools(deps: ToolDeps): void {
|
|||||||
initiatorAgentId,
|
initiatorAgentId,
|
||||||
callbackGuildId: p.callbackGuildId,
|
callbackGuildId: p.callbackGuildId,
|
||||||
callbackChannelId: p.callbackChannelId,
|
callbackChannelId: p.callbackChannelId,
|
||||||
discussionGuide: p.discussionGuide,
|
discussionGuide: resolvedGuide,
|
||||||
participants: p.participants,
|
participants: p.participants,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -197,12 +197,10 @@ if (mode === "install") {
|
|||||||
ok("plugin configured");
|
ok("plugin configured");
|
||||||
|
|
||||||
step(5, 7, "configure no-reply provider");
|
step(5, 7, "configure no-reply provider");
|
||||||
const providers = getJson("models.providers") || {};
|
setJson(`models.providers.${NO_REPLY_PROVIDER_ID}`, {
|
||||||
providers[NO_REPLY_PROVIDER_ID] = {
|
|
||||||
baseUrl: NO_REPLY_BASE_URL, apiKey: NO_REPLY_API_KEY, api: "openai-completions",
|
baseUrl: NO_REPLY_BASE_URL, apiKey: NO_REPLY_API_KEY, api: "openai-completions",
|
||||||
models: [{ id: NO_REPLY_MODEL_ID, name: `${NO_REPLY_MODEL_ID} (Custom Provider)`, reasoning: false, input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 200000, maxTokens: 8192 }],
|
models: [{ id: NO_REPLY_MODEL_ID, name: `${NO_REPLY_MODEL_ID} (Custom Provider)`, reasoning: false, input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 200000, maxTokens: 8192 }],
|
||||||
};
|
});
|
||||||
setJson("models.providers", providers);
|
|
||||||
ok("provider configured");
|
ok("provider configured");
|
||||||
|
|
||||||
step(6, 7, "add no-reply model to allowlist");
|
step(6, 7, "add no-reply model to allowlist");
|
||||||
@@ -229,10 +227,8 @@ if (mode === "uninstall") {
|
|||||||
ok("removed plugin entry");
|
ok("removed plugin entry");
|
||||||
|
|
||||||
step(2, 4, "remove plugin load path");
|
step(2, 4, "remove plugin load path");
|
||||||
const plugins = getJson("plugins") || {};
|
const paths = getJson("plugins.load.paths") || [];
|
||||||
const paths = Array.isArray(plugins?.load?.paths) ? plugins.load.paths : [];
|
setJson("plugins.load.paths", paths.filter((p) => p !== PLUGIN_INSTALL_DIR));
|
||||||
plugins.load = plugins.load || {}; plugins.load.paths = paths.filter((p) => p !== PLUGIN_INSTALL_DIR);
|
|
||||||
setJson("plugins", plugins);
|
|
||||||
ok("removed load path");
|
ok("removed load path");
|
||||||
|
|
||||||
step(3, 4, "remove installed files");
|
step(3, 4, "remove installed files");
|
||||||
|
|||||||
Reference in New Issue
Block a user