@divlet/mcp 0.0.3 → 0.0.5
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 +1 -1
- package/dist/lib/server.js +6 -6
- package/dist/package.json +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ The MCP stdio adapter for divlet. This package owns its implementation and depen
|
|
|
5
5
|
Install:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npx -y @divlet/mcp@0.0.
|
|
8
|
+
npx -y @divlet/mcp@0.0.5 --cwd ./workspace
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
From 0.0.3: connect to a website that is its own MCP provider (the tools run in a managed browser page; `playwright-core` drives the installed Chrome or Playwright's Chromium):
|
package/dist/lib/server.js
CHANGED
|
@@ -42,7 +42,7 @@ export function localBoardOpener({ hubs = new Map() } = {}) {
|
|
|
42
42
|
*/
|
|
43
43
|
export function createMcpServer({ session, argv = {}, send, log = () => { } }) {
|
|
44
44
|
const tools = toolList();
|
|
45
|
-
const toolByName = new Map(tools.
|
|
45
|
+
const toolByName = new Map(tools.flatMap(tool => [tool.name, ...(tool.aliases ?? [])].map(name => [name, tool])));
|
|
46
46
|
let initialized = false;
|
|
47
47
|
let sampling = false;
|
|
48
48
|
let nextRequestId = 1;
|
|
@@ -77,7 +77,7 @@ export function createMcpServer({ session, argv = {}, send, log = () => { } }) {
|
|
|
77
77
|
protocolVersion: SUPPORTED.has(requested) ? requested : PROTOCOL_VERSION,
|
|
78
78
|
capabilities: { tools: { listChanged: false } },
|
|
79
79
|
serverInfo: { name: SERVER_NAME, version: argv.version || '0.0.0' },
|
|
80
|
-
instructions: 'divlet edits a local layout project (one .divlet file of HTML elements with Tailwind classes). Call
|
|
80
|
+
instructions: 'divlet edits a local layout project (one .divlet file of HTML elements with Tailwind classes). Call divlet_open first, then divlet_read before divlet_patch or divlet_edit.',
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
case 'notifications/initialized':
|
|
@@ -94,12 +94,12 @@ export function createMcpServer({ session, argv = {}, send, log = () => { } }) {
|
|
|
94
94
|
if (!tool)
|
|
95
95
|
return failure(id, -32602, `Unknown tool: ${name}.`);
|
|
96
96
|
try {
|
|
97
|
-
// `
|
|
98
|
-
const args =
|
|
97
|
+
// `divlet_open` inherits the server's own defaults (--project, --port, --no-demo) unless the call overrides them.
|
|
98
|
+
const args = tool.kind === 'open'
|
|
99
99
|
? { path: argv.project, port: argv.port, createDemo: argv.createDemo, ...(params?.arguments ?? {}) }
|
|
100
100
|
: (params?.arguments ?? {});
|
|
101
101
|
const value = await session.call(name, args, { cwd: argv.cwd });
|
|
102
|
-
return result(id, answer(
|
|
102
|
+
return result(id, answer(tool.kind === 'open' ? openView(value) : value));
|
|
103
103
|
}
|
|
104
104
|
catch (error) {
|
|
105
105
|
return result(id, refusal(error));
|
|
@@ -173,7 +173,7 @@ export function wireBoardAgent(runtime, server, { log = () => { } } = {}) {
|
|
|
173
173
|
const result = await server.request('sampling/createMessage', {
|
|
174
174
|
messages: [{ role: 'user', content: { type: 'text', text: message } }],
|
|
175
175
|
maxTokens: 4096,
|
|
176
|
-
systemPrompt: 'You are the agent of a divlet layout board. Answer in a few sentences. Use the divlet tools (
|
|
176
|
+
systemPrompt: 'You are the agent of a divlet layout board. Answer in a few sentences. Use the divlet tools (divlet_read, divlet_patch, divlet_edit) when the request asks for a change; style with Tailwind classes.',
|
|
177
177
|
});
|
|
178
178
|
const text = samplingText(result);
|
|
179
179
|
runtime.say({ text: text || 'The client returned no text answer.', seq });
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@divlet/mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The divlet MCP stdio adapter",
|
|
6
6
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"#package": "./package.json"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@divlet/core": "0.0.
|
|
33
|
+
"@divlet/core": "0.0.5",
|
|
34
34
|
"playwright-core": "^1.62.1"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@divlet/mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The divlet MCP stdio adapter",
|
|
6
6
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"#package": "./package.json"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@divlet/core": "0.0.
|
|
33
|
+
"@divlet/core": "0.0.5",
|
|
34
34
|
"playwright-core": "^1.62.1"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|