No room has room_settings.is_main = 1, so every main-only path was dead, and admin work is done from the host shell. Each room's agent may now only act on its own room: - IPC: messages/inbound injection only to the source room; schedule, update, pause, resume and cancel only for the source room's tasks; drop the assign_room and refresh_groups IPC tasks and the deps they needed (assignRoom/syncGroups/getAvailableGroups/writeGroupsSnapshot) - DB/host evidence is always scoped to the source group folder - runner MCP server: drop the assign_room tool, the target_group_jid parameters and the isMain flag; list_tasks shows only the room's tasks - drop EJCLAW_IS_MAIN, RunnerInput.isMain and AgentInput.isMain; the global CLAUDE.md memory is now included for every room - drop the available_groups.json snapshot (available-groups.ts), the inferred restart announcement that only went to the main room, and the unused Channel.syncGroups hook - setup register: drop --is-main; deregister-room: drop the main-room refusal and --force, and fix its unknown[] binding type error - remove the groups/main/ template The room_settings.is_main column and migrations are untouched; new rows get the column default (0) and nothing reads it anymore. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
901 B
TypeScript
35 lines
901 B
TypeScript
import type { McpStdioServerConfig } from '@anthropic-ai/claude-agent-sdk';
|
|
import { EJCLAW_ENV } from 'ejclaw-runners-shared';
|
|
|
|
export interface EjclawMcpServerConfigInput {
|
|
chatJid: string;
|
|
groupFolder: string;
|
|
agentType: string;
|
|
roomRole: string;
|
|
ipcDir?: string;
|
|
hostIpcDir?: string;
|
|
}
|
|
|
|
export function buildEjclawMcpServerConfig(
|
|
mcpServerPath: string,
|
|
input: EjclawMcpServerConfigInput,
|
|
): McpStdioServerConfig {
|
|
return {
|
|
command: 'node',
|
|
args: [mcpServerPath],
|
|
alwaysLoad: true,
|
|
env: {
|
|
[EJCLAW_ENV.chatJid]: input.chatJid,
|
|
[EJCLAW_ENV.groupFolder]: input.groupFolder,
|
|
[EJCLAW_ENV.agentType]: input.agentType,
|
|
[EJCLAW_ENV.roomRole]: input.roomRole,
|
|
...(input.ipcDir && {
|
|
[EJCLAW_ENV.ipcDir]: input.ipcDir,
|
|
}),
|
|
...(input.hostIpcDir && {
|
|
[EJCLAW_ENV.hostIpcDir]: input.hostIpcDir,
|
|
}),
|
|
},
|
|
};
|
|
}
|