refactor: new design — sidecar services, moderator Gateway client, tool execute API
- Replace standalone no-reply-api Docker service with unified sidecar (services/main.mjs) that routes /no-reply/* and /moderator/* and starts/stops with openclaw-gateway - Add moderator Discord Gateway client (services/moderator/index.mjs) for real-time MESSAGE_CREATE push instead of polling; notifies plugin via HTTP callback - Add plugin HTTP routes (plugin/web/dirigent-api.ts) for moderator → plugin callbacks (wake-from-dormant, interrupt tail-match) - Fix tool registration format: AgentTool requires execute: not handler:; factory form for tools needing ctx - Rename no-reply-process.ts → sidecar-process.ts, startNoReplyApi → startSideCar - Remove dead config fields from openclaw.plugin.json (humanList, agentList, listMode, channelPoliciesFile, endSymbols, waitIdentifier, multiMessage*, bypassUserIds, etc.) - Rename noReplyPort → sideCarPort - Remove docker-compose.yml, dev-up/down scripts, package-plugin.mjs, test-no-reply-api.mjs - Update install.mjs: clean dist before build, copy services/, drop dead config writes - Update README, Makefile, smoke script for new architecture Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,20 +1,29 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
const root = path.resolve(process.cwd(), '..');
|
||||
const pluginDir = path.join(root, 'plugin');
|
||||
const required = ['index.ts', 'rules.ts', 'openclaw.plugin.json', 'README.md', 'package.json'];
|
||||
const root = path.resolve(import.meta.dirname, '..');
|
||||
|
||||
const checks = [
|
||||
// Core plugin files
|
||||
path.join(root, 'plugin', 'index.ts'),
|
||||
path.join(root, 'plugin', 'turn-manager.ts'),
|
||||
path.join(root, 'plugin', 'openclaw.plugin.json'),
|
||||
path.join(root, 'plugin', 'package.json'),
|
||||
// Sidecar
|
||||
path.join(root, 'services', 'main.mjs'),
|
||||
path.join(root, 'services', 'no-reply-api', 'server.mjs'),
|
||||
path.join(root, 'services', 'moderator', 'index.mjs'),
|
||||
];
|
||||
|
||||
let ok = true;
|
||||
for (const f of required) {
|
||||
const p = path.join(pluginDir, f);
|
||||
for (const p of checks) {
|
||||
if (!fs.existsSync(p)) {
|
||||
ok = false;
|
||||
console.error(`missing: ${p}`);
|
||||
}
|
||||
}
|
||||
|
||||
const manifestPath = path.join(pluginDir, 'openclaw.plugin.json');
|
||||
const manifestPath = path.join(root, 'plugin', 'openclaw.plugin.json');
|
||||
if (fs.existsSync(manifestPath)) {
|
||||
const m = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
||||
for (const k of ['id', 'entry', 'configSchema']) {
|
||||
|
||||
Reference in New Issue
Block a user