@botmux-ai/plugin-demo-base 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # Botmux Demo Base
2
+
3
+ Base example plugin for the Botmux plugin system. It contributes CLI commands,
4
+ plugin configuration, and a stdio MCP server.
5
+
6
+ GitHub: https://github.com/botmux-ai/botmux-plugin-demo/tree/main/packages/demo-base
7
+
8
+ ```bash
9
+ botmux plugin install demo-base
10
+ botmux plugin enable demo-base
11
+ ```
@@ -0,0 +1,13 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "commands": [
4
+ {
5
+ "name": "base:set-config",
6
+ "description": "Set demo-base config values used by static MCP templates."
7
+ },
8
+ {
9
+ "name": "base:show-config",
10
+ "description": "Print demo-base config values."
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,16 @@
1
+ export default {
2
+ 'base:set-config'(ctx) {
3
+ const token = ctx.args[0] ?? 'base-token';
4
+ const nested = ctx.args[1] ?? 'nested-token';
5
+ ctx.api.config.set('token', token);
6
+ ctx.api.config.set('nested.value', nested);
7
+ return `demo-base config token=${token} nested=${nested}`;
8
+ },
9
+
10
+ 'base:show-config'(ctx) {
11
+ return JSON.stringify({
12
+ token: ctx.api.config.get('token') ?? null,
13
+ nested: ctx.api.config.get('nested.value') ?? null,
14
+ });
15
+ },
16
+ };
@@ -0,0 +1,11 @@
1
+ {
2
+ "transport": "stdio",
3
+ "command": [
4
+ "node",
5
+ "./mcp/server.js"
6
+ ],
7
+ "env": {
8
+ "DEMO_MCP_PLUGIN": "demo-base",
9
+ "DEMO_MCP_REVISION": "1"
10
+ }
11
+ }
@@ -0,0 +1,64 @@
1
+ import { createInterface } from 'node:readline';
2
+
3
+ const serverName = process.env.DEMO_MCP_PLUGIN || 'demo-base';
4
+ const routeName = 'demo-base';
5
+ const input = createInterface({ input: process.stdin, crlfDelay: Infinity });
6
+
7
+ function send(message) {
8
+ process.stdout.write(`${JSON.stringify(message)}\n`);
9
+ }
10
+
11
+ input.on('line', (line) => {
12
+ if (!line.trim()) return;
13
+ let request;
14
+ try {
15
+ request = JSON.parse(line);
16
+ } catch {
17
+ send({ jsonrpc: '2.0', id: null, error: { code: -32700, message: 'Parse error' } });
18
+ return;
19
+ }
20
+ if (request.id === undefined) return;
21
+ if (request.method === 'initialize') {
22
+ send({
23
+ jsonrpc: '2.0',
24
+ id: request.id,
25
+ result: {
26
+ protocolVersion: request.params?.protocolVersion ?? '2024-11-05',
27
+ capabilities: { tools: {} },
28
+ serverInfo: { name: serverName, version: '0.1.0' },
29
+ },
30
+ });
31
+ return;
32
+ }
33
+ if (request.method === 'tools/list') {
34
+ send({
35
+ jsonrpc: '2.0',
36
+ id: request.id,
37
+ result: {
38
+ tools: [
39
+ { name: 'echo', description: 'Shared collision fixture', inputSchema: { type: 'object' } },
40
+ { name: `${routeName}_unique`, description: 'Unique base tool', inputSchema: { type: 'object' } },
41
+ ],
42
+ },
43
+ });
44
+ return;
45
+ }
46
+ if (request.method === 'tools/call') {
47
+ send({
48
+ jsonrpc: '2.0',
49
+ id: request.id,
50
+ result: {
51
+ content: [{
52
+ type: 'text',
53
+ text: `${routeName}:${request.params?.name}:revision=${process.env.DEMO_MCP_REVISION || 'unset'}`,
54
+ }],
55
+ },
56
+ });
57
+ return;
58
+ }
59
+ if (request.method === 'ping') {
60
+ send({ jsonrpc: '2.0', id: request.id, result: {} });
61
+ return;
62
+ }
63
+ send({ jsonrpc: '2.0', id: request.id, error: { code: -32601, message: 'Method not found' } });
64
+ });
@@ -0,0 +1,4 @@
1
+ {
2
+ "private": true,
3
+ "type": "module"
4
+ }
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@botmux-ai/plugin-demo-base",
3
+ "version": "0.1.0",
4
+ "description": "Base fixture plugin for botmux plugin conformance tests.",
5
+ "type": "module",
6
+ "keywords": [
7
+ "botmux-plugin"
8
+ ],
9
+ "botmux": {
10
+ "schemaVersion": 1,
11
+ "id": "demo-base",
12
+ "displayName": "Demo Base"
13
+ },
14
+ "files": [
15
+ "dist/"
16
+ ],
17
+ "publishConfig": {
18
+ "registry": "https://registry.npmjs.org/",
19
+ "access": "public"
20
+ },
21
+ "license": "MIT"
22
+ }