Adds plugin kind `channel` (interfaceVersion 1, dispatch(request, {call}))
with cli and webui modules. Project and thread surfaces and thread
talk/follow in the CLI and the Console chat go through the selected
channel. An empty or absent channel selection is off: the CLI exits 3 and
the Console answers 503, each naming `mosaic plugins` and `mosaic plugins
set` with the business selector. Management plugins and plugins.set stay
on the core transport. The loader gains a synchronous snapshot(kind)
getter; loaded(), modules() and last-good handling are unchanged. No lock
is held across dispatch. serve.mjs, public/ and the bus are untouched.
Owner Rocko. Reviewer Dewey: r1 changes (comment 28980, B1: the recovery
sentence was never asserted), r2 approve (comment 28984) on candidate
manifest ae2fcfda...1fc8, the B1 assert killing mutant D1. Design accepted
by Mos (mos-0768, mos-0773). Fixture rewrite at project.test.mjs:47 acked
by Mos (mos-0789) on Dewey's line-by-line check: lines 48-51 identical,
one added assert. Sage gate on e5b10d275: 25 steps green, 2081 package tests, 156 queue node tests, 422 script selftests, 0 failed.
Live stays as pinned. The re-pin that takes this live puts `mosaic
plugins set` in Jason's window right after activate (mos-0768).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
18 lines
505 B
JavaScript
18 lines
505 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",
|
|
]);
|
|
|
|
export async function dispatch({ verb, args }, { call }) {
|
|
if (!VERBS.has(verb)) throw new PluginError("channel-operation", "unsupported channel operation");
|
|
return call(verb, args);
|
|
}
|