25 lines
644 B
JavaScript
25 lines
644 B
JavaScript
// Surface adapter only. The caller and its human proof belong to core.
|
|
import { PluginError } from "../../src/kinds.mjs";
|
|
export const interfaceVersion = 1;
|
|
const VERBS = new Set([
|
|
"project.list",
|
|
"project.create",
|
|
"thread.list",
|
|
"thread.create",
|
|
"thread.messages",
|
|
"thread.send",
|
|
"thread.open",
|
|
"session.list",
|
|
"session.create",
|
|
"session.clear",
|
|
"session.cancel",
|
|
"session.operation",
|
|
"message.receive",
|
|
"message.read",
|
|
]);
|
|
|
|
export async function dispatch({ verb, args }, { call }) {
|
|
if (!VERBS.has(verb)) throw new PluginError("channel-operation", "unsupported channel operation");
|
|
return call(verb, args);
|
|
}
|