Features: - Direct conversations (1-to-1) auto-created and permanent - Group conversations with leave/archive support - Real-time messaging via long-polling - Offline notifications via CLAUDE.md - Auto-registration on MCP startup Architecture: - Broker: Express HTTP server + SQLite - MCP Partner: Modular tools (one file per tool) - Full documentation and API reference
38 lines
922 B
JavaScript
38 lines
922 B
JavaScript
import { brokerFetch, myId, ensureRegistered } from "../shared.js";
|
|
|
|
export const definition = {
|
|
name: "notifications",
|
|
description: "Active ou désactive les notifications dans CLAUDE.md.",
|
|
inputSchema: {
|
|
type: "object",
|
|
properties: {
|
|
enabled: {
|
|
type: "boolean",
|
|
description: "true pour activer, false pour désactiver",
|
|
},
|
|
},
|
|
required: ["enabled"],
|
|
},
|
|
};
|
|
|
|
export async function handler(args) {
|
|
try {
|
|
await ensureRegistered();
|
|
|
|
await brokerFetch(`/partners/${myId}/notifications`, {
|
|
method: "POST",
|
|
body: JSON.stringify({ enabled: args.enabled }),
|
|
});
|
|
|
|
const status = args.enabled ? "activées" : "désactivées";
|
|
return {
|
|
content: [{ type: "text", text: `Notifications ${status}.` }],
|
|
};
|
|
} catch (error) {
|
|
return {
|
|
content: [{ type: "text", text: `Erreur: ${error.message}` }],
|
|
isError: true,
|
|
};
|
|
}
|
|
}
|